VCLCommon.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //---------------------------------------------------------------------------
  2. #ifndef VCLCommonH
  3. #define VCLCommonH
  4. //---------------------------------------------------------------------------
  5. #include "Common.h"
  6. #include "Configuration.h"
  7. #include "Exceptions.h"
  8. #include <ComCtrls.hpp>
  9. //---------------------------------------------------------------------------
  10. const TColor LinkColor = clBlue;
  11. //---------------------------------------------------------------------------
  12. void __fastcall FixListColumnWidth(TListView * TListView, int Index);
  13. void __fastcall AutoSizeListColumnsWidth(TListView * ListView, int ColumnToShrinkIndex = -1);
  14. void __fastcall EnableControl(TControl* Control, bool Enable);
  15. void __fastcall ReadOnlyControl(TControl * Control, bool ReadOnly = true);
  16. void __fastcall ReadOnlyAndEnabledControl(TControl * Control, bool ReadOnly, bool Enabled);
  17. void __fastcall InitializeSystemSettings();
  18. void __fastcall FinalizeSystemSettings();
  19. void __fastcall LocalSystemSettings(TCustomForm * Control);
  20. void __fastcall UseSystemSettingsPre(TCustomForm * Control);
  21. void __fastcall UseSystemSettingsPost(TCustomForm * Control);
  22. void __fastcall UseSystemSettings(TCustomForm * Control);
  23. void __fastcall ResetSystemSettings(TCustomForm * Control);
  24. void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url = L"",
  25. TNotifyEvent OnEnter = NULL);
  26. void __fastcall LinkAppLabel(TStaticText * StaticText);
  27. void __fastcall HintLabel(TStaticText * StaticText, UnicodeString Hint = L"");
  28. void __fastcall HotTrackLabel(TLabel * Label);
  29. void __fastcall SetLabelHintPopup(TLabel * Label, const UnicodeString & Hint);
  30. bool __fastcall HasLabelHintPopup(TLabel * Label, const UnicodeString & HintStr);
  31. void __fastcall FixComboBoxResizeBug(TCustomComboBox * ComboBox);
  32. void __fastcall ShowAsModal(TForm * Form, void *& Storage);
  33. void __fastcall HideAsModal(TForm * Form, void *& Storage);
  34. void __fastcall ReleaseAsModal(TForm * Form, void *& Storage);
  35. TImageList * __fastcall SharedSystemImageList(bool Large);
  36. bool __fastcall SelectDirectory(UnicodeString & Path, const UnicodeString Prompt,
  37. bool PreserveFileName);
  38. enum TListViewCheckAll { caCheck, caUncheck, caToggle };
  39. bool __fastcall ListViewAnyChecked(TListView * ListView, bool Checked = true);
  40. void __fastcall ListViewCheckAll(TListView * ListView,
  41. TListViewCheckAll CheckAll);
  42. void __fastcall ComboAutoSwitchInitialize(TComboBox * ComboBox);
  43. void __fastcall ComboAutoSwitchLoad(TComboBox * ComboBox, TAutoSwitch Value);
  44. TAutoSwitch __fastcall ComboAutoSwitchSave(TComboBox * ComboBox);
  45. void __fastcall CheckBoxAutoSwitchLoad(TCheckBox * CheckBox, TAutoSwitch Value);
  46. TAutoSwitch __fastcall CheckBoxAutoSwitchSave(TCheckBox * CheckBox);
  47. void __fastcall InstallPathWordBreakProc(TWinControl * Control);
  48. void __fastcall SetVerticalControlsOrder(TControl ** ControlsOrder, int Count);
  49. void __fastcall SetHorizontalControlsOrder(TControl ** ControlsOrder, int Count);
  50. void __fastcall MakeNextInTabOrder(TWinControl * Control, TWinControl * After);
  51. void __fastcall CutFormToDesktop(TForm * Form);
  52. void __fastcall UpdateFormPosition(TCustomForm * Form, TPosition Position);
  53. void __fastcall ResizeForm(TCustomForm * Form, int Width, int Height);
  54. TComponent * __fastcall GetFormOwner();
  55. TForm * __fastcall GetMainForm();
  56. void __fastcall SetCorrectFormParent(TForm * Form);
  57. void __fastcall InvokeHelp(TWinControl * Control);
  58. void __fastcall FixFormIcons(TForm * Form);
  59. Forms::TMonitor * __fastcall FormMonitor(TCustomForm * Form);
  60. int __fastcall GetLastMonitor();
  61. void __fastcall SetLastMonitor(int MonitorNum);
  62. TForm * __fastcall _SafeFormCreate(TMetaClass * FormClass, TComponent * Owner);
  63. template<class FormType>
  64. FormType * __fastcall SafeFormCreate(TComponent * Owner = NULL)
  65. {
  66. return dynamic_cast<FormType *>(_SafeFormCreate(__classid(FormType), Owner));
  67. }
  68. bool __fastcall SupportsSplitButton();
  69. TModalResult __fastcall DefaultResult(TCustomForm * Form, TButton * DefaultButton = NULL);
  70. void __fastcall DefaultButton(TButton * Button, bool Default);
  71. void __fastcall MemoKeyDown(TObject * Sender, WORD & Key, TShiftState Shift);
  72. void __fastcall UseDesktopFont(TControl * Control);
  73. UnicodeString __fastcall FormatFormCaption(TCustomForm * Form, const UnicodeString & Caption);
  74. UnicodeString __fastcall FormatMainFormCaption(const UnicodeString & Caption);
  75. TShiftState __fastcall AllKeyShiftStates();
  76. void __fastcall RealignControl(TControl * Control);
  77. void __fastcall HookFormActivation(TCustomForm * Form);
  78. void __fastcall UnhookFormActivation(TCustomForm * Form);
  79. TPanel * __fastcall CreateBlankPanel(TComponent * Owner);
  80. //---------------------------------------------------------------------------
  81. #endif // VCLCommonH