fix for using an invalid HWND in IsEditable
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -844,6 +844,12 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
|
|||||||
|
|
||||||
bool wxTextCtrl::IsEditable() const
|
bool wxTextCtrl::IsEditable() const
|
||||||
{
|
{
|
||||||
|
// strangely enough, we may be called before the control is created: our
|
||||||
|
// own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls
|
||||||
|
// us
|
||||||
|
if ( !m_hWnd )
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
long style = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
long style = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||||
|
|
||||||
return (style & ES_READONLY) == 0;
|
return (style & ES_READONLY) == 0;
|
||||||
|
Reference in New Issue
Block a user