ide: Find/replace cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@10955 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-03-19 12:01:57 +00:00
parent a39ed09ac7
commit ef60a3ef31
2 changed files with 23 additions and 24 deletions

View file

@ -1,29 +1,27 @@
LAYOUT(IDEFindReplaceLayout, 776, 52)
ITEM(Label, info, SetLabel(t_("&Find")).LeftPosZ(4, 60).TopPosZ(4, 19))
ITEM(WithDropChoice<EditString>, find, LeftPosZ(56, 124).TopPosZ(4, 19))
ITEM(Button, prev, LeftPosZ(180, 20).TopPosZ(4, 19))
ITEM(Button, next, LeftPosZ(200, 20).TopPosZ(4, 19))
ITEM(Option, wholeword, SetLabel(t_("&Whole word")).LeftPosZ(276, 88).TopPosZ(4, 19))
ITEM(Option, wildcards, SetLabel(t_("Wild&cards")).LeftPosZ(368, 72).TopPosZ(4, 19))
ITEM(Option, ignorecase, SetLabel(t_("&Ignore case")).LeftPosZ(444, 80).TopPosZ(4, 19))
ITEM(Option, regexp, SetLabel(t_("RegExp")).LeftPosZ(528, 80).TopPosZ(4, 19))
ITEM(Option, incremental, SetLabel(t_("Incremental")).LeftPosZ(588, 92).TopPosZ(4, 19))
ITEM(Option, incremental_from_cursor, SetLabel(t_("From cursor")).LeftPosZ(668, 92).TopPosZ(4, 19))
LAYOUT(IDEFindReplaceLayout, 724, 52)
ITEM(WithDropChoice<EditString>, find, LeftPosZ(4, 124).TopPosZ(4, 19))
ITEM(Button, prev, LeftPosZ(128, 20).TopPosZ(4, 19))
ITEM(Button, next, LeftPosZ(148, 20).TopPosZ(4, 19))
ITEM(Option, wholeword, SetLabel(t_("&Whole word")).LeftPosZ(224, 88).TopPosZ(4, 19))
ITEM(Option, wildcards, SetLabel(t_("Wild&cards")).LeftPosZ(316, 72).TopPosZ(4, 19))
ITEM(Option, ignorecase, SetLabel(t_("&Ignore case")).LeftPosZ(392, 80).TopPosZ(4, 19))
ITEM(Option, regexp, SetLabel(t_("RegExp")).LeftPosZ(476, 80).TopPosZ(4, 19))
ITEM(Option, incremental, SetLabel(t_("Incremental")).LeftPosZ(536, 92).TopPosZ(4, 19))
ITEM(Option, incremental_from_cursor, SetLabel(t_("From cursor")).LeftPosZ(620, 92).TopPosZ(4, 19))
ITEM(Button, close, RightPosZ(4, 20).TopPosZ(4, 19))
ITEM(Label, replace_txt, SetLabel(t_("&Replace")).LeftPosZ(4, 60).TopPosZ(28, 21))
ITEM(WithDropChoice<EditString>, replace, LeftPosZ(56, 124).TopPosZ(28, 19))
ITEM(Button, amend, LeftPosZ(180, 20).TopPosZ(28, 19))
ITEM(Button, amend_all, SetLabel(t_("All")).LeftPosZ(208, 44).TopPosZ(28, 19))
ITEM(Button, find_all, SetLabel(t_("All")).LeftPosZ(220, 44).TopPosZ(4, 19))
ITEM(Button, amend_rest, SetLabel(t_("Rest")).LeftPosZ(256, 52).TopPosZ(28, 19))
ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(396, 108).TopPosZ(28, 19))
ITEM(WithDropChoice<EditString>, replace, LeftPosZ(4, 124).TopPosZ(28, 19))
ITEM(Button, amend, LeftPosZ(128, 20).TopPosZ(28, 19))
ITEM(Button, amend_all, SetLabel(t_("All")).LeftPosZ(152, 44).TopPosZ(28, 19))
ITEM(Button, find_all, SetLabel(t_("All")).LeftPosZ(172, 44).TopPosZ(4, 19))
ITEM(Button, amend_rest, SetLabel(t_("Rest")).LeftPosZ(200, 52).TopPosZ(28, 19))
ITEM(Option, samecase, SetLabel(t_("Mimic case")).LeftPosZ(256, 108).TopPosZ(28, 19))
ITEM(Switch, mode, SetLabel(t_("Replace\nRemove lines without pattern\nRemove line with pattern")).LeftPosZ(0, 408).TopPosZ(64, 16))
ITEM(Label, find_lbl, SetLabel(t_("Find")).LeftPosZ(0, 48).TopPosZ(84, 19))
ITEM(Label, replace_lbl, SetLabel(t_("Replace")).LeftPosZ(52, 48).TopPosZ(84, 19))
END_LAYOUT
LAYOUT(BlockReplaceLayout, 408, 136)
ITEM(Label, info, SetLabel(t_("Find")).LeftPosZ(8, 46).TopPosZ(4, 19))
ITEM(WithDropChoice<EditString>, find, HSizePosZ(56, 8).TopPosZ(4, 19))
ITEM(Label, replace_txt, SetLabel(t_("Replace")).LeftPosZ(8, 46).TopPosZ(48, 19))
ITEM(WithDropChoice<EditString>, replace, HSizePosZ(56, 8).TopPosZ(48, 19))
ITEM(Option, wholeword, SetLabel(t_("&Whole word")).LeftPosZ(8, 84).BottomPosZ(40, 20))
ITEM(Option, wildcards, SetLabel(t_("Wild&cards")).LeftPosZ(96, 72).BottomPosZ(40, 20))
@ -33,5 +31,7 @@ LAYOUT(BlockReplaceLayout, 408, 136)
ITEM(Button, next, SetLabel(t_("Replace")).RightPosZ(80, 76).BottomPosZ(8, 24))
ITEM(Button, close, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(8, 24))
ITEM(Switch, mode, SetLabel(t_("Replace\nRemove lines without pattern\nRemove line with pattern")).LeftPosZ(8, 396).TopPosZ(28, 16))
ITEM(Label, find_lbl, SetLabel(t_("Find")).LeftPosZ(8, 48).TopPosZ(4, 19))
ITEM(Label, replace_lbl, SetLabel(t_("Replace")).LeftPosZ(8, 48).TopPosZ(48, 19))
END_LAYOUT

