Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: dmoore on August 11, 2012, 05:07:31 am

Title: Some UI refactoring/tidy up
Post by: dmoore on August 11, 2012, 05:07:31 am
Hi guys,

I've been thinking about the following changes:

Find/Replace:
1. Possibly remove "Find uses selected text" check box <-- have no idea what this is supposed to do (the code is attributed to tiwag). We already have a scope option and if you select text before pressing control F it become the default search term. What does this do differently?
2. Add regular expression option: "." searches across newlines or within
3. Find/Replace in files: add option to specify project to search in (active or others)

Settings Dialogs:
4. Load XRC for each configuration panel on demand (i.e. as the user clicks the tab). Avoids some delay, esp. on slower Linux systems. (also means no changes written for config panels that were never opened and, hence, no changes were made).
5. Explore making the settings dialog a modeless editor tab
6. Explore replacing the settings dialog listbook with a single scrollable page where panels are folded away and unfold on click revealing their content

I have partial patches for 2 and 4.

5 & 6 I've talked about in the past and will take a bit of work, and not sure they will necessarily improve on what we have now, but worth a try (note that 4 is pretty much a pre-requisite for these)

Any thoughts?
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 11, 2012, 08:28:38 am
2. Add regular expression option: "." searches across newlines or within
We have that already?!

3. Find/Replace in files: add option to specify project to search in (active or others)
Good - also an option to search int he files of the target is something I'd like to see... ;-)

4. Load XRC for each configuration panel on demand
Be careful here: We have a resource loader that kind off does such things already, but its not used. Something  I had in mind to investigate why that is...

5. Explore making the settings dialog a modeless editor tab
Again: Be careful: We disable some function s if the settings dialog is opened for good reasons. also, avoid race conditions, like changing the (project's) compiler options while compiling in the background. Modeless dialogs require to handle this carefully. As we have an event based system this is not so easy! Other than That: Fine.

6. Explore replacing the settings dialog listbook with a single scrollable page where panels are folded away and unfold on click revealing their content
This sounds like a very major change and I don't know how it affects plugins which provide panels as their foreign config dialogs. There was a very nice wxWidgets class though - I recall where you were able to shrink/unshrink parts of the window. But I didn't find it anymore... wxTreeSomewhat... wxScrolledSomewhat...?!
Title: Re: Some UI refactoring/tidy up
Post by: Jenna on August 11, 2012, 08:34:41 am
1. is a very useful feature, I use a lot in find and replace dialog, because you get the posibility to select a range of text and only replace a keyword in this selection. Very good for manual refactoring after copy and paste. Please do not remove !
Title: Re: Some UI refactoring/tidy up
Post by: oBFusCATed on August 11, 2012, 11:18:58 am
1. is a very useful feature, I use a lot in find and replace dialog, because you get the posibility to select a range of text and only replace a keyword in this selection. Very good for manual refactoring after copy and paste. Please do not remove !
Yes, but it is annoying that if you have accidentally selected some text and you start a search it is in this unexpected mode.
What about making it the non-automatically selected option and the user is explicitly required to switch to this mode?

I can will add 7 to the list:

7). See if it is possible to make the project properties and build options modeless or editors, so the user can edit multiple settings at once.
This will be pretty useful in multi project workspaces.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 11, 2012, 07:24:02 pm
1. is a very useful feature, I use a lot in find and replace dialog, because you get the posibility to select a range of text and only replace a keyword in this selection. Very good for manual refactoring after copy and paste. Please do not remove !

Isn't this what "Scope: global / selected text" radio boxes let you do? In case it wasn't clear, I was referring to the check box labeled "Find uses selected text". I still can't figure out what it does.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 11, 2012, 07:28:34 pm
Yes, but it is annoying that if you have accidentally selected some text and you start a search it is in this unexpected mode.
What about making it the non-automatically selected option and the user is explicitly required to switch to this mode?

I personally prefer the behavior that treats a multiline selection as the scope by default, but I can see how others might not. Rather than change default behavior for everyone, how about a check box in the editor settings to enable the ability to change default behavior. (I do realize settings are already pretty polluted)

Quote
I can will add 7 to the list:

7). See if it is possible to make the project properties and build options modeless or editors, so the user can edit multiple settings at once.
This will be pretty useful in multi project workspaces.

Sounds good to me. I will investigate that when I'm done with 5/6.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 11, 2012, 07:53:48 pm
2. Add regular expression option: "." searches across newlines or within
We have that already?!

I don't  think so. Currently regex won't match a multiline expression. Sometimes that is useful, other times not. I put a partial patch here, but need to change the dialogs: http://forums.codeblocks.org/index.php/topic,16680.msg113282.html#msg113282

Quote
Good - also an option to search int he files of the target is something I'd like to see... ;-)

agree.

Quote
4. Load XRC for each configuration panel on demand
Be careful here: We have a resource loader that kind off does such things already, but its not used. Something  I had in mind to investigate why that is...

What I am actually doing is deferring instantiation of the whole panel (which also defers the XRC load)

