1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-09-23 20:34:14 -04:00
|
|
|
// Name: wx/msw/dialog.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// Purpose: wxDialog class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_DIALOG_H_
|
|
|
|
#define _WX_DIALOG_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
2009-05-02 13:06:39 -04:00
|
|
|
// this option is always enabled (there doesn't seem to be any good reason to
|
|
|
|
// disable it) for desktop Windows versions but Windows CE dialogs are usually
|
|
|
|
// not resizeable and never show resize gripper anyhow so don't use it there
|
|
|
|
#ifdef __WXWINCE__
|
|
|
|
#define wxUSE_DIALOG_SIZEGRIP 0
|
|
|
|
#else
|
|
|
|
#define wxUSE_DIALOG_SIZEGRIP 1
|
|
|
|
#endif
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDialogModalData;
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2005-03-19 07:06:56 -05:00
|
|
|
#if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxToolBar;
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxToolBarNameStr[];
|
2005-03-19 07:06:56 -05:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
// Dialog boxes
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-02-06 18:27:08 -05:00
|
|
|
public:
|
2000-10-07 16:19:10 -04:00
|
|
|
wxDialog() { Init(); }
|
1999-02-14 16:59:48 -05:00
|
|
|
|
2004-04-21 08:45:16 -04:00
|
|
|
// full ctor
|
1999-02-06 18:27:08 -05:00
|
|
|
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)
|
|
|
|
{
|
2004-02-05 15:51:33 -05:00
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, title, pos, size, style, name);
|
1999-02-06 18:27:08 -05:00
|
|
|
}
|
1999-02-14 16:59:48 -05:00
|
|
|
|
1999-02-06 18:27:08 -05:00
|
|
|
bool Create(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-02-14 16:59:48 -05:00
|
|
|
|
2001-09-23 20:34:14 -04:00
|
|
|
virtual ~wxDialog();
|
1999-02-14 16:59:48 -05:00
|
|
|
|
2004-04-21 08:45:16 -04:00
|
|
|
// return true if we're showing the dialog modally
|
|
|
|
virtual bool IsModal() const { return m_modalData != NULL; }
|
1999-02-14 16:59:48 -05:00
|
|
|
|
2004-04-21 08:45:16 -04:00
|
|
|
// show the dialog modally and return the value passed to EndModal()
|
2000-01-29 20:31:09 -05:00
|
|
|
virtual int ShowModal();
|
|
|
|
|
|
|
|
// may be called to terminate the dialog with the given return code
|
|
|
|
virtual void EndModal(int retCode);
|
|
|
|
|
2005-09-16 06:28:40 -04:00
|
|
|
|
|
|
|
// we treat dialog toolbars specially under Windows CE
|
2005-03-19 07:06:56 -05:00
|
|
|
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
|
|
|
|
// create main toolbar by calling OnCreateToolBar()
|
|
|
|
virtual wxToolBar* CreateToolBar(long style = -1,
|
|
|
|
wxWindowID winid = wxID_ANY,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
// return a new toolbar
|
|
|
|
virtual wxToolBar *OnCreateToolBar(long style,
|
|
|
|
wxWindowID winid,
|
|
|
|
const wxString& name );
|
|
|
|
|
|
|
|
// get the main toolbar
|
|
|
|
wxToolBar *GetToolBar() const { return m_dialogToolBar; }
|
2005-09-16 06:28:40 -04:00
|
|
|
#endif // wxUSE_TOOLBAR && __POCKETPC__
|
|
|
|
|
2005-03-19 07:06:56 -05:00
|
|
|
|
2000-01-29 20:31:09 -05:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
1999-02-14 16:59:48 -05:00
|
|
|
|
2001-09-23 20:34:14 -04:00
|
|
|
// override some base class virtuals
|
2004-08-24 06:31:41 -04:00
|
|
|
virtual bool Show(bool show = true);
|
2001-09-23 20:34:14 -04:00
|
|
|
|
2003-06-01 17:01:18 -04:00
|
|
|
virtual void Raise();
|
|
|
|
|
2008-05-11 13:12:36 -04:00
|
|
|
virtual void SetWindowStyleFlag(long style);
|
|
|
|
|
2005-03-14 12:15:06 -05:00
|
|
|
#ifdef __POCKETPC__
|
|
|
|
// Responds to the OK button in a PocketPC titlebar. This
|
|
|
|
// can be overridden, or you can change the id used for
|
|
|
|
// sending the event with SetAffirmativeId. Returns false
|
|
|
|
// if the event was not processed.
|
|
|
|
virtual bool DoOK();
|
|
|
|
#endif
|
|
|
|
|
2000-01-29 20:31:09 -05:00
|
|
|
// Windows callbacks
|
2004-02-25 05:45:02 -05:00
|
|
|
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-05-18 20:53:27 -04:00
|
|
|
|
1998-08-07 18:27:33 -04:00
|
|
|
protected:
|
2000-10-07 16:19:10 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2009-05-02 13:06:39 -04:00
|
|
|
private:
|
|
|
|
#if wxUSE_DIALOG_SIZEGRIP
|
2008-05-11 13:12:36 -04:00
|
|
|
// these functions deal with the gripper window shown in the corner of
|
|
|
|
// resizeable dialogs
|
|
|
|
void CreateGripper();
|
|
|
|
void DestroyGripper();
|
|
|
|
void ShowGripper(bool show);
|
|
|
|
void ResizeGripper();
|
|
|
|
|
2008-06-06 22:04:16 -04:00
|
|
|
// this function is used to adjust Z-order of new children relative to the
|
|
|
|
// gripper if we have one
|
|
|
|
void OnWindowCreate(wxWindowCreateEvent& event);
|
|
|
|
|
2009-05-02 13:06:39 -04:00
|
|
|
// gripper window for a resizable dialog, NULL if we're not resizable
|
|
|
|
WXHWND m_hGripper;
|
|
|
|
#endif // wxUSE_DIALOG_SIZEGRIP
|
|
|
|
|
2005-03-19 07:06:56 -05:00
|
|
|
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
|
|
|
|
wxToolBar* m_dialogToolBar;
|
|
|
|
#endif
|
|
|
|
|
2003-09-16 08:30:34 -04:00
|
|
|
// this pointer is non-NULL only while the modal event loop is running
|
|
|
|
wxDialogModalData *m_modalData;
|
|
|
|
|
2000-10-07 16:19:10 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxDialog);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_DIALOG_H_
|