From 073478b3d0586ffc056578831a6676d2306cff48 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 10 Aug 1999 11:23:46 +0000 Subject: [PATCH] Updates for makefile.unx Converted numdlg to use wxSizer Corrcted bug in default size of wxStaticLine Other optical corrections git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure.in | 37 ++++-- distrib/msw/tmake/filelist.t | 2 + distrib/msw/tmake/filelist.txt | 56 ++++++++- distrib/msw/tmake/unx.t | 56 +++++++-- makefile.unx.in | 223 +++++++++++++++++++++++++++++---- samples/image/image.cpp | 9 +- src/generic/numdlgg.cpp | 135 ++++++++++++-------- src/gtk/choicdlg.cpp | 2 +- src/gtk/statline.cpp | 16 +++ src/gtk/textdlg.cpp | 2 +- src/gtk1/choicdlg.cpp | 2 +- src/gtk1/statline.cpp | 16 +++ src/gtk1/textdlg.cpp | 2 +- 13 files changed, 450 insertions(+), 108 deletions(-) diff --git a/configure.in b/configure.in index 6e7fa23fe5..fa87fbf381 100644 --- a/configure.in +++ b/configure.in @@ -364,7 +364,7 @@ else DEFAULT_wxUSE_LIBJPEG=yes DEFAULT_wxUSE_ODBC=no - DEFAULT_wxUSE_STD_IOSTREAM=yes + DEFAULT_wxUSE_STD_IOSTREAM=no DEFAULT_wxUSE_FILE=yes DEFAULT_wxUSE_TEXTFILE=yes DEFAULT_wxUSE_TIMEDATE=yes @@ -1022,6 +1022,10 @@ dnl ---------------------------------------------------------------- TOOLKIT= TOOLKIT_INCLUDE= +GUIOBJS= +COMMONOBJS= +GENERICOBJS= + GUI_TK_LIBRARY= GUI_TK_LINK= @@ -1052,16 +1056,20 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then fi if test "$wxUSE_GTK" = 1; then - dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and - dnl only then, if it wasn't found, for an older one - AM_PATH_GTK(1.2.0, WXGTK12=1) - if test "$WXGTK12" != 1; then - AM_PATH_GTK(1.0.0, , AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.X or 1.0.X?)) - fi + dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and + dnl only then, if it wasn't found, for an older one + AM_PATH_GTK(1.2.0, WXGTK12=1) + if test "$WXGTK12" != 1; then + AM_PATH_GTK(1.0.0, , AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.X or 1.0.X?)) + fi - TOOLKIT_INCLUDE="$GTK_CFLAGS" - GUI_TK_LIBRARY="$GTK_LIBS" - TOOLKIT=GTK + TOOLKIT_INCLUDE="$GTK_CFLAGS" + GUI_TK_LIBRARY="$GTK_LIBS" + TOOLKIT=GTK + + GUIOBJS=GTK_GUIOBJS + COMMONOBJS=GTK_COMMONOBJS + GENERICOBJS=GTK_GENERICOBJS fi if test "$wxUSE_WINE" = 1; then @@ -1169,6 +1177,10 @@ if test "$wxUSE_MOTIF" = 1; then GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -ldl -lm" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK" TOOLKIT=MOTIF + + GUIOBJS=MOTIF_GUIOBJS + COMMONOBJS=MOTIF_COMMONOBJS + GENERICOBJS=MOTIF_GENERICOBJS fi dnl the name of the directory where the files for this toolkit live @@ -2209,6 +2221,11 @@ AC_SUBST(TOOLKIT_DEF) AC_SUBST(TOOLKIT_DIR) AC_SUBST(TOOLKIT_INCLUDE) +dnl what to compile +AC_SUBST(GUIOBJS) +AC_SUBST(COMMONOBJS) +AC_SUBST(GENERICOBJS) + dnl additional sources AC_SUBST(EXTRA_VPATH) AC_SUBST(LTLIBOBJS) diff --git a/distrib/msw/tmake/filelist.t b/distrib/msw/tmake/filelist.t index d231c6f1e3..030083140a 100644 --- a/distrib/msw/tmake/filelist.t +++ b/distrib/msw/tmake/filelist.t @@ -39,6 +39,8 @@ $wxGeneric{$fields[0]} = $fields[2]; } elsif ( $fields[1] eq "M" ) { $wxMSW{$fields[0]} = $fields[2]; + } elsif ( $fields[1] eq "X" ) { + $wxMOTIF{$fields[0]} = $fields[2]; } elsif ( $fields[1] eq "R" ) { $wxGTK{$fields[0]} = $fields[2]; } elsif ( $fields[1] eq "H" ) { diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 026b607aea..f832755bf1 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -10,8 +10,9 @@ # G /src/generic # C /src/common # M /src/msw +# X /src/motif X for Xt # U /src/unix -# R /src/gtk +# R /src/gtk R for Robert # H /src/html # I /include/wx, /include/wx/gtk, /include/wx/msw, etc. # @@ -314,6 +315,59 @@ utilsres.cpp R wave.cpp R window.cpp R +gsockmot.cpp X +accel.cpp X +app.cpp X +bitmap.cpp X +bmpbuttn.cpp X +brush.cpp X +button.cpp X +checkbox.cpp X +choice.cpp X +clipbrd.cpp X +colour.cpp X +combobox.cpp X +control.cpp X +cursor.cpp X +data.cpp X +dataobj.cpp X +dc.cpp X +dcclient.cpp X +dcmemory.cpp X +dcscreen.cpp X +dialog.cpp X +filedlg.cpp X +font.cpp X +frame.cpp X +gauge.cpp X +gdiobj.cpp X +icon.cpp X +listbox.cpp X +main.cpp X +mdi.cpp X +menu.cpp X +menuitem.cpp X +minifram.cpp X +msgdlg.cpp X +palette.cpp X +pen.cpp X +radiobox.cpp X +radiobut.cpp X +region.cpp X +scrolbar.cpp X +settings.cpp X +slider.cpp X +spinbutt.cpp X +statbmp.cpp X +statbox.cpp X +stattext.cpp X +toolbar.cpp X +textctrl.cpp X +timer.cpp X +tooltip.cpp X +utils.cpp X +window.cpp X + htmlcell.cpp H htmlfilter.cpp H htmlhelp.cpp H diff --git a/distrib/msw/tmake/unx.t b/distrib/msw/tmake/unx.t index 7c14b251b1..120aede3c2 100644 --- a/distrib/msw/tmake/unx.t +++ b/distrib/msw/tmake/unx.t @@ -17,19 +17,37 @@ next if $wxGeneric{$file} =~ /\bR\b/; $file =~ s/cp?p?$/\o/; - $project{"WXGENERICOBJS"} .= $file . " " + $project{"WXGTK_GENERICOBJS"} .= $file . " " + } + + #! now transform these hashes into $project tags + foreach $file (sort keys %wxGeneric) { + + $file =~ s/cp?p?$/\o/; + $project{"WXMOTIF_GENERICOBJS"} .= $file . " " } foreach $file (sort keys %wxCommon) { next if $wxCommon{$file} =~ /\bR\b/; $file =~ s/cp?p?$/\o/; - $project{"WXCOMMONOBJS"} .= $file . " " + $project{"WXGTK_COMMONOBJS"} .= $file . " " + } + + foreach $file (sort keys %wxCommon) { + + $file =~ s/cp?p?$/\o/; + $project{"WXMOTIF_COMMONOBJS"} .= $file . " " } foreach $file (sort keys %wxGTK) { $file =~ s/cp?p?$/\o/; - $project{"WXGTKOBJS"} .= $file . " " + $project{"WXGTK_GUIOBJS"} .= $file . " " + } + + foreach $file (sort keys %wxMOTIF) { + $file =~ s/cp?p?$/\o/; + $project{"WXMOTIF_GUIOBJS"} .= $file . " " } foreach $file (sort keys %wxHTML) { @@ -89,7 +107,7 @@ SHELL = @SHELL@ ########################### Paths ################################# -srcdir = @srcdir@/src/gtk +srcdir = @srcdir@/src/@TOOLKIT_DIR@ top_srcdir = @top_srcdir@ prefix = @prefix@ @@ -135,7 +153,7 @@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ -EXTRA_VPATH = @EXTRA_VPATH_MF@ +EXTRA_VPATH = @EXTRA_VPATH@ VPATH = .:${srcdir}:${srcdir}/src/common:${srcdir}/src/generic:${srcdir}/src/html:${EXTRA_VPATH} @@ -195,23 +213,34 @@ PNGDIR = $(WXDIR)/src/png JPEGDIR = $(WXDIR)/src/jpeg ZLIBDIR = $(WXDIR)/src/zlib GTKDIR = $(WXDIR)/src/gtk +MOTIFDIR = $(WXDIR)/src/motif INCDIR = $(WXDIR)/include DOCDIR = $(WXDIR)\docs -GENERICOBJS = \ - #$ ExpandList("WXGENERICOBJS"); +GTK_GENERICOBJS = \ + #$ ExpandList("WXGTK_GENERICOBJS"); + +GTK_COMMONOBJS = \ + parser.o \ + #$ ExpandList("WXGTK_COMMONOBJS"); + +GTK_GUIOBJS = \ + #$ ExpandList("WXGTK_GUIOBJS"); + +MOTIF_GENERICOBJS = \ + #$ ExpandList("WXMOTIF_GENERICOBJS"); -COMMONOBJS = \ +MOTIF_COMMONOBJS = \ parser.o \ - #$ ExpandList("WXCOMMONOBJS"); + #$ ExpandList("WXMOTIF_COMMONOBJS"); + +MOTIF_GUIOBJS = \ + #$ ExpandList("WXMOTIF_GUIOBJS"); HTMLOBJS = \ #$ ExpandList("WXHTMLOBJS"); -GTKOBJS = \ - #$ ExpandList("WXGTKOBJS"); - UNIXOBJS = \ #$ ExpandList("WXUNIXOBJS"); @@ -297,7 +326,8 @@ JPEGOBJS = \ jquant2.o \ jdmerge.o -OBJECTS = $(GTKOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJ) $(UNIXOBJS) \ + +OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(HTMLOBJS) $(UNIXOBJS) \ $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) all: $(OBJECTS) $(WXLIB) diff --git a/makefile.unx.in b/makefile.unx.in index dfe76559a8..cd7b83c96d 100644 --- a/makefile.unx.in +++ b/makefile.unx.in @@ -11,7 +11,7 @@ # # # -# This file was automatically generated by tmake at 23:37, 1999/08/08 +# This file was automatically generated by tmake at 10:43, 1999/08/10 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -45,7 +45,7 @@ SHELL = @SHELL@ ########################### Paths ################################# -srcdir = @srcdir@/src/gtk +srcdir = @srcdir@/src/@TOOLKIT_DIR@ top_srcdir = @top_srcdir@ prefix = @prefix@ @@ -91,7 +91,7 @@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ -EXTRA_VPATH = @EXTRA_VPATH_MF@ +EXTRA_VPATH = @EXTRA_VPATH@ VPATH = .:${srcdir}:${srcdir}/src/common:${srcdir}/src/generic:${srcdir}/src/html:${EXTRA_VPATH} @@ -151,11 +151,12 @@ PNGDIR = $(WXDIR)/src/png JPEGDIR = $(WXDIR)/src/jpeg ZLIBDIR = $(WXDIR)/src/zlib GTKDIR = $(WXDIR)/src/gtk +MOTIFDIR = $(WXDIR)/src/motif INCDIR = $(WXDIR)/include DOCDIR = $(WXDIR)\docs -GENERICOBJS = \ +GTK_GENERICOBJS = \ busyinfo.o \ caret.o \ colrdlgg.o \ @@ -181,7 +182,7 @@ GENERICOBJS = \ tipdlg.o \ treectrl.o -COMMONOBJS = \ +GTK_COMMONOBJS = \ parser.o \ cmndata.o \ config.o \ @@ -261,26 +262,7 @@ COMMONOBJS = \ zipstrm.o \ zstream.o -HTMLOBJS = \ - htmlcell.o \ - htmlfilter.o \ - htmlhelp.o \ - htmlhelp_io.o \ - htmlparser.o \ - htmltag.o \ - htmlwin.o \ - htmlwinparser.o \ - mod_fonts.o \ - mod_hline.o \ - mod_image.o \ - mod_layout.o \ - mod_links.o \ - mod_list.o \ - mod_pre.o \ - mod_tables.o \ - search.o - -GTKOBJS = \ +GTK_GUIOBJS = \ accel.o \ app.o \ bitmap.o \ @@ -342,6 +324,194 @@ GTKOBJS = \ win_gtk.o \ window.o +MOTIF_GENERICOBJS = \ + busyinfo.o \ + caret.o \ + choicdgg.o \ + colrdlgg.o \ + dirdlgg.o \ + extdlgg.o \ + fontdlgg.o \ + gridg.o \ + helpxlp.o \ + imaglist.o \ + laywin.o \ + listctrl.o \ + msgdlgg.o \ + notebook.o \ + numdlgg.o \ + panelg.o \ + printps.o \ + prntdlgg.o \ + progdlgg.o \ + prop.o \ + propform.o \ + proplist.o \ + sashwin.o \ + scrolwin.o \ + splitter.o \ + statusbr.o \ + tabg.o \ + textdlgg.o \ + tipdlg.o \ + treectrl.o + +MOTIF_COMMONOBJS = \ + parser.o \ + choiccmn.o \ + cmndata.o \ + config.o \ + ctrlcmn.o \ + date.o \ + datstrm.o \ + db.o \ + dbtable.o \ + dcbase.o \ + dlgcmn.o \ + docmdi.o \ + docview.o \ + dynarray.o \ + dynlib.o \ + event.o \ + extended.o \ + ffile.o \ + file.o \ + fileconf.o \ + filefn.o \ + filesys.o \ + framecmn.o \ + fs_inet.o \ + fs_zip.o \ + ftp.o \ + gdicmn.o \ + hash.o \ + helpbase.o \ + http.o \ + imagbmp.o \ + image.o \ + imaggif.o \ + imagjpeg.o \ + imagpng.o \ + intl.o \ + ipcbase.o \ + layout.o \ + list.o \ + log.o \ + memory.o \ + mimetype.o \ + module.o \ + mstream.o \ + object.o \ + objstrm.o \ + odbc.o \ + paper.o \ + prntbase.o \ + process.o \ + protocol.o \ + resource.o \ + sckaddr.o \ + sckfile.o \ + sckipc.o \ + sckstrm.o \ + socket.o \ + strconv.o \ + stream.o \ + string.o \ + tbarbase.o \ + tbarsmpl.o \ + textcmn.o \ + textfile.o \ + time.o \ + timercmn.o \ + tokenzr.o \ + txtstrm.o \ + unzip.o \ + url.o \ + utilscmn.o \ + valgen.o \ + validate.o \ + valtext.o \ + variant.o \ + wfstream.o \ + wincmn.o \ + wxchar.o \ + wxexpr.o \ + zipstrm.o \ + zstream.o + +MOTIF_GUIOBJS = \ + accel.o \ + app.o \ + bitmap.o \ + bmpbuttn.o \ + brush.o \ + button.o \ + checkbox.o \ + choice.o \ + clipbrd.o \ + colour.o \ + combobox.o \ + control.o \ + cursor.o \ + data.o \ + dataobj.o \ + dc.o \ + dcclient.o \ + dcmemory.cpp \ + dcscreen.o \ + dialog.o \ + filedlg.o \ + font.o \ + frame.o \ + gauge.o \ + gdiobj.o \ + gsockmot.o \ + icon.o \ + listbox.o \ + main.o \ + mdi.o \ + menu.o \ + menuitem.o \ + minifram.o \ + msgdlg.o \ + palette.o \ + pen.o \ + radiobox.o \ + radiobut.o \ + region.o \ + scrolbar.o \ + settings.o \ + slider.o \ + spinbutt.o \ + statbmp.o \ + statbox.o \ + stattext.o \ + textctrl.o \ + timer.o \ + toolbar.o \ + tooltip.o \ + utils.o \ + window.o + +HTMLOBJS = \ + htmlcell.o \ + htmlfilter.o \ + htmlhelp.o \ + htmlhelp_io.o \ + htmlparser.o \ + htmltag.o \ + htmlwin.o \ + htmlwinparser.o \ + mod_fonts.o \ + mod_hline.o \ + mod_image.o \ + mod_layout.o \ + mod_links.o \ + mod_list.o \ + mod_pre.o \ + mod_tables.o \ + search.o + UNIXOBJS = \ gsocket.o \ threadpsx.o \ @@ -429,7 +599,8 @@ JPEGOBJS = \ jquant2.o \ jdmerge.o -OBJECTS = $(GTKOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJ) $(UNIXOBJS) \ + +OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(HTMLOBJS) $(UNIXOBJS) \ $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) all: $(OBJECTS) $(WXLIB) diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 80d07d6a17..3fcd095ffb 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -102,8 +102,8 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, wxMemoryDC dc; dc.SelectObject( bitmap ); - dc.SetBrush( wxBrush( "orange", wxSOLID ) ); - dc.SetPen( *wxWHITE_PEN ); + dc.SetBrush( wxBrush( wxColour(50,100,150), wxSOLID ) ); + dc.SetPen( *wxBLACK_PEN ); dc.DrawRectangle( 0, 0, 100, 100 ); dc.SelectObject( wxNullBitmap ); @@ -117,6 +117,11 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, wxLogWarning("Can't find image files in either '.' or '..'!"); wxImage image( bitmap ); + + printf( "(1,1) red: %d\n", (int)image.GetRed(2,2) ); + printf( "(1,1) green: %d\n", (int)image.GetGreen(2,2) ); + printf( "(1,1) blue: %d\n", (int)image.GetBlue(2,2) ); + if ( !image.SaveFile( dir + wxString("test.png"), wxBITMAP_TYPE_PNG ) ) wxLogError("Can't save file"); diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 21dcd5d23b..bea91d2583 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -38,11 +38,45 @@ #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 // 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 // ---------------------------------------------------------------------------- @@ -97,73 +131,70 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) { - // init members - // ------------ - m_value = value; m_max = max; m_min = min; - // calculate the sizes - // ------------------- - - wxArrayString lines; - wxSize sizeText = SplitTextMessage(message, &lines); - - wxSize sizeBtn = GetStandardButtonSize(); - - int wPrompt, hPrompt; - GetTextExtent(prompt, &wPrompt, &hPrompt); + wxBeginBusyCursor(); + + wxBox *topsizer = new wxBox( wxVERTICAL ); - long wText = wxMax(2*sizeBtn.GetWidth(), - wxMax(wPrompt, sizeText.GetWidth())); - long hText = GetStandardTextHeight(); - - long wDialog = 5*LAYOUT_X_MARGIN + wText + wPrompt; - 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; - - // prompt - (void)new wxStaticText(this, -1, prompt, - wxPoint(x, y), - wxSize(wPrompt, hPrompt)); + // 1) text message + wxBox *textsizer = new wxBox( wxVERTICAL ); + wxSplitMessage2( message, this, textsizer ); + topsizer->Add( textsizer, 0, wxALL, 10 ); + // 2) prompt and text ctrl + wxBox *inputsizer = new wxBox( wxHORIZONTAL ); + // prompt if any + if (!prompt.IsEmpty()) + inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 ); // spin ctrl wxString valStr; valStr.Printf(_T("%lu"), m_value); - m_spinctrl = new wxTextCtrl(this, -1, valStr, - wxPoint(x + wPrompt + LAYOUT_X_MARGIN, y), - wxSize(wText, hText)); - y += hText + 2*LAYOUT_X_MARGIN; + m_spinctrl = new wxTextCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) ); + inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 ); + // add both + topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); + +#if wxUSE_STATLINE + // 3) static line + topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); +#endif + - // and buttons - CreateStandardButtons(wDialog, y, sizeBtn.GetWidth(), sizeBtn.GetHeight()); + // 4) buttons + wxBox *buttonsizer = new wxBox( wxHORIZONTAL ); - // set the dialog size and position - SetClientSize(wDialog, hDialog); - if ( pos == wxDefaultPosition ) + wxButton *ok = (wxButton *) NULL; +// if (style & wxOK) { - // centre the dialog if no explicit position given - Centre(wxBOTH | wxCENTER_FRAME); + 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(); + m_spinctrl->SetFocus(); + + wxEndBusyCursor(); } void wxNumberEntryDialog::OnOK(wxCommandEvent& event) diff --git a/src/gtk/choicdlg.cpp b/src/gtk/choicdlg.cpp index 5aeb8dec86..177457ad54 100644 --- a/src/gtk/choicdlg.cpp +++ b/src/gtk/choicdlg.cpp @@ -253,7 +253,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m #if wxUSE_STATLINE // 3) static line - topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 3 ); + topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif diff --git a/src/gtk/statline.cpp b/src/gtk/statline.cpp index fda6826dc6..cd67c8a642 100644 --- a/src/gtk/statline.cpp +++ b/src/gtk/statline.cpp @@ -49,9 +49,25 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id, } if ( IsVertical() ) + { m_widget = gtk_vseparator_new(); + if (size.x == -1) + { + wxSize new_size( size ); + new_size.x = 4; + SetSize( new_size ); + } + } else + { m_widget = gtk_hseparator_new(); + if (size.y == -1) + { + wxSize new_size( size ); + new_size.y = 4; + SetSize( new_size ); + } + } m_parent->DoAddChild( this ); diff --git a/src/gtk/textdlg.cpp b/src/gtk/textdlg.cpp index db9257d998..c4cbd59af0 100644 --- a/src/gtk/textdlg.cpp +++ b/src/gtk/textdlg.cpp @@ -97,7 +97,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, #if wxUSE_STATLINE // 3) static line - topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 3 ); + topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif diff --git a/src/gtk1/choicdlg.cpp b/src/gtk1/choicdlg.cpp index 5aeb8dec86..177457ad54 100644 --- a/src/gtk1/choicdlg.cpp +++ b/src/gtk1/choicdlg.cpp @@ -253,7 +253,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m #if wxUSE_STATLINE // 3) static line - topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 3 ); + topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif diff --git a/src/gtk1/statline.cpp b/src/gtk1/statline.cpp index fda6826dc6..cd67c8a642 100644 --- a/src/gtk1/statline.cpp +++ b/src/gtk1/statline.cpp @@ -49,9 +49,25 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id, } if ( IsVertical() ) + { m_widget = gtk_vseparator_new(); + if (size.x == -1) + { + wxSize new_size( size ); + new_size.x = 4; + SetSize( new_size ); + } + } else + { m_widget = gtk_hseparator_new(); + if (size.y == -1) + { + wxSize new_size( size ); + new_size.y = 4; + SetSize( new_size ); + } + } m_parent->DoAddChild( this ); diff --git a/src/gtk1/textdlg.cpp b/src/gtk1/textdlg.cpp index db9257d998..c4cbd59af0 100644 --- a/src/gtk1/textdlg.cpp +++ b/src/gtk1/textdlg.cpp @@ -97,7 +97,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message, #if wxUSE_STATLINE // 3) static line - topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 3 ); + topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif -- 2.45.2