[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] Keypresses (was Re: [XaraXtreme-commits] Commit Complete)



Luke,

You can get a wxVListBox in a normal dialog. Would a better fix not
be to look up the parent hierarchy until EITHER you get to the top
OR you find the window IsKindOf one of the classes (wxTextControl,
wxComboCtrl etc.), and if the latter (but not the former), return -1?
That way it will cope with subcontrols of all the listed classes.

Alex


Changed paths:
   M /Trunk/XaraLX/wxOil/camelot.cpp

Fix for BZ#1254, keypress was coming from the wxVList and not the
wxOwnerDrawnComboBox (which is presumably the parent)


Diff:
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp	(revision 1421)
+++ Trunk/XaraLX/wxOil/camelot.cpp	(revision 1422)
@@ -298,7 +298,8 @@
 		if( pClassInfo->IsKindOf( CLASSINFO(wxTextCtrl) ) ||
 			pClassInfo->IsKindOf( CLASSINFO(wxComboBox) ) ||
 			pClassInfo->IsKindOf( CLASSINFO(wxOwnerDrawnComboBox) ) ||
-			pClassInfo->IsKindOf( CLASSINFO(wxComboCtrl) )
+			pClassInfo->IsKindOf( CLASSINFO(wxComboCtrl) ) ||
+			pClassInfo->IsKindOf( CLASSINFO(wxVListBox) )
 			)
 		{
 			TRACEUSER( "jlh92", _T("Control gets keys") );
@@ -306,6 +307,16 @@
 			return -1;
 		}

+#if defined(DEBUG_KEYPRESS_SPEW)
+		while( NULL != pClassInfo )
+		{
+			TRACEUSER( "jlh92", _T("Class %s
"), PCTSTR(pClassInfo->GetClassName()) );
+
+			PCTSTR	pszName = pClassInfo->GetBaseClassName1();
+			pClassInfo = NULL == pszName ? NULL : wxClassInfo::FindClass( pszName
); +		}
+#endif
+
 		// Scan down ancestors looking for either wxPanels (always non-modal)
and  		// wxDailogs (can be modal, so we check)
 		wxWindow *pWnd = (wxWindow*)pEventObject;


Xara





Alex