Custom.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //----------------------------------------------------------------------------
  2. #ifndef CustomH
  3. #define CustomH
  4. //----------------------------------------------------------------------------
  5. #include <System.Classes.hpp>
  6. #include <Vcl.Controls.hpp>
  7. #include <Vcl.StdCtrls.hpp>
  8. //----------------------------------------------------------------------------
  9. #include <Windows.h>
  10. //----------------------------------------------------------------------------
  11. class TCustomDialog : public TForm
  12. {
  13. __published:
  14. TButton * OKButton;
  15. TButton * CancelButton;
  16. TButton * HelpButton;
  17. void __fastcall HelpButtonClick(TObject *Sender);
  18. private:
  19. int FPos;
  20. int FPrePos;
  21. int FIndent;
  22. int FHorizontalMargin;
  23. int FControlPadding;
  24. short FCount;
  25. void __fastcall Change(TObject * Sender);
  26. void __fastcall Changed();
  27. int __fastcall GetMaxControlWidth(TControl * Control);
  28. void __fastcall AdjustHeight(TControl * Control);
  29. protected:
  30. DYNAMIC void __fastcall DoShow();
  31. virtual bool __fastcall CloseQuery();
  32. virtual void __fastcall DoChange(bool & CanSubmit);
  33. virtual void __fastcall DoValidate();
  34. virtual void __fastcall DoHelp();
  35. public:
  36. __fastcall TCustomDialog(UnicodeString HelpKeyword);
  37. TLabel * __fastcall CreateLabel(UnicodeString Label);
  38. TCheckBox * __fastcall CreateAndAddCheckBox(const UnicodeString & Caption);
  39. void __fastcall AddEditLikeControl(TWinControl * Edit, TLabel * Label, bool OneLine = false);
  40. void __fastcall AddEdit(TCustomEdit * Edit, TLabel * Label);
  41. void __fastcall AddComboBox(TCustomCombo * Combo, TLabel * Label, TStrings * Items = NULL, bool OneLine = false);
  42. void __fastcall AddButtonControl(TButtonControl * Control);
  43. void __fastcall AddImage(const UnicodeString & ImageName);
  44. void __fastcall AddWinControl(TWinControl * Control);
  45. void __fastcall AddText(TLabel * Label);
  46. void __fastcall AddText(TStaticText * Label);
  47. void __fastcall AddSeparator();
  48. void __fastcall ScaleButtonControl(TButtonControl * Control);
  49. bool __fastcall Execute();
  50. };
  51. //----------------------------------------------------------------------------
  52. #endif