Quote
5. Explore making the settings dialog a modeless editor tab
Again: Be careful: We disable some function s if the settings dialog is opened for good reasons. also, avoid race conditions, like changing the (project's) compiler options while compiling in the background. Modeless dialogs require to handle this carefully. As we have an event based system this is not so easy! Other than That: Fine.

Will be careful. The plan is that changed options won't be accepted until you hit apply. (And there will be an option cancel/reset the changes). It will take a little work to make sure the apply button is disabled if there are critical things happening.

Quote
6. Explore replacing the settings dialog listbook with a single scrollable page where panels are folded away and unfold on click revealing their content
This sounds like a very major change and I don't know how it affects plugins which provide panels as their foreign config dialogs. There was a very nice wxWidgets class though - I recall where you were able to shrink/unshrink parts of the window. But I didn't find it anymore... wxTreeSomewhat... wxScrolledSomewhat...?!

This coupled with modal dialogs is a pretty big change. I am hoping that changes for plugin writers will be very minimal (I think I can get it down to a simple change to how the plugin returns GetConfigurationPanel, GetProjectConfigurationPanel etc). This may not work well at all, hence "explore".

Btw, qtCreator does most of their settings modally in the main window (though still using notebooks). I also like the qtCreator start page.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 13, 2012, 09:10:06 am
Attached is a patch that is a first stab at 4 -- uses a lot of templating to get things done, which isn't ideal.

This speeds up opening up editor and environment settings a bit on slow systems, but there is more to do in terms of the parts of the config that aren't supplied by plugins. The idea would be to break up the XRC into chunks that can be instantiated in pieces. I didn't mess with Project dialogs, they seem to open quickly enough even on slow systems. Most things still work fine. The dialogs will occasionally resize as you click on configs with big panels that haven't been opened yet, which looks a bit weird and could be remedied with size hints. BrowseTracker's config panel is screwed up for some reason. Shouldn't be difficult to fix.

In the end I'm not sure the performance is worth the pain, but I do have a good handle on how the config system works now, which will help implementing the other items on the list.

I do get an assertion on exit: 
Code
(codeblocks:9081): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:9081): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:9081): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:9081): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed
Aborted (core dumped)

Don't have time to check whether my changes caused this.

The big challenge will be #5 on my list. If settings change outside of the config (e.g. list of mimetypehandlers is modified when you double click on new file types in the project tree), the config will need to be notified if it is opened.

I plan to take a break from coding for a week or so, so won't be very active here.

[attachment deleted by admin]
Title: Re: Some UI refactoring/tidy up
Post by: Jenna on August 13, 2012, 09:47:45 am
I do get an assertion on exit:  
Code
(codeblocks:9081): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:9081): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:9081): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:9081): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed
Aborted (core dumped)

The core-dump is not related to this as far as I know, and it seems it has gone with the xm-compiler branch, so it might be related to compiler-plugin.
In most cases a bt shows an error while deleting a wxString and/or wxArrayString.

The GLIB and GTK stuff is related to a wxWidgets or gtk issue when removing menu-entries. It comes from debugger-menu.
There is a bug-report by Eran, because of a similar issue on wx-dev mailinglist.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 13, 2012, 05:22:56 pm
The core-dump is not related to this as far as I know, and it seems it has gone with the xm-compiler branch, so it might be related to compiler-plugin.
I've cleaned-up the resource file sin the compiler plugin. Maybe we can merge that part to trunk a little earlier, too... I seems wxSmith does strange things sometimes in combination with editing XRC files, but I did not iinvestigate any further.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 21, 2012, 05:24:15 pm
Returning to this... Was playing with Find/Replace. First step, I created a unified find and replace dialog that dynamically relabels relevant widgets to either "Find" or "Replace" and hides irrelevant options when it is created. This makes the UI more consistent. I will be adding the ability to search in targets and search in workspaces (fixing the current broken implementation).

A couple of Qs:
1. Is there a reason why we pre-size the replace dialog to the MinSize of the multiline text entries? This introduces a lot of ugly whitespace when the multiline option is unchecked. Why not just let the dialog grow using Fit?
2. Is there an easy way to insert widgets between radio box items in wxSmith. To handle the search scope, I wanted to do something like:

Code
o Open files
o Project files
    Project Combo\/   Target Combo\/
o Workspace
o Path
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 21, 2012, 05:28:37 pm
There was a very nice wxWidgets class though - I recall where you were able to shrink/unshrink parts of the window. But I didn't find it anymore... wxTreeSomewhat... wxScrolledSomewhat...?!

wxCollapsiblePane? http://docs.wxwidgets.org/2.8/wx_wxcollapsiblepane.html
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 22, 2012, 06:19:08 am
wxCollapsiblePane? http://docs.wxwidgets.org/2.8/wx_wxcollapsiblepane.html
Maybe that was it, yes. Just I recall that it didn't have buttons but tiny plusses for collapsing...?! Maybe it was an older version.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 28, 2012, 04:45:25 am
Here's a pretty extensive patch for Find/Replace.

