Author: matt
Date: 2011-05-30 14:19:43 -0700 (Mon, 30 May 2011)
New Revision: 8770
Log:
123: wrapping more classes.

Modified:
   branches/branch-3.0/FL/Fl_Button.H
   branches/branch-3.0/FL/Fl_Check_Button.H
   branches/branch-3.0/FL/Fl_Light_Button.H
   branches/branch-3.0/FL/Fl_Valuator.H
   branches/branch-3.0/fltk3/Button.h
   branches/branch-3.0/fltk3/LightButton.h
   branches/branch-3.0/test/demo.cxx

Modified: branches/branch-3.0/FL/Fl_Button.H
===================================================================
--- branches/branch-3.0/FL/Fl_Button.H  2011-05-30 19:09:38 UTC (rev 8769)
+++ branches/branch-3.0/FL/Fl_Button.H  2011-05-30 21:19:43 UTC (rev 8770)
@@ -36,21 +36,18 @@
 #define FL_RADIO_BUTTON                (FL_RESERVED_TYPE+2)
 #define FL_HIDDEN_BUTTON       3
 
-#if 0 // FIXME: 123
-extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
+// FIXME: 123 extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
 
 class Fl_Widget_Tracker;
-#endif
 
+
 class FL_EXPORT Fl_Button : public Fl_Widget {
 
 protected:
   
-#if 0 // FIXME: 123
-  static void key_release_timeout(void*);
-  void simulate_key_action();
-  virtual void draw();
-#endif
+  void simulate_key_action() {
+    ((fltk3::Button*)_p)->simulate_key_action();
+  }
   
 public:
 
@@ -61,6 +58,16 @@
     _p->wrapper(this);
   }
 
+  FLTK3_WRAPPER_VCALLS_OBJECT(Button, resize(int x, int y, int w, int h), 
resize(x, y, w, h), Resize)
+  
+  FLTK3_WRAPPER_VCALLS_OBJECT(Button, hide(), hide(), Hide)
+  
+  FLTK3_WRAPPER_VCALLS_OBJECT(Button, show(), show(), Show)
+  
+  FLTK3_WRAPPER_VCALLS_OBJECT(Button, draw(), draw(), Draw)
+  
+  FLTK3_WRAPPER_VCALLS_OBJECT_INT(Button, handle(int event), handle(event), 
Handle)
+
   int value(int v) {
     return ((fltk3::Button*)_p)->value(v);
   }
@@ -81,17 +88,34 @@
     ((fltk3::Button*)_p)->setonly();
   }
   
-#if 0 // FIXME: 123
-  virtual int handle(int);
-  int shortcut() const {return shortcut_;}
-  void shortcut(int s) {shortcut_ = s;}
-  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
-  void down_box(Fl_Boxtype b) {down_box_ = b;}
-  void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
-  Fl_Color down_color() const {return selection_color();}
-  void down_color(unsigned c) {selection_color(c);}
-#endif
+  int shortcut() const {
+    return ((fltk3::Button*)_p)->shortcut();
+  }
   
+  void shortcut(int s) {
+    ((fltk3::Button*)_p)->shortcut(s);
+  }
+  
+  Fl_Boxtype down_box() const {
+    return fltk3::_3to1_boxtype( ((fltk3::Button*)_p)->down_box() );
+  }
+  
+  void down_box(Fl_Boxtype b) {
+    ((fltk3::Button*)_p)->down_box(fltk3::_1to3_boxtype(b) );
+  }
+  
+  void shortcut(const char *s) {
+    ((fltk3::Button*)_p)->shortcut(s);
+  }
+  
+  Fl_Color down_color() const {
+    return fltk3::_3to1_color( ((fltk3::Button*)_p)->down_color() );
+  }
+  
+  void down_color(unsigned c) {
+    ((fltk3::Button*)_p)->down_color( fltk3::_1to3_color(c) );
+  }
+  
 };
 
 #endif

Modified: branches/branch-3.0/FL/Fl_Check_Button.H
===================================================================
--- branches/branch-3.0/FL/Fl_Check_Button.H    2011-05-30 19:09:38 UTC (rev 
8769)
+++ branches/branch-3.0/FL/Fl_Check_Button.H    2011-05-30 21:19:43 UTC (rev 
8770)
@@ -1,4 +1,3 @@
-#error header has not been ported to 3.0 yet
 //
 // "$Id$"
 //
@@ -26,32 +25,23 @@
 //     http://www.fltk.org/str.php
 //
 
-/* \file
-   Fl_Check_Button widget . */
-
 #ifndef Fl_Check_Button_H
 #define Fl_Check_Button_H
 
+#include <fltk3/CheckButton.h>
 #include "Fl_Light_Button.H"
 
