Commit info
This patch adds a context menu to all wxSmith tree items except the main dialog. The context menu is just a shortcut for the following combinations
Cut Menu/Edit/Cut
Copy Menu/Edit/Copy
PasteBefore Button "InsertBefore" and then Menu/Edit/Paste
PasteInto Button "InsertInto" and then Menu/Edit/Paste
PasteAfter Button "InsertAfter" and then Menu/Edit/Paste
The patch speeds up refactoring work on exisitng wxSmith dialogs dramatically.
The patch was tested under Linux 22.04 only with wxGTK3 3.0.5.
Nice contribution.
One question:
What is the "2" mean in the patch:
Also, some TABs in the source code should be replaced by spaces if I remember correct.
I will test it in my C::B, I use C::B and wxSmith in many of my personal projects(mainly under Windows).
Thanks.
Thanks for your feedback.
The "Cut2" was an leftover from debugging (my first implementation used wxSmith menu items but that proved much less efficient than the context menu. I'll correct that.
The tabs. I had to change the patch manually, because it had loads of changes from my AStyle setting which seems very different than the code style CB svn is using. I think the editor tab preferences also affect hat.
I have not found anything on the wiki about the settings to use for SVN commits. Obviously one is "use spacess for tabs", but what is the AStyle setting?
Attached the corrected patch, I hope I caught all tabs
Hi, I got a linker error:
wxsItemEditor::OnMouseClick is not defined.
Do you forget to add this function implementation in your patch file?
Last edit: ollydbg 2023-12-20
Hm. Interesting.
I was sure this was already there as function with header but no CPP body but the compiler did not complain. In fact I added an implementation first but found that it was not called, so I deleted the CPP part again. Not sure why the compiler complains.
So I did not use it and would have deleted it.
OK, this is a bit strange, so let me comment out that line in the event handler macro table, and continue building. Thanks.
I think I can't find a "astyle" format which can direct format the code.
see here: Coding style - Code::Blocks — https://wiki.codeblocks.org/index.php/Coding_style
There is a "space" after the "if", but there is no space between the function definition like
Last edit: ollydbg 2023-12-20
So according to the wiki, the AStyle option "ANSI" should do it, then, thanks
I will try next time.
This is my modified patch, I only fix some formats.
Thanks. Is there anything expected from me now?
Currently, no question. Give me some time for testing and reading your code. Thanks.
<moved to="" #1436=""></moved>
Last edit: Tiger Beard 2023-12-31
I am using it for a while not and its speeding up things a lot. There is one thing I failed to track down, because I got lost in the code complexity a bit.
When pasting an item, e.g. after copy, the current properties are not all maintained. For example the Border Settings are always reset to 5 and all sides ON. Same for Proportion that is set to 1.
I think it would be better if all properties except the Varname and IDs remain as the source item.
@ollydbg any chance to look at he code yet?
Hi, when review the code in my local git , I see one code changes:
~~~~
@@ -949,6 +960,9 @@ BEGIN_EVENT_TABLE(wxsItemEditor,wxsEditor)
EVT_BUTTON(wxsPreviewId,wxsItemEditor::OnPreview)
EVT_BUTTON(wxsQuickPropsId,wxsItemEditor::OnQuickProps)
EVT_BUTTON(-1,wxsItemEditor::OnButton)
+// EVT_BUTTON(wxsCutId,wxsItemEditor::OnCut)
+// EVT_BUTTON(wxsCopyId,wxsItemEditor::OnCopy)
EVT_KEY_DOWN(wxsItemEditor::OnKeyDown)
+ EVT_RIGHT_UP(wxsItemEditor::OnMouseClick)
EVT_MENU(wxID_ANY,wxsItemEditor::OnPopup)
END_EVENT_TABLE()
~~~~
I try to find the two functions
wxsItemEditor::OnCut
andwxsItemEditor::OnCopy
, maybe those two functions are your test functions? So I will remove them in the commit.Thanks.
It's in svn rev13453 now. Thanks.
Nice contribution.
One question:
What is the "2" mean in the patch:
Also, some TABs in the source code should be replaced by spaces if I remember correct.
I will test it in my C::B, I use C::B and wxSmith in many of my personal projects(mainly under Windows).
Thanks.
Removed.
Last edit: Tiger Beard 2024-02-20
Sorry, firefox sent my comments which was months ago.