What's changed:
1. Find and replace now share a common XRC file and class.
2. Layout of dialogs (still a few minor glitches with the layout that I need to fix)
3. Can now specify project and optionally a target to find/replace in (defaults to active project every time, could store last used settings)
4. Can now do replace in "search path"
5. Code::Blocks Project files (I haven't touched the make files)

Attaching 2 patches:
#1 is based on rev 8239, my working copy while I was working on these changes
#2 is based on rev 8250, the current rev

Hopefully either one will apply fine.

Please test and give me your thoughts.

[attachment deleted by admin]
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 28, 2012, 04:04:10 pm
There is an issue with my patches. Before you run them, you will first need to do:

Code
svn cp src/sdk/replacedlg.cpp  src/sdk/findreplacedlg.cpp 
svn cp src/include/replacedlg.h  src/include/findreplacedlg.h

I had used svn cp to do this, but the svn diff does not show up the need to copy replacedlg.* first.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 06:02:33 am
Adding to the original list, here are some more paper cuts with Dialogs and default/escape actions:

7. OK/Close is not default, escape does not close the dialog
select target dialog
file properties
project properties
manage plugins
settings environment
settings editor
settings compiler
settings debugger
settings global variables

8. Escape key does not close the dialog
project build options
file print dialog
add todo item dialog
replace prompt (despite setting SetEscapeId in the constructor)
browse tracker settings (from edit menu)
categories & file types
project remove files

9. too large for small screens
all(?) file picker dialogs (e.g. file open, file save as, project add files, ...)

10.  broken layout
settings global variables (need to scroll dialog, probably just missing a layout/fit call)

This is on Linux, not sure there are the same problems on windows. Let me know if I have misdiagnosed or miss some issues. The fixes for 7 and 8 may not be straightforward because they may be due to bugs in wxWidgets.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 06:23:35 am
I had used svn cp to do this, but the svn diff does not show up the need to copy replacedlg.* first.
What you need to do is copy these files plain, the svn add them temporarily, then do the modifications and then create the patch.

Both patches presented here do not work for me. Alternatively just provide the two new files as "plain" files here, not included in the patch.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 06:26:00 am
I had used svn cp to do this, but the svn diff does not show up the need to copy replacedlg.* first.
What you need to do is copy these files plain, the svn add them temporarily, then do the modifications and then create the patch.

Both patches presented here do not work for me. Alternatively just provide the two new files as "plain" files here, not included in the patch.

Did you make the copies using the two commands I suggested? (The bigger problem may be because the patch was created on linux and you are trying to apply to windows)
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 06:27:40 am
Did you make the copies using the two commands I suggested?
Yes, I did - but they were left un-modifed after applying the patch.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 06:30:47 am
Yes, I did - but they were left un-modifed after applying the patch.
BTW, in the patch file you see this:
--- src/sdk/findreplacedlg.cpp   (revision 8239)
+++ src/sdk/findreplacedlg.cpp   (working copy)

...but this will fail, because in revision 8239 there is no such file. That's why I said you need to add them.
Title: Re: Some UI refactoring/tidy up
Post by: Jenna on August 29, 2012, 06:32:00 am
(The bigger problem may be because the patch was created on linux and you are trying to apply to windows)
If they are created with "svn diff", they normally work out of the box on windows.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 06:36:16 am
If they are created with "svn diff", they normally work out of the box on windows.
Yes, unless there are missing steps. Like here, patch assumes files to be present which are not. So it cannot work. Not even, if you do a svn cp, because they are assumed to be there, committed, in r8239 - that's not the case.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 06:44:56 am
I guess you are using some "fancy" patch tool. good ole linux patch apparently ignores the stuff in parentheses, so it applies fine after creating the copies of the file. :-\

I've attached another one, hopefully this works. (It does say "revision 0" for the new files, hope that is what you are expecting)

@jens: yes, used svn diff.

I realize that I need to disable the option to convert line endings for multiline "find", because I don't think it makes sense. Maybe multiline search doesn't make sense at all for "find" (I figure that it will be occasionally useful so worth keeping).

Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 07:02:52 am
I've attached another one, hopefully this works. (It does say "revision 0" for the new files, hope that is what you are expecting)
Yes, this one worked out of the box (as expected).

I guess you are using some "fancy" patch tool. good ole linux patch apparently ignores the stuff in parentheses, so it applies fine after creating the copies of the file. :-\
Well I am on Windows - so thee is no "good ole linux patch". And still: A patch is correct only, if it doesn't require any pre-requisite. Everything else just may work but is not guaranteed.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 07:16:37 am
Yes, I did - but they were left un-modifed after applying the patch.
BTW, in the patch file you see this:
--- src/sdk/findreplacedlg.cpp   (revision 8239)
+++ src/sdk/findreplacedlg.cpp   (working copy)

...but this will fail, because in revision 8239 there is no such file. That's why I said you need to add them.

So OK I was wrong, but isn't that partly an issue with svn diff? Why does it treat the added file as if it was in revision 8239, when clearly it wasn't? I used svn cp, but I guess diff just treats the cp as having occurred and just reports the changes.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 07:50:24 am
So OK I was wrong, but isn't that partly an issue with svn diff? Why does it treat the added file as if it was in revision 8239, when clearly it wasn't? I used svn cp, but I guess diff just treats the cp as having occurred and just reports the changes.
Maybe... I wonder how "svn cp" and "svn add" are interpreted by patch. I mean: In both cases you have a brand new file. From a "diff"-view perspective its the same. But: If you look at both patches, in one case you get a diff to an existing file, in the other you get the full file. I guess its just a mystery...
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 04:00:38 pm
There is some unconvincing rationalization of the issue here (http://mail-archives.apache.org/mod_mbox/subversion-users/201108.mbox/%3C20110807122227.GA15919@ted.stsp.name%3E). They mention a "treat copies as adds" option, but if default behavior produces broken patches I would call that a bug.

Anyway, any thoughts on the patch? (Note that the patch does not remove the files that are no longer needed)

Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 29, 2012, 05:58:48 pm
Anyway, any thoughts on the patch? (Note that the patch does not remove the files that are no longer needed)
Hey, I've just managed to compile C::B... please gimme more than 5 minutes to try... ;D
BTW: Which files should I remove now? (Header, source, resource files?!)
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 29, 2012, 06:11:11 pm
Sorry ... :D

BTW: Which files should I remove now? (Header, source, resource files?!)

It will run as is, but eventually will need to remove find_dialog.xrc, finddialog.cpp, finddlg.h, finddlg.cpp, replacedlg.cpp, replacedlg.h (in retrospect a smarter way to create the patch would be to svn mv replacedlg to findreplacedlg)
Could also rename replace_dialog.xrc find_replace_dialog.xrc

Will then need to adjust project/make files accordingly
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 30, 2012, 08:11:06 am
Will then need to adjust project/make files accordingly
Well, when compiling the C::B sources with the patch applied, compilation of the plugins (namely codesnippets) will fail:
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1524:101: error: cannot allocate an object of abstract type 'FindDlg'
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1527:104: error: cannot allocate an object of abstract type 'ReplaceDlg'

Can you provide a complete patch, so one can compile the whole workspace?
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 30, 2012, 03:10:24 pm
Well, when compiling the C::B sources with the patch applied, compilation of the plugins (namely codesnippets) will fail:
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1524:101: error: cannot allocate an object of abstract type 'FindDlg'
C:/Devel/CodeBlocks/src/plugins/contrib/codesnippets/editor/seditormanager.cpp:1527:104: error: cannot allocate an object of abstract type 'ReplaceDlg'

Can you provide a complete patch, so one can compile the whole workspace?

ugh... had no idea codesnippets did this (I will remember to build the whole workspace next time). So I have to copy a lot of my fixes across to CodeSnippets because it reimplements a lot of C::Bs editor functionality (SEditorManager)? I notice the code has been changed a little bit (e.g. no find in files, though I note that the find in files still appears in the find dialog)

IMHO codesnippets would be more consistent if the plugin version allowed you to edit snippets in the regular editor notebook. Also, this may just a problem with my default.conf, but snippets does not work properly for me. I add a few snippets using the default name of new snippet but different content. Then when I click them they all have the name "codesnippets.txt" in the editor and the same content.

Here's a separate patch for CodeSnippets that as a first pass that does the minimal fix to use the new combined dialog, I haven't done more because I am not sure how it is supposed to work. Should it have find/replace in files functionality? Then the scope options in the regular C::B shouldn't really apply (e.g. why would I search in project/workspace for snippet??). Perhaps this plugin should really have its own dialogs?
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on August 30, 2012, 06:23:00 pm
Perhaps this plugin should really have its own dialogs?
IMHO it is because besides the plugin, the codesnippets project also includes a standalone app to edito your snippets. For this to work, the dialogs were "copied" and renamed. Not nice, I know...
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 30, 2012, 11:16:35 pm
Perhaps this plugin should really have its own dialogs?
IMHO it is because besides the plugin, the codesnippets project also includes a standalone app to edito your snippets. For this to work, the dialogs were "copied" and renamed. Not nice, I know...

Actually I think the dialogs aren't copied, just imported by linking the app with libcodeblocks. Would be better if they were copied.

Anyway, I can do more fixes to CodeSnippets later. For now, just let me know what you think of the new functionality, and whether you think additional tweaks to the layout of the dialogs are needed. (e.g. does the spacing around the find and replace dialogs bother you? An option would be to put the extra space, which is needed for multiline mode to avoid resizing the entire dialog when switching modes, at the bottom when not in that mode)
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on August 31, 2012, 12:03:45 am
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 31, 2012, 12:26:17 am
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)

Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?
Title: Re: Some UI refactoring/tidy up
Post by: oBFusCATed on August 31, 2012, 12:34:01 am
Is there any chance Thread search might be merged into the standard search (only really makes sense for Find in files)?  I find it a little confusing to have the duplicate search buttons, but I like features of both.  (Just a thought.)
I've keybinded the ctrl-shift-f to thread search and I've not use the standard find in files for ages.

Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?
why bother, thread search for the win...
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on August 31, 2012, 01:47:09 am
why bother, thread search for the win...

You've got a point. Ideally though I would like the UI to be more consistent.
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on August 31, 2012, 02:14:13 pm
Yes, I have give some thought to making the search use a worker thread (for find). Are there other features besides that?
I prefer the UI of find, however Thread search has "Delete item" in a right-click menu.  It also shows filenames in a separate column, which is important, because (on a small screen) it is fine for the path column to have a default size it which it is truncated, but I always want to see the full filename.
Thread search supplies the "Find occurrences" context menu item; if there is a merge, I would like for this item to be supplied by Find in files.
Title: Re: Some UI refactoring/tidy up
Post by: oBFusCATed on August 31, 2012, 09:22:12 pm
Thread search supplies the "Find occurrences" context menu item; if there is a merge, I would like for this item to be supplied by Find in files.
Thread search provides on better option View -> Focus Thread search. I've a key bound to it and I'm using it all the time.
In combination with a disabled option of "Delete previous entries before search" this is the best searcher in town.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on September 01, 2012, 12:10:11 am
Here's a separate patch for CodeSnippets [...]
For the record: Having applied both patches I see no negative side effect. It seems to work and looks OK.

If you consider to apply, please also remove the obsolete files in SVN and from all build system (projects files, automake).
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 01, 2012, 02:02:21 pm
Thread search provides on better option View -> Focus Thread search. I've a key bound to it and I'm using it all the time.
In combination with a disabled option of "Delete previous entries before search" this is the best searcher in town.
I agree; Thread search is currently the best large search option in Code::Blocks.  However my personal preference is that the UI for Find in files is nicer.  (Also it feels redundant to have two items that do nearly the same thing; it took me several months when I first started Code::Blocks to figure out the difference between the two :-[.)  If anyone (in this case, it seems it might be you, dmoore) is willing to spend time merging them, I would appreciate it.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 01, 2012, 07:46:04 pm
Here's a separate patch for CodeSnippets [...]
For the record: Having applied both patches I see no negative side effect. It seems to work and looks OK.

If you consider to apply, please also remove the obsolete files in SVN and from all build system (projects files, automake).

Done. On Linux, I built the full workspace from C::B as well as the configure/make jig. I haven't tested on windows.

I have some plans to rearrange the dialog some more. It is much too tall, but not particularly wide.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 02, 2012, 06:54:25 am
Find/Replace Dialog updated in SVN. I think this is a cleaner look and it should work better on smaller screens. Please test and report any issues. Happy to revert this if people don't like it.
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 03, 2012, 01:45:55 am
Find/Replace Dialog updated in SVN. I think this is a cleaner look and it should work better on smaller screens. Please test and report any issues.
It seems to work well so far.  If no projects are open, some of the radio boxes should be disabled:
Code
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp  (revision 8330)
+++ src/sdk/findreplacedlg.cpp  (working copy)
@@ -168,6 +168,18 @@
                 chTarget->AppendString(active_project->GetBuildTarget(j)->GetTitle());
         }
     }
