]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/dialog.h
Some #include and #if wxUSE_XX things
[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
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DIALOG_H_
13#define _WX_DIALOG_H_
14
15#ifdef __GNUG__
16#pragma interface "dialog.h"
17#endif
18
19#include "wx/panel.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
22
23// Dialog boxes
bfc6fde4 24class WXDLLEXPORT wxDialog : public wxPanel
9b6dbb09 25{
bfc6fde4
VZ
26DECLARE_DYNAMIC_CLASS(wxDialog)
27
9b6dbb09 28public:
bfc6fde4
VZ
29 wxDialog();
30
31 // Constructor with a modal flag, but no window id - the old convention
32 wxDialog(wxWindow *parent,
33 const wxString& title, bool modal,
34 int x = -1, int y= -1, int width = 500, int height = 500,
35 long style = wxDEFAULT_DIALOG_STYLE,
36 const wxString& name = wxDialogNameStr)
37 {
38 long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
39 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
40 }
41
42 // Constructor with no modal flag - the new convention.
43 wxDialog(wxWindow *parent, wxWindowID id,
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)
49 {
50 Create(parent, id, title, pos, size, style, name);
51 }
52
53 bool Create(wxWindow *parent, wxWindowID id,
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);
59
60 ~wxDialog();
61
62 virtual bool Destroy();
63
64 bool Show(bool show);
65 void Iconize(bool iconize);
66 void Raise();
67 void Lower();
68
69 virtual bool IsIconized() const;
70 void Fit();
71
72 void SetTitle(const wxString& title);
73 wxString GetTitle() const ;
74
75 // bool OnClose();
76 void OnCharHook(wxKeyEvent& event);
77 void OnCloseWindow(wxCloseEvent& event);
78
79 void SetModal(bool flag);
80
81 virtual void Centre(int direction = wxBOTH);
82 virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
83
84 virtual int ShowModal();
85 virtual void EndModal(int retCode);
86
87 // Standard buttons
88 void OnOK(wxCommandEvent& event);
89 void OnApply(wxCommandEvent& event);
90 void OnCancel(wxCommandEvent& event);
d75638f8 91 void OnPaint(wxPaintEvent &event);
bfc6fde4
VZ
92
93 // Responds to colour changes
94 void OnSysColourChanged(wxSysColourChangedEvent& event);
95
96 // Implementation
97 virtual void ChangeFont(bool keepOriginalSize = TRUE);
98 virtual void ChangeBackgroundColour();
99 virtual void ChangeForegroundColour();
100 inline WXWidget GetTopWidget() const { return m_mainWidget; }
101 inline WXWidget GetClientWidget() const { return m_mainWidget; }
9b6dbb09 102
bfc6fde4
VZ
103public:
104 //// Motif-specific
105 bool m_modalShowing;
106 wxString m_dialogTitle;
dfc54541 107
bfc6fde4
VZ
108protected:
109 virtual void DoSetSize(int x, int y,
110 int width, int height,
111 int sizeFlags = wxSIZE_AUTO);
dfc54541 112
bfc6fde4 113 virtual void DoSetClientSize(int width, int height);
dfc54541 114
bfc6fde4
VZ
115private:
116 DECLARE_EVENT_TABLE()
9b6dbb09
JS
117};
118
119#endif
120 // _WX_DIALOG_H_