Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Debugger: Put the most recent entered command in the position 0 of the wxComboBo

(1/1)

ollydbg:
When debugging, I see that it is annoying to select the recent command I just sent. For example, I send some commands to GDB from the panel, such as:

first, I enter "p a", then, I enter "p b", and finally I enter "p c", now if I use the UP and DOWN key, I see that the wxCombo list are:


--- Code: ---p a  -> this is selected firstly
p b
p c

--- End code ---

This means the oldest command is selected, you have to press UP or DOWN several times to select the recent sent command.

But what I think is that the user maybe need only repeat the command he just entered.

This patch fix this issue. (If you look at the ThreadSearch's wxComboBox, you see the last search item is put in the position 0 of the wxComboBox list.


--- Code: --- src/sdk/debuggermanager.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sdk/debuggermanager.cpp b/src/sdk/debuggermanager.cpp
index eb4be390..65da9bc4 100644
--- a/src/sdk/debuggermanager.cpp
+++ b/src/sdk/debuggermanager.cpp
@@ -621,7 +621,7 @@ public:
             int index = m_command_entry->FindString(cmd);
             if (index != wxNOT_FOUND)
                 m_command_entry->Delete(index);
-            m_command_entry->Append(cmd);
+            m_command_entry->Insert(cmd, 0);
 
             m_command_entry->SetValue(wxEmptyString);
         }

--- End code ---

OK to commit?

oBFusCATed:
I'm not sure the combo behaves the same on different OSes. :(
I'll do some testing with this patch, but I'm not too optimistic.

oBFusCATed:
Works for both wx2.8 and 3.1 on my gentoo, so go on and commit this change.

ollydbg:

--- Quote from: oBFusCATed on October 03, 2018, 12:13:55 am ---Works for both wx2.8 and 3.1 on my gentoo, so go on and commit this change.

--- End quote ---
Thanks for the test, it is in trunk now.

Navigation

[0] Message Index

Go to full version