+    if (pa->IsEmpty())
+    {
+        if (rbScope->GetSelection() == 1 || rbScope->GetSelection() == 2)
+        {
+            rbScope->SetSelection(0);
+            XRCCTRL(*this, "pnSearchPath", wxPanel)->Show();
+            XRCCTRL(*this, "pnSearchPath", wxPanel)->Disable();
+            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
+        }
+        rbScope->Enable(1, false);
+        rbScope->Enable(2, false);
+    }
 
     if (findReplaceInFilesOnly)
     {

The "Find" tab and the "Replace" tab fail to be hidden (tested on Windows) by:
Code
    if (findReplaceInFilesOnly)
    {
        // NOTE (jens#1#): Do not delete, just hide the page, to avoid asserts in debug-mode
        XRCCTRL(*this, "nbReplace", wxNotebook)->SetSelection(1);
        (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0))->Hide(); // no active editor, so only replace-in-files
        XRCCTRL(*this, "cmbFind2", wxComboBox)->SetFocus();
    }
(I am not sure how to fix this.)
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 03, 2012, 03:55:34 am
@Alpha: applied the patch and tried resequencing the constructor logic (renaming notebook tabs before hiding them). See if that makes a difference.
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 03, 2012, 07:13:17 am
The page is still visible after your resequencing.

