From 41fecb4451682f11e352fc5b9b7383f6335322a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 19 May 2002 22:44:27 +0000 Subject: [PATCH] Cosmetic changes to wxSS::GetScreen: 1) Renamed to GetScreenType (so that the name better describes its function) 2) Changed use of <,>,<=,>= operators together with wxSYS_SCREEN_* so that 'foo is smaller that bar' is written as 'foo < bar' and not (sic) 'foo > bar' git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/settings.h | 15 +++---- src/common/settcmn.cpp | 6 +-- src/generic/filedlgg.cpp | 80 +++++++++++++++++++------------------- src/os2/wx23.def | 2 +- src/univ/button.cpp | 2 +- wxPython/src/gtk/misc2.cpp | 2 +- wxPython/src/mac/misc2.cpp | 2 +- wxPython/src/msw/misc2.cpp | 2 +- 8 files changed, 56 insertions(+), 55 deletions(-) diff --git a/include/wx/settings.h b/include/wx/settings.h index 8d5467212f..af1b6bde81 100644 --- a/include/wx/settings.h +++ b/include/wx/settings.h @@ -131,13 +131,14 @@ enum wxSystemFeature }; // values for different screen designs -enum wxSystemScreen +enum wxSystemScreenType { wxSYS_SCREEN_NONE = 0, // not yet defined - wxSYS_SCREEN_DESKTOP, // >= 800x600 - wxSYS_SCREEN_SMALL, // >= 640x480 + + wxSYS_SCREEN_TINY, // < wxSYS_SCREEN_PDA, // >= 320x240 - wxSYS_SCREEN_TINY // < + wxSYS_SCREEN_SMALL, // >= 640x480 + wxSYS_SCREEN_DESKTOP // >= 800x600 }; // ---------------------------------------------------------------------------- @@ -183,13 +184,13 @@ public: // Get system screen design (desktop, pda, ..) used for // laying out various dialogs. - static wxSystemScreen GetScreen(); + static wxSystemScreenType GetScreenType(); // Override default. - static void SetScreen( wxSystemScreen screen ); + static void SetScreenType( wxSystemScreenType screen ); // Value - static wxSystemScreen ms_screen; + static wxSystemScreenType ms_screen; // the backwards compatible versions of wxSystemSettingsNative functions, diff --git a/src/common/settcmn.cpp b/src/common/settcmn.cpp index 7e527aa59b..93ebe6286d 100644 --- a/src/common/settcmn.cpp +++ b/src/common/settcmn.cpp @@ -36,12 +36,12 @@ // static data // ---------------------------------------------------------------------------- -wxSystemScreen wxSystemSettings::ms_screen = wxSYS_SCREEN_NONE; +wxSystemScreenType wxSystemSettings::ms_screen = wxSYS_SCREEN_NONE; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- -wxSystemScreen wxSystemSettings::GetScreen() +wxSystemScreenType wxSystemSettings::GetScreenType() { if (ms_screen == wxSYS_SCREEN_NONE) #ifndef __WXUNIV__ @@ -72,7 +72,7 @@ wxSystemScreen wxSystemSettings::GetScreen() return ms_screen; } -void wxSystemSettings::SetScreen( wxSystemScreen screen ) +void wxSystemSettings::SetScreenType( wxSystemScreenType screen ) { ms_screen = screen; } diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 00fe75da38..3d7e58d701 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -1109,13 +1109,13 @@ wxFileDialog::wxFileDialog(wxWindow *parent, #endif buttonsizer->Add( butNewDir, 0, wxALL, 5 ); - if (wxSystemSettings::GetScreen() >= wxSYS_SCREEN_PDA) + if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA) mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 0 ); else mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 ); wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL ); - if (wxSystemSettings::GetScreen() < wxSYS_SCREEN_PDA) + if (wxSystemSettings::GetScreenType() > 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 ); @@ -1131,48 +1131,48 @@ wxFileDialog::wxFileDialog(wxWindow *parent, m_list->SetNewDirControl(butNewDir); m_list->SetGoToParentControl(butDirUp); - if (wxSystemSettings::GetScreen() >= wxSYS_SCREEN_PDA) + if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA) { - // PDAs have a different screen layout - mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); - - wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL ); - m_choice = new wxChoice( this, ID_CHOICE ); - choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 5 ); - mainsizer->Add( choicesizer, 0, wxEXPAND ); - - wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); - m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER ); - textsizer->Add( m_text, 1, wxCENTER | wxALL, 5 ); - mainsizer->Add( textsizer, 0, wxEXPAND ); - - m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") ); - m_check->SetValue( s_lastShowHidden ); - textsizer->Add( m_check, 0, wxCENTER|wxALL, 5 ); - - buttonsizer = new wxBoxSizer( wxHORIZONTAL ); - 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 ); + // PDAs have a different screen layout + mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); + + wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL ); + m_choice = new wxChoice( this, ID_CHOICE ); + choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 5 ); + mainsizer->Add( choicesizer, 0, wxEXPAND ); + + wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); + m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER ); + textsizer->Add( m_text, 1, wxCENTER | wxALL, 5 ); + mainsizer->Add( textsizer, 0, wxEXPAND ); + + m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") ); + m_check->SetValue( s_lastShowHidden ); + textsizer->Add( m_check, 0, wxCENTER|wxALL, 5 ); + + buttonsizer = new wxBoxSizer( wxHORIZONTAL ); + 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 { - mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 ); - - wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); - m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER ); - textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); - textsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); - mainsizer->Add( textsizer, 0, wxEXPAND ); - - wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL ); - m_choice = new wxChoice( this, ID_CHOICE ); - choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 10 ); - m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") ); - m_check->SetValue( s_lastShowHidden ); - 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 ); + mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 ); + + wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); + m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER ); + textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); + textsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); + mainsizer->Add( textsizer, 0, wxEXPAND ); + + wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL ); + m_choice = new wxChoice( this, ID_CHOICE ); + choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 10 ); + m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") ); + m_check->SetValue( s_lastShowHidden ); + 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 ); } m_choice->Append( firstWildText, (void*) new wxString( firstWild ) ); diff --git a/src/os2/wx23.def b/src/os2/wx23.def index a58a128459..dbe5e93877 100644 --- a/src/os2/wx23.def +++ b/src/os2/wx23.def @@ -5044,7 +5044,7 @@ EXPORTS ms_screen__16wxSystemSettings ;wxSystemSettings::SetScreen(wxSystemScreen) SetScreen__16wxSystemSettingsF14wxSystemScreen - ;wxSystemSettings::GetScreen() + ;wxSystemSettings::GetScreenType() GetScreen__16wxSystemSettingsFv ;From object file: ..\common\sizer.cpp ;PUBDEFs (Symbols available from object file): diff --git a/src/univ/button.cpp b/src/univ/button.cpp index 6306d33ac5..4bde5f3b96 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -138,7 +138,7 @@ wxSize wxButton::DoGetBestClientSize() const // for compatibility with other ports, the buttons default size is never // less than the standard one, but not when display not PDAs. - if (wxSystemSettings::GetScreen() < wxSYS_SCREEN_PDA) + if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA) { if ( !(GetWindowStyle() & wxBU_EXACTFIT) ) { diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp index 46ac78960d..a1ea157e4e 100644 --- a/wxPython/src/gtk/misc2.cpp +++ b/wxPython/src/gtk/misc2.cpp @@ -2481,7 +2481,7 @@ static PyObject *_wrap_wxSystemSettings_GetScreen(PyObject *self, PyObject *args return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSystemScreen )wxSystemSettings::GetScreen(); + _result = (wxSystemScreen )wxSystemSettings::GetScreenType(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; diff --git a/wxPython/src/mac/misc2.cpp b/wxPython/src/mac/misc2.cpp index e9e319bc66..646e34ac3f 100644 --- a/wxPython/src/mac/misc2.cpp +++ b/wxPython/src/mac/misc2.cpp @@ -2481,7 +2481,7 @@ static PyObject *_wrap_wxSystemSettings_GetScreen(PyObject *self, PyObject *args return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSystemScreen )wxSystemSettings::GetScreen(); + _result = (wxSystemScreen )wxSystemSettings::GetScreenType(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 51ec40fb62..5f264a506c 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -2544,7 +2544,7 @@ static PyObject *_wrap_wxSystemSettings_GetScreen(PyObject *self, PyObject *args return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSystemScreen )wxSystemSettings::GetScreen(); + _result = (wxSystemScreen )wxSystemSettings::GetScreenType(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -- 2.45.2