busyinfo.cpp G
caret.cpp G U
-choicdgg.cpp G R
+choicdgg.cpp G
colrdlgg.cpp G G
dirdlgg.cpp G 16
-extdlgg.cpp G
fontdlgg.cpp G G
gridg.cpp G
helpxlp.cpp G G,R
imaglist.cpp G 16
laywin.cpp G
listctrl.cpp G 16
-msgdlgg.cpp G G,R
+msgdlgg.cpp G G
notebook.cpp G 16,R
panelg.cpp G
printps.cpp G PS
statusbr.cpp G
tabg.cpp G R
numdlgg.cpp G
-textdlgg.cpp G R
+textdlgg.cpp G
tipdlg.cpp G
treectrl.cpp G 16
checkbox.cpp R
checklst.cpp R
choice.cpp R
-choicdlg.cpp R
clipbrd.cpp R
colour.cpp R
combobox.cpp R
mdi.cpp R
menu.cpp R
minifram.cpp R
-msgdlg.cpp R
notebook.cpp R
palette.cpp R
pen.cpp R
stattext.cpp R
tbargtk.cpp R
textctrl.cpp R
-textdlg.cpp R
timer.cpp R
tooltip.cpp R
utilsgtk.cpp R
dynlib.h I WX
event.h I WX
expr.h I WX
-extdlg.h I WX
ffile.h I WX
file.h I WX
fileconf.h I WX
checkbox.h I GTK
checklst.h I GTK
choice.h I GTK
-choicdlg.h I GTK
clipbrd.h I GTK
colour.h I GTK
combobox.h I GTK
stattext.h I GTK
tbargtk.h I GTK
textctrl.h I GTK
-textdlg.h I GTK
timer.h I GTK
tooltip.h I GTK
treectrl.h I GTK
dynlib.h \
event.h \
expr.h \
- extdlg.h \
ffile.h \
file.h \
fileconf.h \
#ifndef _WX_CHOICDLG_H_BASE_
#define _WX_CHOICDLG_H_BASE_
-#ifdef __WXGTK__
-#include "wx/gtk/choicdlg.h"
-#else
#include "wx/generic/choicdgg.h"
-#endif
#endif
// _WX_CHOICDLG_H_BASE_
int GetReturnCode() const { return m_returnCode; }
protected:
- // functions to help with dialog layout
- // ------------------------------------
-
- // constants used in dialog layout
- static const long LAYOUT_X_MARGIN;
- static const long LAYOUT_Y_MARGIN;
- static const long MARGIN_BETWEEN_BUTTONS;
-
- // Split the message in lines putting them into the array and calculating
- // the maximum line width/height which is returned as wxSize.
- wxSize SplitTextMessage(const wxString& message, wxArrayString *lines);
-
- // Creates the (possibly multiline) message, assuming each line has the
- // size sizeText (which can be retrieved from SplitTextMessage). Returns
- // the bottom border of the multiline text zone.
- long CreateTextMessage(const wxArrayString& lines,
- const wxPoint& posText,
- const wxSize& sizeText);
-
- // Returns the preferred size for the buttons in the dialog
- wxSize GetStandardButtonSize(bool hasCancel = TRUE);
-
- // Create the standard [Ok] and [Cancel] (if hasCancel) buttons centering
- // them with respect to the dialog width wDialog at vertical position y.
- // wButton and hButton is the size of the button (which can be retrieved
- // from GetStandardButtonSize)
- void CreateStandardButtons(long wDialog,
- long y,
- long wButton,
- long hButton,
- bool hasCancel = TRUE);
-
- // Returns the standard height of single line text ctrl (it's not the same
- // as the height of just text which may be retrieved from
- // wxGetCharHeight())
- long GetStandardTextHeight();
+ // splits text up at newlines and places the
+ // lines into a vertical wxBoxSizer
+ wxSizer *CreateTextSizer( const wxString &message );
+
+ // places buttons into a horizontal wxBoxSizer
+ wxSizer *CreateButtonSizer( long flags );
// the return code from modal dialog
int m_returnCode;
+++ /dev/null
-#ifndef _WX_EXTDLG_H_BASE_
-#define _WX_EXTDLG_H_BASE_
-
-#include "wx/generic/extdlgg.h"
-
-#endif
- // _WX_EXTDLG_H_BASE_
colrdlgg.h \
dcpsg.h \
dirdlgg.h \
- extdlgg.h \
fontdlgg.h \
gridg.h \
helpext.h \
protected:
int m_selection;
+ int m_dialogStyle;
wxString m_stringSelection;
wxListBox *m_listbox;
protected:
wxTextCtrl *m_textctrl;
wxString m_value;
+ int m_dialogStyle;
private:
DECLARE_EVENT_TABLE()
checkbox.h \
checklst.h \
choice.h \
- choicdlg.h \
clipbrd.h \
colour.h \
combobox.h \
mdi.h \
menu.h \
menuitem.h \
- msgdlg.h \
minifram.h \
notebook.h \
palette.h \
stattext.h \
tbargtk.h \
textctrl.h \
- textdlg.h \
timer.h \
tooltip.h \
treectrl.h \
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: choicdgg.h
-// Purpose: Generic choice dialogs
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c)
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __CHOICEDLGH_G__
-#define __CHOICEDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "choicdgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-
-#define wxCHOICE_HEIGHT 150
-#define wxCHOICE_WIDTH 200
-
-#define wxID_LISTBOX 3000
-
-class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
-public:
- wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
- bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- void SetSelection(int sel) ;
- int GetSelection() const { return m_selection; }
- wxString GetStringSelection() const { return m_stringSelection; }
- char *GetSelectionClientData() const { return (char *)m_clientData; }
-
- void OnOK(wxCommandEvent& event);
- void OnListBoxDClick(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
-
-protected:
- long m_dialogStyle;
- int m_selection;
- wxString m_stringSelection;
-};
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-// Same as above but gets position in list of strings, instead of string,
-// or -1 if no selection
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
- int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-// Return client data instead
-WXDLLEXPORT wxChar* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **client_data,
- wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT wxChar* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], char **client_data,
- wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-/*
-WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices,
- int nsel, int * selection,
- wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-*/
-
-#endif
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: msgdlgg.h
-// Purpose: Generic wxMessageDialog
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c)
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __MSGDLGH_G__
-#define __MSGDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "msgdlgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-
-// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
-// Returns wxYES/NO/OK/CANCEL
-
-WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr;
-
-class WXDLLEXPORT wxGenericMessageDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
-
-public:
- wxGenericMessageDialog(wxWindow *parent, const wxString& message,
- const wxString& caption = wxMessageBoxCaptionStr,
- long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- void OnYes(wxCommandEvent& event);
- void OnNo(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
-private:
- wxList m_buttons;
- int m_dialogStyle;
-
-DECLARE_EVENT_TABLE()
-};
-
-#if !defined( __WXMSW__ ) && !defined( __WXMAC__)
-#define wxMessageDialog wxGenericMessageDialog
-
-int wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
- long style = wxOK|wxCENTRE, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1);
-
-#endif
-
-#endif
- // __MSGDLGH_G__
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: textdlgg.h
-// Purpose: wxStatusBar class
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __TEXTDLGH_G__
-#define __TEXTDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "textdlgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-#include "wx/extdlg.h"
-
-// Handy dialog functions (will be converted into classes at some point)
-WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
-WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
-
-#define wxID_TEXT 3000
-
-class WXDLLEXPORT wxTextEntryDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
-protected:
- long m_dialogStyle;
- wxString m_value;
-public:
- wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
- const wxString& value = wxEmptyString, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- inline void SetValue(const wxString& val) { m_value = val; }
- inline wxString GetValue(void) const { return m_value; }
-
- void OnOK(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
-};
-
-wxString WXDLLEXPORT wxGetTextFromUser(const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
- const wxString& default_value = wxEmptyString, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE);
-
-#endif
- // __TEXTDLGH_G__
checkbox.h \
checklst.h \
choice.h \
- choicdlg.h \
clipbrd.h \
colour.h \
combobox.h \
mdi.h \
menu.h \
menuitem.h \
- msgdlg.h \
minifram.h \
notebook.h \
palette.h \
stattext.h \
tbargtk.h \
textctrl.h \
- textdlg.h \
timer.h \
tooltip.h \
treectrl.h \
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: choicdgg.h
-// Purpose: Generic choice dialogs
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c)
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __CHOICEDLGH_G__
-#define __CHOICEDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "choicdgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-
-#define wxCHOICE_HEIGHT 150
-#define wxCHOICE_WIDTH 200
-
-#define wxID_LISTBOX 3000
-
-class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
-public:
- wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
- bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- void SetSelection(int sel) ;
- int GetSelection() const { return m_selection; }
- wxString GetStringSelection() const { return m_stringSelection; }
- char *GetSelectionClientData() const { return (char *)m_clientData; }
-
- void OnOK(wxCommandEvent& event);
- void OnListBoxDClick(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
-
-protected:
- long m_dialogStyle;
- int m_selection;
- wxString m_stringSelection;
-};
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-// Same as above but gets position in list of strings, instead of string,
-// or -1 if no selection
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
- int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-// Return client data instead
-WXDLLEXPORT wxChar* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **client_data,
- wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT wxChar* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
- int n, wxChar *choices[], char **client_data,
- wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
- bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-
-/*
-WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices,
- int nsel, int * selection,
- wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE,
- int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-*/
-
-#endif
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: msgdlgg.h
-// Purpose: Generic wxMessageDialog
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c)
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __MSGDLGH_G__
-#define __MSGDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "msgdlgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-
-// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
-// Returns wxYES/NO/OK/CANCEL
-
-WXDLLEXPORT_DATA(extern const wxChar*) wxMessageBoxCaptionStr;
-
-class WXDLLEXPORT wxGenericMessageDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
-
-public:
- wxGenericMessageDialog(wxWindow *parent, const wxString& message,
- const wxString& caption = wxMessageBoxCaptionStr,
- long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- void OnYes(wxCommandEvent& event);
- void OnNo(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
-private:
- wxList m_buttons;
- int m_dialogStyle;
-
-DECLARE_EVENT_TABLE()
-};
-
-#if !defined( __WXMSW__ ) && !defined( __WXMAC__)
-#define wxMessageDialog wxGenericMessageDialog
-
-int wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
- long style = wxOK|wxCENTRE, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1);
-
-#endif
-
-#endif
- // __MSGDLGH_G__
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: textdlgg.h
-// Purpose: wxStatusBar class
-// Author: Julian Smart
-// Modified by:
-// Created: 01/02/97
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __TEXTDLGH_G__
-#define __TEXTDLGH_G__
-
-#ifdef __GNUG__
-#pragma interface "textdlgg.h"
-#endif
-
-#include "wx/setup.h"
-#include "wx/dialog.h"
-#include "wx/extdlg.h"
-
-// Handy dialog functions (will be converted into classes at some point)
-WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
-WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
-
-#define wxID_TEXT 3000
-
-class WXDLLEXPORT wxTextEntryDialog: public wxDialog
-{
-DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
-protected:
- long m_dialogStyle;
- wxString m_value;
-public:
- wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
- const wxString& value = wxEmptyString, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
-
- inline void SetValue(const wxString& val) { m_value = val; }
- inline wxString GetValue(void) const { return m_value; }
-
- void OnOK(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
-};
-
-wxString WXDLLEXPORT wxGetTextFromUser(const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
- const wxString& default_value = wxEmptyString, wxWindow *parent = (wxWindow *) NULL,
- int x = -1, int y = -1, bool centre = TRUE);
-
-#endif
- // __TEXTDLGH_G__
#elif defined(__WXMOTIF__)
#include "wx/motif/msgdlg.h"
#elif defined(__WXGTK__)
-#include "wx/gtk/msgdlg.h"
+#include "wx/generic/msgdlgg.h"
#elif defined(__WXQT__)
#include "wx/generic/msgdlgg.h"
#elif defined(__WXMAC__)
class wxSizerItem;
class wxSizer;
-class wxBox;
+class wxBoxSizer;
//---------------------------------------------------------------------------
// wxSizerItem
};
//---------------------------------------------------------------------------
-// wxBox
+// wxBoxSizer
//---------------------------------------------------------------------------
-class WXDLLEXPORT wxBox: public wxSizer
+class WXDLLEXPORT wxBoxSizer: public wxSizer
{
public:
- wxBox( int orient );
+ wxBoxSizer( int orient );
void RecalcSizes();
wxSize CalcMin();
#ifndef _WX_TEXTDLG_H_BASE_
#define _WX_TEXTDLG_H_BASE_
-#ifdef __WXGTK__
-#include "wx/gtk/textdlg.h"
-#else
#include "wx/generic/textdlgg.h"
-#endif
// ----------------------------------------------------------------------------
// function to get a number from user
#include "wx/fontdlg.h"
#include "wx/choicdlg.h"
#include "wx/tipdlg.h"
-#include "wx/extdlg.h"
#define wxTEST_GENERIC_DIALOGS_IN_MSW 0
file_menu->Append(DIALOGS_TEXT_ENTRY, "Text &entry");
file_menu->Append(DIALOGS_NUM_ENTRY, "&Numeric entry\tCtrl-N");
file_menu->Append(DIALOGS_SINGLE_CHOICE, "&Single choice");
- file_menu->Append(DIALOGS_EXT_DIALOG, "&Extended dialog");
file_menu->AppendSeparator();
file_menu->Append(DIALOGS_TIP, "&Tip of the day");
file_menu->AppendSeparator();
wxFrame(parent, -1, title, pos, size)
{}
-void MyFrame::ExtDialog(wxCommandEvent& WXUNUSED(event) )
-{
- // The standard flags causes this dialog to display a
- // wxStaticLine under wxMotif and wxGTK, but none under
- // other platforms. Also, it will not be resizable
- // anywhere.
-
- wxExtDialog dialog( this, -1, "Test 1 for wxExtDialog", wxOK|wxFORWARD|wxBACKWARD );
- dialog.AddButton( new wxButton( &dialog, -1, "Custom") );
-
- dialog.SetClientWindow( new wxTextCtrl( &dialog, -1, "Test", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ) );
-
- // query minimal recommended size from the buttons
- dialog.SetSize( dialog.GetButtonAreaSize().x, 170 );
-
- dialog.Centre( wxBOTH );
- dialog.ShowModal();
-
- // This dialog uses the standard dialog styles but is also
- // resizable on all platforms and shows a wxStaticLine on
- // all platforms.
-
- wxExtDialog dialog2( this, -1, "Test 2 for wxExtDialog",
- wxOK|wxFORWARD|wxBACKWARD|wxCANCEL,
- wxDefaultPosition, wxSize(400,170),
- wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxED_BUTTONS_RIGHT | wxED_STATIC_LINE | wxED_CLIENT_MARGIN );
-
- dialog2.SetClientWindow( new wxTextCtrl( &dialog2, -1, "Test", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ) );
-
- // query minimal recommended size from the buttons
- wxSize min_size( dialog2.GetButtonAreaSize() );
- dialog2.SetSizeHints( min_size.x + 200, min_size.y );
-
- dialog2.Centre( wxBOTH );
- dialog2.ShowModal();
-}
-
void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) )
{
wxColourData data;
EVT_MENU(DIALOGS_FILE_SAVE, MyFrame::FileSave)
EVT_MENU(DIALOGS_DIR_CHOOSE, MyFrame::DirChoose)
EVT_MENU(DIALOGS_TIP, MyFrame::ShowTip)
- EVT_MENU(DIALOGS_EXT_DIALOG, MyFrame::ExtDialog)
#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC, MyFrame::ChooseColourGeneric)
EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC, MyFrame::ChooseFontGeneric)
void FileSave(wxCommandEvent& event);
void DirChoose(wxCommandEvent& event);
void ShowTip(wxCommandEvent& event);
- void ExtDialog(wxCommandEvent &event);
#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
void ChooseColourGeneric(wxCommandEvent& event);
#define DIALOGS_FILE_SAVE 9
#define DIALOGS_DIR_CHOOSE 10
#define DIALOGS_TIP 11
-#define DIALOGS_EXT_DIALOG 12
#define DIALOGS_NUM_ENTRY 13
#endif
#include "wx/intl.h"
#include "wx/settings.h"
#include "wx/stattext.h"
+ #include "wx/sizer.h"
#endif
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-const long wxDialogBase::LAYOUT_X_MARGIN = 5;
-const long wxDialogBase::LAYOUT_Y_MARGIN = 5;
-
-const long wxDialogBase::MARGIN_BETWEEN_BUTTONS = 3*LAYOUT_X_MARGIN;
-
-// ============================================================================
-// implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// dialog layout functions
-// ----------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+// wxDialogBase
+//--------------------------------------------------------------------------
-wxSize wxDialogBase::SplitTextMessage(const wxString& message,
- wxArrayString *lines)
+wxSizer *wxDialogBase::CreateTextSizer( const wxString &message )
{
- wxClientDC dc(this);
- dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
-
- wxString curLine;
- long height, width, heightTextMax = 0, widthTextMax = 0;
- for ( const wxChar *pc = message; ; pc++ )
+ wxBoxSizer *box = new wxBoxSizer( wxVERTICAL );
+
+ wxString line;
+ for (size_t pos = 0; pos < message.Len(); pos++)
{
- if ( *pc == _T('\n') || !*pc )
+ if (message[pos] == _T('\n'))
{
-#if defined(__VISAGECPP__)
-// have two versions of this in wxWindowDC tp avoid function hiding
-// since there are two of these in wxDCBase, and in turn in wxDC.
-// VA cannot resolve this so:
- dc.GetTextExtent(curLine, &width, &height, NULL, NULL, NULL, FALSE);
-#else
- dc.GetTextExtent(curLine, &width, &height);
-#endif
- if ( width > widthTextMax )
- widthTextMax = width;
- if ( height > heightTextMax )
- heightTextMax = height;
-
- lines->Add(curLine);
-
- if ( !*pc )
+ if (!line.IsEmpty())
{
- // the end of string
- break;
+ wxStaticText *s1 = new wxStaticText( this, -1, line );
+ box->Add( s1 );
+ line = _T("");
}
-
- curLine.Empty();
}
else
{
- curLine += *pc;
+ line += message[pos];
}
}
-
- return wxSize(widthTextMax, heightTextMax);
-}
-
-long wxDialogBase::CreateTextMessage(const wxArrayString& lines,
- const wxPoint& posText,
- const wxSize& sizeText)
-{
- wxStaticText *text;
- int y = posText.y;
- size_t nLineCount = lines.GetCount();
- for ( size_t nLine = 0; nLine < nLineCount; nLine++ )
+
+ // remaining text behind last '\n'
+ if (!line.IsEmpty())
{
- text = new wxStaticText(this, -1, lines[nLine],
- wxPoint(posText.x, y),
- sizeText);
- y += sizeText.GetHeight();
+ wxStaticText *s2 = new wxStaticText( this, -1, line );
+ box->Add( s2 );
}
-
- return y;
+
+ return box;
}
-
-wxSize wxDialogBase::GetStandardButtonSize(bool hasCancel)
+
+wxSizer *wxDialogBase::CreateButtonSizer( long flags )
{
-#if 0
- int wButton = 0;
- GetTextExtent(_("OK"), &wButton, NULL);
+ wxBoxSizer *box = new wxBoxSizer( wxHORIZONTAL );
- if ( hasCancel )
- {
- int width;
- GetTextExtent(_("Cancel"), &width, NULL);
- if ( width > wButton )
- wButton = width;
- }
+#if defined(__WXMSW__) || defined(__WXMAC__)
+ int margin = 6;
+#else
+ int margin = 10;
+#endif
- if ( wButton < 75 )
+ wxButton *ok = (wxButton *) NULL;
+ wxButton *cancel = (wxButton *) NULL;
+ wxButton *yes = (wxButton *) NULL;
+ wxButton *no = (wxButton *) NULL;
+
+ if (flags & wxYES_NO)
{
- // the minimal acceptable width
- wButton = 75;
+ yes = new wxButton( this, wxID_YES, _("Yes") );
+ box->Add( yes, 0, wxLEFT|wxRIGHT, margin );
+ no = new wxButton( this, wxID_NO, _("No") );
+ box->Add( no, 0, wxLEFT|wxRIGHT, margin );
+ } else
+ if (flags & wxYES)
+ {
+ yes = new wxButton( this, wxID_YES, _("Yes") );
+ box->Add( yes, 0, wxLEFT|wxRIGHT, margin );
+ } else
+ if (flags & wxNO)
+ {
+ no = new wxButton( this, wxID_NO, _("No") );
+ box->Add( no, 0, wxLEFT|wxRIGHT, margin );
}
- else
+
+ if (flags & wxOK)
{
- // the width of the button is not just the width of the label...
- wButton += 2*LAYOUT_X_MARGIN;
+ ok = new wxButton( this, wxID_OK, _("OK") );
+ box->Add( ok, 0, wxLEFT|wxRIGHT, margin );
}
- // a nice looking proportion
- int hButton = (wButton * 23) / 75;
+ if (flags & wxFORWARD)
+ box->Add( new wxButton( this, wxID_FORWARD, _("Forward") ), 0, wxLEFT|wxRIGHT, margin );
- return wxSize(wButton, hButton);
-#else
- return wxButton::GetDefaultSize();
-#endif
-}
+ if (flags & wxBACKWARD)
+ box->Add( new wxButton( this, wxID_BACKWARD, _("Backward") ), 0, wxLEFT|wxRIGHT, margin );
-void wxDialogBase::CreateStandardButtons(long wDialog,
- long y,
- long wButton,
- long hButton,
- bool hasCancel)
-{
- // NB: create [Ok] first to get the right tab order
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
+ if (flags & wxSETUP)
+ box->Add( new wxButton( this, wxID_SETUP, _("Setup") ), 0, wxLEFT|wxRIGHT, margin );
- long x = wDialog / 2;
- if ( hasCancel )
- x -= MARGIN_BETWEEN_BUTTONS / 2 + wButton;
- else
- x -= wButton / 2;
+ if (flags & wxMORE)
+ box->Add( new wxButton( this, wxID_MORE, _("More...") ), 0, wxLEFT|wxRIGHT, margin );
- ok = new wxButton( this, wxID_OK, _("OK"),
- wxPoint(x, y),
- wxSize(wButton, hButton) );
+ if (flags & wxHELP)
+ box->Add( new wxButton( this, wxID_HELP, _("Help") ), 0, wxLEFT|wxRIGHT, margin );
- if ( hasCancel )
+ if (flags & wxCANCEL)
{
- x += MARGIN_BETWEEN_BUTTONS + wButton;
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel"),
- wxPoint(x, y),
- wxSize(wButton, hButton) );
+ cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
+ box->Add( cancel, 0, wxLEFT|wxRIGHT, margin );
}
- ok->SetDefault();
- ok->SetFocus();
+ if ((flags & wxNO_DEFAULT) == 0)
+ {
+ if (ok)
+ {
+ ok->SetDefault();
+ ok->SetFocus();
+ }
+ else if (yes)
+ {
+ yes->SetDefault();
+ yes->SetFocus();
+ }
+ }
+
+ return box;
}
-long wxDialogBase::GetStandardTextHeight()
-{
- return (3*GetCharHeight()) / 2;
-}
}
//---------------------------------------------------------------------------
-// wxBox
+// wxBoxSizer
//---------------------------------------------------------------------------
-wxBox::wxBox( int orient )
+wxBoxSizer::wxBoxSizer( int orient )
{
m_orient = orient;
}
-void wxBox::RecalcSizes()
+void wxBoxSizer::RecalcSizes()
{
if (m_children.GetCount() == 0)
{
}
}
-wxSize wxBox::CalcMin()
+wxSize wxBoxSizer::CalcMin()
{
if (m_children.GetCount() == 0)
return wxSize(2,2);
#include "wx/listbox.h"
#include "wx/stattext.h"
#include "wx/intl.h"
+ #include "wx/sizer.h"
#endif
#if wxUSE_STATLINE
IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
#endif
+#if defined(__WXMSW__) || defined(__WXMAC__)
#define wxCHOICEDLG_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE | \
wxDIALOG_MODAL | \
wxTAB_TRAVERSAL)
+#else
+#define wxCHOICEDLG_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE | \
+ wxDIALOG_MODAL | \
+ wxRESIZE_BORDER | \
+ wxTAB_TRAVERSAL)
+#endif
+
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
const wxString& message,
{
m_selection = 0;
m_clientData = NULL;
-
- // calc the message size
- // ---------------------
-
- wxArrayString lines;
- wxSize sizeText = SplitTextMessage(message, &lines);
- long heightTextMax = sizeText.GetHeight(),
- widthTextMax = sizeText.GetWidth();
- size_t nLineCount = lines.Count();
- long hTotalMsg = heightTextMax*nLineCount;
-
- // calc the button size
- // --------------------
-
- // always create the OK button - the code below supposes we do have buttons
- // and besides the user should have some way to close this dialog
- wxASSERT_MSG( style & wxOK, _T("this dialog should have OK button") );
-
- bool hasCancel = (style & wxCANCEL) != 0;
-
- wxSize sizeButtons = GetStandardButtonSize(hasCancel);
-
- long wButton = sizeButtons.GetWidth(),
- hButton = sizeButtons.GetHeight();
-
- long wTotalButtons = wButton;
- if ( hasCancel )
- {
- wTotalButtons *= 2; // second button
- wTotalButtons += MARGIN_BETWEEN_BUTTONS; // margin between the 2
- }
-
- // listbox and stat line
- // ---------------------
-
- // make the listbox at least as tall as the message - otherwise it looks
- // ugly (the lower limit of 300 for the width is arbitrary OTOH)
- //
- // NB: we write "n + 2" because the horiz. scrollbar also takes some place
- long hListbox = wxMax((n + 2) * heightTextMax, hTotalMsg),
- wListbox = wxMax(300, wxMax(wTotalButtons, widthTextMax));
-
-#if wxUSE_STATLINE
- long hStatLine = wxStaticLine::GetDefaultSize();
-#endif
-
- // now the complete dialog size
- // ----------------------------
-
- long hDialog = 2*LAYOUT_Y_MARGIN + // top margin
- hTotalMsg + // message
- 2*LAYOUT_Y_MARGIN + // margin between text and listbox
- hListbox + // listbox
-#if wxUSE_STATLINE
- LAYOUT_Y_MARGIN + // margin
- hStatLine + // separator line
-#endif
- 2*LAYOUT_Y_MARGIN + // margin between listbox and buttons
- hButton + // button(s)
- LAYOUT_Y_MARGIN; // bottom margin
-
- long wDialog = wxMax(wListbox, wxMax(wTotalButtons, widthTextMax)) +
- 4*LAYOUT_X_MARGIN; // 2 from each side
-
- // create the controls
- // -------------------
-
- // message
- wxStaticText *text;
- int y = 2*LAYOUT_Y_MARGIN;
- for ( size_t nLine = 0; nLine < nLineCount; nLine++ )
- {
- text = new wxStaticText(this, -1, lines[nLine],
- wxPoint(2*LAYOUT_X_MARGIN, y),
- wxSize(widthTextMax, heightTextMax));
- y += heightTextMax;
- }
-
- y += 2*LAYOUT_X_MARGIN;
-
- // listbox
- m_listbox = new wxListBox( this, wxID_LISTBOX,
- wxPoint(2*LAYOUT_X_MARGIN, y),
- wxSize(wListbox, hListbox),
- n, choices,
- wxLB_HSCROLL);
- y += hListbox;
-
- if ( clientData )
+ m_stringSelection = _T("");
+
+ m_dialogStyle = style;
+
+ wxBeginBusyCursor();
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ // 1) text message
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
+
+ // 2) list box
+ m_listbox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
+ n, choices, wxLB_ALWAYS_SB );
+ m_listbox->SetSelection( m_selection );
+ if (clientData)
{
for (int i = 0; i < n; i++)
m_listbox->SetClientData(i, clientData[i]);
}
+ topsizer->Add( m_listbox, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
- // separator line
#if wxUSE_STATLINE
- (void) new wxStaticLine( this, -1,
- wxPoint(2*LAYOUT_X_MARGIN, y + LAYOUT_Y_MARGIN),
- wxSize(wDialog - 4*LAYOUT_X_MARGIN, hStatLine) );
-
- y += LAYOUT_Y_MARGIN + hStatLine;
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
- // buttons
+ // 4) buttons
+ topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 );
- y += 2*LAYOUT_X_MARGIN;
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+ SetSizer( topsizer );
+ SetAutoLayout( TRUE );
- CreateStandardButtons(wDialog, y, wButton, hButton, hasCancel);
+ Centre( wxBOTH );
- SetClientSize( wDialog, hDialog );
+ m_listbox->SetFocus();
- Centre( wxBOTH );
+ wxEndBusyCursor();
return TRUE;
}
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: extdlgg.cpp
-// Purpose: extended generic dialog
-// Author: Robert Roebling
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Robert Roebling
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "extdlgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/intl.h"
-#include "wx/dialog.h"
-#include "wx/button.h"
-#endif
-
-#if wxUSE_STATLINE
-#include "wx/statline.h"
-#endif
-
-#include "wx/generic/extdlgg.h"
-
-//-----------------------------------------------------------------------------
-// wxExtDialog
-//-----------------------------------------------------------------------------
-
-#define BUTTON_AREA_MARGIN 10
-
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxExtDialog, wxDialog)
-
-BEGIN_EVENT_TABLE(wxExtDialog, wxDialog)
- EVT_SIZE(wxExtDialog::OnSize)
- EVT_BUTTON(wxID_YES, wxExtDialog::OnYes)
- EVT_BUTTON(wxID_NO, wxExtDialog::OnNo)
- EVT_BUTTON(wxID_CANCEL, wxExtDialog::OnCancel)
-END_EVENT_TABLE()
-#endif
-
-wxExtDialog::wxExtDialog( wxWindow *parent, wxWindowID id,
- const wxString& title, long extraStyle,
- const wxPoint& pos, const wxSize& size,
- long style, const wxString &name )
-{
- Create( parent, id, title, extraStyle, pos, size, style, name );
-}
-
-bool wxExtDialog::Create( wxWindow *parent, wxWindowID id,
- const wxString& title, long extraStyle,
- const wxPoint& pos, const wxSize& size,
- long style, const wxString &name )
-{
- if (!wxDialog::Create( parent, id, title, pos, size, style, name ))
- return FALSE;
-
- m_extraStyle = extraStyle;
-
- m_clientWindowMargin = 10;
-
- if (m_windowStyle & wxED_BUTTONS_RIGHT)
- {
- m_spacePerButton.x = wxButton::GetDefaultSize().x + 18;
- m_spacePerButton.y = wxButton::GetDefaultSize().y + 8;
- }
- else
- {
- m_spacePerButton.x = wxButton::GetDefaultSize().x + 8;
- m_spacePerButton.y = wxButton::GetDefaultSize().y + 18;
- }
-
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
- // Under Motif and GTK, the default button has a big frame around
- // it and to avoid overlapping buttons we make the margin bigger.
- // We could give other platforms a bigger margin as well, but this
- // wouldn't be standard L&F.
- m_spacePerButton.x += 10;
- m_spacePerButton.y += 10;
-#endif
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
- wxButton *yes = (wxButton *) NULL;
- wxButton *no = (wxButton *) NULL;
-
-
- if (m_extraStyle & wxYES_NO)
- {
- yes = new wxButton( this, wxID_YES, _("Yes") );
- m_buttons.Append( yes );
- no = new wxButton( this, wxID_NO, _("No") );
- m_buttons.Append( no );
- }
-
- if (m_extraStyle & wxYES)
- {
- yes = new wxButton( this, wxID_YES, _("Yes") );
- m_buttons.Append( yes );
- }
-
- if (m_extraStyle & wxNO)
- {
- no = new wxButton( this, wxID_NO, _("No") );
- m_buttons.Append( no );
- }
-
- if (m_extraStyle & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- m_buttons.Append( ok );
- }
-
- if (m_extraStyle & wxFORWARD)
- AddButton( new wxButton( this, wxID_FORWARD, _("Forward") ) );
-
- if (m_extraStyle & wxBACKWARD)
- AddButton( new wxButton( this, wxID_BACKWARD, _("Backward") ) );
-
- if (m_extraStyle & wxSETUP)
- AddButton( new wxButton( this, wxID_SETUP, _("Setup") ) );
-
- if (m_extraStyle & wxMORE)
- AddButton( new wxButton( this, wxID_MORE, _("More...") ) );
-
- if (m_extraStyle & wxHELP)
- AddButton( new wxButton( this, wxID_HELP, _("Help") ) );
-
- if (m_extraStyle & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- m_buttons.Append( cancel );
- }
-
- if ((m_extraStyle & wxNO_DEFAULT) == 0)
- {
- if (ok)
- {
- ok->SetDefault();
- ok->SetFocus();
- }
- else if (yes)
- {
- yes->SetDefault();
- yes->SetFocus();
- }
- }
-
-#if wxUSE_STATLINE
- if (style & wxED_STATIC_LINE)
- {
- int line_style = wxLI_HORIZONTAL;
- if (style & wxED_BUTTONS_RIGHT) line_style = wxLI_VERTICAL;
-
- m_statLine = new wxStaticLine( this, -1, wxDefaultPosition, wxDefaultSize, line_style );
- }
- else
- m_statLine = (wxStaticLine*) NULL;
-#endif
-
- if (m_extraStyle & wxCENTRE)
- Centre( wxBOTH );
-
- return TRUE;
-}
-
-void wxExtDialog::AddButton( wxButton *button )
-{
- m_buttons.Append( button );
-}
-
-void wxExtDialog::SetDefaultButton( wxWindowID button )
-{
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxButton *but = (wxButton*) node->Data();
- if (but->GetId() == button)
- {
- but->SetDefault();
- but->SetFocus();
- return;
- }
- }
-}
-
-void wxExtDialog::EnableButton( wxWindowID button, bool enable )
-{
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxButton *but = (wxButton*) node->Data();
- if (but->GetId() == button)
- {
- but->Enable(enable);
- return;
- }
- }
-}
-
-bool wxExtDialog::ButtonIsEnabled( wxWindowID button )
-{
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxButton *but = (wxButton*) node->Data();
- if (but->GetId() == button)
- return but->IsEnabled();
- }
- return FALSE;
-}
-
-void wxExtDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
-{
- wxSize client_size( GetClientSize() );
- wxSize button_area( LayoutButtons() );
-
- if (HasFlag(wxED_BUTTONS_RIGHT))
- client_size.x -= button_area.x;
- else
- client_size.y -= button_area.y;
-
- if (m_clientWindow)
- {
- if (m_windowStyle & wxED_CLIENT_MARGIN)
- m_clientWindow->SetSize( m_clientWindowMargin,
- m_clientWindowMargin,
- client_size.x - 2*m_clientWindowMargin,
- client_size.y - 2*m_clientWindowMargin );
- else
- m_clientWindow->SetSize( 0, 0, client_size.x, client_size.y );
-
- if (m_clientWindow->GetAutoLayout())
- m_clientWindow->Layout();
- }
-}
-
-void wxExtDialog::OnYes(wxCommandEvent& event)
-{
- EndModal( wxID_YES );
-}
-
-void wxExtDialog::OnNo(wxCommandEvent& event)
-{
- EndModal( wxID_NO );
-}
-
-void wxExtDialog::OnCancel(wxCommandEvent& event)
-{
- /* allow cancellation via ESC/Close button except if
- only YES and NO are specified. */
- if ((m_extraStyle & wxYES_NO) != wxYES_NO || (m_extraStyle & wxCANCEL))
- {
- EndModal( wxID_CANCEL );
- }
-}
-
-wxSize wxExtDialog::GetButtonAreaSize()
-{
- if (m_buttons.GetCount() == 0) return wxSize(0,0);
-
- wxSize ret(0,0);
-
- if (m_windowStyle & wxED_BUTTONS_RIGHT)
- {
- ret.x = m_spacePerButton.x;
- ret.y = m_buttons.GetCount()*m_spacePerButton.y + 2*BUTTON_AREA_MARGIN;
-#if wxUSE_STATLINE
- if (m_statLine)
- ret.x += wxStaticLine::GetDefaultSize();
-#endif
- }
- else
- {
- ret.x = m_buttons.GetCount()*m_spacePerButton.x + 2*BUTTON_AREA_MARGIN;
- ret.y = m_spacePerButton.y;
-#if wxUSE_STATLINE
- if (m_statLine)
- ret.y += wxStaticLine::GetDefaultSize();
-#endif
- }
-
- return ret;
-}
-
-wxSize wxExtDialog::LayoutButtons()
-{
- if (m_buttons.GetCount() == 0) return wxSize(0,0);
-
- wxSize area_used( GetButtonAreaSize() );
- wxSize client_area( GetClientSize() );
-
- if (m_windowStyle & wxED_BUTTONS_RIGHT)
- {
- area_used.y = client_area.y;
- wxSize area_used_by_buttons( area_used );
-#if wxUSE_STATLINE
- if (m_statLine)
- area_used_by_buttons.x -= wxStaticLine::GetDefaultSize();
-#endif
-
- int space_for_each_button = (client_area.y-2*BUTTON_AREA_MARGIN) / m_buttons.GetCount();
- int n = 0;
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxButton *button = (wxButton*)node->Data();
-
- wxSize button_size( button->GetSize() );
- if (button_size.x < wxButton::GetDefaultSize().x) button_size.x = wxButton::GetDefaultSize().x;
-
- int center_of_button_y = n*space_for_each_button + space_for_each_button/2;
- int button_y = BUTTON_AREA_MARGIN + center_of_button_y - button_size.y/2;
-
- int center_of_button_x = client_area.x - area_used_by_buttons.x/2;
- int button_x = center_of_button_x - button_size.x/2;
-
- button->SetSize( button_x, button_y, button_size.x, button_size.y );
-
- node = node->Next();
- n++;
- }
-
-#if wxUSE_STATLINE
- if (m_statLine)
- m_statLine->SetSize( client_area.x - area_used_by_buttons.x - wxStaticLine::GetDefaultSize(),
- 0,
- wxStaticLine::GetDefaultSize(),
- client_area.y );
-#endif
- }
- else
- {
- area_used.x = client_area.x;
- wxSize area_used_by_buttons( area_used );
-#if wxUSE_STATLINE
- if (m_statLine)
- area_used_by_buttons.y -= wxStaticLine::GetDefaultSize();
-#endif
-
- int space_for_each_button = (client_area.x-2*BUTTON_AREA_MARGIN) / m_buttons.GetCount();
- int n = 0;
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxButton *button = (wxButton*)node->Data();
-
- wxSize button_size( button->GetSize() );
- if (button_size.x < wxButton::GetDefaultSize().x) button_size.x = wxButton::GetDefaultSize().x;
-
- int center_of_button_x = n*space_for_each_button + space_for_each_button/2;
- int button_x = BUTTON_AREA_MARGIN + center_of_button_x - button_size.x/2;
-
- int center_of_button_y = client_area.y - area_used_by_buttons.y/2;
- int button_y = center_of_button_y - button_size.y/2;
-
- button->SetSize( button_x, button_y, button_size.x, button_size.y );
-
- node = node->Next();
- n++;
- }
-
-#if wxUSE_STATLINE
- if (m_statLine)
- m_statLine->SetSize( 0,
- client_area.y - area_used_by_buttons.y - wxStaticLine::GetDefaultSize(),
- client_area.x,
- wxStaticLine::GetDefaultSize() );
-#endif
- }
-
- return area_used;
-}
-
-
#include "wx/layout.h"
#include "wx/intl.h"
#include "wx/icon.h"
-# include "wx/app.h"
+ #include "wx/sizer.h"
+ #include "wx/app.h"
#endif
#include <stdio.h>
wxBeginBusyCursor();
- wxLayoutConstraints *c;
- SetAutoLayout(TRUE);
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
- wxStaticBitmap *icon = new wxStaticBitmap(this, -1,
- wxTheApp->GetStdIcon(style & wxICON_MASK));
- const int iconSize = icon->GetBitmap().GetWidth();
-
- // split the message in lines
- // --------------------------
-
- wxArrayString lines;
- wxSize sizeText = SplitTextMessage(message, &lines);
- long widthTextMax = sizeText.GetWidth(),
- heightTextMax = sizeText.GetHeight();
- size_t nLineCount = lines.GetCount();
-
- // calculate the total dialog size
- enum
+ wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );
+
+ // 1) icon
+ if (style & wxICON_MASK)
{
- Btn_Ok,
- Btn_Yes,
- Btn_No,
- Btn_Cancel,
- Btn_Max
- };
- wxButton *buttons[Btn_Max] = { NULL, NULL, NULL, NULL };
- int nDefaultBtn = -1;
-
- // some checks are in order...
- wxASSERT_MSG( !(style & wxOK) || !(style & wxYES_NO),
- "don't create dialog with both Yes/No and Ok buttons!" );
-
- wxASSERT_MSG( (style & wxOK ) || (style & wxYES_NO),
- "don't create dialog with only the Cancel button!" );
-
- if ( style & wxYES_NO ) {
- buttons[Btn_Yes] = new wxButton(this, wxID_YES, _("Yes"));
- buttons[Btn_No] = new wxButton(this, wxID_NO, _("No"));
-
-
- if(style & wxNO_DEFAULT)
- nDefaultBtn = Btn_No;
- else
- nDefaultBtn = Btn_Yes;
+ wxStaticBitmap *icon = new wxStaticBitmap(
+ this, -1, wxTheApp->GetStdIcon(style & wxICON_MASK));
+ icon_text->Add( icon, 0, wxCENTER );
}
+
+ // 2) text
+ icon_text->Add( CreateTextSizer( message ), 0, wxCENTER | wxLEFT, 10 );
+
+ topsizer->Add( icon_text, 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
+
+#if wxUSE_STATLINE
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
+#endif
- if (style & wxOK) {
- buttons[Btn_Ok] = new wxButton(this, wxID_OK, _("OK"));
-
- if ( nDefaultBtn == -1 )
- nDefaultBtn = Btn_Ok;
- }
-
- if (style & wxCANCEL) {
- buttons[Btn_Cancel] = new wxButton(this, wxID_CANCEL, _("Cancel"));
- }
-
- // get the longest caption and also calc the number of buttons
- size_t nBtn, nButtons = 0;
- int width, widthBtnMax = 0;
- for ( nBtn = 0; nBtn < Btn_Max; nBtn++ ) {
- if ( buttons[nBtn] ) {
- nButtons++;
- GetTextExtent(buttons[nBtn]->GetLabel(), &width, NULL);
- if ( width > widthBtnMax )
- widthBtnMax = width;
- }
- }
-
- // now we can place the buttons
- if ( widthBtnMax < 75 )
- widthBtnMax = 75;
- else
- widthBtnMax += 10;
- long heightButton = widthBtnMax*23/75;
-
- // *1.2 baselineskip
- heightTextMax *= 12;
- heightTextMax /= 10;
-
- long widthButtonsTotal = nButtons * (widthBtnMax + LAYOUT_X_MARGIN) -
- LAYOUT_X_MARGIN;
-
- // the size of the dialog
- long widthDlg = wxMax(widthTextMax + iconSize + 4*LAYOUT_X_MARGIN,
- wxMax(widthButtonsTotal, width)) +
- 2*LAYOUT_X_MARGIN,
- heightDlg = 8*LAYOUT_Y_MARGIN + heightButton +
- heightTextMax*(nLineCount + 1);
-
- // create the controls
- // -------------------
-
- // the icon first
- c = new wxLayoutConstraints;
- c->width.Absolute(iconSize);
- c->height.Absolute(iconSize);
- c->top.SameAs(this, wxTop, 3*LAYOUT_Y_MARGIN);
- c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
- icon->SetConstraints(c);
-
- wxStaticText *text = NULL;
- for ( size_t nLine = 0; nLine < nLineCount; nLine++ ) {
- c = new wxLayoutConstraints;
- if ( text == NULL )
- c->top.SameAs(this, wxTop, 3*LAYOUT_Y_MARGIN);
- else
- c->top.Below(text);
-
- c->left.RightOf(icon, 2*LAYOUT_X_MARGIN);
- c->width.Absolute(widthTextMax);
- c->height.Absolute(heightTextMax);
- text = new wxStaticText(this, -1, lines[nLine]);
- text->SetConstraints(c);
- }
-
- // create the buttons
- wxButton *btnPrevious = (wxButton *)NULL;
- for ( nBtn = 0; nBtn < Btn_Max; nBtn++ ) {
- if ( buttons[nBtn] ) {
- c = new wxLayoutConstraints;
-
- if ( btnPrevious ) {
- c->left.RightOf(btnPrevious, LAYOUT_X_MARGIN);
- }
- else {
- c->left.SameAs(this, wxLeft,
- (widthDlg - widthButtonsTotal) / 2);
- }
-
- c->width.Absolute(widthBtnMax);
- c->top.Below(text, 4*LAYOUT_Y_MARGIN);
- c->height.Absolute(heightButton);
- buttons[nBtn]->SetConstraints(c);
-
- btnPrevious = buttons[nBtn];
- }
- }
-
- // set default button
- // ------------------
-
- if ( nDefaultBtn != -1 ) {
- buttons[nDefaultBtn]->SetDefault();
- buttons[nDefaultBtn]->SetFocus();
- }
- else {
- wxFAIL_MSG( "can't find default button for this dialog." );
- }
-
- // position the controls and the dialog itself
- // -------------------------------------------
-
- SetClientSize(widthDlg, heightDlg);
-
- // SetSizeHints() wants the size of the whole dialog, not just client size
- wxSize sizeTotal = GetSize(),
- sizeClient = GetClientSize();
- SetSizeHints(widthDlg + sizeTotal.GetWidth() - sizeClient.GetWidth(),
- heightDlg + sizeTotal.GetHeight() - sizeClient.GetHeight());
+ // 4) buttons
+ topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 );
- Layout();
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+ SetSizer( topsizer );
+ SetAutoLayout( TRUE );
- Centre(wxCENTER_FRAME | wxBOTH);
+ Centre( wxBOTH | wxCENTER_FRAME);
wxEndBusyCursor();
}
// this is where wxGetNumberFromUser() is declared
#include "wx/generic/textdlgg.h"
-static void wxSplitMessage2( const wxString &message, wxWindow *parent, wxSizer* sizer )
-{
- wxString line;
- for (size_t pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line );
- sizer->Add( s1 );
- line = _T("");
- }
- }
- else
- {
- line += message[pos];
- }
- }
-
- // remaining text behind last '\n'
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line );
- sizer->Add( s2 );
- }
-}
-
-
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
wxBeginBusyCursor();
- wxBox *topsizer = new wxBox( wxVERTICAL );
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
// 1) text message
- wxBox *textsizer = new wxBox( wxVERTICAL );
- wxSplitMessage2( message, this, textsizer );
- topsizer->Add( textsizer, 0, wxALL, 10 );
-
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
+
// 2) prompt and text ctrl
- wxBox *inputsizer = new wxBox( wxHORIZONTAL );
+ wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL );
// prompt if any
if (!prompt.IsEmpty())
inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 );
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
-
// 4) buttons
- wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
-
- wxButton *ok = (wxButton *) NULL;
-// if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- buttonsizer->Add( ok, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- wxButton *cancel = (wxButton *) NULL;
-// if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- buttonsizer->Add( cancel, 0, wxLEFT|wxRIGHT, 10 );
- }
+ topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 );
- topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
-
SetSizer( topsizer );
SetAutoLayout( TRUE );
Centre( wxBOTH );
- if (ok)
- ok->SetDefault();
-
m_spinctrl->SetFocus();
wxEndBusyCursor();
#include "wx/stattext.h"
#include "wx/textctrl.h"
#include "wx/intl.h"
+ #include "wx/sizer.h"
#endif
#if wxUSE_STATLINE
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL),
m_value(value)
{
- // calculate the sizes
- // -------------------
-
- wxArrayString lines;
- wxSize sizeText = SplitTextMessage(message, &lines);
-
- wxSize sizeBtn = GetStandardButtonSize();
-
- long wText = wxMax(4*sizeBtn.GetWidth(), sizeText.GetWidth());
- long hText = GetStandardTextHeight();
-
- long wDialog = 4*LAYOUT_X_MARGIN + wText;
- long hDialog = 2*LAYOUT_Y_MARGIN +
- sizeText.GetHeight() * lines.GetCount() +
- 2*LAYOUT_Y_MARGIN +
- hText +
- 2*LAYOUT_Y_MARGIN +
- sizeBtn.GetHeight() +
- 2*LAYOUT_Y_MARGIN;
-
- // create the controls
- // -------------------
-
- // message
- long x = 2*LAYOUT_X_MARGIN;
- long y = CreateTextMessage(lines,
- wxPoint(x, 2*LAYOUT_Y_MARGIN),
- sizeText);
-
- y += 2*LAYOUT_X_MARGIN;
-
- // text ctrl
- m_textctrl = new wxTextCtrl(this, wxID_TEXT, m_value,
- wxPoint(x, y),
- wxSize(wText, hText));
- y += hText + 2*LAYOUT_X_MARGIN;
-
- // and buttons
- CreateStandardButtons(wDialog, y, sizeBtn.GetWidth(), sizeBtn.GetHeight());
-
- // set the dialog size and position
- SetClientSize(wDialog, hDialog);
- if ( pos == wxDefaultPosition )
- {
- // centre the dialog if no explicit position given
- Centre(wxBOTH | wxCENTER_FRAME);
- }
+ m_dialogStyle = style;
+ m_value = value;
+
+ wxBeginBusyCursor();
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ // 1) text message
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
+
+ // 2) text ctrl
+ m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, wxDefaultPosition, wxSize(300, -1));
+ topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
+
+#if wxUSE_STATLINE
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
+#endif
+
+ // 4) buttons
+ topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 );
+
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+ SetSizer( topsizer );
+ SetAutoLayout( TRUE );
+
+ Centre( wxBOTH );
m_textctrl->SetFocus();
+
+ wxEndBusyCursor();
}
void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
#include "wx/dialog.h"
#include "wx/icon.h"
#include "wx/intl.h"
- #include "wx/layout.h"
#include "wx/settings.h"
#include "wx/textctrl.h"
#include "wx/statbmp.h"
+ #include "wx/sizer.h"
#endif // WX_PRECOMP
#include "wx/statline.h"
{
m_tipProvider = tipProvider;
- wxSize sizeBtn = GetStandardButtonSize();
- wxLayoutConstraints *c;
-
- // create the controls in the right order, then set the constraints
+ // 1) create all controls in tab order
+
wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close"));
+
m_checkbox = new wxCheckBox(this, -1, _("&Show tips at startup"));
+ m_checkbox->SetValue(showAtStartup);
+
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next"));
wxTextCtrl *text = new wxTextCtrl(this, -1, _("Did you know..."),
text->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE));
m_text = new wxTextCtrl(this, -1, _T(""),
- wxDefaultPosition, wxDefaultSize,
+ wxDefaultPosition, wxSize(200, 160),
wxTE_MULTILINE | wxTE_READONLY | wxSUNKEN_BORDER);
m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL));
#include "wx/generic/tip.xpm"
wxIcon icon(tipIcon);
#endif
-
wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon);
- const int iconSize = icon.GetWidth();
-
- c = new wxLayoutConstraints;
- c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
- c->left.RightOf(bmp, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
- c->height.Absolute(2*text->GetSize().GetHeight());
- text->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->centreY.SameAs(text, wxCentreY);
- c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
- c->width.Absolute(iconSize);
- c->height.Absolute(iconSize);
- bmp->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->bottom.SameAs(this, wxBottom, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
- c->width.Absolute(sizeBtn.GetWidth());
- c->height.Absolute(sizeBtn.GetHeight());
- btnClose->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->bottom.SameAs(this, wxBottom, 2*LAYOUT_X_MARGIN);
- c->right.LeftOf(btnClose, 2*LAYOUT_X_MARGIN);
- c->width.Absolute(sizeBtn.GetWidth());
- c->height.Absolute(sizeBtn.GetHeight());
- btnNext->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->bottom.SameAs(this, wxBottom, 2*LAYOUT_X_MARGIN);
- c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
- c->width.AsIs();
- c->height.AsIs();
- m_checkbox->SetConstraints(c);
- m_checkbox->SetValue(showAtStartup);
+ // 2) put them in boxes
- c = new wxLayoutConstraints;
- c->top.Below(text);
- c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
- c->bottom.Above(btnClose, -2*LAYOUT_Y_MARGIN);
- m_text->SetConstraints(c);
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );
+ icon_text->Add( bmp, 0, wxCENTER );
+ icon_text->Add( text, 1, wxCENTER | wxLEFT, 10 );
+ topsizer->Add( icon_text, 0, wxEXPAND | wxALL, 10 );
+
+ topsizer->Add( m_text, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );
+
+ wxBoxSizer *bottom = new wxBoxSizer( wxHORIZONTAL );
+ bottom->Add( m_checkbox, 0, wxCENTER );
+ bottom->Add( btnNext, 0, wxCENTER | wxLEFT, 10 );
+ bottom->Add( btnClose, 0, wxCENTER | wxLEFT, 10 );
+ topsizer->Add( bottom, 0, wxALIGN_RIGHT | wxALL, 10 );
SetTipText();
+
+ SetAutoLayout(TRUE);
+ SetSizer( topsizer );
+
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
Centre(wxBOTH | wxCENTER_FRAME);
- wxSize size(5*sizeBtn.GetWidth(), 10*sizeBtn.GetHeight());
- SetSize(size);
- SetSizeHints(size.x, size.y);
-
- SetAutoLayout(TRUE);
}
// ----------------------------------------------------------------------------
\
busyinfo.cpp \
caret.cpp \
+ choicdgg.cpp \
colrdlgg.cpp \
dcpsg.cpp \
dirdlgg.cpp \
- extdlgg.cpp \
fontdlgg.cpp \
gridg.cpp \
helpext.cpp \
imaglist.cpp \
laywin.cpp \
listctrl.cpp \
+ msgdlgg.cpp \
numdlgg.cpp \
panelg.cpp \
printps.cpp \
splitter.cpp \
statusbr.cpp \
tabg.cpp \
+ textdlgg.cpp \
tipdlg.cpp \
treectrl.cpp \
\
checkbox.cpp \
checklst.cpp \
choice.cpp \
- choicdlg.cpp \
clipbrd.cpp \
colour.cpp \
combobox.cpp \
mdi.cpp \
menu.cpp \
minifram.cpp \
- msgdlg.cpp \
notebook.cpp \
palette.cpp \
pen.cpp \
stattext.cpp \
tbargtk.cpp \
textctrl.cpp \
- textdlg.cpp \
timer.cpp \
tooltip.cpp \
utilsgtk.cpp \
GetTextExtent( m_label, &x, &y, (int*)NULL, (int*)NULL, &new_font );
wxSize newSize = size;
- if (newSize.x == -1) newSize.x = 12+x;
- if (newSize.y == -1) newSize.y = 11+y;
+ if (newSize.x == -1)
+ {
+ newSize.x = 12+x;
+ if (newSize.x < 80) newSize.x = 80;
+ }
+ if (newSize.y == -1)
+ {
+ newSize.y = 11+y;
+ if (newSize.x < 26) newSize.x = 26;
+ }
+
SetSize( newSize.x, newSize.y );
gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: choicdgg.cpp
-// Purpose: Choice dialogs
-// Author: Julian Smart
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
- #pragma implementation "choicdgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
- #pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include <stdio.h>
- #include "wx/utils.h"
- #include "wx/dialog.h"
- #include "wx/button.h"
- #include "wx/listbox.h"
- #include "wx/stattext.h"
- #include "wx/intl.h"
- #include "wx/sizer.h"
-#endif
-
-#if wxUSE_STATLINE
- #include "wx/statline.h"
-#endif
-
-#include "wx/gtk/choicdlg.h"
-
-static void wxSplitMessage2( const wxString &message, wxWindow *parent, wxSizer* sizer )
-{
- wxString line;
- for (size_t pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line );
- sizer->Add( s1 );
- line = _T("");
- }
- }
- else
- {
- line += message[pos];
- }
- }
-
- // remaining text behind last '\n'
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line );
- sizer->Add( s2 );
- }
-}
-
-
-wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
- const wxString *choices, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
- if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetStringSelection();
- else
- return _T("");
-}
-
-// Overloaded for backward compatibility
-wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
- char *choices[], wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- wxString ans(wxGetSingleChoice(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height));
- delete[] strings;
- return ans;
-}
-
-int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n,
- const wxString *choices, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
- if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelection();
- else
- return -1;
-}
-
-// Overloaded for backward compatibility
-int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n,
- wxChar *choices[], wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- for ( int i = 0; i < n; i++)
- strings[i] = choices[i];
- int ans = wxGetSingleChoiceIndex(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height);
- delete[] strings;
- return ans;
-}
-
-wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- const wxString *choices, char **client_data, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices, client_data);
- if ( dialog.ShowModal() == wxID_OK )
- return (wxChar *)dialog.GetSelectionClientData();
- else
- return NULL;
-}
-
-// Overloaded for backward compatibility
-wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- wxChar *choices[], char **client_data, wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- wxChar *data = wxGetSingleChoiceData(message, caption, n, (const wxString *)strings, client_data, parent,
- x, y, centre, width, height);
- delete[] strings;
- return data;
-}
-
-
-/* Multiple choice dialog contributed by Robert Cowell
- *
-
-The new data passed are in the "int nsel" and "int * selection"
-
-The idea is to make a multiple selection from list of strings.
-The returned value is the total number selected. initialily there
-are nsel selected, with indices stored in
-selection[0],...,selection[nsel-1] which appear highlighted to
-begin with. On exit with value i
-selection[0..i-1] contains the indices of the selected items.
-(Some prior selectecions might be deselected.)
-Thus selection must be as big as choices, in case all items are
-selected.
-
-*/
-/*
-int wxGetMultipleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices,
- int nsel, int * selection,
- wxWindow *parent , int x , int y, bool centre,
- int width, int height)
-{
- return -1;
-}
-*/
-
-// wxSingleChoiceDialog
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
- EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
- EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
-#endif
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
-{
- Create(parent, message, caption, n, choices, clientData, style);
-}
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
-{
- Create(parent, message, caption, choices, clientData, style);
-}
-
-bool wxSingleChoiceDialog::Create(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData, long style, const wxPoint& pos)
-{
- wxString *strings = new wxString[choices.Number()];
- int i;
- for ( i = 0; i < choices.Number(); i++)
- {
- strings[i] = (char *)choices.Nth(i)->Data();
- }
- bool ans = Create(parent, message, caption, choices.Number(), strings, clientData, style, pos);
- delete[] strings;
- return ans;
-}
-
-bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message,
- const wxString& WXUNUSED(caption), int n,
- const wxString *choices, char **clientData, long style,
- const wxPoint& WXUNUSED(pos) )
-{
- m_dialogStyle = style;
- m_selection = 0;
- m_stringSelection = _T("");
- m_clientData = NULL;
-
- wxBeginBusyCursor();
-
- wxBox *topsizer = new wxBox( wxVERTICAL );
-
- // 1) text message
- wxBox *textsizer = new wxBox( wxVERTICAL );
- wxSplitMessage2( message, this, textsizer );
- topsizer->Add( textsizer, 0, wxALL, 10 );
-
- // 2) list box
- wxListBox *listBox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
- n, choices, wxLB_ALWAYS_SB );
- listBox->SetSelection( m_selection );
- if (clientData)
- {
- for (int i = 0; i < n; i++)
- listBox->SetClientData(i, clientData[i]);
- }
- topsizer->Add( listBox, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
-
-
-#if wxUSE_STATLINE
- // 3) static line
- topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
-#endif
-
-
- // 4) buttons
- wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
-
- wxButton *ok = (wxButton *) NULL;
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- buttonsizer->Add( ok, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- wxButton *cancel = (wxButton *) NULL;
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- buttonsizer->Add( cancel, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
-
- topsizer->SetSizeHints( this );
- topsizer->Fit( this );
- SetSizer( topsizer );
- SetAutoLayout( TRUE );
-
- Centre( wxBOTH );
-
- if (ok)
- ok->SetDefault();
-
- listBox->SetFocus();
-
- wxEndBusyCursor();
-
- return TRUE;
-}
-
-// Set the selection
-void wxSingleChoiceDialog::SetSelection(int sel)
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if (listBox)
- {
- listBox->SetSelection(sel);
- }
- m_selection = sel;
-}
-
-void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if ( listBox )
- {
- m_selection = listBox->GetSelection();
- m_stringSelection = listBox->GetStringSelection();
- m_clientData = listBox->GetClientData(m_selection);
- }
-
- EndModal(wxID_OK);
-}
-
-void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if ( listBox )
- {
- m_selection = listBox->GetSelection();
- m_stringSelection = listBox->GetStringSelection();
- m_clientData = listBox->GetClientData(m_selection);
- }
-
- EndModal(wxID_OK);
-}
-
#
#
#
-# This file was automatically generated by tmake at 19:48, 1999/08/10
+# This file was automatically generated by tmake at 09:46, 1999/08/11
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
#
GTK_GENERICOBJS = \
../generic/busyinfo.o \
../generic/caret.o \
+ ../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/imaglist.o \
../generic/scrolwin.o \
../generic/splitter.o \
../generic/statusbr.o \
+ ../generic/textdlgg.o \
../generic/tipdlg.o \
../generic/treectrl.o
../gtk/button.o \
../gtk/checkbox.o \
../gtk/checklst.o \
- ../gtk/choicdlg.o \
../gtk/choice.o \
../gtk/clipbrd.o \
../gtk/colour.o \
../gtk/stattext.o \
../gtk/tbargtk.o \
../gtk/textctrl.o \
- ../gtk/textdlg.o \
../gtk/timer.o \
../gtk/tooltip.o \
../gtk/utilsgtk.o \
../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/helpxlp.o \
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: msgdlgg.cpp
-// Purpose: wxGenericMessageDialog
-// Author: Julian Smart, Robert Roebling
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart, Markus Holzem, Robert Roebling
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "msgdlgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx/utils.h"
-#include "wx/dialog.h"
-#include "wx/listbox.h"
-#include "wx/button.h"
-#include "wx/statbmp.h"
-#include "wx/stattext.h"
-#include "wx/layout.h"
-#include "wx/intl.h"
-#include "wx/bitmap.h"
-#include "wx/app.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "wx/gtk/msgdlg.h"
-#include "wx/statline.h"
-
-///////////////////////////////////////////////////////////////////
-// New dialog box implementations
-
-// Split message, using constraints to position controls
-wxSize wxSplitMessage2( const wxString &message, wxWindow *parent, int text_pos_x )
-{
- int y = 15;
- int w = 50;
- wxString line( _T("") );
- for (uint pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(text_pos_x,y) );
- wxSize size1( s1->GetSize() );
- if (size1.x > w) w = size1.x;
- line = _T("");
- }
- y += 18;
- }
- else
- {
- line += message[pos];
- }
- }
-
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(text_pos_x,y) );
- wxSize size2( s2->GetSize() );
- if (size2.x > w) w = size2.x;
- }
-
- y += 18;
-
- return wxSize(w+15+text_pos_x,y);
-}
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
- EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
- EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
- EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
-#endif
-
-wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message,
- const wxString& caption, long style, const wxPoint& pos) :
- wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
-{
- m_dialogStyle = style;
-
- int text_pos_x = 15;
-
- if (m_dialogStyle & wxICON_MASK)
- text_pos_x += 80;
-
- wxSize message_size( wxSplitMessage2( message, this, text_pos_x ) );
-
- if (m_dialogStyle & wxICON_MASK)
- {
- if (message_size.y < 50) message_size.y = 50;
- (void) new wxStaticBitmap( this, -1,
- wxTheApp->GetStdIcon(m_dialogStyle
- & wxICON_MASK),
- wxPoint(15,message_size.y/2-16) );
- }
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
- wxButton *yes = (wxButton *) NULL;
- wxButton *no = (wxButton *) NULL;
-
- int y = message_size.y + 30;
-
- if (style & wxYES_NO)
- {
- yes = new wxButton( this, wxID_YES, _("Yes"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( yes );
- no = new wxButton( this, wxID_NO, _("No"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( no );
- }
-
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( ok );
- }
-
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( cancel );
- }
-
- if (ok)
- {
- ok->SetDefault();
- ok->SetFocus();
- }
- else if (yes)
- {
- yes->SetDefault();
- yes->SetFocus();
- }
-
- int w = m_buttons.GetCount() * 100;
- if (message_size.x > w) w = message_size.x;
- int space = w / (m_buttons.GetCount()*2);
-
- int n = 0;
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxWindow *win = (wxWindow*)node->Data();
- int x = (n*2+1)*space - 40 + 15;
- win->Move( x, -1 );
- node = node->Next();
- n++;
- }
-
-#ifdef __WXGTK__
- int edge_margin = 7;
- (void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
-#endif
-
- SetSize( w+30, y+40 );
-
- Centre( wxBOTH );
-}
-
-void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event))
-{
- EndModal( wxID_YES );
-}
-
-void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event))
-{
- EndModal( wxID_NO );
-}
-
-void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
- /* Allow cancellation via ESC/Close button except if
- only YES and NO are specified. */
- if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) )
- {
- EndModal( wxID_CANCEL );
- }
-}
-
-
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: textdlgg.cpp
-// Purpose: wxTextEntryDialog
-// Author: Julian Smart
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "textdlgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include <stdio.h>
- #include "wx/utils.h"
- #include "wx/dialog.h"
- #include "wx/button.h"
- #include "wx/stattext.h"
- #include "wx/textctrl.h"
- #include "wx/intl.h"
- #include "wx/sizer.h"
-#endif
-
-#if wxUSE_STATLINE
- #include "wx/statline.h"
-#endif
-
-#include "wx/gtk/textdlg.h"
-
-static void wxSplitMessage2( const wxString &message, wxWindow *parent, wxSizer* sizer )
-{
- wxString line;
- for (size_t pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line );
- sizer->Add( s1 );
- line = _T("");
- }
- }
- else
- {
- line += message[pos];
- }
- }
-
- // remaining text behind last '\n'
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line );
- sizer->Add( s2 );
- }
-}
-
-// wxTextEntryDialog
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog)
- EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
-#endif
-
-wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxString& value, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
-{
- m_dialogStyle = style;
- m_value = value;
-
- wxBeginBusyCursor();
-
- wxBox *topsizer = new wxBox( wxVERTICAL );
-
- // 1) text message
- wxBox *textsizer = new wxBox( wxVERTICAL );
- wxSplitMessage2( message, this, textsizer );
- topsizer->Add( textsizer, 0, wxALL, 10 );
-
- // 2) text ctrl
- wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_TEXT, value, wxDefaultPosition, wxSize(300, -1));
- topsizer->Add( textCtrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
-
-#if wxUSE_STATLINE
- // 3) static line
- topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
-#endif
-
-
- // 4) buttons
- wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
-
- wxButton *ok = (wxButton *) NULL;
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- buttonsizer->Add( ok, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- wxButton *cancel = (wxButton *) NULL;
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- buttonsizer->Add( cancel, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
-
- topsizer->SetSizeHints( this );
- topsizer->Fit( this );
- SetSizer( topsizer );
- SetAutoLayout( TRUE );
-
- Centre( wxBOTH );
-
- if (ok)
- ok->SetDefault();
-
- textCtrl->SetFocus();
-
- wxEndBusyCursor();
-}
-
-void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
-{
- wxTextCtrl *textCtrl = (wxTextCtrl *)FindWindow(wxID_TEXT);
- if ( textCtrl )
- m_value = textCtrl->GetValue();
-
- EndModal(wxID_OK);
-}
-
\
busyinfo.cpp \
caret.cpp \
+ choicdgg.cpp \
colrdlgg.cpp \
dcpsg.cpp \
dirdlgg.cpp \
- extdlgg.cpp \
fontdlgg.cpp \
gridg.cpp \
helpext.cpp \
imaglist.cpp \
laywin.cpp \
listctrl.cpp \
+ msgdlgg.cpp \
numdlgg.cpp \
panelg.cpp \
printps.cpp \
splitter.cpp \
statusbr.cpp \
tabg.cpp \
+ textdlgg.cpp \
tipdlg.cpp \
treectrl.cpp \
\
checkbox.cpp \
checklst.cpp \
choice.cpp \
- choicdlg.cpp \
clipbrd.cpp \
colour.cpp \
combobox.cpp \
mdi.cpp \
menu.cpp \
minifram.cpp \
- msgdlg.cpp \
notebook.cpp \
palette.cpp \
pen.cpp \
stattext.cpp \
tbargtk.cpp \
textctrl.cpp \
- textdlg.cpp \
timer.cpp \
tooltip.cpp \
utilsgtk.cpp \
GetTextExtent( m_label, &x, &y, (int*)NULL, (int*)NULL, &new_font );
wxSize newSize = size;
- if (newSize.x == -1) newSize.x = 12+x;
- if (newSize.y == -1) newSize.y = 11+y;
+ if (newSize.x == -1)
+ {
+ newSize.x = 12+x;
+ if (newSize.x < 80) newSize.x = 80;
+ }
+ if (newSize.y == -1)
+ {
+ newSize.y = 11+y;
+ if (newSize.x < 26) newSize.x = 26;
+ }
+
SetSize( newSize.x, newSize.y );
gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: choicdgg.cpp
-// Purpose: Choice dialogs
-// Author: Julian Smart
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
- #pragma implementation "choicdgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
- #pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include <stdio.h>
- #include "wx/utils.h"
- #include "wx/dialog.h"
- #include "wx/button.h"
- #include "wx/listbox.h"
- #include "wx/stattext.h"
- #include "wx/intl.h"
- #include "wx/sizer.h"
-#endif
-
-#if wxUSE_STATLINE
- #include "wx/statline.h"
-#endif
-
-#include "wx/gtk/choicdlg.h"
-
-static void wxSplitMessage2( const wxString &message, wxWindow *parent, wxSizer* sizer )
-{
- wxString line;
- for (size_t pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line );
- sizer->Add( s1 );
- line = _T("");
- }
- }
- else
- {
- line += message[pos];
- }
- }
-
- // remaining text behind last '\n'
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line );
- sizer->Add( s2 );
- }
-}
-
-
-wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
- const wxString *choices, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
- if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetStringSelection();
- else
- return _T("");
-}
-
-// Overloaded for backward compatibility
-wxString wxGetSingleChoice( const wxString& message, const wxString& caption, int n,
- char *choices[], wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- wxString ans(wxGetSingleChoice(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height));
- delete[] strings;
- return ans;
-}
-
-int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n,
- const wxString *choices, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
- if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelection();
- else
- return -1;
-}
-
-// Overloaded for backward compatibility
-int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n,
- wxChar *choices[], wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- for ( int i = 0; i < n; i++)
- strings[i] = choices[i];
- int ans = wxGetSingleChoiceIndex(message, caption, n, (const wxString *)strings, parent,
- x, y, centre, width, height);
- delete[] strings;
- return ans;
-}
-
-wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- const wxString *choices, char **client_data, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
-{
- wxSingleChoiceDialog dialog(parent, message, caption, n, choices, client_data);
- if ( dialog.ShowModal() == wxID_OK )
- return (wxChar *)dialog.GetSelectionClientData();
- else
- return NULL;
-}
-
-// Overloaded for backward compatibility
-wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- wxChar *choices[], char **client_data, wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
-{
- wxString *strings = new wxString[n];
- int i;
- for ( i = 0; i < n; i++)
- {
- strings[i] = choices[i];
- }
- wxChar *data = wxGetSingleChoiceData(message, caption, n, (const wxString *)strings, client_data, parent,
- x, y, centre, width, height);
- delete[] strings;
- return data;
-}
-
-
-/* Multiple choice dialog contributed by Robert Cowell
- *
-
-The new data passed are in the "int nsel" and "int * selection"
-
-The idea is to make a multiple selection from list of strings.
-The returned value is the total number selected. initialily there
-are nsel selected, with indices stored in
-selection[0],...,selection[nsel-1] which appear highlighted to
-begin with. On exit with value i
-selection[0..i-1] contains the indices of the selected items.
-(Some prior selectecions might be deselected.)
-Thus selection must be as big as choices, in case all items are
-selected.
-
-*/
-/*
-int wxGetMultipleChoice(const wxString& message, const wxString& caption,
- int n, const wxString *choices,
- int nsel, int * selection,
- wxWindow *parent , int x , int y, bool centre,
- int width, int height)
-{
- return -1;
-}
-*/
-
-// wxSingleChoiceDialog
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
- EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
- EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
-#endif
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- int n, const wxString *choices, char **clientData, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
-{
- Create(parent, message, caption, n, choices, clientData, style);
-}
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
-{
- Create(parent, message, caption, choices, clientData, style);
-}
-
-bool wxSingleChoiceDialog::Create(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxStringList& choices, char **clientData, long style, const wxPoint& pos)
-{
- wxString *strings = new wxString[choices.Number()];
- int i;
- for ( i = 0; i < choices.Number(); i++)
- {
- strings[i] = (char *)choices.Nth(i)->Data();
- }
- bool ans = Create(parent, message, caption, choices.Number(), strings, clientData, style, pos);
- delete[] strings;
- return ans;
-}
-
-bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message,
- const wxString& WXUNUSED(caption), int n,
- const wxString *choices, char **clientData, long style,
- const wxPoint& WXUNUSED(pos) )
-{
- m_dialogStyle = style;
- m_selection = 0;
- m_stringSelection = _T("");
- m_clientData = NULL;
-
- wxBeginBusyCursor();
-
- wxBox *topsizer = new wxBox( wxVERTICAL );
-
- // 1) text message
- wxBox *textsizer = new wxBox( wxVERTICAL );
- wxSplitMessage2( message, this, textsizer );
- topsizer->Add( textsizer, 0, wxALL, 10 );
-
- // 2) list box
- wxListBox *listBox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
- n, choices, wxLB_ALWAYS_SB );
- listBox->SetSelection( m_selection );
- if (clientData)
- {
- for (int i = 0; i < n; i++)
- listBox->SetClientData(i, clientData[i]);
- }
- topsizer->Add( listBox, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
-
-
-#if wxUSE_STATLINE
- // 3) static line
- topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
-#endif
-
-
- // 4) buttons
- wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
-
- wxButton *ok = (wxButton *) NULL;
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- buttonsizer->Add( ok, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- wxButton *cancel = (wxButton *) NULL;
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- buttonsizer->Add( cancel, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
-
- topsizer->SetSizeHints( this );
- topsizer->Fit( this );
- SetSizer( topsizer );
- SetAutoLayout( TRUE );
-
- Centre( wxBOTH );
-
- if (ok)
- ok->SetDefault();
-
- listBox->SetFocus();
-
- wxEndBusyCursor();
-
- return TRUE;
-}
-
-// Set the selection
-void wxSingleChoiceDialog::SetSelection(int sel)
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if (listBox)
- {
- listBox->SetSelection(sel);
- }
- m_selection = sel;
-}
-
-void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if ( listBox )
- {
- m_selection = listBox->GetSelection();
- m_stringSelection = listBox->GetStringSelection();
- m_clientData = listBox->GetClientData(m_selection);
- }
-
- EndModal(wxID_OK);
-}
-
-void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
-{
- wxListBox *listBox = (wxListBox *)FindWindow(wxID_LISTBOX);
- if ( listBox )
- {
- m_selection = listBox->GetSelection();
- m_stringSelection = listBox->GetStringSelection();
- m_clientData = listBox->GetClientData(m_selection);
- }
-
- EndModal(wxID_OK);
-}
-
#
#
#
-# This file was automatically generated by tmake at 19:48, 1999/08/10
+# This file was automatically generated by tmake at 09:46, 1999/08/11
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
#
GTK_GENERICOBJS = \
../generic/busyinfo.o \
../generic/caret.o \
+ ../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/imaglist.o \
../generic/scrolwin.o \
../generic/splitter.o \
../generic/statusbr.o \
+ ../generic/textdlgg.o \
../generic/tipdlg.o \
../generic/treectrl.o
../gtk/button.o \
../gtk/checkbox.o \
../gtk/checklst.o \
- ../gtk/choicdlg.o \
../gtk/choice.o \
../gtk/clipbrd.o \
../gtk/colour.o \
../gtk/stattext.o \
../gtk/tbargtk.o \
../gtk/textctrl.o \
- ../gtk/textdlg.o \
../gtk/timer.o \
../gtk/tooltip.o \
../gtk/utilsgtk.o \
../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/helpxlp.o \
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: msgdlgg.cpp
-// Purpose: wxGenericMessageDialog
-// Author: Julian Smart, Robert Roebling
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart, Markus Holzem, Robert Roebling
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "msgdlgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx/utils.h"
-#include "wx/dialog.h"
-#include "wx/listbox.h"
-#include "wx/button.h"
-#include "wx/statbmp.h"
-#include "wx/stattext.h"
-#include "wx/layout.h"
-#include "wx/intl.h"
-#include "wx/bitmap.h"
-#include "wx/app.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "wx/gtk/msgdlg.h"
-#include "wx/statline.h"
-
-///////////////////////////////////////////////////////////////////
-// New dialog box implementations
-
-// Split message, using constraints to position controls
-wxSize wxSplitMessage2( const wxString &message, wxWindow *parent, int text_pos_x )
-{
- int y = 15;
- int w = 50;
- wxString line( _T("") );
- for (uint pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line, wxPoint(text_pos_x,y) );
- wxSize size1( s1->GetSize() );
- if (size1.x > w) w = size1.x;
- line = _T("");
- }
- y += 18;
- }
- else
- {
- line += message[pos];
- }
- }
-
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line, wxPoint(text_pos_x,y) );
- wxSize size2( s2->GetSize() );
- if (size2.x > w) w = size2.x;
- }
-
- y += 18;
-
- return wxSize(w+15+text_pos_x,y);
-}
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
- EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
- EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
- EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
-#endif
-
-wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message,
- const wxString& caption, long style, const wxPoint& pos) :
- wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
-{
- m_dialogStyle = style;
-
- int text_pos_x = 15;
-
- if (m_dialogStyle & wxICON_MASK)
- text_pos_x += 80;
-
- wxSize message_size( wxSplitMessage2( message, this, text_pos_x ) );
-
- if (m_dialogStyle & wxICON_MASK)
- {
- if (message_size.y < 50) message_size.y = 50;
- (void) new wxStaticBitmap( this, -1,
- wxTheApp->GetStdIcon(m_dialogStyle
- & wxICON_MASK),
- wxPoint(15,message_size.y/2-16) );
- }
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
- wxButton *yes = (wxButton *) NULL;
- wxButton *no = (wxButton *) NULL;
-
- int y = message_size.y + 30;
-
- if (style & wxYES_NO)
- {
- yes = new wxButton( this, wxID_YES, _("Yes"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( yes );
- no = new wxButton( this, wxID_NO, _("No"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( no );
- }
-
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( ok );
- }
-
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( cancel );
- }
-
- if (ok)
- {
- ok->SetDefault();
- ok->SetFocus();
- }
- else if (yes)
- {
- yes->SetDefault();
- yes->SetFocus();
- }
-
- int w = m_buttons.GetCount() * 100;
- if (message_size.x > w) w = message_size.x;
- int space = w / (m_buttons.GetCount()*2);
-
- int n = 0;
- wxNode *node = m_buttons.First();
- while (node)
- {
- wxWindow *win = (wxWindow*)node->Data();
- int x = (n*2+1)*space - 40 + 15;
- win->Move( x, -1 );
- node = node->Next();
- n++;
- }
-
-#ifdef __WXGTK__
- int edge_margin = 7;
- (void) new wxStaticLine( this, -1, wxPoint(edge_margin,y-20), wxSize(w+30-2*edge_margin, 5) );
-#endif
-
- SetSize( w+30, y+40 );
-
- Centre( wxBOTH );
-}
-
-void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event))
-{
- EndModal( wxID_YES );
-}
-
-void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event))
-{
- EndModal( wxID_NO );
-}
-
-void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
-{
- /* Allow cancellation via ESC/Close button except if
- only YES and NO are specified. */
- if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) )
- {
- EndModal( wxID_CANCEL );
- }
-}
-
-
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: textdlgg.cpp
-// Purpose: wxTextEntryDialog
-// Author: Julian Smart
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "textdlgg.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include <stdio.h>
- #include "wx/utils.h"
- #include "wx/dialog.h"
- #include "wx/button.h"
- #include "wx/stattext.h"
- #include "wx/textctrl.h"
- #include "wx/intl.h"
- #include "wx/sizer.h"
-#endif
-
-#if wxUSE_STATLINE
- #include "wx/statline.h"
-#endif
-
-#include "wx/gtk/textdlg.h"
-
-static void wxSplitMessage2( const wxString &message, wxWindow *parent, wxSizer* sizer )
-{
- wxString line;
- for (size_t pos = 0; pos < message.Len(); pos++)
- {
- if (message[pos] == _T('\n'))
- {
- if (!line.IsEmpty())
- {
- wxStaticText *s1 = new wxStaticText( parent, -1, line );
- sizer->Add( s1 );
- line = _T("");
- }
- }
- else
- {
- line += message[pos];
- }
- }
-
- // remaining text behind last '\n'
- if (!line.IsEmpty())
- {
- wxStaticText *s2 = new wxStaticText( parent, -1, line );
- sizer->Add( s2 );
- }
-}
-
-// wxTextEntryDialog
-
-#if !USE_SHARED_LIBRARY
-BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog)
- EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
-END_EVENT_TABLE()
-
-IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
-#endif
-
-wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption,
- const wxString& value, long style, const wxPoint& pos):
- wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
-{
- m_dialogStyle = style;
- m_value = value;
-
- wxBeginBusyCursor();
-
- wxBox *topsizer = new wxBox( wxVERTICAL );
-
- // 1) text message
- wxBox *textsizer = new wxBox( wxVERTICAL );
- wxSplitMessage2( message, this, textsizer );
- topsizer->Add( textsizer, 0, wxALL, 10 );
-
- // 2) text ctrl
- wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_TEXT, value, wxDefaultPosition, wxSize(300, -1));
- topsizer->Add( textCtrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
-
-#if wxUSE_STATLINE
- // 3) static line
- topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
-#endif
-
-
- // 4) buttons
- wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
-
- wxButton *ok = (wxButton *) NULL;
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK") );
- buttonsizer->Add( ok, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- wxButton *cancel = (wxButton *) NULL;
- if (style & wxCANCEL)
- {
- cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
- buttonsizer->Add( cancel, 0, wxLEFT|wxRIGHT, 10 );
- }
-
- topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
-
- topsizer->SetSizeHints( this );
- topsizer->Fit( this );
- SetSizer( topsizer );
- SetAutoLayout( TRUE );
-
- Centre( wxBOTH );
-
- if (ok)
- ok->SetDefault();
-
- textCtrl->SetFocus();
-
- wxEndBusyCursor();
-}
-
-void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) )
-{
- wxTextCtrl *textCtrl = (wxTextCtrl *)FindWindow(wxID_TEXT);
- if ( textCtrl )
- m_value = textCtrl->GetValue();
-
- EndModal(wxID_OK);
-}
-
#
#
#
-# This file was automatically generated by tmake at 19:48, 1999/08/10
+# This file was automatically generated by tmake at 09:46, 1999/08/11
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
#
GTK_GENERICOBJS = \
../generic/busyinfo.o \
../generic/caret.o \
+ ../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/imaglist.o \
../generic/scrolwin.o \
../generic/splitter.o \
../generic/statusbr.o \
+ ../generic/textdlgg.o \
../generic/tipdlg.o \
../generic/treectrl.o
../gtk/button.o \
../gtk/checkbox.o \
../gtk/checklst.o \
- ../gtk/choicdlg.o \
../gtk/choice.o \
../gtk/clipbrd.o \
../gtk/colour.o \
../gtk/stattext.o \
../gtk/tbargtk.o \
../gtk/textctrl.o \
- ../gtk/textdlg.o \
../gtk/timer.o \
../gtk/tooltip.o \
../gtk/utilsgtk.o \
../generic/choicdgg.o \
../generic/colrdlgg.o \
../generic/dirdlgg.o \
- ../generic/extdlgg.o \
../generic/fontdlgg.o \
../generic/gridg.o \
../generic/helpxlp.o \