RemovePage() does work, however, that would take much more effort to work properly (and may introduce a memory leak).  (DeletePage() may be the best choice, but a quick test crashed Code::Blocks - methods try to access the deleted objects.)
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 04, 2012, 07:29:14 pm
The page is still visible after your resequencing.

RemovePage() does work, however, that would take much more effort to work properly (and may introduce a memory leak).  (DeletePage() may be the best choice, but a quick test crashed Code::Blocks - methods try to access the deleted objects.)

So I gather this issue predates my recent changes and was actually introduced here (http://svn.berlios.de/wsvn/codeblocks?manualorder=1&op=comp&compare%5B0%5D=%2Ftrunk%2Fsrc%2Fsdk%2Freplacedlg.cpp&compare_rev%5B0%5D=7915&compare%5B1%5D=%2Ftrunk%2Fsrc%2Fsdk%2Freplacedlg.cpp&compare_rev%5B1%5D=7916&comparesubmit=Compare+Paths)
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 04, 2012, 08:00:52 pm
try this:

Code
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp (revision 8351)
+++ src/sdk/findreplacedlg.cpp (working copy)
@@ -194,11 +194,13 @@
         XRCCTRL(*this, "chkFixEOLs2",   wxCheckBox)->Hide();
     }
 
+    m_findPage=0;
     if (findReplaceInFilesOnly)
     {
-        // NOTE (jens#1#): Do not delete, just hide the page, to avoid asserts in debug-mode
+        //Remove, but don't destroy the Find/Replace page until this dialog is destroyed.
         XRCCTRL(*this, "nbReplace", wxNotebook)->SetSelection(1);
-        (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0))->Hide(); // no active editor, so only replace-in-files
+        m_findPage=(XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0)); // no active editor, so only replace-in-files
+        (XRCCTRL(*this, "nbReplace", wxNotebook)->RemovePage(0)); // no active editor, so only replace-in-files
         XRCCTRL(*this, "cmbFind2", wxComboBox)->SetFocus();
     }
     else if (m_findReplaceInFilesActive)
@@ -270,6 +272,11 @@
     cfg->Write(CONF_GROUP _T("/regex2"),      XRCCTRL(*this, "chkRegEx2",     wxCheckBox)->GetValue());
     cfg->Write(CONF_GROUP _T("/scope2"),      XRCCTRL(*this, "rbScope2",      wxRadioBox)->GetSelection());
 
+    if(m_findPage!=0)
+    {
+        m_findPage->Destroy();
+    }
+
     Disconnect(XRCID("nbReplace"), wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler(FindReplaceDlg::OnReplaceChange));
 }
 
Index: src/include/findreplacedlg.h
===================================================================
--- src/include/findreplacedlg.h (revision 8351)
+++ src/include/findreplacedlg.h (working copy)
@@ -62,6 +62,7 @@
         void SaveComboValues(wxComboBox* combo, const wxString& configKey);
         bool m_findReplaceInFilesActive;
         bool m_findMode;
