User forums > Using Code::Blocks
Misc questions around CB and wxWidgets integration
ollydbg:
FYI: with the patch below, user can double click on the Event ID name (entries in the left column), then the editor will jump to the associated event handler function body.
The method was quite simple, I reuse the OnChange() handler when the user double click on the entry, if the visual string matches the function name already assigned for the EventID, jump to the function body. In other cases, it is a real event handler name change, so it goes to the old routine.
--- Code: ---Index: properties/wxspropertygridmanager.cpp
===================================================================
--- properties/wxspropertygridmanager.cpp (revision 8249)
+++ properties/wxspropertygridmanager.cpp (working copy)
@@ -306,4 +306,5 @@
BEGIN_EVENT_TABLE(wxsPropertyGridManager,wxPropertyGridManager)
EVT_PG_CHANGED(-1,wxsPropertyGridManager::OnChange)
+ EVT_PG_DOUBLE_CLICK(-1,wxsPropertyGridManager::OnChange)
END_EVENT_TABLE()
Index: wxwidgets/wxseventseditor.cpp
===================================================================
--- wxwidgets/wxseventseditor.cpp (revision 8249)
+++ wxwidgets/wxseventseditor.cpp (working copy)
@@ -151,6 +151,15 @@
}
wxString Selection = Grid->GetPropertyValueAsString(Id);
+ wxString oldHandlerName = m_Events->GetHandler(Index);
+ if ( (!oldHandlerName.IsEmpty()) && oldHandlerName.IsSameAs(Selection) )
+ {
+ // which means this event is emulated from the double click on the event ID name,
+ // user want to jump to the implementation of this event handler function body,
+ // no need to rebuild the event and notify other part
+ GotoHandler(Index);
+ return;
+ }
if ( Selection == NoneStr )
{
--- End code ---
Tests and comments are all welcome.
eranon:
Is it present in the current nightly build, Olly, or should we add-it by ourself in the source for testing ?
ollydbg:
--- Quote from: eanon on August 31, 2012, 03:16:45 pm ---Is it present in the current nightly build,
--- End quote ---
NO.
--- Quote ---Olly, or should we add-it by ourself in the source for testing ?
--- End quote ---
To test it: Check out the codeblocks' source code, apply the patch, and build the source yourself.
PS: If there were no objections for several days, I will commit it to trunk, and some days later, this feature will appeared in nightly build.
eranon:
OK, I'll try to test-it tomorrow.
--
EDIT : oops ! tommorow being today since it's already 1:42 AM... So after my personal human nightly sleep, I mean :)
EDIT #2 : It works for me ! Nice feature, Ollydbg. Tested under Win7 with patch added in source code of C::B SVN rev 8328 (against wx 2.8.12 ; this precision because I've seen a wx 2.9 workspace beside, but don't know if it's fully ready for buidling).
ollydbg:
--- Quote from: eanon on September 02, 2012, 01:42:12 am ---OK, I'll try to test-it tomorrow.
--
EDIT : oops ! tommorow being today since it's already 1:42 AM... So after my personal human nightly sleep, I mean :)
EDIT #2 : It works for me ! Nice feature, Ollydbg. Tested under Win7 with patch added in source code of C::B SVN rev 8328 (against wx 2.8.12 ; this precision because I've seen a wx 2.9 workspace beside, but don't know if it's fully ready for buidling).
--- End quote ---
Thanks for the test.
It is in trunk now. (rev 8336)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version