-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxSearchCtrl color mismatch with ChangeValue #12798
Comments
2010-12-23 23:14:32: jim22k (Jim Kitchen) uploaded file
|
2010-12-25 14:31:24: @vadz changed status from new to closed2010-12-25 14:31:24: @vadz set resolution to outdated2010-12-25 14:31:24: @vadz commentedIf this was under MSW, I'm almost sure this was fixed in the trunk already. Can you please retest with wxPython 2.9? If it's still present please reopen and give details about your platform, thanks. |
2010-12-27 15:45:18: jim22k (Jim Kitchen) changed status from closed to reopened2010-12-27 15:45:18: jim22k (Jim Kitchen) changed resolution from outdated to **2010-12-27 15:45:18: jim22k (Jim Kitchen) commentedYes, this is MSW. I just tested with the 2.9.1.1 wxPython Windows binary and the problem is still there. I've shown the problem spot in the source code below (wx/wxWidgets/trunk/src/generic/srchctlg.cpp). Changes to the text color (lightness) only occur in two places: But if the text is currently light (i.e. showing the DescriptiveText) and the user calls ChangeValue() on the SearchCtrl, it updates the text but leaves it a lighter color. And when the user clicks in the SearchCtrl, it gets Focus, but the text != the Descriptive Text, so it still doesn't change the text color back to the original. That's the bug. wxSearchCtrl needs to override the ChangeValue() and SetValue() methods to ensure that the text color is correct (m_defaultFG). 131 void OnIdle(wxIdleEvent& WXUNUSED(event)) |
Issue migrated from trac ticket # 12798
component: GUI-generic | priority: normal | resolution: fixed | keywords: wxSearchCtrl
2010-12-23 23:13:51: jim22k (Jim Kitchen) created the issue
When the ChangeValue(new_text) method is called on an empty wxSearchCtrl, the control is updated with new_text, but it remains in the lighter text reserved for the Descriptive Text. Editing the text continues to use the lighter colored text until the SearchCtrl is cleared and loses focus.
If the user has manually typed in the SearchCtrl first, calling ChangeValue(new_text) works correctly. This is only a problem when the SearchCtrl is empty and the lighter Descriptive Text is being displayed.
A workaround solution for wxPython was given by Robin Dunn in the following conversation:
http://groups.google.com/group/wxpython-users/browse_thread/thread/6e999b3013e383f6
wxPython code showing the problem and workaround is attached.
The correct solution, rather than using a workaround, is to have the SearchCtrl handle the text color itself when either ChangeValue() or SetValue() is called.
The text was updated successfully, but these errors were encountered: