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
This commit is contained in:
Robert Roebling
1999-08-10 11:23:46 +00:00
parent 50bcd1ae77
commit 073478b3d0
13 changed files with 450 additions and 108 deletions

View File

@@ -364,7 +364,7 @@ else
DEFAULT_wxUSE_LIBJPEG=yes DEFAULT_wxUSE_LIBJPEG=yes
DEFAULT_wxUSE_ODBC=no DEFAULT_wxUSE_ODBC=no
DEFAULT_wxUSE_STD_IOSTREAM=yes DEFAULT_wxUSE_STD_IOSTREAM=no
DEFAULT_wxUSE_FILE=yes DEFAULT_wxUSE_FILE=yes
DEFAULT_wxUSE_TEXTFILE=yes DEFAULT_wxUSE_TEXTFILE=yes
DEFAULT_wxUSE_TIMEDATE=yes DEFAULT_wxUSE_TIMEDATE=yes
@@ -1022,6 +1022,10 @@ dnl ----------------------------------------------------------------
TOOLKIT= TOOLKIT=
TOOLKIT_INCLUDE= TOOLKIT_INCLUDE=
GUIOBJS=
COMMONOBJS=
GENERICOBJS=
GUI_TK_LIBRARY= GUI_TK_LIBRARY=
GUI_TK_LINK= GUI_TK_LINK=
@@ -1052,16 +1056,20 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
fi fi
if test "$wxUSE_GTK" = 1; then if test "$wxUSE_GTK" = 1; then
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and 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 dnl only then, if it wasn't found, for an older one
AM_PATH_GTK(1.2.0, WXGTK12=1) AM_PATH_GTK(1.2.0, WXGTK12=1)
if test "$WXGTK12" != 1; then 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?)) 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 fi
TOOLKIT_INCLUDE="$GTK_CFLAGS" TOOLKIT_INCLUDE="$GTK_CFLAGS"
GUI_TK_LIBRARY="$GTK_LIBS" GUI_TK_LIBRARY="$GTK_LIBS"
TOOLKIT=GTK TOOLKIT=GTK
GUIOBJS=GTK_GUIOBJS
COMMONOBJS=GTK_COMMONOBJS
GENERICOBJS=GTK_GENERICOBJS
fi fi
if test "$wxUSE_WINE" = 1; then 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_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -ldl -lm"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
TOOLKIT=MOTIF TOOLKIT=MOTIF
GUIOBJS=MOTIF_GUIOBJS
COMMONOBJS=MOTIF_COMMONOBJS
GENERICOBJS=MOTIF_GENERICOBJS
fi fi
dnl the name of the directory where the files for this toolkit live 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_DIR)
AC_SUBST(TOOLKIT_INCLUDE) AC_SUBST(TOOLKIT_INCLUDE)
dnl what to compile
AC_SUBST(GUIOBJS)
AC_SUBST(COMMONOBJS)
AC_SUBST(GENERICOBJS)
dnl additional sources dnl additional sources
AC_SUBST(EXTRA_VPATH) AC_SUBST(EXTRA_VPATH)
AC_SUBST(LTLIBOBJS) AC_SUBST(LTLIBOBJS)

View File

