1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog.h
|
|
|
|
// Purpose: wxDialog class
|
1999-10-14 22:36:24 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-14 22:36:24 +00:00
|
|
|
// Created: 10/14/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 22:36:24 +00:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DIALOG_H_
|
|
|
|
#define _WX_DIALOG_H_
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Dialog boxes
|
1999-08-02 04:44:01 +00:00
|
|
|
class WXDLLEXPORT wxDialog: public wxDialogBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-08-02 04:44:01 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
1999-07-29 05:11:30 +00:00
|
|
|
public:
|
1999-08-02 04:44:01 +00:00
|
|
|
|
|
|
|
wxDialog();
|
|
|
|
|
|
|
|
// Constructor with a modal flag, but no window id - the old convention
|
|
|
|
inline wxDialog( wxWindow* parent
|
|
|
|
,const wxString& title
|
|
|
|
,bool modal
|
|
|
|
,int x = -1
|
|
|
|
,int y = -1
|
|
|
|
,int width = 500
|
|
|
|
,int height = 500
|
|
|
|
,long style = wxDEFAULT_DIALOG_STYLE
|
|
|
|
,const wxString& name = wxDialogNameStr
|
|
|
|
)
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
1999-08-02 04:44:01 +00:00
|
|
|
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
|
1999-07-29 05:11:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Constructor with no modal flag - the new convention.
|
1999-08-02 04:44:01 +00:00
|
|
|
inline wxDialog( wxWindow* parent
|
|
|
|
,wxWindowID id
|
|
|
|
,const wxString& title
|
|
|
|
,const wxPoint& pos = wxDefaultPosition
|
|
|
|
,const wxSize& size = wxDefaultSize
|
|
|
|
,long style = wxDEFAULT_DIALOG_STYLE
|
|
|
|
,const wxString& name = wxDialogNameStr
|
|
|
|
)
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
bool Create( wxWindow* parent
|
|
|
|
,wxWindowID id
|
|
|
|
,const wxString& title
|
|
|
|
, // bool modal = FALSE, // TODO make this a window style?
|
|
|
|
const wxPoint& pos = wxDefaultPosition
|
|
|
|
,const wxSize& size = wxDefaultSize
|
|
|
|
,long style = wxDEFAULT_DIALOG_STYLE
|
|
|
|
,const wxString& name = wxDialogNameStr
|
|
|
|
);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
~wxDialog();
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
virtual bool Destroy();
|
1999-10-14 22:36:24 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-10-14 22:36:24 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
virtual void GetPosition(int *x, int *y) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
bool Show(bool show);
|
|
|
|
bool IsShown() const;
|
|
|
|
void Iconize(bool iconize);
|
1999-08-02 16:39:18 +00:00
|
|
|
|
1999-10-14 22:36:24 +00:00
|
|
|
#if WXWIN_COMPATIBILITY
|
|
|
|
bool Iconized() const { return IsIconized(); };
|
|
|
|
#endif
|
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
virtual bool IsIconized() const;
|
|
|
|
void Fit();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
void SetTitle(const wxString& title);
|
|
|
|
wxString GetTitle() const ;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
bool OnClose();
|
|
|
|
void OnCharHook(wxKeyEvent& event);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
void SetModal(bool flag);
|
|
|
|
|
|
|
|
virtual void Centre(int direction = wxBOTH);
|
|
|
|
virtual bool IsModal() const;
|
|
|
|
|
|
|
|
// For now, same as Show(TRUE) but returns return code
|
|
|
|
virtual int ShowModal();
|
|
|
|
virtual void EndModal(int retCode);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
// Standard buttons
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnApply(wxCommandEvent& event);
|
|
|
|
void OnCancel(wxCommandEvent& event);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-05 04:22:59 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2000-02-21 05:12:34 +00:00
|
|
|
virtual MRESULT OS2WindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-10-05 04:22:59 +00:00
|
|
|
|
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
|
|
|
bool IsModalShowing() const { return m_modalShowing; }
|
|
|
|
|
|
|
|
// tooltip management
|
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
|
|
|
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
|
|
|
#endif // tooltips
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool m_modalShowing;
|
|
|
|
WXHWND m_hwndOldFocus; // the window which had focus before we were shown
|
|
|
|
|
|
|
|
private:
|
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
WXHWND m_hwndToolTip;
|
|
|
|
#endif // tooltips
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
1999-08-02 04:44:01 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_DIALOG_H_
|