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_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=
@@ -1062,6 +1066,10 @@ if test "$wxUSE_GTK" = 1; then
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)

View File

@@ -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" ) {

View File

@@ -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

View File

@@ -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");
COMMONOBJS = \
GTK_COMMONOBJS = \
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 = \
#$ 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)

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!
#
@@ -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)

View File

@@ -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");

View File

@@ -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
// -------------------
wxBeginBusyCursor();
wxArrayString lines;
wxSize sizeText = SplitTextMessage(message, &lines);
wxBox *topsizer = new wxBox( wxVERTICAL );
wxSize sizeBtn = GetStandardButtonSize();
int wPrompt, hPrompt;
GetTextExtent(prompt, &wPrompt, &hPrompt);
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 );
// and buttons
CreateStandardButtons(wDialog, y, sizeBtn.GetWidth(), sizeBtn.GetHeight());
#if wxUSE_STATLINE
// 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);
if ( pos == wxDefaultPosition )
// 4) buttons
wxBox *buttonsizer = new wxBox( wxHORIZONTAL );
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)

View File

@@ -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

View File

@@ -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 );

View File

@@ -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

View File

@@ -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

View File

@@ -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 );

View File

@@ -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