]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/dialog.h
Applied pop menu patch.
[wxWidgets.git] / include / wx / motif / dialog.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: 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
dfe1eee3 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DIALOG_H_
13#define _WX_DIALOG_H_
14
3399051e 15#if defined(__GNUG__) && !defined(__APPLE__)
83df96d6 16#pragma interface "dialog.h"
9b6dbb09
JS
17#endif
18
7e1bcfa8
MB
19class WXDLLEXPORT wxEventLoop;
20
9b6dbb09 21// Dialog boxes
dfe1eee3 22class WXDLLEXPORT wxDialog : public wxDialogBase
9b6dbb09 23{
83df96d6 24 DECLARE_DYNAMIC_CLASS(wxDialog)
e30285ab 25
9b6dbb09 26public:
bfc6fde4 27 wxDialog();
798a4529
MB
28
29#if WXWIN_COMPATIBILITY_2
bfc6fde4
VZ
30 // Constructor with a modal flag, but no window id - the old convention
31 wxDialog(wxWindow *parent,
83df96d6
JS
32 const wxString& title, bool modal,
33 int x = -1, int y= -1, int width = 500, int height = 500,
34 long style = wxDEFAULT_DIALOG_STYLE,
35 const wxString& name = wxDialogNameStr)
bfc6fde4
VZ
36 {
37 long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
38 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
39 }
798a4529
MB
40#endif
41
bfc6fde4
VZ
42 // Constructor with no modal flag - the new convention.
43 wxDialog(wxWindow *parent, wxWindowID id,
83df96d6
JS
44 const wxString& title,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = wxDEFAULT_DIALOG_STYLE,
48 const wxString& name = wxDialogNameStr)
bfc6fde4
VZ
49 {
50 Create(parent, id, title, pos, size, style, name);
51 }
e30285ab 52
bfc6fde4 53 bool Create(wxWindow *parent, wxWindowID id,
83df96d6
JS
54 const wxString& title, // bool modal = FALSE, // TODO make this a window style?
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 long style = wxDEFAULT_DIALOG_STYLE,
58 const wxString& name = wxDialogNameStr);
e30285ab 59
bfc6fde4 60 ~wxDialog();
e30285ab 61
bfc6fde4 62 virtual bool Destroy();
798a4529
MB
63
64 virtual bool Show(bool show = TRUE);
65
bfc6fde4 66 void SetTitle(const wxString& title);
e30285ab 67
bfc6fde4 68 void SetModal(bool flag);
e30285ab 69
dfe1eee3 70 virtual bool IsModal() const
83df96d6 71 { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
e30285ab 72
bfc6fde4
VZ
73 virtual int ShowModal();
74 virtual void EndModal(int retCode);
e30285ab 75
dfe1eee3
VZ
76 // Implementation
77 virtual void ChangeFont(bool keepOriginalSize = TRUE);
78 virtual void ChangeBackgroundColour();
79 virtual void ChangeForegroundColour();
80 inline WXWidget GetTopWidget() const { return m_mainWidget; }
81 inline WXWidget GetClientWidget() const { return m_mainWidget; }
e30285ab 82
bfc6fde4
VZ
83 // Standard buttons
84 void OnOK(wxCommandEvent& event);
85 void OnApply(wxCommandEvent& event);
86 void OnCancel(wxCommandEvent& event);
e30285ab 87
bfc6fde4
VZ
88 // Responds to colour changes
89 void OnSysColourChanged(wxSysColourChangedEvent& event);
e30285ab 90
dfe1eee3
VZ
91 void OnCharHook(wxKeyEvent& event);
92 void OnCloseWindow(wxCloseEvent& event);
e30285ab 93
798a4529
MB
94private:
95 virtual bool DoCreate( wxWindow* parent, wxWindowID id,
96 const wxString& title,
97 const wxPoint& pos,
98 const wxSize& size,
99 long style,
100 const wxString& name );
101 virtual void DoDestroy();
102
bfc6fde4
VZ
103 //// Motif-specific
104 bool m_modalShowing;
7e1bcfa8 105 wxEventLoop* m_eventLoop;
798a4529 106
bfc6fde4
VZ
107protected:
108 virtual void DoSetSize(int x, int y,
83df96d6
JS
109 int width, int height,
110 int sizeFlags = wxSIZE_AUTO);
e30285ab 111
bfc6fde4 112 virtual void DoSetClientSize(int width, int height);
e30285ab 113
bfc6fde4
VZ
114private:
115 DECLARE_EVENT_TABLE()
9b6dbb09
JS
116};
117
118#endif
83df96d6 119// _WX_DIALOG_H_