Author: matt
Date: 2012-06-24 12:01:54 -0700 (Sun, 24 Jun 2012)
New Revision: 9627
Log:
Added some more FLTK2 compatibility stuff.

Modified:
   branches/branch-3.0/include/fltk/Color.h
   branches/branch-3.0/include/fltk/FloatInput.h
   branches/branch-3.0/include/fltk/Input.h
   branches/branch-3.0/include/fltk/IntInput.h
   branches/branch-3.0/include/fltk/SecretInput.h
   branches/branch-3.0/include/fltk/Style.h
   branches/branch-3.0/include/fltk/Widget.h
   branches/branch-3.0/include/fltk/WordwrapInput.h
   branches/branch-3.0/test2/input.cxx

Modified: branches/branch-3.0/include/fltk/Color.h
===================================================================
--- branches/branch-3.0/include/fltk/Color.h    2012-06-22 23:08:27 UTC (rev 
9626)
+++ branches/branch-3.0/include/fltk/Color.h    2012-06-24 19:01:54 UTC (rev 
9627)
@@ -30,100 +30,116 @@
 #ifndef fltk_Color_h
 #define fltk_Color_h
 
+#include "Style.h"
 #include "FL_API.h"
 #include "Flags.h"
 
 namespace fltk {
   
-/// \name fltk/Color.h
-//@{
+  /// \name fltk/Color.h
+  //@{
+  
+  typedef unsigned Color;
+  
+  /*! Symbolic names for some of the indexed colors.
+   
+   The 24-entry "gray ramp" is modified by fltk::set_background() so
+   that the color fltk::GRAY75 is the background color, and the others
+   are a nice range from black to a lighter version of the gray. These
+   are used to draw box edges. The gray levels are chosen to be evenly
+   spaced, listed here is the actual 8-bit and decimal gray level
+   assigned by default.  Also listed here is the letter used for
+   fltk::FrameBox and the old fltk1.1 names used for these levels.
+   
+   The remiander of the colormap is a 5x8x5 color cube. This cube is
+   used to dither images on 8-bit screens X colormaps to reduce the
+   number of colors used.
+   */
+  enum {
+    NO_COLOR   = 0, //!< Black, empty place holder in Style
+    
+    FREE_COLOR = 16, //!< Starting from index 16 is the FREE_COLOR area
+    NUM_FREE_COLOR= 16, //!< Number of free color slots starting from index 
FREE_COLOR
+    
+    GRAY00     = 32, //!< hex=00, dec=.00, framebox=A, fltk1 = GRAY0, GRAY_RAMP
+    GRAY05     = 33, //!< hex=0d, dec=.05, framebox=B
+    GRAY10     = 34, //!< hex=1a, dec=.10, framebox=C
+    GRAY15     = 35, //!< hex=27, dec=.15, framebox=D
+    GRAY20     = 36, //!< hex=34, dec=.20, framebox=E
+    GRAY25     = 37, //!< hex=41, dec=.25, framebox=F
+    GRAY30     = 38, //!< hex=4f, dec=.31, framebox=G
+    GRAY33     = 39, //!< hex=5c, dec=.36, framebox=H, fltk1 = DARK3
+    GRAY35     = 40, //!< hex=69, dec=.41, framebox=I
+    GRAY40     = 41, //!< hex=76, dec=.46, framebox=J (18% gray card)
+    GRAY45     = 42, //!< hex=83, dec=.51, framebox=K
+    GRAY50     = 43, //!< hex=90, dec=.56, framebox=L
+    GRAY55     = 44, //!< hex=9e, dec=.62, framebox=M
+    GRAY60     = 45, //!< hex=ab, dec=.67, framebox=N, fltk1 = DARK2
+    GRAY65     = 46, //!< hex=b8, dec=.72, framebox=O
+    GRAY66     = 47, //!< hex=c5, dec=.77, framebox=P, fltk1 = DARK1, 
INACTIVE_COLOR
+    GRAY70     = 48, //!< hex=d2, dec=.82, framebox=Q
+    GRAY75     = 49, //!< hex=e0, dec=.88, framebox=R, fltk1 = GRAY, 
SELECTION_COLOR
+    GRAY80     = 50, //!< hex=e5, dec=.90, framebox=S
+    GRAY85     = 51, //!< hex=ea, dec=.92, framebox=T, fltk1 = LIGHT1
+                      //unnamed entry     hex=ef, dec=.94, framebox=U
+    GRAY90     = 53, //!< hex=f4, dec=.96, framebox=V, fltk1 = LIGHT2
+    GRAY95     = 54, //!< hex=f9, dec=.98, framebox=W
+    GRAY99     = 55, //!< hex=ff, dec=1.0, framebox=X, fltk1 = LIGHT3
+    
+    BLACK              = 0x38, //!< Corner of color cube
+    RED                = 0x58, //!< Corner of color cube
+    GREEN              = 0x3f, //!< Corner of color cube
+    YELLOW     = 0x5f, //!< Corner of color cube
+    BLUE               = 0xd8, //!< Corner of color cube
+    MAGENTA    = 0xf8, //!< Corner of color cube
+    CYAN               = 0xdf, //!< Corner of color cube
+    WHITE              = 0xff, //!< Corner of color cube
+    
+    DARK_RED   = 72,
+    DARK_GREEN = 60,
+    DARK_YELLOW        = 76,
+    DARK_BLUE  = 136,
+    DARK_MAGENTA       = 152,
+    DARK_CYAN  = 140,
+    
+    WINDOWS_BLUE       = 0x88 //!< default selection_color
+  };
+  
+}
 
