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. public:
  13. static TForm * __fastcall Create(const UnicodeString & Msg, TStrings * MoreMessages,
  14. TMsgDlgType DlgType, unsigned int Answers,
  15. const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
  16. unsigned int TimeoutAnswer, TButton ** TimeoutButton, const UnicodeString & ImageName,
  17. const UnicodeString & NeverAskAgainCaption, const UnicodeString & MoreMessagesUrl,
  18. TSize MoreMessagesSize, const UnicodeString & CustomCaption);
  19. virtual int __fastcall ShowModal();
  20. void __fastcall InsertPanel(TPanel * Panel);
  21. int __fastcall GetContentWidth();
  22. void __fastcall NavigateToUrl(const UnicodeString & Url);
  23. protected:
  24. __fastcall TMessageForm(TComponent * AOwner);
  25. virtual __fastcall ~TMessageForm();
  26. DYNAMIC void __fastcall KeyDown(Word & Key, TShiftState Shift);
  27. DYNAMIC void __fastcall KeyUp(Word & Key, TShiftState Shift);
  28. UnicodeString __fastcall GetFormText();
  29. UnicodeString __fastcall GetReportText();
  30. UnicodeString __fastcall NormalizeNewLines(UnicodeString Text);
  31. virtual void __fastcall CreateParams(TCreateParams & Params);
  32. DYNAMIC void __fastcall DoShow();
  33. virtual void __fastcall Dispatch(void * Message);
  34. void __fastcall MenuItemClick(TObject * Sender);
  35. void __fastcall ButtonSubmit(TObject * Sender);
  36. void __fastcall ButtonDropDownClick(TObject * Sender);
  37. void __fastcall UpdateForShiftStateTimer(TObject * Sender);
  38. DYNAMIC void __fastcall SetZOrder(bool TopMost);
  39. void __fastcall LoadMessageBrowser();
  40. virtual void __fastcall ReadState(TReader * Reader);
  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. TForm * FDummyForm;
  52. bool FShowNoActivate;
  53. std::map<TObject *, TButtonSubmitEvent> FButtonSubmitEvents;
  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