-/**
-  \class Fl_Check_Button
-  \brief A button with an "checkmark" to show its status.
-
-  \image html Fl_Check_Button.png
-  \image latex Fl_Check_Button.png  "Fl_Check_Button" width=4cm
-  Buttons generate callbacks when they are clicked by the user. You control
-  exactly when and how by changing the values for type() and when().
-
-  The Fl_Check_Button subclass displays its "ON" state by showing a "checkmark"
-  rather than drawing itself pushed in.
-  
-  \todo Refactor Fl_Check_Button doxygen comments (add color() info etc?)
-  \todo Generate Fl_Check_Button.gif with visible checkmark.
- */
 class FL_EXPORT Fl_Check_Button : public Fl_Light_Button {
+  
 public:
-  Fl_Check_Button(int X, int Y, int W, int H, const char *L = 0);
+  
+  Fl_Check_Button() { /* empty */ }
+    
+  Fl_Check_Button(int X, int Y, int W, int H, const char *L = 0) {
+    _p = new fltk3::CheckButton(x, y, w, h, label);
+    _p->wrapper(this);
+  }
+
 };
 
 #endif

Modified: branches/branch-3.0/FL/Fl_Light_Button.H
===================================================================
--- branches/branch-3.0/FL/Fl_Light_Button.H    2011-05-30 19:09:38 UTC (rev 
8769)
+++ branches/branch-3.0/FL/Fl_Light_Button.H    2011-05-30 21:19:43 UTC (rev 
8770)
@@ -36,15 +36,11 @@
   
 protected:
   
-#if 0 // FIXME: 123
-    virtual void draw();
-#endif
+  FLTK3_WRAPPER_VCALLS_OBJECT(LightButton, draw(), draw(), Draw)
   
 public:
 
-#if 0 // FIXME: 123
-  virtual int handle(int);
-#endif
+  FLTK3_WRAPPER_VCALLS_OBJECT_INT(LightButton, handle(int event), 
handle(event), Handle)
   
   Fl_Light_Button() { /* empty */ }
   

Modified: branches/branch-3.0/FL/Fl_Valuator.H
===================================================================
--- branches/branch-3.0/FL/Fl_Valuator.H        2011-05-30 19:09:38 UTC (rev 
8769)
+++ branches/branch-3.0/FL/Fl_Valuator.H        2011-05-30 21:19:43 UTC (rev 
8770)
@@ -25,9 +25,6 @@
 //     http://www.fltk.org/str.php
 //
 
-/* \file
-   Fl_Valuator widget . */
-
 #ifndef Fl_Valuator_H
 #define Fl_Valuator_H
 
@@ -49,38 +46,85 @@
     _p->wrapper(this);
   }
 
-#if 0 // FIXME: 123
+  int horizontal() const {
+    return ((fltk3::Valuator*)_p)->horizontal();
+  }
   
-  int horizontal() const {return type()& FL_HORIZONTAL;}
-  Fl_Valuator(int X, int Y, int W, int H, const char* L);
-  double previous_value() const {return previous_value_;}
-  void handle_push() {previous_value_ = value_;}
-  double softclamp(double);
-  void handle_drag(double newvalue);
-  void handle_release();
-  virtual void value_damage();
-  void set_value(double v) {value_ = v;}
+  double previous_value() const {
+    return ((fltk3::Valuator*)_p)->previous_value();
+  }
+  
+  void handle_push() {
+    ((fltk3::Valuator*)_p)->handle_push();
+  }
+  
+  double softclamp(double v) {
+    return ((fltk3::Valuator*)_p)->softclamp(v);
+  }
+  
+  void handle_drag(double newvalue) {
+    ((fltk3::Valuator*)_p)->handle_drag(newvalue);
+  }
+  
+  void handle_release() {
+    ((fltk3::Valuator*)_p)->handle_release();
+  }
+  
+  // FIXME: 123 - this method was virtual 
+  void value_damage() {
+    ((fltk3::Valuator*)_p)->value_damage();
+  }
+  
+  void set_value(double v) {
+    ((fltk3::Valuator*)_p)->set_value(v);
+  }
 
-#endif
-  
 public:
 