-typedef unsigned Color;
+namespace fltk3 {
+  inline Color _2to3_color(fltk::Color b) { return b; }
+  inline fltk::Color _3to2_color(Color b) { return b; }
+}
 
-/*! Symbolic names for some of the indexed colors.
-
-  The 24-entry "gray ramp" is modified by fltk::set_background() so
-  that the color fltk::GRAY75 is the background color, and the others
-  are a nice range from black to a lighter version of the gray. These
-  are used to draw box edges. The gray levels are chosen to be evenly
-  spaced, listed here is the actual 8-bit and decimal gray level
-  assigned by default.  Also listed here is the letter used for
-  fltk::FrameBox and the old fltk1.1 names used for these levels.
-
-  The remiander of the colormap is a 5x8x5 color cube. This cube is
-  used to dither images on 8-bit screens X colormaps to reduce the
-  number of colors used.
-*/
-enum {
-  NO_COLOR     = 0, //!< Black, empty place holder in Style
-
-  FREE_COLOR   = 16, //!< Starting from index 16 is the FREE_COLOR area
-  NUM_FREE_COLOR= 16, //!< Number of free color slots starting from index 
FREE_COLOR
-
-  GRAY00       = 32, //!< hex=00, dec=.00, framebox=A, fltk1 = GRAY0, GRAY_RAMP
-  GRAY05       = 33, //!< hex=0d, dec=.05, framebox=B
-  GRAY10       = 34, //!< hex=1a, dec=.10, framebox=C
-  GRAY15       = 35, //!< hex=27, dec=.15, framebox=D
-  GRAY20       = 36, //!< hex=34, dec=.20, framebox=E
-  GRAY25       = 37, //!< hex=41, dec=.25, framebox=F
-  GRAY30       = 38, //!< hex=4f, dec=.31, framebox=G
-  GRAY33       = 39, //!< hex=5c, dec=.36, framebox=H, fltk1 = DARK3
-  GRAY35       = 40, //!< hex=69, dec=.41, framebox=I
-  GRAY40       = 41, //!< hex=76, dec=.46, framebox=J (18% gray card)
-  GRAY45       = 42, //!< hex=83, dec=.51, framebox=K
-  GRAY50       = 43, //!< hex=90, dec=.56, framebox=L
-  GRAY55       = 44, //!< hex=9e, dec=.62, framebox=M
-  GRAY60       = 45, //!< hex=ab, dec=.67, framebox=N, fltk1 = DARK2
-  GRAY65       = 46, //!< hex=b8, dec=.72, framebox=O
-  GRAY66       = 47, //!< hex=c5, dec=.77, framebox=P, fltk1 = DARK1, 
INACTIVE_COLOR
-  GRAY70       = 48, //!< hex=d2, dec=.82, framebox=Q
-  GRAY75       = 49, //!< hex=e0, dec=.88, framebox=R, fltk1 = GRAY, 
SELECTION_COLOR
-  GRAY80       = 50, //!< hex=e5, dec=.90, framebox=S
-  GRAY85       = 51, //!< hex=ea, dec=.92, framebox=T, fltk1 = LIGHT1
-  //unnamed entry         hex=ef, dec=.94, framebox=U
-  GRAY90       = 53, //!< hex=f4, dec=.96, framebox=V, fltk1 = LIGHT2
-  GRAY95       = 54, //!< hex=f9, dec=.98, framebox=W
-  GRAY99       = 55, //!< hex=ff, dec=1.0, framebox=X, fltk1 = LIGHT3
-
-  BLACK                = 0x38, //!< Corner of color cube
-  RED          = 0x58, //!< Corner of color cube
-  GREEN                = 0x3f, //!< Corner of color cube
-  YELLOW       = 0x5f, //!< Corner of color cube
-  BLUE         = 0xd8, //!< Corner of color cube
-  MAGENTA      = 0xf8, //!< Corner of color cube
-  CYAN         = 0xdf, //!< Corner of color cube
-  WHITE                = 0xff, //!< Corner of color cube
-
-  DARK_RED     = 72,
-  DARK_GREEN   = 60,
-  DARK_YELLOW  = 76,
-  DARK_BLUE    = 136,
-  DARK_MAGENTA = 152,
-  DARK_CYAN    = 140,
-
-  WINDOWS_BLUE = 0x88 //!< default selection_color
-};
+namespace fltk {
   
 #if 0 // FIXME: 123-2
-
-inline Color color(unsigned char r, unsigned char g, unsigned char b) {
-  return Color((r<<24)+(g<<16)+(b<<8)); }
-inline Color color(unsigned char g) {
-  return Color(g*0x1010100u); }
-FL_API Color color(const char*);
-FL_API Color parsecolor(const char*, unsigned length);
-FL_API Color lerp(Color c0, Color c1, float f);
-FL_API Color inactive(Color fg);
-FL_API Color inactive(Color fg, Color bg);
-FL_API Color contrast(Color fg, Color bg);
-FL_API void split_color(Color c, unsigned char& r, unsigned char& g, unsigned 
char& b);
-FL_API void set_color_index(Color index, Color);
-FL_API Color get_color_index(Color index);
-FL_API void set_background(Color);
-FL_API Color nearest_index(Color);
-
+  
+  inline Color color(unsigned char r, unsigned char g, unsigned char b) {
+    return Color((r<<24)+(g<<16)+(b<<8)); }
+  inline Color color(unsigned char g) {
+    return Color(g*0x1010100u); }
+  FL_API Color color(const char*);
+  FL_API Color parsecolor(const char*, unsigned length);
+  FL_API Color lerp(Color c0, Color c1, float f);
+  FL_API Color inactive(Color fg);
+  FL_API Color inactive(Color fg, Color bg);
 #endif
   
+  Color contrast(Color fg, Color bg) {
+    return fltk3::_3to2_color(fltk3::contrast(fltk3::_2to3_color(fg), 
fltk3::_2to3_color(bg)));
+  }
+  
+#if 0 // FIXME: 123-2
+  FL_API void split_color(Color c, unsigned char& r, unsigned char& g, 
unsigned char& b);
+  FL_API void set_color_index(Color index, Color);
+  FL_API Color get_color_index(Color index);
+  FL_API void set_background(Color);
+  FL_API Color nearest_index(Color);
+  
+#endif
+  
 }
 
 //@}

