VCLCommon.h 5.7 KB

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