View file

@ -38,6 +38,9 @@ FindReplaceDlg::FindReplaceDlg()
mode <<= THISBACK(Sync);
mode.Hide();
Sync();
find.NullText("Find");
replace.NullText("Replace");
}
void FindReplaceDlg::Sync()
@ -51,7 +54,6 @@ void FindReplaceDlg::Sync()
incremental_from_cursor.Enable(IsIncremental());
b = !mode.IsVisible() || ~mode == 0;
replace.Enable(b);
replace_txt.Enable(b);
}
dword CodeEditor::find_next_key = K_F3;
@ -101,7 +103,6 @@ void FindReplaceDlg::Setup(bool doreplace)
prev.Tip("Find prev (" + GetKeyDesc(CodeEditor::find_prev_key) + ")");
amend.Tip("Replace (" + GetKeyDesc(CodeEditor::replace_key) + ")");
amend.Disable();
info.SetLabel("&Find");
replacing = doreplace;
replace.Show(replacing);
amend.Show(replacing);
@ -362,13 +363,11 @@ void CodeEditor::FindReplaceAddHistory()
void CodeEditor::NoFindError()
{
findreplace.find.Error(false);
findreplace.info.SetLabel("&Find");
}
void CodeEditor::NotFound()
{
findreplace.find.Error();
findreplace.info.SetLabel("Not &found");
if(!findreplace.IsIncremental())
SetFocus();
findreplace.amend.Disable();