Modified: branches/branch-3.0/include/fltk/FloatInput.h
===================================================================
--- branches/branch-3.0/include/fltk/FloatInput.h       2012-06-22 23:08:27 UTC 
(rev 9626)
+++ branches/branch-3.0/include/fltk/FloatInput.h       2012-06-24 19:01:54 UTC 
(rev 9627)
@@ -68,6 +68,7 @@
   };
   
 }
+
 #endif
 
 //

Modified: branches/branch-3.0/include/fltk/Input.h
===================================================================
--- branches/branch-3.0/include/fltk/Input.h    2012-06-22 23:08:27 UTC (rev 
9626)
+++ branches/branch-3.0/include/fltk/Input.h    2012-06-24 19:01:54 UTC (rev 
9627)
@@ -52,7 +52,7 @@
       _p->wrapper(this);
     }
 
-#if 0
+#if 0 // FIXME: 123-2
     enum { // values for type()
       NORMAL   = 0,
       FLOAT_INPUT = 1,
@@ -74,8 +74,19 @@
     
     bool text(const char*);
     bool text(const char*, int);
-    bool static_text(const char*);
-    bool static_text(const char*, int);
+#endif
+    
+    // the original function returns a boolean value
+    void static_text(const char* text) {
+      ((fltk3::Input*)_p)->static_value(text);
+    }
+    
+    // the original function returns a boolean value
+    void static_text(const char* text, int n) {
+      ((fltk3::Input*)_p)->static_value(text, n);
+    }
+    
+#if 0 // FIXME: 123-2
     const char* text() const {return text_;}
     char at(int i) const {return text_[i];}
 #ifdef FLTK_1_WIDGET  // back-compatability section:

Modified: branches/branch-3.0/include/fltk/IntInput.h
===================================================================
--- branches/branch-3.0/include/fltk/IntInput.h 2012-06-22 23:08:27 UTC (rev 
9626)
+++ branches/branch-3.0/include/fltk/IntInput.h 2012-06-24 19:01:54 UTC (rev 
9627)
@@ -1,4 +1,3 @@
-#error header has not been ported to 3.0 yet
 //
 // "$Id$"
 //
@@ -27,16 +26,32 @@
 #ifndef fltk_IntInput_h
 #define fltk_IntInput_h
 
+#include <fltk3/IntInput.h>
 #include "FloatInput.h"
 
-namespace fltk {
 
-class FL_API IntInput : public FloatInput {
-public:
-  IntInput(int x,int y,int w,int h,const char *l = 0)
-    : FloatInput(x,y,w,h,l) { type(INT); }
-};
+FLTK2_WRAPPER_INTERFACE_BEGIN(IntInput, IntInput)
+FLTK2_WRAPPER_INTERFACE_WIDGET(IntInput, IntInput)
+FLTK2_WRAPPER_INTERFACE_END()
 
+
+namespace fltk {
+  
+  class FL_API IntInput : public FloatInput {
+    
+  public:
+    
+    FLTK2_WIDGET_VCALLS(IntInput, IntInput)
+    
+    IntInput() {}
+    
+    IntInput(int x,int y,int w,int h, const char *l = 0) {
+      _p = new fltk3::IntInput_I(x, y, w, h, l);
+      _p->wrapper(this);
+    }
+    
+  };
+  
 }
 #endif
 

Modified: branches/branch-3.0/include/fltk/SecretInput.h
===================================================================
--- branches/branch-3.0/include/fltk/SecretInput.h      2012-06-22 23:08:27 UTC 
(rev 9626)
+++ branches/branch-3.0/include/fltk/SecretInput.h      2012-06-24 19:01:54 UTC 
(rev 9627)
@@ -1,4 +1,3 @@
-#error header has not been ported to 3.0 yet
 //
 // "$Id$"
 //
@@ -31,16 +30,32 @@
 #ifndef fltk_SecretInput_h
 #define fltk_SecretInput_h
 
+#include <fltk3/SecretInput.h>
 #include "Input.h"
 
-namespace fltk {
 
-class SecretInput : public Input {
-public:
-  SecretInput(int x,int y,int w,int h,const char *l = 0)
-    : Input(x,y,w,h,l) {type(SECRET);}
-};
+FLTK2_WRAPPER_INTERFACE_BEGIN(SecretInput, SecretInput)
+FLTK2_WRAPPER_INTERFACE_WIDGET(SecretInput, SecretInput)
+FLTK2_WRAPPER_INTERFACE_END()
 
+
+namespace fltk {
+  
+  class SecretInput : public Input {
+    
+  public:
+    
+    FLTK2_WIDGET_VCALLS(SecretInput, SecretInput)
+    
+    SecretInput() {}
+    
+    SecretInput(int x,int y,int w,int h, const char *l = 0) {
+      _p = new fltk3::SecretInput_I(x, y, w, h, l);
+      _p->wrapper(this);
+    }
+    
+  };
+  
 }
 
 #endif

Modified: branches/branch-3.0/include/fltk/Style.h
===================================================================
--- branches/branch-3.0/include/fltk/Style.h    2012-06-22 23:08:27 UTC (rev 
9626)
+++ branches/branch-3.0/include/fltk/Style.h    2012-06-24 19:01:54 UTC (rev 
9627)
@@ -218,8 +218,6 @@
   inline float _3to2_fontsize(int b) { return (float)b; }
   inline Box* _2to3_boxtype(fltk::Box* b) { return (Box*)b; }
   inline fltk::Box* _3to2_boxtype(Box* b) { return (fltk::Box*)b; }
-  inline Color _2to3_color(fltk::Color b) { return b; }
-  inline fltk::Color _3to2_color(Color b) { return b; }
 }
 
 

Modified: branches/branch-3.0/include/fltk/Widget.h
===================================================================
--- branches/branch-3.0/include/fltk/Widget.h   2012-06-22 23:08:27 UTC (rev 
9626)
+++ branches/branch-3.0/include/fltk/Widget.h   2012-06-24 19:01:54 UTC (rev 
9627)
@@ -107,7 +107,7 @@
       ((fltk3::Widget_I*)_p)->type(t);
     }
 
-#if 0
+#if 0 // FIXME: 123-2
     bool       is_group() const        { return type_ >= GROUP_TYPE; }
     bool       is_window() const       { return type_ >= WINDOW_TYPE; }
     
@@ -130,7 +130,7 @@
       ((fltk3::Widget_I*)_p)->copy_label(new_label);
     }
     
