Custom.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 Changed();
  27. int __fastcall GetMaxControlWidth(TControl * Control);
  28. int __fastcall GetParentClientWidth();
  29. void __fastcall AdjustHeight(TControl * Control);
  30. void __fastcall SetUpComboBox(TCustomCombo * Combo, TStrings * Items, bool OneLine);
  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. void __fastcall Change(TObject * Sender);
  38. public:
  39. __fastcall TCustomDialog(UnicodeString HelpKeyword);
  40. void __fastcall StartGroup(const UnicodeString & Caption);
  41. TLabel * __fastcall CreateLabel(UnicodeString Label);
  42. TCheckBox * __fastcall CreateAndAddCheckBox(const UnicodeString & Caption);
  43. void __fastcall AddEditLikeControl(TWinControl * Edit, TLabel * Label, bool OneLine = false);
  44. void __fastcall AddEdit(TCustomEdit * Edit, TLabel * Label, bool OneLine = false);
  45. void __fastcall AddComboBox(TCustomCombo * Combo, TLabel * Label, TStrings * Items = NULL, bool OneLine = false);
  46. void __fastcall AddShortCutComboBox(TComboBox * Combo, TLabel * Label, const TShortCuts & ShortCuts);
  47. void __fastcall AddButtonControl(TButtonControl * Control);
  48. void AddButtonNextToEdit(TButton * Control, TWinControl * Edit);
  49. void __fastcall AddImage(const UnicodeString & ImageName);
  50. void __fastcall AddWinControl(TWinControl * Control);
  51. void __fastcall AddText(TLabel * Label);
  52. void __fastcall AddText(TStaticText * Label);
  53. void __fastcall AddSeparator();
  54. void __fastcall AddDialogButton(TButton * Button);
  55. void __fastcall RemoveCancelButton();
  56. void __fastcall ScaleButtonControl(TButtonControl * Control);
  57. TWinControl * __fastcall GetDefaultParent();
  58. __property int HorizontalMargin = { read = FHorizontalMargin };
  59. bool __fastcall Execute();
  60. };
  61. //----------------------------------------------------------------------------
  62. #endif