1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-04-14 13:01:16 -04:00
|
|
|
// Name: wx/os2/dialog.h
|
1999-07-29 01:11:30 -04:00
|
|
|
// Purpose: wxDialog class
|
1999-10-14 18:36:24 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-14 18:36:24 -04:00
|
|
|
// Created: 10/14/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 18:36:24 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DIALOG_H_
|
|
|
|
#define _WX_DIALOG_H_
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr[];
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDialogModalData;
|
2003-09-21 17:54:03 -04:00
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
//
|
1999-07-29 01:11:30 -04:00
|
|
|
// Dialog boxes
|
2001-04-18 16:46:23 -04:00
|
|
|
//
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDialog: public wxDialogBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-08-02 00:44:01 -04:00
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
inline wxDialog() { Init(); }
|
1999-08-02 00:44:01 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
// full ctor
|
|
|
|
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 01:11:30 -04:00
|
|
|
{
|
2004-10-24 08:08:25 -04:00
|
|
|
Init();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
(void)Create(parent, id, title, pos, size, style, name);
|
1999-07-29 01:11:30 -04:00
|
|
|
}
|
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
bool Create( wxWindow* pParent
|
|
|
|
,wxWindowID vId
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,const wxPoint& rPos = wxDefaultPosition
|
|
|
|
,const wxSize& rSize = wxDefaultSize
|
|
|
|
,long lStyle = wxDEFAULT_DIALOG_STYLE
|
|
|
|
,const wxString& rsName = wxDialogNameStr
|
1999-08-02 00:44:01 -04:00
|
|
|
);
|
2004-10-24 08:08:25 -04:00
|
|
|
virtual ~wxDialog();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
// return true if we're showing the dialog modally
|
|
|
|
virtual bool IsModal() const { return m_modalData != NULL; }
|
1999-10-14 18:36:24 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
// show the dialog modally and return the value passed to EndModal()
|
2002-01-06 19:44:31 -05:00
|
|
|
virtual int ShowModal();
|
|
|
|
|
|
|
|
// may be called to terminate the dialog with the given return code
|
|
|
|
virtual void EndModal(int retCode);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
// implementation only from now on
|
2001-04-18 16:46:23 -04:00
|
|
|
// -------------------------------
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-10-24 08:08:25 -04:00
|
|
|
// override some base class virtuals
|
|
|
|
virtual bool Show(bool show = true);
|
2002-01-06 19:44:31 -05:00
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
//
|
|
|
|
// Callbacks
|
|
|
|
//
|
|
|
|
virtual MRESULT OS2WindowProc( WXUINT uMessage
|
|
|
|
,WXWPARAM wParam
|
|
|
|
,WXLPARAM lParam
|
|
|
|
);
|
2006-04-14 13:01:16 -04:00
|
|
|
#if WXWIN_COMPATIBILITY_2_6
|
2004-10-24 08:08:25 -04:00
|
|
|
|
|
|
|
// Constructor with a modal flag, but no window id - the old convention
|
|
|
|
wxDEPRECATED( wxDialog( wxWindow* pParent
|
|
|
|
,const wxString& rsTitle
|
|
|
|
,bool bModal
|
|
|
|
,int nX = -1
|
|
|
|
,int nY = -1
|
|
|
|
,int nWidth = 500
|
|
|
|
,int nHeight = 500
|
|
|
|
,long lStyle = wxDEFAULT_DIALOG_STYLE
|
|
|
|
,const wxString& rsName = wxDialogNameStr
|
|
|
|
) );
|
|
|
|
|
|
|
|
// just call Show() or ShowModal()
|
|
|
|
wxDEPRECATED( void SetModal(bool bFlag) );
|
|
|
|
|
|
|
|
// use IsModal()
|
|
|
|
wxDEPRECATED( bool IsModalShowing() const );
|
2002-01-06 19:44:31 -05:00
|
|
|
|
2006-04-14 13:01:16 -04:00
|
|
|
#endif // WXWIN_COMPATIBILITY_2_6
|
|
|
|
|
1999-10-05 00:22:59 -04:00
|
|
|
protected:
|
2001-04-18 16:46:23 -04:00
|
|
|
//
|
|
|
|
// Common part of all ctors
|
|
|
|
//
|
2002-01-06 19:44:31 -05:00
|
|
|
void Init(void);
|
1999-10-05 00:22:59 -04:00
|
|
|
|
|
|
|
private:
|
2001-04-18 16:46:23 -04:00
|
|
|
wxWindow* m_pOldFocus;
|
2004-10-24 08:08:25 -04:00
|
|
|
bool m_endModalCalled; // allow for closing within InitDialog
|
1999-10-05 00:22:59 -04:00
|
|
|
|
2003-09-21 17:54:03 -04:00
|
|
|
// this pointer is non-NULL only while the modal event loop is running
|
|
|
|
wxDialogModalData *m_modalData;
|
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
//
|
|
|
|
// While we are showing a modal dialog we disable the other windows using
|
|
|
|
// this object
|
|
|
|
//
|
|
|
|
class wxWindowDisabler* m_pWindowDisabler;
|
1999-10-05 00:22:59 -04:00
|
|
|
|
2001-04-18 16:46:23 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxDialog);
|
2001-04-18 16:46:23 -04:00
|
|
|
}; // end of CLASS wxDialog
|
|
|
|
|
|
|
|
#endif // _WX_DIALOG_H_
|