Make wxPASSWORD and wxPROCESS_ENTER really deprecated.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2006-03-28 11:02:37 +00:00
parent 39987096b3
commit 8e13c1ec4e
13 changed files with 56 additions and 53 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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