1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog.h
|
|
|
|
// Purpose: wxDialog class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart and Markus Holzem
|
1999-02-14 21:59:48 +00:00
|
|
|
// Licence: wxWindows license
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_DIALOG_H_
|
|
|
|
#define _WX_DIALOG_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-02-06 23:27:08 +00:00
|
|
|
#pragma interface "dialog.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
1999-06-10 18:12:13 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// Dialog boxes
|
1999-06-28 21:39:49 +00:00
|
|
|
class WXDLLEXPORT wxDialog : public wxDialogBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-02-06 23:27:08 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
public:
|
|
|
|
wxDialog();
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
// Constructor with a modal flag, but no window id - the old convention
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
|
|
|
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
|
|
|
|
style | modalStyle, name);
|
|
|
|
}
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
// Constructor with no modal flag - the new convention.
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00: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 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
~wxDialog();
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
virtual bool Destroy();
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-26 22:22:13 +00:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
virtual void GetPosition(int *x, int *y) const;
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
bool Show(bool show);
|
|
|
|
bool IsShown() const;
|
|
|
|
void Iconize(bool iconize);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
#if WXWIN_COMPATIBILITY
|
1999-02-06 23:27:08 +00:00
|
|
|
bool Iconized() const { return IsIconized(); };
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
virtual bool IsIconized() const;
|
|
|
|
void Fit();
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
void SetTitle(const wxString& title);
|
|
|
|
wxString GetTitle() const ;
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
bool OnClose();
|
|
|
|
void OnCharHook(wxKeyEvent& event);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
void SetModal(bool flag);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
virtual void Centre(int direction = wxBOTH);
|
1999-07-24 23:16:35 +00:00
|
|
|
virtual bool IsModal() const;
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
// For now, same as Show(TRUE) but returns return code
|
|
|
|
virtual int ShowModal();
|
|
|
|
virtual void EndModal(int retCode);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
// Standard buttons
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnApply(wxCommandEvent& event);
|
|
|
|
void OnCancel(wxCommandEvent& event);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
|
|
|
|
1999-05-19 00:53:27 +00:00
|
|
|
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-02-06 23:27:08 +00:00
|
|
|
bool IsModalShowing() const { return m_modalShowing; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-02-14 21:59:48 +00:00
|
|
|
// tooltip management
|
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
|
|
|
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
|
|
|
#endif // tooltips
|
|
|
|
|
1998-08-07 22:27:33 +00:00
|
|
|
protected:
|
1999-02-06 23:27:08 +00:00
|
|
|
bool m_modalShowing;
|
|
|
|
WXHWND m_hwndOldFocus; // the window which had focus before we were shown
|
1999-02-14 21:59:48 +00:00
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
private:
|
1999-02-14 21:59:48 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
WXHWND m_hwndToolTip;
|
|
|
|
#endif // tooltips
|
|
|
|
|
1999-06-29 12:34:18 +00:00
|
|
|
private:
|
1999-02-06 23:27:08 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_DIALOG_H_
|