removed unnecessary (now that we leave Windows paint background itself) SetBackgroundColour() calls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-11-15 18:22:11 +00:00
parent 8681b0940e
commit caea50acee
2 changed files with 27 additions and 18 deletions

View File

@@ -192,8 +192,6 @@ bool wxFrame::Create(wxWindow *parent,
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
return false; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
#if defined(__SMARTPHONE__) && defined(__WXWINCE__) #if defined(__SMARTPHONE__) && defined(__WXWINCE__)
SetLeftMenu(wxID_EXIT, _("Done")); SetLeftMenu(wxID_EXIT, _("Done"));
#endif #endif

View File

@@ -220,15 +220,12 @@ void wxTextCtrl::Init()
m_privateContextMenu = NULL; m_privateContextMenu = NULL;
m_suppressNextUpdate = false; m_suppressNextUpdate = false;
m_isNativeCaretShown = true; m_isNativeCaretShown = true;
m_isCaretAtEnd = true;
} }
wxTextCtrl::~wxTextCtrl() wxTextCtrl::~wxTextCtrl()
{ {
if (m_privateContextMenu) delete m_privateContextMenu;
{
delete m_privateContextMenu;
m_privateContextMenu = NULL;
}
} }
bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
@@ -346,8 +343,6 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) ) if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) )
return false; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
if ( IsRich() ) if ( IsRich() )
{ {
@@ -943,8 +938,6 @@ void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly)
SendUpdateEvent(); SendUpdateEvent();
} }
} }
AdjustSpaceLimit();
} }
void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::AppendText(const wxString& text)
@@ -954,7 +947,8 @@ void wxTextCtrl::AppendText(const wxString& text)
WriteText(text); WriteText(text);
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
if ( IsMultiLine() && GetRichVersion() > 1 ) // don't do this if we're frozen, saves some time
if ( !IsFrozen() && IsMultiLine() && GetRichVersion() > 1 )
{ {
// setting the caret to the end and showing it simply doesn't work for // setting the caret to the end and showing it simply doesn't work for
// RichEdit 2.0 -- force it to still do what we want // RichEdit 2.0 -- force it to still do what we want
@@ -1084,6 +1078,8 @@ void wxTextCtrl::SetEditable(bool editable)
void wxTextCtrl::SetInsertionPoint(long pos) void wxTextCtrl::SetInsertionPoint(long pos)
{ {
DoSetSelection(pos, pos); DoSetSelection(pos, pos);
m_isCaretAtEnd = pos == GetLastPosition();
} }
void wxTextCtrl::SetInsertionPointEnd() void wxTextCtrl::SetInsertionPointEnd()
@@ -1093,8 +1089,11 @@ void wxTextCtrl::SetInsertionPointEnd()
// if it doesn't actually move the caret anywhere and so the simple fact of // if it doesn't actually move the caret anywhere and so the simple fact of
// doing it results in horrible flicker when appending big amounts of text // doing it results in horrible flicker when appending big amounts of text
// to the control in a few chunks (see DoAddText() test in the text sample) // to the control in a few chunks (see DoAddText() test in the text sample)
if ( GetInsertionPoint() == GetLastPosition() ) if ( m_isCaretAtEnd || GetInsertionPoint() == GetLastPosition() )
{
m_isCaretAtEnd = true;
return; return;
}
long pos; long pos;
@@ -1212,7 +1211,7 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret)
::SendMessage(hWnd, EM_SETSEL, (WPARAM)from, (LPARAM)to); ::SendMessage(hWnd, EM_SETSEL, (WPARAM)from, (LPARAM)to);
} }
if ( scrollCaret ) if ( scrollCaret && !IsFrozen() )
{ {
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
// richedit 3.0 (i.e. the version living in riched20.dll distributed // richedit 3.0 (i.e. the version living in riched20.dll distributed
@@ -1473,6 +1472,9 @@ void wxTextCtrl::ShowPosition(long pos)
if (linesToScroll != 0) if (linesToScroll != 0)
(void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll); (void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll);
// be pessimistic
m_isCaretAtEnd = false;
} }
long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const
@@ -1549,6 +1551,9 @@ void wxTextCtrl::Undo()
if (CanUndo()) if (CanUndo())
{ {
::SendMessage(GetHwnd(), EM_UNDO, 0, 0); ::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
// it's not necessarily at the end any more
m_isCaretAtEnd = false;
} }
} }
@@ -1563,6 +1568,9 @@ void wxTextCtrl::Redo()
#endif #endif
// Same as Undo, since Undo undoes the undo, i.e. a redo. // Same as Undo, since Undo undoes the undo, i.e. a redo.
::SendMessage(GetHwnd(), EM_UNDO, 0, 0); ::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
// it's not necessarily at the end any more
m_isCaretAtEnd = false;
} }
} }
@@ -2457,10 +2465,13 @@ bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)
if ( !wxTextCtrlBase::SetDefaultStyle(style) ) if ( !wxTextCtrlBase::SetDefaultStyle(style) )
return false; return false;
// we have to do this or the style wouldn't apply for the text typed by the if ( IsEditable() )
// user {
long posLast = GetLastPosition(); // we have to do this or the style wouldn't apply for the text typed by
SetStyle(posLast, posLast, m_defaultStyle); // the user
long posLast = GetLastPosition();
SetStyle(posLast, posLast, m_defaultStyle);
}
return true; return true;
} }