VCLCommon.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #include <HistoryComboBox.hpp>
  10. //---------------------------------------------------------------------------
  11. const TColor LinkColor = clBlue;
  12. extern const UnicodeString ContextSeparator;
  13. //---------------------------------------------------------------------------
  14. void __fastcall FixListColumnWidth(TListView * TListView, int Index);
  15. void __fastcall AutoSizeListColumnsWidth(TListView * ListView, int ColumnToShrinkIndex = -1);
  16. void __fastcall EnableControl(TControl* Control, bool Enable);
  17. void __fastcall ReadOnlyControl(TControl * Control, bool ReadOnly = true);
  18. void __fastcall ReadOnlyAndEnabledControl(TControl * Control, bool ReadOnly, bool Enabled);
  19. int CalculateCheckBoxWidth(TControl * Control, const UnicodeString & Caption);
  20. void AutoSizeCheckBox(TCheckBox * CheckBox);
  21. void __fastcall InitializeSystemSettings();
  22. void __fastcall FinalizeSystemSettings();
  23. void __fastcall LocalSystemSettings(TForm * Control);
  24. void __fastcall UseSystemSettingsPre(TForm * Control);
  25. void __fastcall UseSystemSettingsPost(TForm * Control);
  26. void __fastcall UseSystemSettings(TForm * Control);
  27. void __fastcall ResetSystemSettings(TForm * Control);
  28. void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url = L"",
  29. TNotifyEvent OnEnter = NULL);
  30. void __fastcall LinkActionLabel(TStaticText * StaticText);
  31. void __fastcall LinkAppLabel(TStaticText * StaticText);
  32. void __fastcall HintLabel(TStaticText * StaticText, UnicodeString Hint = L"");
  33. void __fastcall HotTrackLabel(TLabel * Label);
  34. void __fastcall SetLabelHintPopup(TLabel * Label, const UnicodeString & Hint);
  35. bool __fastcall HasLabelHintPopup(TControl * Control, const UnicodeString & HintStr);
  36. void __fastcall FixComboBoxResizeBug(TCustomComboBox * ComboBox);
  37. void __fastcall ShowAsModal(TForm * Form, void *& Storage, bool BringToFront = true, bool TriggerModalStarted = false);
  38. void __fastcall HideAsModal(TForm * Form, void *& Storage);
  39. bool __fastcall ReleaseAsModal(TForm * Form, void *& Storage);
  40. bool __fastcall IsMainFormLike(TCustomForm * Form);
  41. bool __fastcall SelectDirectory(UnicodeString & Path, const UnicodeString Prompt,
  42. bool PreserveFileName);
  43. void SelectDirectoryForEdit(THistoryComboBox * Edit);
  44. enum TListViewCheckAll { caCheck, caUncheck, caToggle };
  45. bool __fastcall ListViewAnyChecked(TListView * ListView, bool Checked = true);
  46. void __fastcall ListViewCheckAll(TListView * ListView,
  47. TListViewCheckAll CheckAll);
  48. void __fastcall ComboAutoSwitchInitialize(TComboBox * ComboBox);
  49. void __fastcall ComboAutoSwitchLoad(TComboBox * ComboBox, TAutoSwitch Value);
  50. TAutoSwitch __fastcall ComboAutoSwitchSave(TComboBox * ComboBox);
  51. void __fastcall CheckBoxAutoSwitchLoad(TCheckBox * CheckBox, TAutoSwitch Value);
  52. TAutoSwitch __fastcall CheckBoxAutoSwitchSave(TCheckBox * CheckBox);
  53. void __fastcall InstallPathWordBreakProc(TWinControl * Control);
  54. void __fastcall SetVerticalControlsOrder(TControl ** ControlsOrder, int Count);
  55. void __fastcall SetHorizontalControlsOrder(TControl ** ControlsOrder, int Count);
  56. void __fastcall MakeNextInTabOrder(TWinControl * Control, TWinControl * After);
  57. void __fastcall CutFormToDesktop(TForm * Form);
  58. void __fastcall UpdateFormPosition(TCustomForm * Form, TPosition Position);
  59. void __fastcall ResizeForm(TCustomForm * Form, int Width, int Height);
  60. TComponent * __fastcall GetFormOwner();
  61. TForm * __fastcall GetMainForm();
  62. void __fastcall SetCorrectFormParent(TForm * Form);
  63. void __fastcall InvokeHelp(TWinControl * Control);
  64. void __fastcall FixFormIcons(TForm * Form);
  65. Forms::TMonitor * __fastcall FormMonitor(TCustomForm * Form);
  66. int __fastcall GetLastMonitor();
  67. void __fastcall SetLastMonitor(int MonitorNum);
  68. TForm * __fastcall _SafeFormCreate(TMetaClass * FormClass, TComponent * Owner);
  69. template<class FormType>
  70. FormType * __fastcall SafeFormCreate(TComponent * Owner = NULL)
  71. {
  72. return dynamic_cast<FormType *>(_SafeFormCreate(__classid(FormType), Owner));
  73. }
  74. TModalResult __fastcall DefaultResult(TCustomForm * Form, TButton * DefaultButton = NULL);
  75. void __fastcall DefaultButton(TButton * Button, bool Default);
  76. void __fastcall MemoKeyDown(TObject * Sender, WORD & Key, TShiftState Shift);
  77. void __fastcall UseDesktopFont(TControl * Control);
  78. void __fastcall UpdateDesktopFont();
  79. UnicodeString __fastcall FormatFormCaption(
  80. TCustomForm * Form, const UnicodeString & Caption, const UnicodeString & SessionName = UnicodeString());
  81. UnicodeString __fastcall FormatMainFormCaption(
  82. const UnicodeString & Caption, const UnicodeString & SessionName = UnicodeString());
  83. TShiftState __fastcall AllKeyShiftStates();
  84. void __fastcall RealignControl(TControl * Control);
  85. void __fastcall HookFormActivation(TCustomForm * Form);
  86. void __fastcall UnhookFormActivation(TCustomForm * Form);
  87. void __fastcall ShowFormNoActivate(TForm * Form);
  88. TPanel * __fastcall CreateBlankPanel(TComponent * Owner);
  89. typedef void __fastcall (*TRescaleEvent)(TComponent * Sender, TObject * Token);
  90. void __fastcall SetRescaleFunction(
  91. TComponent * Component, TRescaleEvent OnRescale, TObject * Token = NULL, bool OwnsToken = false);
  92. TWindowState GetWindowStateBeforeMimimize(TForm * Form);
  93. void __fastcall CountClicksForWindowPrint(TForm * Form);
  94. bool IsButtonBeingClicked(TButtonControl * Button);
  95. bool IsCancelButtonBeingClicked(TControl * Control);
  96. TCanvas * CreateControlCanvas(TControl * Control);
  97. void AutoSizeButton(TButton * Button);
  98. namespace Tb2item { class TTBCustomItem; }
  99. void GiveTBItemPriority(Tb2item::TTBCustomItem * Item);
  100. void DeleteChildren(TWinControl * Control);
  101. void AutoSizeLabel(TLabel * Label);
  102. void AutoSizeLabel(TStaticText * Label);
  103. //---------------------------------------------------------------------------
  104. #endif // VCLCommonH