From 8e13c1ec4e6e8d2c5852df39c6be5db4fd279227 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 28 Mar 2006 11:02:37 +0000 Subject: [PATCH] Make wxPASSWORD and wxPROCESS_ENTER really deprecated. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/deprecated/proplist.cpp | 8 ++++---- contrib/src/deprecated/resource.cpp | 11 ++++++----- include/wx/defs.h | 10 ++++++---- samples/controls/controls.cpp | 2 +- src/generic/filedlgg.cpp | 4 ++-- src/gtk/spinctrl.cpp | 18 +++++++++--------- src/gtk/textctrl.cpp | 10 +++++----- src/gtk1/spinctrl.cpp | 18 +++++++++--------- src/gtk1/textctrl.cpp | 14 +++++++------- src/mac/carbon/textctrl.cpp | 6 +++--- src/mac/classic/textctrl.cpp | 4 ++-- src/msw/combobox.cpp | 2 +- src/x11/textctrl.cpp | 2 +- 13 files changed, 56 insertions(+), 53 deletions(-) diff --git a/contrib/src/deprecated/proplist.cpp b/contrib/src/deprecated/proplist.cpp index cb56ef4282..29c17d30f2 100644 --- a/contrib/src/deprecated/proplist.cpp +++ b/contrib/src/deprecated/proplist.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: proplist.cpp +// Name: contrib/src/deprecated/proplist.cpp // Purpose: Property list classes // Author: Julian Smart // Modified by: @@ -219,7 +219,7 @@ wxString wxPropertyListView::MakeNameValueString(wxString name, wxString value) wxString theString(name); int nameWidth = 25; - int padWith = nameWidth - theString.Length(); + int padWith = nameWidth - theString.length(); if (padWith < 0) padWith = 0; @@ -461,7 +461,7 @@ bool wxPropertyListView::CreateControls() } m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString, - wxDefaultPosition, wxSize(wxDefaultCoord, smallButtonSize.y), wxPROCESS_ENTER); + wxDefaultPosition, wxSize(wxDefaultCoord, smallButtonSize.y), wxTE_PROCESS_ENTER); m_valueText->Disable(); topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder ); @@ -1660,7 +1660,7 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList dialog->m_stringText = new wxPropertyStringListEditorText(dialog, wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240), - wxSize(300, wxDefaultCoord), wxPROCESS_ENTER); + wxSize(300, wxDefaultCoord), wxTE_PROCESS_ENTER); dialog->m_stringText->Disable(); wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); diff --git a/contrib/src/deprecated/resource.cpp b/contrib/src/deprecated/resource.cpp index e3117e7c45..b8836dd8af 100644 --- a/contrib/src/deprecated/resource.cpp +++ b/contrib/src/deprecated/resource.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: resource.cpp +// Name: contrib/src/deprecated/resource.cpp // Purpose: Resource system // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -2107,8 +2107,10 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxGA_VERTICAL"), wxGA_VERTICAL }, /* wxTextCtrl */ - { wxT("wxPASSWORD"), wxPASSWORD}, - { wxT("wxPROCESS_ENTER"), wxPROCESS_ENTER}, +#if WXWIN_COMPATIBILITY_2_6 + { wxT("wxPASSWORD"), wxTE_PASSWORD}, + { wxT("wxPROCESS_ENTER"), wxTE_PROCESS_ENTER}, +#endif { wxT("wxTE_PASSWORD"), wxTE_PASSWORD}, { wxT("wxTE_READONLY"), wxTE_READONLY}, { wxT("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, @@ -3275,4 +3277,3 @@ wxControl *wxCreateItem(wxWindow* thisWindow, const wxItemResource *resource, co #endif // VC++ #endif // wxUSE_WX_RESOURCES - diff --git a/include/wx/defs.h b/include/wx/defs.h index e1d94d62aa..537c94c0d7 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1034,7 +1034,7 @@ inline void *wxUIntToPtr(wxUIntPtr p) #define wxHAS_INT64 1 -#else // !wxUSE_LONGLONG +#else /* !wxUSE_LONGLONG */ #define wxHAS_INT64 0 @@ -1526,9 +1526,11 @@ enum wxBorder /* always show an entire number of rows */ #define wxLB_INT_HEIGHT 0x0800 -/* deprecated synonyms */ -#define wxPROCESS_ENTER 0x0400 /* wxTE_PROCESS_ENTER */ -#define wxPASSWORD 0x0800 /* wxTE_PASSWORD */ +#if WXWIN_COMPATIBILITY_2_6 + /* deprecated synonyms */ + #define wxPROCESS_ENTER 0x0400 /* wxTE_PROCESS_ENTER */ + #define wxPASSWORD 0x0800 /* wxTE_PASSWORD */ +#endif /* * wxComboBox style flags diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 178f334240..e6c3f27460 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -787,7 +787,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_combo = new MyComboBox( panel, ID_COMBO, _T("This"), wxPoint(20,25), wxSize(120, wxDefaultCoord), 5, choices, - wxPROCESS_ENTER); + wxTE_PROCESS_ENTER); (void)new wxButton( panel, ID_COMBO_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) ); (void)new wxButton( panel, ID_COMBO_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 6ca8f2ade2..c372fb9fac 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -1122,7 +1122,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent, mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL ); - m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER ); + m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); textsizer->Add( m_text, 1, wxCENTER | wxALL, 5 ); mainsizer->Add( textsizer, 0, wxEXPAND ); @@ -1145,7 +1145,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent, 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 ); + m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); textsizer->Add( new wxButton( this, wxID_OK ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); mainsizer->Add( textsizer, 0, wxEXPAND ); diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 229f6fdf49..f9cc4a9518 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp +// Name: src/gtk/spinbutt.cpp // Purpose: wxSpinCtrl // Author: Robert // Modified by: @@ -98,14 +98,14 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, int min, int max, int initial, const wxString& name) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; + m_needParent = true; + m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxSpinCtrl creation failed") ); - return FALSE; + return false; } m_oldPos = initial; @@ -125,7 +125,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, SetValue( value ); - return TRUE; + return true; } void wxSpinCtrl::GtkDisableEvents() @@ -267,7 +267,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) } } - if ((event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) + if ((event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { wxCommandEvent evt( wxEVT_COMMAND_TEXT_ENTER, m_windowId ); evt.SetEventObject(this); @@ -282,11 +282,11 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window ) { - if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE; + if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return true; - if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE; + if (GTK_SPIN_BUTTON(m_widget)->panel == window) return true; - return FALSE; + return false; } wxSize wxSpinCtrl::DoGetBestSize() const diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 373b2536b7..112af870c3 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/gtk/textctrl.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -954,7 +954,7 @@ int wxTextCtrl::GetLineLength(long lineNo) const else { wxString str = GetLineText (lineNo); - return (int) str.Length(); + return (int) str.length(); } } @@ -975,7 +975,7 @@ int wxTextCtrl::GetNumberOfLines() const // If the last character in the text buffer is a newline, // gtk_text_view_forward_display_line() will return false without that // line being counted. Must add one manually in that case. - GtkTextIter lastCharIter; + GtkTextIter lastCharIter; gtk_text_buffer_get_iter_at_offset ( m_buffer, @@ -1152,7 +1152,7 @@ void wxTextCtrl::SetSelection( long from, long to ) if (from == -1 && to == -1) { from = 0; - to = GetValue().Length(); + to = GetValue().length(); } if (m_windowStyle & wxTE_MULTILINE) @@ -1412,7 +1412,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); - if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) + if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 9820526690..e0c8046cfa 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp +// Name: src/gtk1/spinbutt.cpp // Purpose: wxSpinCtrl // Author: Robert // Modified by: @@ -101,14 +101,14 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, int min, int max, int initial, const wxString& name) { - m_needParent = TRUE; - m_acceptsFocus = TRUE; + m_needParent = true; + m_acceptsFocus = true; if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxSpinCtrl creation failed") ); - return FALSE; + return false; } m_oldPos = initial; @@ -128,7 +128,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, SetValue( value ); - return TRUE; + return true; } void wxSpinCtrl::GtkDisableEvents() @@ -274,7 +274,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) } } - if ((event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) + if ((event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { wxCommandEvent evt( wxEVT_COMMAND_TEXT_ENTER, m_windowId ); evt.SetEventObject(this); @@ -289,11 +289,11 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window ) { - if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE; + if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return true; - if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE; + if (GTK_SPIN_BUTTON(m_widget)->panel == window) return true; - return FALSE; + return false; } wxSize wxSpinCtrl::DoGetBestSize() const diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index e7117ec992..5b6c8cef15 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/gtk1/textctrl.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -325,7 +325,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWX2MBbuf val = value.mbc_str(); gtk_editable_insert_text( GTK_EDITABLE(m_text), val, strlen(val), &tmp ); #else - gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp ); + gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.length(), &tmp ); #endif if (multi_line) @@ -418,7 +418,7 @@ void wxTextCtrl::SetValue( const wxString &value ) gint len = gtk_text_get_length( GTK_TEXT(m_text) ); gtk_editable_delete_text( GTK_EDITABLE(m_text), 0, len ); len = 0; - gtk_editable_insert_text( GTK_EDITABLE(m_text), value.mbc_str(), value.Length(), &len ); + gtk_editable_insert_text( GTK_EDITABLE(m_text), value.mbc_str(), value.length(), &len ); } else { @@ -587,7 +587,7 @@ long wxTextCtrl::XYToPosition(long x, long y ) const int wxTextCtrl::GetLineLength(long lineNo) const { wxString str = GetLineText (lineNo); - return (int) str.Length(); + return (int) str.length(); } int wxTextCtrl::GetNumberOfLines() const @@ -794,7 +794,7 @@ void wxTextCtrl::SetSelection( long from, long to ) if (from == -1 && to == -1) { from = 0; - to = GetValue().Length(); + to = GetValue().length(); } if ( (m_windowStyle & wxTE_MULTILINE) && @@ -873,7 +873,7 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) wxWX2MBbuf buf = value.mbc_str(); gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &pos ); #else - gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos ); + gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.length(), &pos ); #endif // wxUSE_UNICODE } } @@ -978,7 +978,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); - if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) + if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 61cdda0653..b536e37c44 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -885,7 +885,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) } if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB && - !( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) + !( key == WXK_RETURN && ( (m_windowStyle & wxTE_PROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) // && key != WXK_PAGEUP && key != WXK_PAGEDOWN && key != WXK_HOME && key != WXK_END ) { @@ -897,7 +897,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) // allow navigation and deletion if ( !IsMultiLine() && m_maxLength && GetValue().length() >= m_maxLength && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_TAB && - key != WXK_BACK && !( key == WXK_RETURN && (m_windowStyle & wxPROCESS_ENTER) ) + key != WXK_BACK && !( key == WXK_RETURN && (m_windowStyle & wxTE_PROCESS_ENTER) ) ) { // eat it, we don't want to add more than allowed # of characters @@ -928,7 +928,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) switch ( key ) { case WXK_RETURN: - if (m_windowStyle & wxPROCESS_ENTER) + if (m_windowStyle & wxTE_PROCESS_ENTER) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject( this ); diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp index 7fcd94b547..a268a4d250 100644 --- a/src/mac/classic/textctrl.cpp +++ b/src/mac/classic/textctrl.cpp @@ -1579,7 +1579,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) } if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB && - !( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) + !( key == WXK_RETURN && ( (m_windowStyle & wxTE_PROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) ) /* && key != WXK_PAGEUP && key != WXK_PAGEDOWN && key != WXK_HOME && key != WXK_END */ ) { @@ -1605,7 +1605,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) switch ( key ) { case WXK_RETURN: - if (m_windowStyle & wxPROCESS_ENTER) + if (m_windowStyle & wxTE_PROCESS_ENTER) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject( this ); diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index be00b321fe..512a567e99 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -199,7 +199,7 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, { wxCHECK_MSG( win, 0, _T("should have a parent") ); - if ( win->GetWindowStyle() & wxPROCESS_ENTER ) + if ( win->GetWindowStyle() & wxTE_PROCESS_ENTER ) { // need to return a custom dlg code or we'll never get it return DLGC_WANTMESSAGE; diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp index c3aee9d8be..a667a5c13a 100644 --- a/src/x11/textctrl.cpp +++ b/src/x11/textctrl.cpp @@ -1887,7 +1887,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event ) } case WXK_RETURN: { - if (m_windowStyle & wxPROCESS_ENTER) + if (m_windowStyle & wxTE_PROCESS_ENTER) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this); -- 2.47.2