-#if 0 // FIXME: 123
+  void bounds(double a, double b) {
+    ((fltk3::Valuator*)_p)->bounds(a, b);
+  }
+  
+  double minimum() const {
+    return ((fltk3::Valuator*)_p)->minimum();
+  }
+  
+  void minimum(double a) {
+    ((fltk3::Valuator*)_p)->minimum(a);
+  }
+  
+  double maximum() const {
+    return ((fltk3::Valuator*)_p)->maximum();
+  }
+  
+  void maximum(double a) {
+    ((fltk3::Valuator*)_p)->maximum(a);
+  }
+  
+  void range(double a, double b) {
+    ((fltk3::Valuator*)_p)->range(a, b);
+  }
+  
+  void step(int a) {
+    ((fltk3::Valuator*)_p)->step(a);
+  }
+  
+  void step(double a, int b) {
+    ((fltk3::Valuator*)_p)->step(a, b);
+  }
+  
+  void step(double s) {
+    ((fltk3::Valuator*)_p)->step(s);
+  }
+  
+  double step() const {
+    return ((fltk3::Valuator*)_p)->step();
+  }
+  
+  void precision(int x) {
+    ((fltk3::Valuator*)_p)->precision(x);
+  }
 
-  void bounds(double a, double b) {min=a; max=b;}
-  double minimum() const {return min;}
-  void minimum(double a) {min = a;}
-  double maximum() const {return max;}
-  void maximum(double a) {max = a;}
-  void range(double a, double b) {min = a; max = b;}
-  void step(int a) {A = a; B = 1;}
-  void step(double a, int b) {A = a; B = b;}
-  void step(double s);
-  double step() const {return A/B;}
-  void precision(int);
-
-#endif
-
   double value() const {
     return ((fltk3::Valuator*)_p)->value();
   }
@@ -89,15 +133,23 @@
     return ((fltk3::Valuator*)_p)->value(v);
   }
 
-#if 0 // FIXME: 123
+  // FIXME: 123 - this method was virtual 
+  int format(char *f) {
+    return ((fltk3::Valuator*)_p)->format(f);
+  }
   
-  virtual int format(char*);
-  double round(double);
-  double clamp(double);
-  double increment(double, int);
+  double round(double v) {
+    return ((fltk3::Valuator*)_p)->round(v);
+  }
+  
+  double clamp(double v) {
+    return ((fltk3::Valuator*)_p)->clamp(v);
+  }
+  
+  double increment(double v, int x) {
+    return ((fltk3::Valuator*)_p)->increment(v, x);
+  }
 
-#endif
-
 };
 
 #endif

Modified: branches/branch-3.0/fltk3/Button.h
===================================================================
--- branches/branch-3.0/fltk3/Button.h  2011-05-30 19:09:38 UTC (rev 8769)
+++ branches/branch-3.0/fltk3/Button.h  2011-05-30 21:19:43 UTC (rev 8770)
@@ -33,6 +33,9 @@
 
 #include "Widget.h"
 
+class Fl_Button;
+
+
 namespace fltk3 {
   // values for type()
   const uchar NORMAL_BUTTON = 0;   /**< value() will be set to 1 during the 
press of the button and 
@@ -82,6 +85,8 @@
    */
   class FLTK3_EXPORT Button : public Widget {
     
+    friend class ::Fl_Button;
+    
     int shortcut_;
     char value_;
     char oldval;

Modified: branches/branch-3.0/fltk3/LightButton.h
===================================================================
--- branches/branch-3.0/fltk3/LightButton.h     2011-05-30 19:09:38 UTC (rev 
8769)
+++ branches/branch-3.0/fltk3/LightButton.h     2011-05-30 21:19:43 UTC (rev 
8770)
@@ -33,6 +33,8 @@
 
 #include "Button.h"
 
+class Fl_Light_Button;
+
 namespace fltk3 {
   
   /**
@@ -47,6 +49,7 @@
    \image latex fltk3::LightButton.png "fltk3::LightButton" width=4cm
    */
   class FLTK3_EXPORT LightButton : public Button {
+    friend class ::Fl_Light_Button;    
   protected:
     virtual void draw();
   public:

Modified: branches/branch-3.0/test/demo.cxx
===================================================================
--- branches/branch-3.0/test/demo.cxx   2011-05-30 19:09:38 UTC (rev 8769)
+++ branches/branch-3.0/test/demo.cxx   2011-05-30 21:19:43 UTC (rev 8770)
@@ -82,11 +82,13 @@
   choice->add("none");
   choice->add("gtk+");
   choice->add("plastic");
+  choice->add("classic");
   choice->callback((fltk3::Callback *)doscheme);
   fltk3::scheme(NULL);
   if (!fltk3::scheme()) choice->value(0);
   else if (!strcmp(fltk3::scheme(), "gtk+")) choice->value(1);
-  else choice->value(2);
+  else if (!strcmp(fltk3::scheme(), "plastic")) choice->value(2);
+  else choice->value(3);
   obj = new fltk3::Button(10,15,330,380); obj->type(fltk3::HIDDEN_BUTTON);
   obj->callback(doback);
   obj = but[0] = new fltk3::Button( 30, 85,90,90);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to