else if(click_focus)
return click_focus;
else
- return get_child_at(x, y);
+ {
+ Widget *child = get_child_at(x, y);
+ if(child && child->is_enabled())
+ return child;
+ else
+ return 0;
+ }
}
void Container::pointer_leave()
signal_request_focus.emit();
}
+void Widget::set_enabled(bool e)
+{
+ set_state(DISABLED, (e ? NORMAL : DISABLED));
+}
+
void Widget::set_state(State mask, State bits)
{
state = (state&~mask)|bits;
void set_focusable(bool);
bool is_focusable() const { return focusable; }
void set_focus();
+ void set_enabled(bool);
+ bool is_enabled() const { return !(state&DISABLED); }
protected:
void set_state(State s) { set_state(s, s); }