@@ -39,6 +39,8 @@
$wxGeneric{$fields[0]} = $fields[2]; $wxGeneric{$fields[0]} = $fields[2];
} elsif ( $fields[1] eq "M" ) { } elsif ( $fields[1] eq "M" ) {
$wxMSW{$fields[0]} = $fields[2]; $wxMSW{$fields[0]} = $fields[2];
} elsif ( $fields[1] eq "X" ) {
$wxMOTIF{$fields[0]} = $fields[2];
} elsif ( $fields[1] eq "R" ) { } elsif ( $fields[1] eq "R" ) {
$wxGTK{$fields[0]} = $fields[2]; $wxGTK{$fields[0]} = $fields[2];
} elsif ( $fields[1] eq "H" ) { } elsif ( $fields[1] eq "H" ) {

View File

@@ -10,8 +10,9 @@
# G /src/generic # G /src/generic
# C /src/common # C /src/common
# M /src/msw # M /src/msw
# X /src/motif X for Xt
# U /src/unix # U /src/unix
# R /src/gtk # R /src/gtk R for Robert
# H /src/html # H /src/html
# I /include/wx, /include/wx/gtk, /include/wx/msw, etc. # I /include/wx, /include/wx/gtk, /include/wx/msw, etc.
# #
@@ -314,6 +315,59 @@ utilsres.cpp R
wave.cpp R wave.cpp R
window.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 htmlcell.cpp H
htmlfilter.cpp H htmlfilter.cpp H
htmlhelp.cpp H htmlhelp.cpp H

View File

@@ -17,19 +17,37 @@
next if $wxGeneric{$file} =~ /\bR\b/; next if $wxGeneric{$file} =~ /\bR\b/;
$file =~ s/cp?p?$/\o/; $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) { foreach $file (sort keys %wxCommon) {
next if $wxCommon{$file} =~ /\bR\b/; next if $wxCommon{$file} =~ /\bR\b/;
$file =~ s/cp?p?$/\o/; $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) { foreach $file (sort keys %wxGTK) {
$file =~ s/cp?p?$/\o/; $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) { foreach $file (sort keys %wxHTML) {
@@ -89,7 +107,7 @@ SHELL = @SHELL@
########################### Paths ################################# ########################### Paths #################################
srcdir = @srcdir@/src/gtk srcdir = @srcdir@/src/@TOOLKIT_DIR@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
prefix = @prefix@ prefix = @prefix@
@@ -135,7 +153,7 @@ host_triplet = @host@
target_alias = @target_alias@ target_alias = @target_alias@
target_triplet = @target@ 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} 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 JPEGDIR = $(WXDIR)/src/jpeg
ZLIBDIR = $(WXDIR)/src/zlib ZLIBDIR = $(WXDIR)/src/zlib
GTKDIR = $(WXDIR)/src/gtk GTKDIR = $(WXDIR)/src/gtk
MOTIFDIR = $(WXDIR)/src/motif
INCDIR = $(WXDIR)/include INCDIR = $(WXDIR)/include
DOCDIR = $(WXDIR)\docs DOCDIR = $(WXDIR)\docs
GENERICOBJS = \ GTK_GENERICOBJS = \
#$ ExpandList("WXGENERICOBJS"); #$ ExpandList("WXGTK_GENERICOBJS");
COMMONOBJS = \ GTK_COMMONOBJS = \
parser.o \ parser.o \
#$ ExpandList("WXCOMMONOBJS"); #$ ExpandList("WXGTK_COMMONOBJS");
GTK_GUIOBJS = \
#$ ExpandList("WXGTK_GUIOBJS");
MOTIF_GENERICOBJS = \
#$ ExpandList("WXMOTIF_GENERICOBJS");
MOTIF_COMMONOBJS = \
parser.o \
#$ ExpandList("WXMOTIF_COMMONOBJS");
MOTIF_GUIOBJS = \
#$ ExpandList("WXMOTIF_GUIOBJS");
HTMLOBJS = \ HTMLOBJS = \
#$ ExpandList("WXHTMLOBJS"); #$ ExpandList("WXHTMLOBJS");
GTKOBJS = \
#$ ExpandList("WXGTKOBJS");
UNIXOBJS = \ UNIXOBJS = \
#$ ExpandList("WXUNIXOBJS"); #$ ExpandList("WXUNIXOBJS");
@@ -297,7 +326,8 @@ JPEGOBJS = \
jquant2.o \ jquant2.o \
jdmerge.o jdmerge.o
OBJECTS = $(GTKOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJ) $(UNIXOBJS) \
OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(HTMLOBJS) $(UNIXOBJS) \
$(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS)
all: $(OBJECTS) $(WXLIB) all: $(OBJECTS) $(WXLIB)

View File

@@ -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! # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
# #
@@ -45,7 +45,7 @@ SHELL = @SHELL@
########################### Paths ################################# ########################### Paths #################################
srcdir = @srcdir@/src/gtk srcdir = @srcdir@/src/@TOOLKIT_DIR@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
prefix = @prefix@ prefix = @prefix@
@@ -91,7 +91,7 @@ host_triplet = @host@
target_alias = @target_alias@ target_alias = @target_alias@
target_triplet = @target@ 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} 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 JPEGDIR = $(WXDIR)/src/jpeg
ZLIBDIR = $(WXDIR)/src/zlib ZLIBDIR = $(WXDIR)/src/zlib
GTKDIR = $(WXDIR)/src/gtk GTKDIR = $(WXDIR)/src/gtk
MOTIFDIR = $(WXDIR)/src/motif
INCDIR = $(WXDIR)/include INCDIR = $(WXDIR)/include
DOCDIR = $(WXDIR)\docs DOCDIR = $(WXDIR)\docs
GENERICOBJS = \ GTK_GENERICOBJS = \
busyinfo.o \ busyinfo.o \
caret.o \ caret.o \
colrdlgg.o \ colrdlgg.o \
@@ -181,7 +182,7 @@ GENERICOBJS = \
tipdlg.o \ tipdlg.o \
treectrl.o treectrl.o
COMMONOBJS = \ GTK_COMMONOBJS = \
parser.o \ parser.o \
cmndata.o \ cmndata.o \
config.o \ config.o \
@@ -261,26 +262,7 @@ COMMONOBJS = \
zipstrm.o \ zipstrm.o \
zstream.o zstream.o
HTMLOBJS = \ GTK_GUIOBJS = \
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 = \
accel.o \ accel.o \
app.o \ app.o \
bitmap.o \ bitmap.o \
@@ -342,6 +324,194 @@ GTKOBJS = \
win_gtk.o \ win_gtk.o \
window.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 = \ UNIXOBJS = \
gsocket.o \ gsocket.o \
threadpsx.o \ threadpsx.o \
@@ -429,7 +599,8 @@ JPEGOBJS = \
jquant2.o \ jquant2.o \
jdmerge.o jdmerge.o
OBJECTS = $(GTKOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJ) $(UNIXOBJS) \
OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(HTMLOBJS) $(UNIXOBJS) \
$(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS)
all: $(OBJECTS) $(WXLIB) all: $(OBJECTS) $(WXLIB)

View File

@@ -102,8 +102,8 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxMemoryDC dc; wxMemoryDC dc;
dc.SelectObject( bitmap ); dc.SelectObject( bitmap );
dc.SetBrush( wxBrush( "orange", wxSOLID ) ); dc.SetBrush( wxBrush( wxColour(50,100,150), wxSOLID ) );
dc.SetPen( *wxWHITE_PEN ); dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 0, 0, 100, 100 ); dc.DrawRectangle( 0, 0, 100, 100 );
dc.SelectObject( wxNullBitmap ); dc.SelectObject( wxNullBitmap );
@@ -117,6 +117,11 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxLogWarning("Can't find image files in either '.' or '..'!"); wxLogWarning("Can't find image files in either '.' or '..'!");
wxImage image( bitmap ); 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 ) ) if ( !image.SaveFile( dir + wxString("test.png"), wxBITMAP_TYPE_PNG ) )
wxLogError("Can't save file"); wxLogError("Can't save file");

