Fixed bug #778299 - wxTE_RICH2 causes SetValue to show control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
eb5d9594db
commit
b7a3ba7dcd
@ -75,6 +75,8 @@ wxMSW:
|
||||
- wxStatusBar no longer corrupts surrounding windows on resize.
|
||||
- Enable wxListCtrl in report mode to be able to use images in other
|
||||
columns, if ComCtl32 >= 470.
|
||||
- Fixed problem where using SetValue and wxTE_RICH2 would cause control to
|
||||
show.
|
||||
|
||||
wxGTK:
|
||||
|
||||
|
@ -1261,10 +1261,14 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret)
|
||||
// ES_DISABLENOSCROLL
|
||||
//
|
||||
// this is very ugly but I don't see any other way to make this work
|
||||
long style = 0;
|
||||
if ( GetRichVersion() > 1 )
|
||||
{
|
||||
if ( !HasFlag(wxTE_NOHIDESEL) )
|
||||
{
|
||||
// setting ECO_NOHIDESEL also sets WS_VISIBLE and possibly
|
||||
// others, remember the style so we can reset it later if needed
|
||||
style = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||
::SendMessage(GetHwnd(), EM_SETOPTIONS,
|
||||
ECOOP_OR, ECO_NOHIDESEL);
|
||||
}
|
||||
@ -1280,6 +1284,8 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret)
|
||||
{
|
||||
::SendMessage(GetHwnd(), EM_SETOPTIONS,
|
||||
ECOOP_AND, ~ECO_NOHIDESEL);
|
||||
if ( style != ::GetWindowLong(GetHwnd(), GWL_STYLE) )
|
||||
::SetWindowLong(GetHwnd(), GWL_STYLE, style);
|
||||
}
|
||||
#endif // wxUSE_RICHEDIT
|
||||
}
|
||||
@ -1963,7 +1969,7 @@ wxSize wxTextCtrl::DoGetBestSize() const
|
||||
int hText = cy;
|
||||
if ( m_windowStyle & wxTE_MULTILINE )
|
||||
{
|
||||
hText *= wxMax(wxMin(GetNumberOfLines(), 10), 2);
|
||||
hText *= wxMax(wxMin(GetNumberOfLines(), 10), 2);
|
||||
}
|
||||
//else: for single line control everything is ok
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user