1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog.h
|
|
|
|
// Purpose: wxDialog class
|
1999-08-02 00:44:01 -04:00
|
|
|
// Author: AUTHOR
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-08-02 00:44:01 -04:00
|
|
|
// Created: ??/??/98
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-08-02 00:44:01 -04:00
|
|
|
// Copyright: (c) AUTHOR
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DIALOG_H_
|
|
|
|
#define _WX_DIALOG_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-08-02 00:44:01 -04:00
|
|
|
#pragma interface "dialog.h"
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
// Dialog boxes
|
1999-08-02 00:44:01 -04:00
|
|
|
class WXDLLEXPORT wxDialog: public wxDialogBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
1999-08-02 00:44:01 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
1999-07-29 01:11:30 -04:00
|
|
|
public:
|
1999-08-02 00:44:01 -04: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 01:11:30 -04:00
|
|
|
{
|
|
|
|
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
1999-08-02 00:44:01 -04:00
|
|
|
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
|
1999-07-29 01:11:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Constructor with no modal flag - the new convention.
|
1999-08-02 00:44:01 -04: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 01:11:30 -04:00
|
|
|
{
|
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
1999-08-02 00:44:01 -04: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 01:11:30 -04:00
|
|
|
|
|
|
|
~wxDialog();
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// Virtuals
|
|
|
|
// ---------------------------------------------------------------------------
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
virtual bool Destroy();
|
1999-07-29 01:11:30 -04:00
|
|
|
virtual bool IsIconized() const;
|
|
|
|
virtual void Centre(int direction = wxBOTH);
|
1999-08-02 00:44:01 -04:00
|
|
|
virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
virtual int ShowModal();
|
1999-07-29 01:11:30 -04:00
|
|
|
virtual void EndModal(int retCode);
|
|
|
|
|
1999-08-02 12:39:18 -04:00
|
|
|
void SetClientSize(int width, int height) { wxWindow::DoSetClientSize(width, height); };
|
|
|
|
void SetClientSize( const wxSize& size ) { wxWindow::DoSetClientSize(size.x, size.y); };
|
|
|
|
void SetClientSize(const wxRect& rect) { SetClientSize( rect.width, rect.height ); };
|
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void GetPosition(int *x, int *y) const;
|
|
|
|
bool Show(bool show);
|
|
|
|
void Iconize(bool iconize);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void Fit();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void SetTitle(const wxString& title);
|
|
|
|
wxString GetTitle() const ;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void OnCharHook(wxKeyEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
void SetModal(bool flag);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
// Standard buttons
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnApply(wxCommandEvent& event);
|
|
|
|
void OnCancel(wxCommandEvent& event);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-08-02 00:44:01 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_DIALOG_H_
|