MessageDlg.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //----------------------------------------------------------------------------
  2. #ifndef MessageDlgH
  3. #define MessageDlgH
  4. //----------------------------------------------------------------------------
  5. #include <System.Classes.hpp>
  6. #include <Vcl.Controls.hpp>
  7. #include <Vcl.StdCtrls.hpp>
  8. //---------------------------------------------------------------------------
  9. class TMessageForm : public TForm
  10. {
  11. __published:
  12. void __fastcall FormAfterMonitorDpiChanged(TObject *Sender, int OldDPI, int NewDPI);
  13. public:
  14. static TForm * __fastcall Create(const UnicodeString & Msg, TStrings * MoreMessages,
  15. TMsgDlgType DlgType, unsigned int Answers,
  16. const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
  17. unsigned int TimeoutAnswer, TButton ** TimeoutButton, const UnicodeString & ImageName,
  18. const UnicodeString & NeverAskAgainCaption, const UnicodeString & MoreMessagesUrl,
  19. TSize MoreMessagesSize, const UnicodeString & CustomCaption);
  20. virtual int __fastcall ShowModal();
  21. void __fastcall InsertPanel(TPanel * Panel);
  22. int __fastcall GetContentWidth();
  23. void __fastcall NavigateToUrl(const UnicodeString & Url);
  24. protected:
  25. __fastcall TMessageForm(TComponent * AOwner);
  26. virtual __fastcall ~TMessageForm();
  27. DYNAMIC void __fastcall KeyDown(Word & Key, TShiftState Shift);
  28. DYNAMIC void __fastcall KeyUp(Word & Key, TShiftState Shift);
  29. UnicodeString __fastcall GetFormText();
  30. UnicodeString __fastcall GetReportText();
  31. UnicodeString __fastcall NormalizeNewLines(UnicodeString Text);
  32. virtual void __fastcall CreateParams(TCreateParams & Params);
  33. virtual void __fastcall CreateWnd();
  34. DYNAMIC void __fastcall DoShow();
  35. virtual void __fastcall Dispatch(void * Message);
  36. void __fastcall MenuItemClick(TObject * Sender);
  37. void __fastcall ButtonSubmit(TObject * Sender);
  38. void __fastcall ButtonDropDownClick(TObject * Sender);
  39. void __fastcall UpdateForShiftStateTimer(TObject * Sender);
  40. DYNAMIC void __fastcall SetZOrder(bool TopMost);
  41. void __fastcall LoadMessageBrowser();
  42. TControl * GetContentsControls();
  43. private:
  44. typedef std::map<unsigned int, TButton *> TAnswerButtons;
  45. UnicodeString MessageText;
  46. TPanel * ContentsPanel;
  47. TMemo * MessageMemo;
  48. TPanel * MessageBrowserPanel;
  49. TWebBrowserEx * MessageBrowser;
  50. UnicodeString MessageBrowserUrl;
  51. TShiftState FShiftState;
  52. TTimer * FUpdateForShiftStateTimer;
  53. bool FShowNoActivate;
  54. std::map<TObject *, TButtonSubmitEvent> FButtonSubmitEvents;
  55. TCheckBox * NeverAskAgainCheck;
  56. void __fastcall HelpButtonSubmit(TObject * Sender, unsigned int & Answer);
  57. void __fastcall ReportButtonSubmit(TObject * Sender, unsigned int & Answer);
  58. void __fastcall CMDialogKey(TWMKeyDown & Message);
  59. void __fastcall CMShowingChanged(TMessage & Message);
  60. void __fastcall UpdateForShiftState();
  61. TButton * __fastcall CreateButton(
  62. UnicodeString Name, UnicodeString Caption, unsigned int Answer,
  63. TButtonSubmitEvent OnSubmit, bool IsTimeoutButton,
  64. int GroupWith, TShiftState GrouppedShiftState, bool ElevationRequired, bool MenuButton,
  65. TAnswerButtons & AnswerButtons, bool HasMoreMessages, int & ButtonWidths);
  66. };
  67. //----------------------------------------------------------------------------
  68. #endif