mirror of https://github.com/buggins/dlangui.git
allow clearing all signal handlers; allow clearing all menu item subitems
This commit is contained in:
parent
81b5175572
commit
b942bdd35f
|
@ -164,6 +164,10 @@ struct Listener(RETURN_T, T1...)
|
|||
final slot_t get() {
|
||||
return _listener;
|
||||
}
|
||||
/// disconnect all listeners
|
||||
final void clear() {
|
||||
_listener = null;
|
||||
}
|
||||
alias get this;
|
||||
}
|
||||
|
||||
|
@ -235,6 +239,10 @@ struct Signal(T1) if (is(T1 == interface) && __traits(allMembers, T1).length ==
|
|||
final void disconnect(T1 listener) {
|
||||
disconnect(&__traits(getMember, listener, __traits(allMembers, T1)[0]));
|
||||
}
|
||||
/// disconnect all listeners
|
||||
final void clear() {
|
||||
_listeners.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// Multiple listeners; implicitly specified return and parameter types
|
||||
|
@ -287,4 +295,8 @@ struct Signal(RETURN_T, T1...)
|
|||
final void disconnect(slot_t listener) {
|
||||
_listeners -= listener;
|
||||
}
|
||||
/// disconnect all listeners
|
||||
final void clear() {
|
||||
_listeners.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,6 +232,12 @@ class MenuItem {
|
|||
}
|
||||
return res;
|
||||
}
|
||||
/// removes all subitems
|
||||
void clear() {
|
||||
foreach(ref item; _subitems)
|
||||
item = null;
|
||||
_subitems.length = 0;
|
||||
}
|
||||
/// returns text description for first accelerator of action; null if no accelerators
|
||||
@property dstring acceleratorText() {
|
||||
if (!_action)
|
||||
|
|
|
@ -1 +1 @@
|
|||
v0.9.145
|
||||
v0.9.146
|
Loading…
Reference in New Issue