View File

@@ -38,11 +38,45 @@
#include "wx/stattext.h" #include "wx/stattext.h"
#include "wx/textctrl.h" #include "wx/textctrl.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/sizer.h"
#endif
#if wxUSE_STATLINE
#include "wx/statline.h"
#endif #endif
// this is where wxGetNumberFromUser() is declared // this is where wxGetNumberFromUser() is declared
#include "wx/generic/textdlgg.h" #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 // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -97,73 +131,70 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
pos, wxDefaultSize, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
{ {
// init members
// ------------
m_value = value; m_value = value;
m_max = max; m_max = max;
m_min = min; m_min = min;
// calculate the sizes wxBeginBusyCursor();
// -------------------
wxArrayString lines; wxBox *topsizer = new wxBox( wxVERTICAL );
wxSize sizeText = SplitTextMessage(message, &lines);
wxSize sizeBtn = GetStandardButtonSize(); // 1) text message
wxBox *textsizer = new wxBox( wxVERTICAL );
int wPrompt, hPrompt; wxSplitMessage2( message, this, textsizer );
GetTextExtent(prompt, &wPrompt, &hPrompt); topsizer->Add( textsizer, 0, wxALL, 10 );
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));
// 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 // spin ctrl
wxString valStr; wxString valStr;
valStr.Printf(_T("%lu"), m_value); valStr.Printf(_T("%lu"), m_value);
m_spinctrl = new wxTextCtrl(this, -1, valStr, m_spinctrl = new wxTextCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) );
wxPoint(x + wPrompt + LAYOUT_X_MARGIN, y), inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
wxSize(wText, hText)); // add both
y += hText + 2*LAYOUT_X_MARGIN; topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
// and buttons #if wxUSE_STATLINE
CreateStandardButtons(wDialog, y, sizeBtn.GetWidth(), sizeBtn.GetHeight()); // 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
// set the dialog size and position
SetClientSize(wDialog, hDialog); // 4) buttons
if ( pos == wxDefaultPosition ) wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
wxButton *ok = (wxButton *) NULL;
// if (style & wxOK)
{ {
// centre the dialog if no explicit position given ok = new wxButton( this, wxID_OK, _("OK") );
Centre(wxBOTH | wxCENTER_FRAME); 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(); m_spinctrl->SetFocus();
wxEndBusyCursor();
} }
void wxNumberEntryDialog::OnOK(wxCommandEvent& event) void wxNumberEntryDialog::OnOK(wxCommandEvent& event)

View File

@@ -253,7 +253,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 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 #endif

View File

@@ -49,9 +49,25 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
} }
if ( IsVertical() ) if ( IsVertical() )
{
m_widget = gtk_vseparator_new(); m_widget = gtk_vseparator_new();
if (size.x == -1)
{
wxSize new_size( size );
new_size.x = 4;
SetSize( new_size );
}
}
else else
{
m_widget = gtk_hseparator_new(); m_widget = gtk_hseparator_new();
if (size.y == -1)
{
wxSize new_size( size );
new_size.y = 4;
SetSize( new_size );
}
}
m_parent->DoAddChild( this ); m_parent->DoAddChild( this );

View File

@@ -97,7 +97,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 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 #endif

View File

@@ -253,7 +253,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 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 #endif

View File

@@ -49,9 +49,25 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
} }
if ( IsVertical() ) if ( IsVertical() )
{
m_widget = gtk_vseparator_new(); m_widget = gtk_vseparator_new();
if (size.x == -1)
{
wxSize new_size( size );
new_size.x = 4;
SetSize( new_size );
}
}
else else
{
m_widget = gtk_hseparator_new(); m_widget = gtk_hseparator_new();
if (size.y == -1)
{
wxSize new_size( size );
new_size.y = 4;
SetSize( new_size );
}
}
m_parent->DoAddChild( this ); m_parent->DoAddChild( this );

View File

@@ -97,7 +97,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, const wxString& message,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 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 #endif