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