-#if 0
+#if 0 // FIXME: 123-2
     const Symbol* image() const        { return image_; }
     void       image(const Symbol* a)  { image_ = a; }
     void       image(const Symbol& a)  { image_ = &a; }
@@ -144,7 +144,7 @@
       ((fltk3::Widget_I*)_p)->tooltip(t);
     }
     
-#if 0
+#if 0 // FIXME: 123-2
     unsigned shortcut() const  ;
     void       shortcut(unsigned key)  ;
     bool       add_shortcut(unsigned key);
@@ -169,10 +169,16 @@
       ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback*)cb );
     }
     
-#if 0    
-    void       callback(Callback0*c)   { callback_=(Callback*)c; }
-    void       callback(Callback1*c, long p=0) { callback_=(Callback*)c; 
user_data_=(void*)p; }
+    void callback(Callback0* cb) {
+      ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback0*)cb );
+    }
     
+    void callback(Callback1* cb, long p=0) {
+      ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback1*)cb, p );
+    }
+
+    
+#if 0 // FIXME: 123-2
     void*      user_data() const       { return user_data_; }
     void       user_data(void* v)      { user_data_ = v; }
     long       argument() const        { return (long)user_data_; }
@@ -252,7 +258,7 @@
       ((fltk3::Widget_I*)_p)->damage( fltk3::_2to3_damage(b) );
     }
     
