changeset 1043:f0de096bfb5f

implement FltkResource::isEnabled()
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Wed, 22 Apr 2009 10:09:01 +0200
parents 32daa61ad511
children 9553380fa470
files dw/fltkui.cc dw/fltkui.hh
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkui.cc	Wed Apr 22 09:57:23 2009 +0200
+++ b/dw/fltkui.cc	Wed Apr 22 10:09:01 2009 +0200
@@ -62,6 +62,8 @@
    allocation.descent = 0;
 
    style = NULL;
+
+   enabled = true;
 }
 
 /**
@@ -105,6 +107,8 @@
       viewsAndWidgets->append (viewAndWidget);
       if (style)
          setWidgetStyle (viewAndWidget->widget, style);
+      if (! enabled)
+         viewAndWidget->widget->deactivate ();
    }
 }
 
@@ -229,12 +233,13 @@
 
 bool FltkResource::isEnabled ()
 {
-   /** \bug Not implemented. */
-   return true;
+   return enabled;
 }
 
 void FltkResource::setEnabled (bool enabled)
 {
+   this->enabled = enabled;
+
    for (Iterator <ViewAndWidget> it = viewsAndWidgets->iterator ();
         it.hasNext(); ) {
       ViewAndWidget *viewAndWidget = it.getNext ();
--- a/dw/fltkui.hh	Wed Apr 22 09:57:23 2009 +0200
+++ b/dw/fltkui.hh	Wed Apr 22 10:09:01 2009 +0200
@@ -176,6 +176,9 @@
  */
 class FltkResource: public object::Object
 {
+private:
+   bool enabled;
+
 protected:
    class ViewAndWidget: public object::Object
    {