| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: wx/motif/dialog.h |
| 3 | // Purpose: wxDialog class |
| 4 | // Author: Julian Smart |
| 5 | // Modified by: |
| 6 | // Created: 17/09/98 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) Julian Smart |
| 9 | // Licence: wxWindows licence |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifndef _WX_DIALOG_H_ |
| 13 | #define _WX_DIALOG_H_ |
| 14 | |
| 15 | class WXDLLEXPORT wxEventLoop; |
| 16 | |
| 17 | // Dialog boxes |
| 18 | class WXDLLEXPORT wxDialog : public wxDialogBase |
| 19 | { |
| 20 | DECLARE_DYNAMIC_CLASS(wxDialog) |
| 21 | |
| 22 | public: |
| 23 | wxDialog(); |
| 24 | |
| 25 | wxDialog(wxWindow *parent, wxWindowID id, |
| 26 | const wxString& title, |
| 27 | const wxPoint& pos = wxDefaultPosition, |
| 28 | const wxSize& size = wxDefaultSize, |
| 29 | long style = wxDEFAULT_DIALOG_STYLE, |
| 30 | const wxString& name = wxDialogNameStr) |
| 31 | { |
| 32 | Create(parent, id, title, pos, size, style, name); |
| 33 | } |
| 34 | |
| 35 | bool Create(wxWindow *parent, wxWindowID id, |
| 36 | const wxString& title, |
| 37 | const wxPoint& pos = wxDefaultPosition, |
| 38 | const wxSize& size = wxDefaultSize, |
| 39 | long style = wxDEFAULT_DIALOG_STYLE, |
| 40 | const wxString& name = wxDialogNameStr); |
| 41 | |
| 42 | ~wxDialog(); |
| 43 | |
| 44 | virtual bool Destroy(); |
| 45 | |
| 46 | virtual bool Show(bool show = true); |
| 47 | |
| 48 | void SetTitle(const wxString& title); |
| 49 | |
| 50 | void SetModal(bool flag); |
| 51 | |
| 52 | virtual bool IsModal() const |
| 53 | { return m_modalShowing; } |
| 54 | |
| 55 | virtual int ShowModal(); |
| 56 | virtual void EndModal(int retCode); |
| 57 | |
| 58 | // Implementation |
| 59 | virtual void ChangeFont(bool keepOriginalSize = true); |
| 60 | virtual void ChangeBackgroundColour(); |
| 61 | virtual void ChangeForegroundColour(); |
| 62 | inline WXWidget GetTopWidget() const { return m_mainWidget; } |
| 63 | inline WXWidget GetClientWidget() const { return m_mainWidget; } |
| 64 | |
| 65 | // Standard buttons |
| 66 | void OnOK(wxCommandEvent& event); |
| 67 | void OnApply(wxCommandEvent& event); |
| 68 | void OnCancel(wxCommandEvent& event); |
| 69 | |
| 70 | // Responds to colour changes |
| 71 | void OnSysColourChanged(wxSysColourChangedEvent& event); |
| 72 | |
| 73 | void OnCharHook(wxKeyEvent& event); |
| 74 | void OnCloseWindow(wxCloseEvent& event); |
| 75 | |
| 76 | private: |
| 77 | virtual bool XmDoCreateTLW(wxWindow* parent, |
| 78 | wxWindowID id, |
| 79 | const wxString& title, |
| 80 | const wxPoint& pos, |
| 81 | const wxSize& size, |
| 82 | long style, |
| 83 | const wxString& name); |
| 84 | |
| 85 | |
| 86 | //// Motif-specific |
| 87 | bool m_modalShowing; |
| 88 | wxEventLoop* m_eventLoop; |
| 89 | |
| 90 | protected: |
| 91 | virtual void DoSetSize(int x, int y, |
| 92 | int width, int height, |
| 93 | int sizeFlags = wxSIZE_AUTO); |
| 94 | |
| 95 | virtual void DoSetClientSize(int width, int height); |
| 96 | |
| 97 | |
| 98 | private: |
| 99 | DECLARE_EVENT_TABLE() |
| 100 | }; |
| 101 | |
| 102 | #endif |
| 103 | // _WX_DIALOG_H_ |