News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

FindDialog improvement

Started by iw2nhl, July 23, 2006, 06:21:40 PM

Previous topic - Next topic

iw2nhl

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
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)
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!

iw2nhl

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.

killerbot

#2
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