Custom.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. TGroupBox * FGroupBox;
  26. void __fastcall Change(TObject * Sender);
  27. void __fastcall Changed();
  28. int __fastcall GetMaxControlWidth(TControl * Control);
  29. int __fastcall GetParentClientWidth();
  30. void __fastcall AdjustHeight(TControl * Control);
  31. protected:
  32. DYNAMIC void __fastcall DoShow();
  33. virtual bool __fastcall CloseQuery();
  34. virtual void __fastcall DoChange(bool & CanSubmit);
  35. virtual void __fastcall DoValidate();
  36. virtual void __fastcall DoHelp();
  37. public:
  38. __fastcall TCustomDialog(UnicodeString HelpKeyword);
  39. void __fastcall StartGroup(const UnicodeString & Caption);
  40. TLabel * __fastcall CreateLabel(UnicodeString Label);
  41. TCheckBox * __fastcall CreateAndAddCheckBox(const UnicodeString & Caption);
  42. void __fastcall AddEditLikeControl(TWinControl * Edit, TLabel * Label, bool OneLine = false);
  43. void __fastcall AddEdit(TCustomEdit * Edit, TLabel * Label, bool OneLine = false);
  44. void __fastcall AddComboBox(TCustomCombo * Combo, TLabel * Label, TStrings * Items = NULL, bool OneLine = false);
  45. void __fastcall AddButtonControl(TButtonControl * Control);
  46. void __fastcall AddImage(const UnicodeString & ImageName);
  47. void __fastcall AddWinControl(TWinControl * Control);
  48. void __fastcall AddText(TLabel * Label);
  49. void __fastcall AddText(TStaticText * Label);
  50. void __fastcall AddSeparator();
  51. void __fastcall AddDialogButton(TButton * Button);
  52. void __fastcall RemoveCancelButton();
  53. void __fastcall ScaleButtonControl(TButtonControl * Control);
  54. TWinControl * __fastcall GetDefaultParent();
  55. __property int HorizontalMargin = { read = FHorizontalMargin };
  56. bool __fastcall Execute();
  57. };
  58. //----------------------------------------------------------------------------
  59. #endif