+        wxWindow *m_findPage;
 
         DECLARE_EVENT_TABLE()
 };
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 05, 2012, 01:01:17 am
So I gather this issue predates my recent changes and was actually introduced here (http://svn.berlios.de/wsvn/codeblocks?manualorder=1&op=comp&compare%5B0%5D=%2Ftrunk%2Fsrc%2Fsdk%2Freplacedlg.cpp&compare_rev%5B0%5D=7915&compare%5B1%5D=%2Ftrunk%2Fsrc%2Fsdk%2Freplacedlg.cpp&compare_rev%5B1%5D=7916&comparesubmit=Compare+Paths)
Sorry; I am not sure why I never noticed this before.
try this:
The page disappears correctly, but you may run into trouble with lines like:
Code
bool FindReplaceDlg::IsFindInFiles() const
{
    return (m_findReplaceInFilesActive || XRCCTRL(*this, "nbReplace", wxNotebook)->GetSelection() == 1);
}
and
Code
    //After hiding/showing panels, redo the layout in the notebook pages
    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0))->Layout();
    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(1))->Layout();
because (from what I can tell in the documentation) there now would only exist a single page (GetSelection() would always == 0).


In the find menu, enable regular expressions and search something.  Now open find in files, switch to the find tab, and disable regular expressions.  The direction boxes (incorrectly) remain disabled.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 05, 2012, 02:40:45 am
The page disappears correctly, but you may run into trouble with lines like:
Code
bool FindReplaceDlg::IsFindInFiles() const
{
    return (m_findReplaceInFilesActive || XRCCTRL(*this, "nbReplace", wxNotebook)->GetSelection() == 1);
}
and
Code
    //After hiding/showing panels, redo the layout in the notebook pages
    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(0))->Layout();
    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(1))->Layout();
because (from what I can tell in the documentation) there now would only exist a single page (GetSelection() would always == 0).

In the find menu, enable regular expressions and search something.  Now open find in files, switch to the find tab, and disable regular expressions.  The direction boxes (incorrectly) remain disabled.

OK, there were only a few instances of that so I made the needed changes and committed them.
Title: Re: Some UI refactoring/tidy up
Post by: daniloz on September 06, 2012, 04:29:02 pm
I really like the new Find/Replace windows. Nice work!

I just notice a bug (svn r8362, gcc 4.6.1, win7 64bit):
-> if I press Ctrl-F, which brings up the Find dialog, and start typing (without clinking on "Text to search for" text entry) I don't see what I'm typing, however it get entered somehow.

-> So, if I type "foo", then click on the text entry box and type "bar", I got the message "Not found: foo".

-> On the other hand, if I bring up the dialog again and first click on the text entry box and type "bar", I got the message: "Can't look for an empty search criterion!"

Is it only me?! :-)
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on September 06, 2012, 04:59:02 pm
Is it only me?! :-)
No, confirmed here. It seems the wrong text boxes are toggled on initialisation. You are actually typing either in the replace, or in the multi-line find box.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 06, 2012, 05:03:02 pm
Is it only me?! :-)
No, confirmed here. It seems the wrong text boxes are toggled on initialisation. You are actually typing either in the replace, or in the multi-line find box.

Well this is strange, because I don't have the issue here(!?). Also using win7.
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on September 06, 2012, 05:20:07 pm
Well this is strange, because I don't have the issue here(!?). Also using win7.
I'll do a full re-compile. Maybe its an old resource or alike...
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 06, 2012, 05:23:27 pm
Sorry! I didn't realize I was so many revs behind. I just updated and now confirm. Seems to be a problem after the XRC rename, morten?
Title: Re: Some UI refactoring/tidy up
Post by: MortenMacFly on September 06, 2012, 06:02:29 pm
Seems to be a problem after the XRC rename, morten?
I doubt... Why would that cause such a strange issue?
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 06, 2012, 06:15:13 pm
Seems to be a problem after the XRC rename, morten?
I doubt... Why would that cause such a strange issue?

You're right! nevermind, I found the (stupid) bug and will commit a fix.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 06, 2012, 06:37:15 pm
Ok, I fixed the bug, tested carefully (but only on windows) and committed the fix in rev 8369. Let me know if there are any other issues.
Title: Re: Some UI refactoring/tidy up
Post by: daniloz on September 07, 2012, 08:53:49 am
Ok, I fixed the bug, tested carefully (but only on windows) and committed the fix in rev 8369. Let me know if there are any other issues.
Fix confirmed here as well (win7).

Thanks!!
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 08, 2012, 02:27:29 am
Focus does not shift correctly when switching tabs in wxgtk (due to tab events being generated on mouse down instead of mouse up); the following can address this:
Code
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp (revision 8376)
+++ src/sdk/findreplacedlg.cpp (working copy)
@@ -34,6 +34,9 @@
 BEGIN_EVENT_TABLE(FindReplaceDlg, wxScrollingDialog)
     EVT_ACTIVATE(                        FindReplaceDlg::OnActivate)
     EVT_CHECKBOX(XRCID("chkRegEx1"),     FindReplaceDlg::OnRegEx)
+#ifdef __WXGTK__
+    EVT_IDLE(                            FindReplaceDlg::OnIdle)
+#endif
 
     // Special events for Replace
     EVT_CHECKBOX(XRCID("chkMultiLine1"), FindReplaceDlg::OnMultiChange)
