Custom.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #include <GUITools.h>
  11. //----------------------------------------------------------------------------
  12. class TCustomDialog : public TForm
  13. {
  14. __published:
  15. TButton * OKButton;
  16. TButton * CancelButton;
  17. TButton * HelpButton;
  18. void __fastcall HelpButtonClick(TObject *Sender);
  19. private:
  20. int FPos;
  21. int FPrePos;
  22. int FIndent;
  23. int FHorizontalMargin;
  24. int FControlPadding;
  25. short FCount;
  26. TGroupBox * FGroupBox;
  27. void __fastcall Changed();
  28. int __fastcall GetMaxControlWidth(TControl * Control);
  29. int __fastcall GetParentClientWidth();
  30. void __fastcall AdjustHeight(TControl * Control);
  31. void __fastcall SetUpComboBox(TCustomCombo * Combo, TStrings * Items, bool OneLine);
  32. protected:
  33. DYNAMIC void __fastcall DoShow();
  34. virtual bool __fastcall CloseQuery();
  35. virtual void __fastcall DoChange(bool & CanSubmit);
  36. virtual void __fastcall DoValidate();
  37. virtual void __fastcall DoHelp();
  38. void __fastcall Change(TObject * Sender);
  39. INTERFACE_HOOK
  40. public:
  41. __fastcall TCustomDialog(UnicodeString HelpKeyword);
  42. void __fastcall StartGroup(const UnicodeString & Caption);
  43. TLabel * __fastcall CreateLabel(UnicodeString Label);
  44. TCheckBox * __fastcall CreateAndAddCheckBox(const UnicodeString & Caption);
  45. void __fastcall AddEditLikeControl(TWinControl * Edit, TLabel * Label, bool OneLine = false);
  46. void __fastcall AddEdit(TCustomEdit * Edit, TLabel * Label, bool OneLine = false);
  47. void __fastcall AddComboBox(TCustomCombo * Combo, TLabel * Label, TStrings * Items = NULL, bool OneLine = false);
  48. void __fastcall AddShortCutComboBox(TComboBox * Combo, TLabel * Label, const TShortCuts & ShortCuts);
  49. void __fastcall AddButtonControl(TButtonControl * Control);
  50. void AddButtonNextToEdit(TButton * Control, TWinControl * Edit);
  51. void __fastcall AddImage(const UnicodeString & ImageName);
  52. void __fastcall AddWinControl(TWinControl * Control);
  53. void __fastcall AddText(TLabel * Label);
  54. void __fastcall AddText(TStaticText * Label);
  55. void __fastcall AddSeparator();
  56. void __fastcall AddDialogButton(TButton * Button);
  57. void __fastcall RemoveCancelButton();
  58. void __fastcall ScaleButtonControl(TButtonControl * Control);
  59. TWinControl * __fastcall GetDefaultParent();
  60. __property int HorizontalMargin = { read = FHorizontalMargin };
  61. bool __fastcall Execute();
  62. };
  63. //----------------------------------------------------------------------------
  64. #endif