Custom.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. 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. 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 __fastcall AddImage(const UnicodeString & ImageName);
  49. void __fastcall AddWinControl(TWinControl * Control);
  50. void __fastcall AddText(TLabel * Label);
  51. void __fastcall AddText(TStaticText * Label);
  52. void __fastcall AddSeparator();
  53. void __fastcall AddDialogButton(TButton * Button);
  54. void __fastcall RemoveCancelButton();
  55. void __fastcall ScaleButtonControl(TButtonControl * Control);
  56. TWinControl * __fastcall GetDefaultParent();
  57. __property int HorizontalMargin = { read = FHorizontalMargin };
  58. bool __fastcall Execute();
  59. };
  60. //----------------------------------------------------------------------------
  61. #endif