mirror of https://github.com/buggins/dlangui.git
editors find panel - part 3
This commit is contained in:
parent
489884c752
commit
8d5c118922
|
@ -266,6 +266,26 @@ class ImageButton : ImageWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// button with image working as trigger: check / uncheck occurs when pressing
|
||||
class ImageCheckButton : ImageButton {
|
||||
/// constructor by id and icon resource id
|
||||
this(string ID = null, string drawableId = null) {
|
||||
super(ID, drawableId);
|
||||
styleId = "BUTTON_CHECK_TRANSPARENT";
|
||||
}
|
||||
/// constructor from action
|
||||
this(const Action a) {
|
||||
super(a);
|
||||
styleId = "BUTTON_CHECK_TRANSPARENT";
|
||||
}
|
||||
|
||||
// called to process click and notify listeners
|
||||
override protected bool handleClick() {
|
||||
checked = !checked;
|
||||
return super.handleClick();
|
||||
}
|
||||
}
|
||||
|
||||
/// button with image and text
|
||||
class ImageTextButton : HorizontalLayout {
|
||||
protected ImageWidget _icon;
|
||||
|
@ -1080,4 +1100,4 @@ class CanvasWidget : Widget {
|
|||
}
|
||||
|
||||
import dlangui.widgets.metadata;
|
||||
mixin(registerWidgets!(Widget, TextWidget, MultilineTextWidget, Button, ImageWidget, ImageButton, ImageTextButton, RadioButton, CheckBox, ScrollBar, HSpacer, VSpacer, CanvasWidget)());
|
||||
mixin(registerWidgets!(Widget, TextWidget, MultilineTextWidget, Button, ImageWidget, ImageButton, ImageCheckButton, ImageTextButton, RadioButton, CheckBox, ScrollBar, HSpacer, VSpacer, CanvasWidget)());
|
||||
|
|
|
@ -2852,8 +2852,8 @@ class LogWidget : EditBox {
|
|||
class FindPanel : HorizontalLayout {
|
||||
protected EditLine _edFind;
|
||||
protected EditLine _edReplace;
|
||||
protected CheckBox _cbCaseInsensitive;
|
||||
protected CheckBox _cbWholeWords;
|
||||
protected ImageCheckButton _cbCaseSensitive;
|
||||
protected ImageCheckButton _cbWholeWords;
|
||||
protected CheckBox _cbSelection;
|
||||
protected Button _btnFindNext;
|
||||
protected Button _btnFindPrev;
|
||||
|
@ -2869,22 +2869,22 @@ class FindPanel : HorizontalLayout {
|
|||
layoutWidth: fill
|
||||
HorizontalLayout {
|
||||
layoutWidth: fill
|
||||
EditLine { id: edFind; layoutWidth: fill }
|
||||
EditLine { id: edFind; layoutWidth: fill; alignment: vcenter }
|
||||
Button { id: btnFindNext; text: EDIT_FIND_NEXT }
|
||||
Button { id: btnFindPrev; text: EDIT_FIND_PREV }
|
||||
}
|
||||
HorizontalLayout {
|
||||
id: replace
|
||||
layoutWidth: fill;
|
||||
EditLine { id: edReplace; layoutWidth: fill }
|
||||
EditLine { id: edReplace; layoutWidth: fill; alignment: vcenter }
|
||||
Button { id: btnReplace; text: EDIT_REPLACE_NEXT }
|
||||
Button { id: btnReplaceAll; text: EDIT_REPLACE_ALL }
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
HorizontalLayout {
|
||||
CheckBox { id: cbCaseInsensitive; text: "Aa" }
|
||||
CheckBox { id: cbWholeWords; text: "Words" }
|
||||
ImageCheckButton { id: cbCaseSensitive; drawableId: "find_case_sensitive"; tooltipText: EDIT_FIND_CASE_SENSITIVE; styleId: TOOLBAR_BUTTON; alignment: vcenter }
|
||||
ImageCheckButton { id: cbWholeWords; drawableId: "find_whole_words"; tooltipText: EDIT_FIND_WHOLE_WORDS; styleId: TOOLBAR_BUTTON; alignment: vcenter }
|
||||
CheckBox { id: cbSelection; text: "Sel" }
|
||||
}
|
||||
VSpacer {}
|
||||
|
@ -2904,8 +2904,8 @@ class FindPanel : HorizontalLayout {
|
|||
_btnFindPrev = childById!Button("btnFindPrev");
|
||||
_btnReplace = childById!Button("btnReplace");
|
||||
_btnReplaceAll = childById!Button("btnReplaceAll");
|
||||
_cbCaseInsensitive = childById!CheckBox("cbCaseInsinsitive");
|
||||
_cbWholeWords = childById!CheckBox("cbWholeWords");
|
||||
_cbCaseSensitive = childById!ImageCheckButton("cbCaseSensitive");
|
||||
_cbWholeWords = childById!ImageCheckButton("cbWholeWords");
|
||||
_cbSelection = childById!CheckBox("cbSelection");
|
||||
if (!replace)
|
||||
childById("replace").visibility = Visibility.Gone;
|
||||
|
|
|
@ -1530,6 +1530,10 @@ public:
|
|||
text = UIString(value);
|
||||
return true;
|
||||
}
|
||||
if (name.equal("tooltipText")) {
|
||||
tooltipText = UIString(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1539,6 +1543,10 @@ public:
|
|||
text = UIString(value);
|
||||
return true;
|
||||
}
|
||||
if (name.equal("tooltipText")) {
|
||||
tooltipText = UIString(value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1548,6 +1556,10 @@ public:
|
|||
text = value;
|
||||
return true;
|
||||
}
|
||||
if (name.equal("tooltipText")) {
|
||||
tooltipText = value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:drawable="@null"
|
||||
android:state_enabled="false"/>
|
||||
<item
|
||||
android:drawable="btn_pressed"
|
||||
android:state_checked="true"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="@null"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="btn_pressed"
|
||||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="btn_pressed"
|
||||
android:state_checked="true" />
|
||||
<item
|
||||
android:drawable="btn_hover"
|
||||
android:state_hovered="true" android:state_enabled="true" />
|
||||
<item
|
||||
android:drawable="@null" />
|
||||
</selector>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:drawable="@null"
|
||||
android:state_enabled="false"/>
|
||||
<item
|
||||
android:drawable="btn_pressed_dark"
|
||||
android:state_checked="true"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="@null"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="btn_pressed_dark"
|
||||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="btn_pressed_dark"
|
||||
android:state_checked="true" />
|
||||
<item
|
||||
android:drawable="btn_hover_dark"
|
||||
android:state_hovered="true" android:state_enabled="true" />
|
||||
<item
|
||||
android:drawable="@null" />
|
||||
</selector>
|
|
@ -31,3 +31,7 @@ EDIT_FIND_NEXT=Find next
|
|||
EDIT_FIND_PREV=Find prev
|
||||
EDIT_REPLACE_NEXT=Replace
|
||||
EDIT_REPLACE_ALL=Replace all
|
||||
EDIT_FIND_CASE_SENSITIVE=Case sensitive
|
||||
EDIT_FIND_WHOLE_WORDS=Whole words
|
||||
EDIT_FIND_SELECTION_ONLY=Selection only
|
||||
|
||||
|
|
|
@ -25,3 +25,6 @@ EDIT_FIND_NEXT=Найти след
|
|||
EDIT_FIND_PREV=Найти пред
|
||||
EDIT_REPLACE_NEXT=Заменить
|
||||
EDIT_REPLACE_ALL=Заменить все
|
||||
EDIT_FIND_CASE_SENSITIVE=С учетом регистра
|
||||
EDIT_FIND_WHOLE_WORDS=Только слова целиком
|
||||
EDIT_FIND_SELECTION_ONLY=Только в выделенном
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 257 B |
Binary file not shown.
After Width: | Height: | Size: 258 B |
|
@ -37,6 +37,10 @@
|
|||
<style id="BUTTON_TRANSPARENT"
|
||||
backgroundImageId="btn_background_transparent_dark"
|
||||
/>
|
||||
<style id="BUTTON_CHECK_TRANSPARENT"
|
||||
backgroundImageId="btn_background_check_transparent_dark"
|
||||
align="Center"
|
||||
/>
|
||||
<style id="BUTTON_LABEL"
|
||||
layoutWidth="FILL_PARENT"
|
||||
focusRectColors="#FFF"
|
||||
|
|
|
@ -43,6 +43,10 @@
|
|||
backgroundImageId="btn_background_transparent"
|
||||
align="Center"
|
||||
/>
|
||||
<style id="BUTTON_CHECK_TRANSPARENT"
|
||||
backgroundImageId="btn_background_check_transparent"
|
||||
align="Center"
|
||||
/>
|
||||
<style id="BUTTON_LABEL"
|
||||
layoutWidth="FILL_PARENT"
|
||||
margins="2,2,2,2"
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
<item
|
||||
android:drawable="toolbar_button_pressed"
|
||||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_pressed"
|
||||
android:state_checked="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_hover"
|
||||
android:state_hovered="true" />
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
<item
|
||||
android:drawable="toolbar_button_pressed_dark"
|
||||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_pressed_dark"
|
||||
android:state_checked="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_hover_dark"
|
||||
android:state_hovered="true" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
res/btn_background.xml
|
||||
res/btn_background_check_transparent.xml
|
||||
res/btn_background_check_transparent_dark.xml
|
||||
res/btn_background_dark.xml
|
||||
res/btn_background_transparent.xml
|
||||
res/btn_background_transparent_dark.xml
|
||||
|
@ -158,6 +160,8 @@ res/mdpi/editbox_background_focus.9.png
|
|||
res/mdpi/editbox_background_focus_dark.9.png
|
||||
res/mdpi/editbox_background_normal.9.png
|
||||
res/mdpi/editbox_background_normal_dark.9.png
|
||||
res/mdpi/find_case_sensitive.png
|
||||
res/mdpi/find_whole_words.png
|
||||
res/mdpi/folder-blue.png
|
||||
res/mdpi/folder-bookmark.png
|
||||
res/mdpi/folder-network.png
|
||||
|
|
Loading…
Reference in New Issue