Author: matt
Date: 2012-05-17 10:20:40 -0700 (Thu, 17 May 2012)
New Revision: 9516
Log:
Moved e_widget to fltk3:: like all other event related variables

Modified:
   branches/branch-3.0/include/FL/Fl_Box.H
   branches/branch-3.0/include/fltk3/Widget.h
   branches/branch-3.0/include/fltk3/run.h
   branches/branch-3.0/src/fltk3/Widget.cxx
   branches/branch-3.0/src/fltk3/run.cxx

Modified: branches/branch-3.0/include/FL/Fl_Box.H
===================================================================
--- branches/branch-3.0/include/FL/Fl_Box.H     2012-05-17 14:42:41 UTC (rev 
9515)
+++ branches/branch-3.0/include/FL/Fl_Box.H     2012-05-17 17:20:40 UTC (rev 
9516)
@@ -33,8 +33,8 @@
 #include "Fl_Widget.H"
 
 
-FLTK3_WRAPPER_INTERFACE_BEGIN(Fl_Box, Box)
-FLTK3_WRAPPER_INTERFACE_WIDGET(Fl_Box, Box)
+FLTK3_WRAPPER_INTERFACE_BEGIN(Fl_Box, Widget)
+FLTK3_WRAPPER_INTERFACE_WIDGET(Fl_Box, Widget)
 FLTK3_WRAPPER_INTERFACE_END()
 
 
@@ -42,15 +42,15 @@
 
 public:
 
-  FLTK3_WIDGET_VCALLS(Fl_Box, Box)
+  FLTK3_WIDGET_VCALLS(Fl_Box, Widget)
 
   Fl_Box(int x, int y, int w, int h, const char *label=0) {
-    _p = new fltk3::Box_I(_ctor_dx(x), _ctor_dy(y), w, h, label);
+    _p = new fltk3::Widget_I(_ctor_dx(x), _ctor_dy(y), w, h, label);
     _p->wrapper(this);
   }
   
   Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const char *label) {
-    _p = new fltk3::Box_I(_ctor_dx(x), _ctor_dy(y), w, h, label);
+    _p = new fltk3::Widget_I(_ctor_dx(x), _ctor_dy(y), w, h, label);
     _p->wrapper(this);
     box(b);
   }

Modified: branches/branch-3.0/include/fltk3/Widget.h
===================================================================
--- branches/branch-3.0/include/fltk3/Widget.h  2012-05-17 14:42:41 UTC (rev 
9515)
+++ branches/branch-3.0/include/fltk3/Widget.h  2012-05-17 17:20:40 UTC (rev 
9516)
@@ -324,9 +324,11 @@
    functions, even if they change the widget's appearance. It is up to the 
    user code to call redraw() after these.
    */
-  class FLTK3_EXPORT Widget : public Label {
+  class FLTK3_EXPORT Widget : public Label 
+  {
     friend class Group;
-    friend Widget* fltk3::event_widget();
+  
+  private:
     
     fltk3::Group* parent_;
     fltk3::Callback* callback_;
@@ -336,10 +338,8 @@
     Boxtype box_;
     uchar type_;
     uchar damage_;
-    uchar when_;
-    
+    uchar when_;    
     const char *tooltip_;
-    static Widget* e_widget; //the Widget to which event coordinates relate or 
NULL
     
     /** unimplemented copy ctor */
     Widget(const Widget &);
@@ -1034,12 +1034,6 @@
      */
     void color2(unsigned a) {color2_ = a;}    
     
-    /** Choose a coding style for this widget.
-     FLTK 1 coding style uses a Window-relative coordinate system.
-     FLTK 2 and 3 use a Group-relative coordinate system.
-     More details will be implemented later.
-     */
-    void coding_style(int s);
 };
   
   

Modified: branches/branch-3.0/include/fltk3/run.h
===================================================================
--- branches/branch-3.0/include/fltk3/run.h     2012-05-17 14:42:41 UTC (rev 
9515)
+++ branches/branch-3.0/include/fltk3/run.h     2012-05-17 17:20:40 UTC (rev 
9516)
@@ -131,6 +131,7 @@
   extern int e_number;
   extern int e_x;
   extern int e_y;
+  extern Widget* e_widget; //the Widget to which event coordinates relate or 
NULL
   extern int e_x_root;
   extern int e_y_root;
   extern int e_dx;

Modified: branches/branch-3.0/src/fltk3/Widget.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Widget.cxx    2012-05-17 14:42:41 UTC (rev 
9515)
+++ branches/branch-3.0/src/fltk3/Widget.cxx    2012-05-17 17:20:40 UTC (rev 
9516)
@@ -45,7 +45,6 @@
 
 static fltk3::Widget *obj_queue[QUEUE_SIZE];
 static int obj_head, obj_tail;
-fltk3::Widget* fltk3::Widget::e_widget = NULL;
 
 void fltk3::Widget::default_callback(fltk3::Widget *o, void * /*v*/) {
 #if 0
@@ -392,9 +391,6 @@
   draw_label();
 }
 
-void fltk3::Widget::coding_style(int s) {
-  // TODO: just store the value somewhere? Or should the compatibility layer 
take car of this?
-}
 
 // ========================= Wrapper Support 
===================================
 
@@ -515,9 +511,9 @@
 
   int old_event = fltk3::e_number; fltk3::e_number = event;
   // the widget to which fltk3::event_x() and event_y() coordinates are 
relative
-  e_widget = this; 
+  fltk3::e_widget = this; 
   int ret = handle(fltk3::e_number);
-  e_widget = NULL; // set to NULL outside of handle()
+  fltk3::e_widget = NULL; // set to NULL outside of handle()
 
   fltk3::e_number = old_event;
   fltk3::e_y = save_y;

Modified: branches/branch-3.0/src/fltk3/run.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/run.cxx       2012-05-17 14:42:41 UTC (rev 
9515)
+++ branches/branch-3.0/src/fltk3/run.cxx       2012-05-17 17:20:40 UTC (rev 
9516)
@@ -96,7 +96,8 @@
 fltk3::Widget  *fltk3::belowmouse_,
                *fltk3::pushed_,
                *fltk3::focus_,
-               *fltk3::selection_owner_;
+               *fltk3::selection_owner_,
+                *fltk3::e_widget;
 int            fltk3::damage_,
                fltk3::e_number,
                fltk3::e_x,
@@ -219,7 +220,6 @@
   // and e_x, e_y are relative to e_widget.
   int dx = e_x, dy = e_y;
   Group* g = o->parent();
-  Widget* e_widget = event_widget();
   if (e_widget != g) {
     if (e_widget && !e_widget->as_window()) {
       dx += e_widget->dx_window();
@@ -2023,7 +2023,7 @@
  offsets from the top-left of the widget returned by this function.
  Outside of event-handling contexts, this function returns NULL.
  */
-fltk3::Widget* fltk3::event_widget() {return fltk3::Widget::e_widget;}
+fltk3::Widget* fltk3::event_widget() {return fltk3::e_widget;}
 
 //
 // End of "$Id$".

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

Reply via email to