-#if 0
+#if 0 // FIXME: 123-2
     void       redraw_label()          ;
     void       redraw_highlight()      ;
     void       redraw(const Rectangle&);
@@ -293,12 +299,18 @@
       return fltk3::_3to2_color( ((fltk3::Widget_I*)_p)->color() );
     }
     
-#if 0
+    Color labelcolor() const {
+      return fltk3::_3to2_color( ((fltk3::Widget_I*)_p)->labelcolor() );
+    }
+    
+    Color selection_color() const {
+      return fltk3::_3to2_color( ((fltk3::Widget_I*)_p)->selection_color() );
+    }
+    
+#if 0 // FIXME: 123-2
     Color      textcolor()             const;
-    Color      selection_color()       const;
     Color      selection_textcolor()   const;
     Color      buttoncolor()           const;
-    Color      labelcolor()            const;
     Color      highlight_color()       const;
     Color      highlight_textcolor()   const;
 #endif
@@ -331,12 +343,18 @@
       ((fltk3::Widget_I*)_p)->color( fltk3::_2to3_color(bg) );
     }
     
+    void labelcolor(Color bg) {
+      ((fltk3::Widget_I*)_p)->labelcolor( fltk3::_2to3_color(bg) );
+    }
+    
+    void selection_color(Color bg) {
+      ((fltk3::Widget_I*)_p)->selection_color( fltk3::_2to3_color(bg) );
+    }
+    
 #if 0 // FIXME: 123-2
     void textcolor(Color a)    ;
