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
This commit is contained in:
Václav Slavík
2002-05-19 22:44:27 +00:00
parent 92432aa111
commit 41fecb4451
8 changed files with 50 additions and 49 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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