MessageDlg.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. void __fastcall NavigateToUrl(const UnicodeString & Url);
  22. protected:
  23. __fastcall TMessageForm(TComponent * AOwner);
  24. virtual __fastcall ~TMessageForm();
  25. DYNAMIC void __fastcall KeyDown(Word & Key, TShiftState Shift);
  26. DYNAMIC void __fastcall KeyUp(Word & Key, TShiftState Shift);
  27. UnicodeString __fastcall GetFormText();
  28. UnicodeString __fastcall GetReportText();
  29. UnicodeString __fastcall NormalizeNewLines(UnicodeString Text);
  30. virtual void __fastcall CreateParams(TCreateParams & Params);
  31. DYNAMIC void __fastcall DoShow();
  32. virtual void __fastcall Dispatch(void * Message);
  33. void __fastcall MenuItemClick(TObject * Sender);
  34. void __fastcall ButtonSubmit(TObject * Sender);
  35. void __fastcall ButtonDropDownClick(TObject * Sender);
  36. void __fastcall UpdateForShiftStateTimer(TObject * Sender);
  37. DYNAMIC void __fastcall SetZOrder(bool TopMost);
  38. void __fastcall LoadMessageBrowser();
  39. virtual void __fastcall ReadState(TReader * Reader);
  40. private:
  41. typedef std::map<unsigned int, TButton *> TAnswerButtons;
  42. UnicodeString MessageText;
  43. TPanel * ContentsPanel;
  44. TMemo * MessageMemo;
  45. TPanel * MessageBrowserPanel;
  46. TWebBrowserEx * MessageBrowser;
  47. UnicodeString MessageBrowserUrl;
  48. TShiftState FShiftState;
  49. TTimer * FUpdateForShiftStateTimer;
  50. TForm * FDummyForm;
  51. bool FShowNoActivate;
  52. std::map<TObject *, TButtonSubmitEvent> FButtonSubmitEvents;
  53. void __fastcall HelpButtonSubmit(TObject * Sender, unsigned int & Answer);
  54. void __fastcall ReportButtonSubmit(TObject * Sender, unsigned int & Answer);
  55. void __fastcall CMDialogKey(TWMKeyDown & Message);
  56. void __fastcall CMShowingChanged(TMessage & Message);
  57. void __fastcall UpdateForShiftState();
  58. TButton * __fastcall CreateButton(
  59. UnicodeString Name, UnicodeString Caption, unsigned int Answer,
  60. TButtonSubmitEvent OnSubmit, bool IsTimeoutButton,
  61. int GroupWith, TShiftState GrouppedShiftState, bool ElevationRequired, bool MenuButton,
  62. TAnswerButtons & AnswerButtons, bool HasMoreMessages, int & ButtonWidths);
  63. };
  64. //----------------------------------------------------------------------------
  65. #endif