Author Topic: FindDialog improvement  (Read 4904 times)

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
FindDialog improvement
« on: July 23, 2006, 06:21:40 pm »
In "Find in files" dialog, if the choosen scope is "Search path", you can give additional informations the box below.
When the scope is different, that options are not used, so they should be disabled (grayed out).
This is only partially done: "Recurse sub directories" and "Hidden files" are not disabled.
I checked in the "find" code and they are really not used for other scopes.
There are 2 options: disable them or disable all the box.
I think it is better to disable all the box, but it does not have a name, and I don't know if this is possible with wxWidgets (I use Qt).

Anyway the simple way (disable them manually) is here:
Original
Code
void FindDlg::UpdateUI()
{
    bool on = XRCCTRL(*this, "rbScope2", wxRadioBox)->GetSelection() == 2; // find in search path
    XRCCTRL(*this, "txtSearchPath", wxTextCtrl)->Enable(on);
    XRCCTRL(*this, "txtSearchMask", wxTextCtrl)->Enable(on);
    XRCCTRL(*this, "btnBrowsePath", wxButton)->Enable(on);
}
New (just added 2 lines)
Code
void FindDlg::UpdateUI()
{
    bool on = XRCCTRL(*this, "rbScope2", wxRadioBox)->GetSelection() == 2; // find in search path
    XRCCTRL(*this, "txtSearchPath", wxTextCtrl)->Enable(on);
    XRCCTRL(*this, "txtSearchMask", wxTextCtrl)->Enable(on);
    XRCCTRL(*this, "btnBrowsePath", wxButton)->Enable(on);
    XRCCTRL(*this, "chkSearchRecursively", wxCheckBox)->Enable(on);
    XRCCTRL(*this, "chkSearchHidden", wxCheckBox)->Enable(on);
}

P:S.: I did not try to compile it!
« Last Edit: July 26, 2006, 08:07:03 pm by iw2nhl »

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: FindDialog improvement
« Reply #1 on: July 26, 2006, 08:03:03 pm »
Ok, I compiled it and it works perfectly!

I need only to know if there is a way to disable all the box, else this patch should be the right one.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: FindDialog improvement
« Reply #2 on: July 26, 2006, 08:06:55 pm »
cool, will apply it tomorrow, not sure about the box myself, if it can be disabled, also my wx knowledge still has severe limitations :-(

[EDIT] : applied
« Last Edit: July 26, 2006, 08:13:15 pm by killerbot »