-    void selection_color(Color)        ;
     void selection_textcolor(Color);
     void buttoncolor(Color)    ;
-    void labelcolor(Color)     ;
     void highlight_color(Color)        ;
     void highlight_textcolor(Color);
 #endif
@@ -365,14 +383,14 @@
   };
   
   enum { // Widget::when() values
-    WHEN_NEVER         = 0,
-    WHEN_CHANGED               = 1,
-    WHEN_RELEASE               = 4,
-    WHEN_RELEASE_ALWAYS        = 6,
-    WHEN_ENTER_KEY     = 8,
-    WHEN_ENTER_KEY_ALWAYS      =10,
-    WHEN_ENTER_KEY_CHANGED=11,
-    WHEN_NOT_CHANGED   = 2 // modifier bit to disable changed() test
+    WHEN_NEVER              = 0,
+    WHEN_CHANGED            = 1,
+    WHEN_RELEASE            = 4,
+    WHEN_RELEASE_ALWAYS     = 6,
+    WHEN_ENTER_KEY          = 8,
+    WHEN_ENTER_KEY_ALWAYS   =10,
+    WHEN_ENTER_KEY_CHANGED  =11,
+    WHEN_NOT_CHANGED        = 2 // modifier bit to disable changed() test
   };
   
 }

Modified: branches/branch-3.0/include/fltk/WordwrapInput.h
===================================================================
--- branches/branch-3.0/include/fltk/WordwrapInput.h    2012-06-22 23:08:27 UTC 
(rev 9626)
+++ branches/branch-3.0/include/fltk/WordwrapInput.h    2012-06-24 19:01:54 UTC 
(rev 9627)
@@ -1,4 +1,3 @@
-#error header has not been ported to 3.0 yet
 //
 // "$Id$"
 //
@@ -29,17 +28,32 @@
 #ifndef fltk_WordwrapInput_h
 #define fltk_WordwrapInput_h
 
+#include <fltk3/MultilineInput.h>
 #include "Input.h"
 
