mirror of https://github.com/buggins/dlangui.git
improvements for dlangui
This commit is contained in:
parent
90cf7253ca
commit
7e4f4ff019
|
@ -30,7 +30,9 @@ enum StandardAction : int {
|
||||||
Ignore,
|
Ignore,
|
||||||
Open,
|
Open,
|
||||||
Save,
|
Save,
|
||||||
|
SaveAll,
|
||||||
DiscardChanges,
|
DiscardChanges,
|
||||||
|
DiscardAll,
|
||||||
OpenUrl,
|
OpenUrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +46,8 @@ const Action ACTION_RETRY = new Action(StandardAction.Retry, "ACTION_RETRY"c);
|
||||||
const Action ACTION_IGNORE = new Action(StandardAction.Ignore, "ACTION_IGNORE"c);
|
const Action ACTION_IGNORE = new Action(StandardAction.Ignore, "ACTION_IGNORE"c);
|
||||||
const Action ACTION_OPEN = new Action(StandardAction.Open, "ACTION_OPEN"c);
|
const Action ACTION_OPEN = new Action(StandardAction.Open, "ACTION_OPEN"c);
|
||||||
const Action ACTION_SAVE = new Action(StandardAction.Save, "ACTION_SAVE"c);
|
const Action ACTION_SAVE = new Action(StandardAction.Save, "ACTION_SAVE"c);
|
||||||
|
const Action ACTION_SAVE_ALL = new Action(StandardAction.SaveAll, "ACTION_SAVE_ALL"c);
|
||||||
const Action ACTION_DISCARD_CHANGES = new Action(StandardAction.DiscardChanges, "ACTION_DISCARD_CHANGES"c);
|
const Action ACTION_DISCARD_CHANGES = new Action(StandardAction.DiscardChanges, "ACTION_DISCARD_CHANGES"c);
|
||||||
|
const Action ACTION_DISCARD_ALL = new Action(StandardAction.DiscardAll, "ACTION_DISCARD_ALL"c);
|
||||||
const Action ACTION_OPEN_URL = (new Action(StandardAction.OpenUrl)).iconId("applications-internet");
|
const Action ACTION_OPEN_URL = (new Action(StandardAction.OpenUrl)).iconId("applications-internet");
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Dialog : VerticalLayout {
|
||||||
/**
|
/**
|
||||||
Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
|
Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
|
||||||
*/
|
*/
|
||||||
void measure(int parentWidth, int parentHeight) {
|
override void measure(int parentWidth, int parentHeight) {
|
||||||
super.measure(parentWidth, parentHeight);
|
super.measure(parentWidth, parentHeight);
|
||||||
if ((_flags & DialogFlag.Resizable) && (_flags & DialogFlag.Popup)) {
|
if ((_flags & DialogFlag.Resizable) && (_flags & DialogFlag.Popup)) {
|
||||||
Point sz = Point(_parentWindow.width * 4 / 5, _parentWindow.height * 4 / 5);
|
Point sz = Point(_parentWindow.width * 4 / 5, _parentWindow.height * 4 / 5);
|
||||||
|
|
|
@ -686,6 +686,12 @@ class TabWidget : VerticalLayout, TabHandler, TabCloseHandler {
|
||||||
return _tabHost.tabBody(id);
|
return _tabHost.tabBody(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// get tab content widget by id
|
||||||
|
Widget tabBody(int index) {
|
||||||
|
string id = _tabControl.tab(index).id;
|
||||||
|
return _tabHost.tabBody(id);
|
||||||
|
}
|
||||||
|
|
||||||
/// returns tab item by id (null if index out of range)
|
/// returns tab item by id (null if index out of range)
|
||||||
TabItem tab(int index) {
|
TabItem tab(int index) {
|
||||||
return _tabControl.tab(index);
|
return _tabControl.tab(index);
|
||||||
|
@ -694,6 +700,10 @@ class TabWidget : VerticalLayout, TabHandler, TabCloseHandler {
|
||||||
TabItem tab(string id) {
|
TabItem tab(string id) {
|
||||||
return _tabControl.tab(id);
|
return _tabControl.tab(id);
|
||||||
}
|
}
|
||||||
|
/// returns tab count
|
||||||
|
@property int tabCount() const {
|
||||||
|
return _tabControl.tabCount;
|
||||||
|
}
|
||||||
/// get tab index by tab id (-1 if not found)
|
/// get tab index by tab id (-1 if not found)
|
||||||
int tabIndex(string id) {
|
int tabIndex(string id) {
|
||||||
return _tabControl.tabIndex(id);
|
return _tabControl.tabIndex(id);
|
||||||
|
|
|
@ -10,4 +10,6 @@ ACTION_RETRY=Retry
|
||||||
ACTION_IGNORE=Ignore
|
ACTION_IGNORE=Ignore
|
||||||
ACTION_OPEN=Open
|
ACTION_OPEN=Open
|
||||||
ACTION_SAVE=Save
|
ACTION_SAVE=Save
|
||||||
ACTION_DISCARD_CHANGES=Discard changes
|
ACTION_SAVE_ALL=Save All
|
||||||
|
ACTION_DISCARD_CHANGES=Discard
|
||||||
|
ACTION_DISCARD_ALL=Discard all
|
||||||
|
|
Loading…
Reference in New Issue