@@ -50,6 +53,9 @@
     : FindReplaceBase(parent, initial, hasSelection),
     m_findReplaceInFilesActive(findReplaceInFilesActive),
     m_findMode(findMode)
+#ifdef __WXGTK__
+    ,m_setFocus(false)
+#endif
 {
     wxXmlResource::Get()->LoadObject(this, parent, _T("dlgFindReplace"),_T("wxScrollingDialog"));
     ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("editor"));
@@ -552,7 +558,9 @@
             m_findReplaceInFilesActive = true;
         }
     }
-
+#ifdef __WXGTK__
+    m_setFocus = true;
+#endif
     Refresh();
     event.Skip();
 }
@@ -672,3 +680,26 @@
     values.Insert(find, 0);
     Manager::Get()->GetConfigManager(_T("editor"))->Write(configKey, values);
 }
+
+#ifdef __WXGTK__
+void FindReplaceDlg::OnIdle(wxIdleEvent& event)
+{
+    if (m_setFocus && !wxGetMouseState().LeftIsDown())
+    {
+        m_setFocus = false;
+        if ( IsMultiLine() )
+        {
+            wxTextCtrl* tcp = ( IsFindInFiles() ? XRCCTRL(*this, "txtMultiLineFind2", wxTextCtrl)
+                                                : XRCCTRL(*this, "txtMultiLineFind1", wxTextCtrl) );
+            if (tcp) tcp->SetFocus();
+        }
+        else
+        {
+            wxComboBox* cbp =  ( IsFindInFiles() ? XRCCTRL(*this, "cmbFind2", wxComboBox)
+                                                 : XRCCTRL(*this, "cmbFind1", wxComboBox) );
+            if (cbp) cbp->SetFocus();
+        }
+    }
+    event.Skip();
+}
+#endif
Index: src/include/findreplacedlg.h
===================================================================
--- src/include/findreplacedlg.h (revision 8376)
+++ src/include/findreplacedlg.h (working copy)
@@ -62,6 +62,10 @@
         void SaveComboValues(wxComboBox* combo, const wxString& configKey);
         bool m_findReplaceInFilesActive;
         bool m_findMode;
+#ifdef __WXGTK__
+        void OnIdle(wxIdleEvent& event);
+        bool m_setFocus;
+#endif
         wxWindow *m_findPage;
 
         DECLARE_EVENT_TABLE()
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 08, 2012, 05:47:14 am
Good find Alpha. How about this slight refinement using a custom instead of idle event? I've dropped the #ifdef __WXGTK__ since I think this should work on either platform (though maybe it makes sense to flag it in case they ever fix the broken behavior). I also dropped the Refresh call, which was in the original code, at the end of the page change handler. Not sure why that would be needed.

Code
Index: include/findreplacedlg.h
===================================================================
--- include/findreplacedlg.h (revision 8376)
+++ include/findreplacedlg.h (working copy)
@@ -56,6 +56,7 @@
         void OnScopeChange(wxCommandEvent& event);
         void OnBrowsePath(wxCommandEvent& event);
         void OnSearchProject(wxCommandEvent& event);
+        void OnDeferredFocus(wxCommandEvent& event);
 
     private:
         void FillComboWithLastValues(wxComboBox* combo, const wxString& configKey);
Index: sdk/findreplacedlg.cpp
===================================================================
--- sdk/findreplacedlg.cpp (revision 8376)
+++ sdk/findreplacedlg.cpp (working copy)
@@ -31,11 +31,17 @@
 
 #define CONF_GROUP _T("/replace_options")
 
+//On wxGTK changing the focus of widgets inside the notebook page change event doesn't work
+//so we create this custom event (and associated handler) to do the focus change after
+//the notebook page change is complete
+DECLARE_EVENT_TYPE(wxDEFERRED_FOCUS_EVENT, -1)
+DEFINE_EVENT_TYPE(wxDEFERRED_FOCUS_EVENT)
+
 BEGIN_EVENT_TABLE(FindReplaceDlg, wxScrollingDialog)
     EVT_ACTIVATE(                        FindReplaceDlg::OnActivate)
     EVT_CHECKBOX(XRCID("chkRegEx1"),     FindReplaceDlg::OnRegEx)
 
-    // Special events for Replace
+    // Special events for Find/Replace
     EVT_CHECKBOX(XRCID("chkMultiLine1"), FindReplaceDlg::OnMultiChange)
     EVT_CHECKBOX(XRCID("chkMultiLine2"), FindReplaceDlg::OnMultiChange)
     EVT_CHECKBOX(XRCID("chkLimitTo1"),   FindReplaceDlg::OnLimitToChange)
@@ -43,6 +49,9 @@
     EVT_RADIOBOX(XRCID("rbScope2"),      FindReplaceDlg::OnScopeChange)
     EVT_BUTTON(  XRCID("btnBrowsePath"), FindReplaceDlg::OnBrowsePath)
     EVT_CHOICE(  XRCID("chProject"),     FindReplaceDlg::OnSearchProject)
+
+    EVT_COMMAND(wxID_ANY, wxDEFERRED_FOCUS_EVENT, FindReplaceDlg::OnDeferredFocus)
+
 END_EVENT_TABLE()
 
 FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool hasSelection,
@@ -532,10 +541,6 @@
             txtFind1->SetValue(txtFind2->GetValue());
             cmbFind1->SetValue(cmbFind2->GetValue());
             cmbReplace1->SetValue(cmbReplace2->GetValue());