-namespace fltk {
 
-// This class is entirely inline.  If that changes, add FL_API to its 
declaration
-class WordwrapInput : public Input {
-public:
-  WordwrapInput(int x,int y,int w,int h,const char *l = 0)
-    : Input(x,y,w,h,l) {type(WORDWRAP);}
-};
+FLTK2_WRAPPER_INTERFACE_BEGIN(WordwrapInput, MultilineInput)
+FLTK2_WRAPPER_INTERFACE_WIDGET(WordwrapInput, MultilineInput)
+FLTK2_WRAPPER_INTERFACE_END()
 
+
+namespace fltk {
+  
+  class WordwrapInput : public Input {
+    
+  public:
+    
+    FLTK2_WIDGET_VCALLS(WordwrapInput, MultilineInput)
+    
+    WordwrapInput() {}
+    
+    WordwrapInput(int x,int y,int w,int h, const char *l = 0) {
+      _p = new fltk3::MultilineInput_I(x, y, w, h, l);
+      _p->wrapper(this);
+    }
+    
+  };
+  
 }
 #endif
 

Modified: branches/branch-3.0/test2/input.cxx
===================================================================
--- branches/branch-3.0/test2/input.cxx 2012-06-22 23:08:27 UTC (rev 9626)
+++ branches/branch-3.0/test2/input.cxx 2012-06-24 19:01:54 UTC (rev 9627)
@@ -26,12 +26,6 @@
 //
 
 
-int main(int, char **) {
-  return 0;
-}
-
-#if 0 // FIXME: 123-2
-
 #include <fltk/run.h>
 #include <fltk/Window.h>
 #include <fltk/Input.h>
@@ -39,13 +33,25 @@
 #include <fltk/IntInput.h>
 #include <fltk/SecretInput.h>
 #include <fltk/WordwrapInput.h>
+#if 0 // FIXME: 123-2
 #include <fltk/TextEditor.h>
+#endif
 #include <fltk/Button.h>
 #include <fltk/ToggleButton.h>
+#if 0 // FIXME: 123-2
 #include <fltk/show_colormap.h>
 #include <stdio.h>
+#endif 
+
 using namespace fltk;
 
+int when = 0;
+Input *input[5];
+
+#if 0 // FIXME: 123-2
+
+TextEditor* editor;
+
 void cb(Widget *ob) {
   printf("Callback for %s '%s'\n",ob->label(),((Input*)ob)->text());
 }
@@ -53,33 +59,37 @@
 void editor_cb(Widget *ob) {
   printf("Callback for %s '%s'\n",ob->label(),((TextEditor*)ob)->text());
 }
+#endif
 
-int when = 0;
-Input *input[5];
-TextEditor* editor;
-
 void toggle_cb(Widget *o, long v) {
+#if 0 // FIXME: 123-2
   if (((ToggleButton*)o)->value()) when |= v; else when &= ~v;
   for (int i=0; i<5; i++) input[i]->when(when);
   editor->when(when);
+#endif
 }
 
+#if 0 // FIXME: 123-2
 void test(Input *i) {
   if (i->changed()) {
     i->clear_changed();
     printf("%s '%s'\n",i->label(),i->text());
   }
 }
+#endif
 
 void button_cb(Widget *,void *) {
+#if 0 // FIXME: 123-2
   for (int i=0; i<5; i++) test(input[i]);
   if (editor->changed()) {
     editor->clear_changed();
     printf("%s '%s'\n",editor->label(),editor->text());
   }
+#endif
 }
 
 void color_cb(Widget* button, void* v) {
+#if 0 // FIXME: 123-2
   Style& s = *Input::default_style;
   Color c;
   
@@ -98,6 +108,7 @@
   button->color(c);
   button->labelcolor(contrast(BLACK,(Color)c));
   fltk::redraw();
+#endif
 }
 
 int main(int argc, char **argv) {
@@ -119,6 +130,7 @@
   input[3]->tooltip("Input field for password");
   input[4] = new WordwrapInput(70,y,300,100,"Wordwrap"); y += 105;
   input[4]->tooltip("Input field for short multi-line text. Use TextEditor for 
anything more than a few lines!");
+#if 0 // FIXME: 123-2
 
   editor = new TextEditor(70,y,300,100,"TextEditor"); y += 105;
   editor->tooltip("TextEditor, designed for editing email and programs. "
@@ -129,10 +141,13 @@
   for (int i = 0; i < 5; i++) {
     input[i]->when(0); input[i]->callback(cb);
   }
+#endif
   int y1 = y;
+#if 0 // FIXME: 123-2
   editor->when(0);
   editor->callback(editor_cb);
-
+#endif
+  
   Button *b;
   b = new ToggleButton(10,y,200,23,"WHEN_&CHANGED");
   b->tooltip("Do callback each time the text changes");
@@ -150,7 +165,7 @@
   b = new Button(10,y,200,23,"&print changed()");
   b->callback(button_cb);
   b->tooltip("Print widgets that have changed() flag set");
-
+  
   b = new Button(220,y1,100,23,"color"); y1 += 23;
   b->color(input[0]->color()); b->callback(color_cb, (void*)0);
   b->labelcolor(contrast(BLACK,b->color()));
@@ -160,16 +175,17 @@
   b->labelcolor(contrast(BLACK,b->color()));
   b->tooltip("Color behind selected text");
   b = new Button(220,y1,100,23,"textcolor"); y1 += 23;
+#if 0 // FIXME: 123-2
   b->color(input[0]->textcolor()); b->callback(color_cb, (void*)2);
   b->labelcolor(contrast(BLACK,b->color()));
+#endif
   b->tooltip("Color of the text");
-
+  
   window->end();
   window->show(argc,argv);
   return run();
 }
 
-#endif
 
 //
 // End of "$Id: input.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".

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

Reply via email to