From c15521c67eb8aba1994240262ba973aa11ef0086 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 4 May 2002 18:33:35 +0000 Subject: [PATCH] Added screen design to system settings for different dialog layouts on desktop vs PDA screens git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/filelist.txt | 1 + distrib/msw/tmake/makeall.sh | 44 +++++++++---------- include/wx/settings.h | 20 +++++++++ src/common/settcmn.cpp | 79 ++++++++++++++++++++++++++++++++++ src/files.lst | 1 + src/generic/filedlgg.cpp | 25 ++++++----- src/gtk/files.lst | 2 + src/gtk1/files.lst | 2 + src/mac/carbon/files.lst | 2 + src/mac/files.lst | 2 + src/mgl/files.lst | 2 + src/mgl/makefile.wat | 4 ++ src/microwin/files.lst | 2 + src/motif/files.lst | 2 + src/msw/files.lst | 2 + src/msw/makefile.b32 | 5 ++- src/msw/makefile.bcc | 3 ++ src/msw/makefile.dos | 6 +++ src/msw/makefile.g95 | 1 + src/msw/makefile.sc | 1 + src/msw/makefile.vc | 1 + src/msw/makefile.wat | 4 ++ src/univ/button.cpp | 16 ++++--- src/wxUniv.dsp | 4 ++ src/wxWindows.dsp | 4 ++ src/x11/files.lst | 2 + 26 files changed, 194 insertions(+), 43 deletions(-) create mode 100644 src/common/settcmn.cpp diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index c1932fe457..4ac2eb4545 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -219,6 +219,7 @@ sckaddr.cpp Common Socket,Base sckfile.cpp Common Socket,Base sckipc.cpp Common Socket,Base sckstrm.cpp Common Socket,Base +settcmn.cpp Common sizer.cpp Common socket.cpp Common Socket,Base statbar.cpp Common diff --git a/distrib/msw/tmake/makeall.sh b/distrib/msw/tmake/makeall.sh index 39d15ef158..ea5e3973c2 100755 --- a/distrib/msw/tmake/makeall.sh +++ b/distrib/msw/tmake/makeall.sh @@ -21,91 +21,91 @@ do case $tname in b32.t) echo "Generating $mswdir/makefile.b32 for Borland C++ (32 bits)..." - tmake -t b32 wxwin.pro -o $mswdir/makefile.b32 ;; + ./tmake -t b32 wxwin.pro -o $mswdir/makefile.b32 ;; bcc.t) echo "Generating $mswdir/makefile.bcc for Borland C++ (16 bits)..." - tmake -t bcc wxwin.pro -o $mswdir/makefile.bcc;; + ./tmake -t bcc wxwin.pro -o $mswdir/makefile.bcc;; dos.t) echo "Generating $mswdir/makefile.dos for Visual C++ 1.52..." - tmake -t dos wxwin.pro -o $mswdir/makefile.dos;; + ./tmake -t dos wxwin.pro -o $mswdir/makefile.dos;; g95.t) echo "Generating $mswdir/makefile.g95 for Cygwin/Mingw32..." - tmake -t g95 wxwin.pro -o $mswdir/makefile.g95;; + ./tmake -t g95 wxwin.pro -o $mswdir/makefile.g95;; sc.t) echo "Generating $mswdir/makefile.sc for Symantec C++..." - tmake -t sc wxwin.pro -o $mswdir/makefile.sc;; + ./tmake -t sc wxwin.pro -o $mswdir/makefile.sc;; vc.t) echo "Generating $mswdir/makefile.vc for Visual C++ 4.0..." - tmake -t vc wxwin.pro -o $mswdir/makefile.vc;; + ./tmake -t vc wxwin.pro -o $mswdir/makefile.vc;; vc6msw.t) echo "Generating $srcdir/wxWindows.dsp for Visual C++ 6.0..." - tmake -t vc6msw wxwin.pro -o $srcdir/wxWindows.dsp;; + ./tmake -t vc6msw wxwin.pro -o $srcdir/wxWindows.dsp;; vc6base.t) echo "Generating $srcdir/wxBase.dsp for Visual C++ 6.0..." - tmake -t vc6base wxwin.pro -o $srcdir/wxBase.dsp;; + ./tmake -t vc6base wxwin.pro -o $srcdir/wxBase.dsp;; vc6univ.t) echo "Generating $srcdir/wxUniv.dsp for Visual C++ 6.0..." - tmake -t vc6univ wxwin.pro -o $srcdir/wxUniv.dsp;; + ./tmake -t vc6univ wxwin.pro -o $srcdir/wxUniv.dsp;; wat.t) echo "Generating $mswdir/makefile.wat for Watcom C++..." - tmake -t wat wxwin.pro -o $mswdir/makefile.wat;; + ./tmake -t wat wxwin.pro -o $mswdir/makefile.wat;; base.t) echo "Generating $topdir/src/files.lst for Configure..." - tmake -t base wxwin.pro -o $topdir/src/files.lst ;; + ./tmake -t base wxwin.pro -o $topdir/src/files.lst ;; gtk.t) echo "Generating $topdir/src/gtk/files.lst for GTK and Configure..." - tmake -t gtk wxwin.pro -o $topdir/src/gtk/files.lst;; + ./tmake -t gtk wxwin.pro -o $topdir/src/gtk/files.lst;; mgl.t) echo "Generating $topdir/src/mgl/files.lst for MGL and Configure..." - tmake -t mgl wxwin.pro -o $topdir/src/mgl/files.lst;; + ./tmake -t mgl wxwin.pro -o $topdir/src/mgl/files.lst;; micro.t) echo "Generating $topdir/src/micro/files.lst for MicroWindows and Configure..." - tmake -t micro wxwin.pro -o $topdir/src/microwin/files.lst;; + ./tmake -t micro wxwin.pro -o $topdir/src/microwin/files.lst;; msw.t) echo "Generating $topdir/src/msw/files.lst for MSW and Configure..." - tmake -t msw wxwin.pro -o $topdir/src/msw/files.lst;; + ./tmake -t msw wxwin.pro -o $topdir/src/msw/files.lst;; mac.t) echo "Generating $topdir/src/mac/files.lst for Mac and Configure..." - tmake -t mac wxwin.pro -o $topdir/src/mac/files.lst;; + ./tmake -t mac wxwin.pro -o $topdir/src/mac/files.lst;; motif.t) echo "Generating $topdir/src/motif/files.lst for Motif and Configure..." - tmake -t motif wxwin.pro -o $topdir/src/motif/files.lst;; + ./tmake -t motif wxwin.pro -o $topdir/src/motif/files.lst;; univ.t) echo "Generating $topdir/src/univ/files.lst for wxUniversal..." - tmake -t univ wxwin.pro -o $topdir/src/univ/files.lst;; + ./tmake -t univ wxwin.pro -o $topdir/src/univ/files.lst;; unx.t) echo "Generating $topdir/src/os2/files.lst for OS/2 PM and Configure..." - tmake -t os2 wxwin.pro -o $topdir/src/os2/files.lst;; + ./tmake -t os2 wxwin.pro -o $topdir/src/os2/files.lst;; mgl.t) echo "Generating $topdir/src/mgl/files.lst for MGL and Configure..." - tmake -t mgl wxwin.pro -o $topdir/src/mgl/files.lst;; + ./tmake -t mgl wxwin.pro -o $topdir/src/mgl/files.lst;; x11.t) echo "Generating $topdir/src/x11/files.lst for X11 and Configure..." - tmake -t x11 wxwin.pro -o $topdir/src/x11/files.lst;; + ./tmake -t x11 wxwin.pro -o $topdir/src/x11/files.lst;; watmgl.t) echo "Generating $topdir/src/mgl/makefile.wat for Watcom C++ and MGL+DOS..." - tmake -t watmgl wxwin.pro -o $topdir/src/mgl/makefile.wat;; + ./tmake -t watmgl wxwin.pro -o $topdir/src/mgl/makefile.wat;; esac done diff --git a/include/wx/settings.h b/include/wx/settings.h index 1d3248d2c8..14d4e5fa3f 100644 --- a/include/wx/settings.h +++ b/include/wx/settings.h @@ -130,6 +130,16 @@ enum wxSystemFeature wxSYS_CAN_ICONIZE_FRAME }; +// values for different screen designs +enum wxSystemScreen +{ + wxSYS_SCREEN_NONE = 0, // not yet defined + wxSYS_SCREEN_DESKTOP, // >= 800x600 + wxSYS_SCREEN_SMALL, // >= 640x480 + wxSYS_SCREEN_PDA, // >= 320x240 + wxSYS_SCREEN_TINY // < +}; + // ---------------------------------------------------------------------------- // wxSystemSettingsNative: defines the API for wxSystemSettings class // ---------------------------------------------------------------------------- @@ -171,6 +181,16 @@ public: static wxColour GetColour(wxSystemColour index); #endif // __WXUNIVERSAL__ + // Get system screen design (desktop, pda, ..) used for + // laying out various dialogs. + static wxSystemScreen GetScreen(); + + // Override default. + static void SetScreen( wxSystemScreen screen ); + + // Value + static wxSystemScreen ms_screen; + // the backwards compatible versions of wxSystemSettingsNative functions, // don't use these methods in the new code! diff --git a/src/common/settcmn.cpp b/src/common/settcmn.cpp new file mode 100644 index 0000000000..7e527aa59b --- /dev/null +++ b/src/common/settcmn.cpp @@ -0,0 +1,79 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: common/settcmn.cpp +// Purpose: common (to all ports) wxWindow functions +// Author: Robert Roebling +// RCS-ID: $Id$ +// Copyright: (c) wxWindows team +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "settings.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/utils.h" + #include "wx/settings.h" +#endif //WX_PRECOMP + +// ---------------------------------------------------------------------------- +// static data +// ---------------------------------------------------------------------------- + +wxSystemScreen wxSystemSettings::ms_screen = wxSYS_SCREEN_NONE; + +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- + +wxSystemScreen wxSystemSettings::GetScreen() +{ + if (ms_screen == wxSYS_SCREEN_NONE) +#ifndef __WXUNIV__ + { + // As a start, all GUI are desktops. + ms_screen = wxSYS_SCREEN_DESKTOP; + } +#else + { + // wxUniv will be used on small devices, too. + int x = 0; + int y = 0; + wxGetDisplaySize( &x, &y ); + + ms_screen = wxSYS_SCREEN_DESKTOP; + + if (x < 800) + ms_screen = wxSYS_SCREEN_SMALL; + + if (x < 640) + ms_screen = wxSYS_SCREEN_PDA; + + if (x < 200) + ms_screen = wxSYS_SCREEN_TINY; + } +#endif + + return ms_screen; +} + +void wxSystemSettings::SetScreen( wxSystemScreen screen ) +{ + ms_screen = screen; +} + diff --git a/src/files.lst b/src/files.lst index 9cee4ea185..1a97f58f2b 100644 --- a/src/files.lst +++ b/src/files.lst @@ -127,6 +127,7 @@ ALL_HEADERS = \ hashmap.h \ intl.h \ ioswrap.h \ + ipc.h \ ipcbase.h \ isql.h \ isqlext.h \ diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 43d35d78e8..9d3d7bc280 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -1109,16 +1109,14 @@ wxFileDialog::wxFileDialog(wxWindow *parent, #endif buttonsizer->Add( butNewDir, 0, wxALL, 5 ); -#ifdef __WXX11__ - mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 0 ); -#else - mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 ); -#endif + if (wxSystemSettings::GetScreen() >= wxSYS_SCREEN_PDA) + mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 0 ); + else + mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 ); wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL ); -#ifndef __WXX11__ - staticsizer->Add( new wxStaticText( this, -1, _("Current directory:") ), 0, wxRIGHT, 10 ); -#endif + if (wxSystemSettings::GetScreen() < wxSYS_SCREEN_PDA) + staticsizer->Add( new wxStaticText( this, -1, _("Current directory:") ), 0, wxRIGHT, 10 ); m_static = new wxStaticText( this, -1, m_dir ); staticsizer->Add( m_static, 1 ); mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 ); @@ -1133,7 +1131,8 @@ wxFileDialog::wxFileDialog(wxWindow *parent, m_list->SetNewDirControl(butNewDir); m_list->SetGoToParentControl(butDirUp); -#ifdef __WXX11__ + if (wxSystemSettings::GetScreen() >= wxSYS_SCREEN_PDA) + { // PDAs have a different screen layout mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); @@ -1155,8 +1154,9 @@ wxFileDialog::wxFileDialog(wxWindow *parent, buttonsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxALL, 5 ); buttonsizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 5 ); mainsizer->Add( buttonsizer, 0, wxALIGN_RIGHT ); - -#else + } + else + { mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 ); wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); @@ -1173,8 +1173,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 ); choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 ); mainsizer->Add( choicesizer, 0, wxEXPAND ); - -#endif + } m_choice->Append( firstWildText, (void*) new wxString( firstWild ) ); while (tokens.HasMoreTokens()) diff --git a/src/gtk/files.lst b/src/gtk/files.lst index c974c31602..e433131f7d 100644 --- a/src/gtk/files.lst +++ b/src/gtk/files.lst @@ -145,6 +145,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -727,6 +728,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/gtk1/files.lst b/src/gtk1/files.lst index c974c31602..e433131f7d 100644 --- a/src/gtk1/files.lst +++ b/src/gtk1/files.lst @@ -145,6 +145,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -727,6 +728,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/mac/carbon/files.lst b/src/mac/carbon/files.lst index 78bd42f509..ab009e5666 100644 --- a/src/mac/carbon/files.lst +++ b/src/mac/carbon/files.lst @@ -142,6 +142,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -753,6 +754,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/mac/files.lst b/src/mac/files.lst index 78bd42f509..ab009e5666 100644 --- a/src/mac/files.lst +++ b/src/mac/files.lst @@ -142,6 +142,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -753,6 +754,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/mgl/files.lst b/src/mgl/files.lst index 1455262202..34ba0931ef 100644 --- a/src/mgl/files.lst +++ b/src/mgl/files.lst @@ -146,6 +146,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -628,6 +629,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/mgl/makefile.wat b/src/mgl/makefile.wat index e430120e81..82ffbcd8f4 100644 --- a/src/mgl/makefile.wat +++ b/src/mgl/makefile.wat @@ -188,6 +188,7 @@ COMMONOBJS = & sckfile.obj & sckipc.obj & sckstrm.obj & + settcmn.obj & sizer.obj & socket.obj & statbar.obj & @@ -829,6 +830,9 @@ sckipc.obj: $(COMMDIR)\sckipc.cpp sckstrm.obj: $(COMMDIR)\sckstrm.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +settcmn.obj: $(COMMDIR)\settcmn.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + sizer.obj: $(COMMDIR)\sizer.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< diff --git a/src/microwin/files.lst b/src/microwin/files.lst index a44d985f8a..af59915286 100644 --- a/src/microwin/files.lst +++ b/src/microwin/files.lst @@ -143,6 +143,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -722,6 +723,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/motif/files.lst b/src/motif/files.lst index 099680f545..9b4f84677f 100644 --- a/src/motif/files.lst +++ b/src/motif/files.lst @@ -144,6 +144,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -715,6 +716,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/msw/files.lst b/src/msw/files.lst index 69ddf7699a..15e56d29b6 100644 --- a/src/msw/files.lst +++ b/src/msw/files.lst @@ -130,6 +130,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -791,6 +792,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \ diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index 65504b448a..7e01ae2e19 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -15,7 +15,7 @@ # Makefile : Builds wxWindows library wx.lib for MS Windows, # and Borland C++ (32-bit). -#BCCDIR now defined in ../makeb32.env +# BCCDIR now defined in ../makeb32.env !if "$(WXWIN)" == "" !error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx @@ -211,6 +211,7 @@ COMMONOBJS = \ $(MSWDIR)\sckfile.obj \ $(MSWDIR)\sckipc.obj \ $(MSWDIR)\sckstrm.obj \ + $(MSWDIR)\settcmn.obj \ $(MSWDIR)\sizer.obj \ $(MSWDIR)\socket.obj \ $(MSWDIR)\statbar.obj \ @@ -859,6 +860,8 @@ $(MSWDIR)\sckipc.obj: $(COMMDIR)\sckipc.$(SRCSUFF) $(MSWDIR)\sckstrm.obj: $(COMMDIR)\sckstrm.$(SRCSUFF) +$(MSWDIR)\settcmn.obj: $(COMMDIR)\settcmn.$(SRCSUFF) + $(MSWDIR)\sizer.obj: $(COMMDIR)\sizer.$(SRCSUFF) $(MSWDIR)\socket.obj: $(COMMDIR)\socket.$(SRCSUFF) diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index 12afb46787..747967f8c0 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -186,6 +186,7 @@ COMMONOBJS = \ $(MSWDIR)\radiocmn.obj \ $(MSWDIR)\regex.obj \ $(MSWDIR)\resource.obj \ + $(MSWDIR)\settcmn.obj \ $(MSWDIR)\sizer.obj \ $(MSWDIR)\statbar.obj \ $(MSWDIR)\strconv.obj \ @@ -675,6 +676,8 @@ $(MSWDIR)\regex.obj: $(COMMDIR)\regex.$(SRCSUFF) $(MSWDIR)\resource.obj: $(COMMDIR)\resource.$(SRCSUFF) +$(MSWDIR)\settcmn.obj: $(COMMDIR)\settcmn.$(SRCSUFF) + $(MSWDIR)\sizer.obj: $(COMMDIR)\sizer.$(SRCSUFF) $(MSWDIR)\statbar.obj: $(COMMDIR)\statbar.$(SRCSUFF) diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index b4a85ff637..85e3470379 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -174,6 +174,7 @@ COMMONOBJS2 = \ $(COMMDIR)\radiocmn.obj \ $(COMMDIR)\regex.obj \ $(COMMDIR)\resource.obj \ + $(COMMDIR)\settcmn.obj \ $(COMMDIR)\sizer.obj \ $(COMMDIR)\statbar.obj \ $(COMMDIR)\strconv.obj \ @@ -1209,6 +1210,11 @@ $(COMMDIR)/resource.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(COMMDIR)/settcmn.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(COMMDIR)/sizer.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index 61a563ba2c..b95bd78624 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -234,6 +234,7 @@ COMMONOBJS = \ $(COMMDIR)/quantize.$(OBJSUFF) \ $(COMMDIR)/radiocmn.$(OBJSUFF) \ $(COMMDIR)/resource.$(OBJSUFF) \ + $(COMMDIR)/settcmn.$(OBJSUFF) \ $(COMMDIR)/sizer.$(OBJSUFF) \ $(COMMDIR)/statbar.$(OBJSUFF) \ $(COMMDIR)/tbarbase.$(OBJSUFF) \ diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index c3a6362057..8b44a3a4fa 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -157,6 +157,7 @@ COMMONOBJS = \ $(COMMDIR)\sckfile.obj \ $(COMMDIR)\sckipc.obj \ $(COMMDIR)\sckstrm.obj \ + $(COMMDIR)\settcmn.obj \ $(COMMDIR)\sizer.obj \ $(COMMDIR)\socket.obj \ $(COMMDIR)\statbar.obj \ diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 6a5295a541..439458b4d0 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -233,6 +233,7 @@ COMMONOBJS = \ $(COMMDIR)\$D\sckfile.obj \ $(COMMDIR)\$D\sckipc.obj \ $(COMMDIR)\$D\sckstrm.obj \ + $(COMMDIR)\$D\settcmn.obj \ $(COMMDIR)\$D\sizer.obj \ $(COMMDIR)\$D\socket.obj \ $(COMMDIR)\$D\statbar.obj \ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index 87d43e0b6e..70c77aaf2b 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -195,6 +195,7 @@ COMMONOBJS = & sckfile.obj & sckipc.obj & sckstrm.obj & + settcmn.obj & sizer.obj & socket.obj & statbar.obj & @@ -1031,6 +1032,9 @@ sckipc.obj: $(COMMDIR)\sckipc.cpp sckstrm.obj: $(COMMDIR)\sckstrm.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +settcmn.obj: $(COMMDIR)\settcmn.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + sizer.obj: $(COMMDIR)\sizer.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< diff --git a/src/univ/button.cpp b/src/univ/button.cpp index b06789a25d..6306d33ac5 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -34,6 +34,7 @@ #include "wx/dcscreen.h" #include "wx/button.h" #include "wx/validate.h" + #include "wx/settings.h" #endif #include "wx/univ/renderer.h" @@ -136,15 +137,16 @@ wxSize wxButton::DoGetBestClientSize() const } // for compatibility with other ports, the buttons default size is never - // less than the standard one -#ifndef __WXX11__ - if ( !(GetWindowStyle() & wxBU_EXACTFIT) ) + // less than the standard one, but not when display not PDAs. + if (wxSystemSettings::GetScreen() < wxSYS_SCREEN_PDA) { - wxSize szDef = GetDefaultSize(); - if ( width < szDef.x ) - width = szDef.x; + if ( !(GetWindowStyle() & wxBU_EXACTFIT) ) + { + wxSize szDef = GetDefaultSize(); + if ( width < szDef.x ) + width = szDef.x; + } } -#endif return wxSize(width, height); } diff --git a/src/wxUniv.dsp b/src/wxUniv.dsp index f5e5ea109e..9fb840a519 100644 --- a/src/wxUniv.dsp +++ b/src/wxUniv.dsp @@ -477,6 +477,10 @@ SOURCE=.\common\sckstrm.cpp # End Source File # Begin Source File +SOURCE=.\common\settcmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\sizer.cpp # End Source File # Begin Source File diff --git a/src/wxWindows.dsp b/src/wxWindows.dsp index f19a8149d2..dedd7c4441 100644 --- a/src/wxWindows.dsp +++ b/src/wxWindows.dsp @@ -636,6 +636,10 @@ SOURCE=.\common\sckstrm.cpp # End Source File # Begin Source File +SOURCE=.\common\settcmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\sizer.cpp # End Source File # Begin Source File diff --git a/src/x11/files.lst b/src/x11/files.lst index 39055001e6..5bcedfd5ae 100644 --- a/src/x11/files.lst +++ b/src/x11/files.lst @@ -177,6 +177,7 @@ ALL_SOURCES = \ common/sckfile.cpp \ common/sckipc.cpp \ common/sckstrm.cpp \ + common/settcmn.cpp \ common/sizer.cpp \ common/socket.cpp \ common/statbar.cpp \ @@ -742,6 +743,7 @@ COMMONOBJS = \ sckfile.o \ sckipc.o \ sckstrm.o \ + settcmn.o \ sizer.o \ socket.o \ statbar.o \