-            if ( IsMultiLine() )
-                txtFind1->SetFocus();
-            else
-                cmbFind1->SetFocus();
             m_findReplaceInFilesActive = false;
         }
         else if (event.GetSelection() == 1)
@@ -545,18 +550,30 @@
             cmbFind2->SetValue(cmbFind1->GetValue());
             cmbReplace2->SetValue(cmbReplace1->GetValue());
             cmbFind1->SetFocus();
-            if ( IsMultiLine() )
-                txtFind2->SetFocus();
-            else
-                cmbFind2->SetFocus();
             m_findReplaceInFilesActive = true;
         }
     }
 
-    Refresh();
+    wxCommandEvent e(wxDEFERRED_FOCUS_EVENT,wxID_ANY);
+    AddPendingEvent(e);
     event.Skip();
 }
 
+void FindReplaceDlg::OnDeferredFocus(wxCommandEvent& /*event*/)
+{
+    if ( IsMultiLine() )
+    {
+        wxTextCtrl* tcp = ( IsFindInFiles() ? XRCCTRL(*this, "txtMultiLineFind2", wxTextCtrl)
+                                           : XRCCTRL(*this, "txtMultiLineFind1", wxTextCtrl) );
+        if (tcp) tcp->SetFocus();
+    }
+    else
+    {
+        wxComboBox* cbp =  ( IsFindInFiles() ? XRCCTRL(*this, "cmbFind2", wxComboBox)
+                                             : XRCCTRL(*this, "cmbFind1", wxComboBox) );
+        if (cbp) cbp->SetFocus();
+    }
+}
 void FindReplaceDlg::OnRegEx(wxCommandEvent& /*event*/)
 {
     XRCCTRL(*this, "rbDirection", wxRadioBox)->Enable(!XRCCTRL(*this, "chkRegEx1", wxCheckBox)->GetValue());
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 09, 2012, 12:26:25 am
That looks good to me.

The one other thing I thought of is that scope should not have a find in open files option if no files are open:
Code
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp (revision 8376)
+++ src/sdk/findreplacedlg.cpp (working copy)
@@ -128,28 +128,6 @@
     XRCCTRL(*this, "pnSearchProject", wxPanel)->SetMinSize(szSearchPath);
     XRCCTRL(*this, "pnSearchPath",  wxPanel)->SetMinSize(szSearchPath);
 
-    wxRadioBox* rbScope = XRCCTRL(*this, "rbScope2", wxRadioBox);
-    switch(rbScope->GetSelection())
-    {
-        case 1:
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Hide();
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Disable();
-            XRCCTRL(*this, "pnSearchProject", wxPanel)->Show();
-            break;
-        case 3:
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Show();
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Enable();
-            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
-            break;
-        default:
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Show();
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Disable();
-            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
-            break;
-    }
-    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(1))->Layout();
-
-
     ProjectManager *pm = Manager::Get()->GetProjectManager();
     ProjectsArray *pa = pm->GetProjects();
     cbProject *active_project = Manager::Get()->GetProjectManager()->GetActiveProject();
@@ -170,18 +148,54 @@
         }
     }
 
+    wxRadioBox* rbScope = XRCCTRL(*this, "rbScope2", wxRadioBox);
+    EditorManager* edMgr = Manager::Get()->GetEditorManager();
+    bool filesOpen = false;
+    for (int i = 0; i < edMgr->GetEditorsCount(); ++i)
+    {
+        if (edMgr->GetBuiltinEditor(i))
+        {
+            filesOpen = true;
+            break;
+        }
+    }
+    if (!filesOpen)
+    {
+        if (rbScope->GetSelection() == 0)
+            rbScope->SetSelection(1);
+        rbScope->Enable(0, false);
+    }
     if (pa->IsEmpty())
     {
         if (rbScope->GetSelection() == 1 || rbScope->GetSelection() == 2)
         {
-            rbScope->SetSelection(0);
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Show();
-            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Disable();
-            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
+            if (rbScope->IsItemEnabled(0))
+                rbScope->SetSelection(0);
+            else
+                rbScope->SetSelection(3);
         }
         rbScope->Enable(1, false);
         rbScope->Enable(2, false);
     }
+    switch(rbScope->GetSelection())
+    {
+        case 1:
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Hide();
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Disable();
+            XRCCTRL(*this, "pnSearchProject", wxPanel)->Show();
+            break;
+        case 3:
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Show();
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Enable();
+            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
+            break;
+        default:
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Show();
+            XRCCTRL(*this, "pnSearchPath",    wxPanel)->Disable();
+            XRCCTRL(*this, "pnSearchProject", wxPanel)->Hide();
+            break;
+    }
+    (XRCCTRL(*this, "nbReplace", wxNotebook)->GetPage(1))->Layout();
 
     if(findMode)
     {

Good find Alpha.
I presume no pun intended ;).
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 09, 2012, 02:02:54 am
and a nice replacement too ;)

I'll test both of these patches on windows before I commit them.
Title: Re: Some UI refactoring/tidy up
Post by: dmoore on September 11, 2012, 07:47:13 pm
Tested and committed these fixes yesterday. Alpha: I forgot to give you credit in the log message. My apologies.
Title: Re: Some UI refactoring/tidy up
Post by: Alpha on September 12, 2012, 12:36:04 am
Alpha: I forgot to give you credit in the log message. My apologies.
No worries.  (Anyways, you technically wrote at least half of it...)