1
0

MessageDlg.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. DYNAMIC void __fastcall DoShow();
  34. virtual void __fastcall Dispatch(void * Message);
  35. void __fastcall MenuItemClick(TObject * Sender);
  36. void __fastcall ButtonSubmit(TObject * Sender);
  37. void __fastcall ButtonDropDownClick(TObject * Sender);
  38. void __fastcall UpdateForShiftStateTimer(TObject * Sender);
  39. DYNAMIC void __fastcall SetZOrder(bool TopMost);
  40. void __fastcall LoadMessageBrowser();
  41. private:
  42. typedef std::map<unsigned int, TButton *> TAnswerButtons;
  43. UnicodeString MessageText;
  44. TPanel * ContentsPanel;
  45. TMemo * MessageMemo;
  46. TPanel * MessageBrowserPanel;
  47. TWebBrowserEx * MessageBrowser;
  48. UnicodeString MessageBrowserUrl;
  49. TShiftState FShiftState;
  50. TTimer * FUpdateForShiftStateTimer;
  51. bool FShowNoActivate;
  52. std::map<TObject *, TButtonSubmitEvent> FButtonSubmitEvents;
  53. TCheckBox * NeverAskAgainCheck;
  54. void __fastcall HelpButtonSubmit(TObject * Sender, unsigned int & Answer);
  55. void __fastcall ReportButtonSubmit(TObject * Sender, unsigned int & Answer);
  56. void __fastcall CMDialogKey(TWMKeyDown & Message);
  57. void __fastcall CMShowingChanged(TMessage & Message);
  58. void __fastcall UpdateForShiftState();
  59. TButton * __fastcall CreateButton(
  60. UnicodeString Name, UnicodeString Caption, unsigned int Answer,
  61. TButtonSubmitEvent OnSubmit, bool IsTimeoutButton,
  62. int GroupWith, TShiftState GrouppedShiftState, bool ElevationRequired, bool MenuButton,
  63. TAnswerButtons & AnswerButtons, bool HasMoreMessages, int & ButtonWidths);
  64. };
  65. //----------------------------------------------------------------------------
  66. #endif