X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c78e7c70271608b076b1dbed201b1204e6898d4..eba0e4d417e4a57204abd04daa22919d4e2d5053:/include/wx/qt/dialog.h diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h index db28c7772b..d68cc7c9a0 100644 --- a/include/wx/qt/dialog.h +++ b/include/wx/qt/dialog.h @@ -1,91 +1,97 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dialog.h -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem +// Purpose: wxDialog class +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - -#ifndef __GTKDIALOGH__ -#define __GTKDIALOGH__ +#ifndef _WX_DIALOG_H_ +#define _WX_DIALOG_H_ #ifdef __GNUG__ -#pragma interface +#pragma interface "dialog.h" #endif -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" -#include "wx/event.h" -#include "wx/window.h" +#include "wx/panel.h" -//----------------------------------------------------------------------------- -// forward decls -//----------------------------------------------------------------------------- +WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr; -class wxRadioBox; +// Dialog boxes +class WXDLLEXPORT wxDialog: public wxPanel +{ + DECLARE_DYNAMIC_CLASS(wxDialog) +public: -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- + wxDialog(); -class 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) + { + long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; + Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name); + } -//----------------------------------------------------------------------------- -// global data -//----------------------------------------------------------------------------- + // Constructor with no modal flag - the new convention. + 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) + { + Create(parent, id, title, pos, size, style, name); + } -extern const char *wxDialogNameStr; + 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); -//----------------------------------------------------------------------------- -// wxDialog -//----------------------------------------------------------------------------- + ~wxDialog(); -class wxDialog: public wxWindow -{ - DECLARE_DYNAMIC_CLASS(wxDialog) + virtual bool Destroy(); + void SetClientSize(int width, int height); + void GetPosition(int *x, int *y) const; + bool Show(bool show); + void Iconize(bool iconize); + + virtual bool IsIconized() const; + void Fit(); + + void SetTitle(const wxString& title); + wxString GetTitle() const ; - public: - - wxDialog(void); - 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 ); - 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 ); - ~wxDialog(void); - void SetTitle(const wxString& title); - wxString GetTitle(void) const; - bool OnClose(void); - void OnApply( wxCommandEvent &event ); - void OnCancel( wxCommandEvent &event ); - void OnOk( wxCommandEvent &event ); - void OnPaint(wxPaintEvent& event); - bool Destroy(void); - void OnCloseWindow(wxCloseEvent& event); -/* - void OnCharHook(wxKeyEvent& event); -*/ - virtual bool Show( bool show ); - virtual int ShowModal(void); - virtual void EndModal(int retCode); - virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); } - virtual void InitDialog(void); - - private: - - friend wxWindow; - friend wxDC; - friend wxRadioBox; - bool m_modalShowing; - wxString m_title; - - DECLARE_EVENT_TABLE() - + void OnCharHook(wxKeyEvent& event); + void OnCloseWindow(wxCloseEvent& event); + + void SetModal(bool flag); + + virtual void Centre(int direction = wxBOTH); + virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); } + + virtual int ShowModal(); + virtual void EndModal(int retCode); + + // Standard buttons + void OnOK(wxCommandEvent& event); + void OnApply(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + + // Responds to colour changes + void OnSysColourChanged(wxSysColourChangedEvent& event); + +DECLARE_EVENT_TABLE() }; -#endif // __GTKDIALOGH__ +#endif + // _WX_DIALOG_H_