VCLCommon.h 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 LinkActionLabel(TStaticText * StaticText);
  27. void __fastcall LinkAppLabel(TStaticText * StaticText);
  28. void __fastcall HintLabel(TStaticText * StaticText, UnicodeString Hint = L"");
  29. void __fastcall HotTrackLabel(TLabel * Label);
  30. void __fastcall SetLabelHintPopup(TLabel * Label, const UnicodeString & Hint);
  31. bool __fastcall HasLabelHintPopup(TControl * Control, const UnicodeString & HintStr);
  32. void __fastcall FixComboBoxResizeBug(TCustomComboBox * ComboBox);
  33. void __fastcall ShowAsModal(TForm * Form, void *& Storage, bool BringToFront = true);
  34. void __fastcall HideAsModal(TForm * Form, void *& Storage);
  35. bool __fastcall ReleaseAsModal(TForm * Form, void *& Storage);
  36. bool __fastcall IsMainFormLike(TCustomForm * Form);
  37. bool __fastcall SelectDirectory(UnicodeString & Path, const UnicodeString Prompt,
  38. bool PreserveFileName);
  39. enum TListViewCheckAll { caCheck, caUncheck, caToggle };
  40. bool __fastcall ListViewAnyChecked(TListView * ListView, bool Checked = true);
  41. void __fastcall ListViewCheckAll(TListView * ListView,
  42. TListViewCheckAll CheckAll);
  43. void __fastcall ComboAutoSwitchInitialize(TComboBox * ComboBox);
  44. void __fastcall ComboAutoSwitchLoad(TComboBox * ComboBox, TAutoSwitch Value);
  45. TAutoSwitch __fastcall ComboAutoSwitchSave(TComboBox * ComboBox);
  46. void __fastcall CheckBoxAutoSwitchLoad(TCheckBox * CheckBox, TAutoSwitch Value);
  47. TAutoSwitch __fastcall CheckBoxAutoSwitchSave(TCheckBox * CheckBox);
  48. void __fastcall InstallPathWordBreakProc(TWinControl * Control);
  49. void __fastcall SetVerticalControlsOrder(TControl ** ControlsOrder, int Count);
  50. void __fastcall SetHorizontalControlsOrder(TControl ** ControlsOrder, int Count);
  51. void __fastcall MakeNextInTabOrder(TWinControl * Control, TWinControl * After);
  52. void __fastcall CutFormToDesktop(TForm * Form);
  53. void __fastcall UpdateFormPosition(TCustomForm * Form, TPosition Position);
  54. void __fastcall ResizeForm(TCustomForm * Form, int Width, int Height);
  55. TComponent * __fastcall GetFormOwner();
  56. TForm * __fastcall GetMainForm();
  57. void __fastcall SetCorrectFormParent(TForm * Form);
  58. void __fastcall InvokeHelp(TWinControl * Control);
  59. void __fastcall FixFormIcons(TForm * Form);
  60. Forms::TMonitor * __fastcall FormMonitor(TCustomForm * Form);
  61. int __fastcall GetLastMonitor();
  62. void __fastcall SetLastMonitor(int MonitorNum);
  63. TForm * __fastcall _SafeFormCreate(TMetaClass * FormClass, TComponent * Owner);
  64. template<class FormType>
  65. FormType * __fastcall SafeFormCreate(TComponent * Owner = NULL)
  66. {
  67. return dynamic_cast<FormType *>(_SafeFormCreate(__classid(FormType), Owner));
  68. }
  69. bool __fastcall SupportsSplitButton();
  70. TModalResult __fastcall DefaultResult(TCustomForm * Form, TButton * DefaultButton = NULL);
  71. void __fastcall DefaultButton(TButton * Button, bool Default);
  72. void __fastcall MemoKeyDown(TObject * Sender, WORD & Key, TShiftState Shift);
  73. void __fastcall UseDesktopFont(TControl * Control);
  74. void __fastcall UpdateDesktopFont();
  75. UnicodeString __fastcall FormatFormCaption(TCustomForm * Form, const UnicodeString & Caption);
  76. UnicodeString __fastcall FormatMainFormCaption(const UnicodeString & Caption);
  77. TShiftState __fastcall AllKeyShiftStates();
  78. void __fastcall RealignControl(TControl * Control);
  79. void __fastcall HookFormActivation(TCustomForm * Form);
  80. void __fastcall UnhookFormActivation(TCustomForm * Form);
  81. void __fastcall ShowFormNoActivate(TForm * Form);
  82. TPanel * __fastcall CreateBlankPanel(TComponent * Owner);
  83. typedef void __fastcall (*TRescaleEvent)(TComponent * Sender, TObject * Token);
  84. void __fastcall SetRescaleFunction(
  85. TComponent * Component, TRescaleEvent OnRescale, TObject * Token = NULL, bool OwnsToken = false);
  86. void __fastcall RecordFormImplicitRescale(TForm * Form);
  87. void __fastcall CountClicksForWindowPrint(TForm * Form);
  88. //---------------------------------------------------------------------------
  89. #endif // VCLCommonH