Author: greg.ercolano
Date: 2013-04-10 14:16:16 -0700 (Wed, 10 Apr 2013)
New Revision: 9872
Log:
As per notes from STR#2948:
Moved top_window_offset() to being a member of Fl_Widget (was Fl_Window)
and moved its code near implementations of top_window() and window().
Modified:
branches/branch-1.3/FL/Fl_Widget.H
branches/branch-1.3/FL/Fl_Window.H
branches/branch-1.3/src/Fl_Window.cxx
Modified: branches/branch-1.3/FL/Fl_Widget.H
===================================================================
--- branches/branch-1.3/FL/Fl_Widget.H 2013-04-10 20:51:24 UTC (rev 9871)
+++ branches/branch-1.3/FL/Fl_Widget.H 2013-04-10 21:16:16 UTC (rev 9872)
@@ -921,6 +921,7 @@
Fl_Window* window() const ;
Fl_Window* top_window() const;
+ Fl_Window* top_window_offset(int& xoff, int& yoff) const;
/** Returns an Fl_Group pointer if this widget is an Fl_Group.
Modified: branches/branch-1.3/FL/Fl_Window.H
===================================================================
--- branches/branch-1.3/FL/Fl_Window.H 2013-04-10 20:51:24 UTC (rev 9871)
+++ branches/branch-1.3/FL/Fl_Window.H 2013-04-10 21:16:16 UTC (rev 9872)
@@ -120,7 +120,6 @@
\see force_position(int)
*/
int force_position() const { return ((flags() & FORCE_POSITION)?1:0); }
- Fl_Window* top_window_offset(int& xoff, int& yoff) const;
public:
Modified: branches/branch-1.3/src/Fl_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Window.cxx 2013-04-10 20:51:24 UTC (rev
9871)
+++ branches/branch-1.3/src/Fl_Window.cxx 2013-04-10 21:16:16 UTC (rev
9872)
@@ -106,6 +106,22 @@
return const_cast<Fl_Widget*>(w)->as_window(); // return if window, or
NULL if not
}
+/**
+ Finds the x/y offset of the current window relative to the top-level window.
+ \param[out] xoff,yoff Returns the x/y offset
+ \returns the top-level window
+*/
+Fl_Window* Fl_Widget::top_window_offset(int& xoff, int& yoff) const {
+ xoff = yoff = 0;
+ const Fl_Window *win = (const Fl_Window*)this;
+ while (win && win->window()) {
+ xoff += win->x(); // accumulate offsets
+ yoff += win->y();
+ win = win->window(); // walk up window hierarchy
+ }
+ return (Fl_Window*)win;
+}
+
/** Gets the x position of the window on the screen */
int Fl_Window::x_root() const {
Fl_Window *p = window();
@@ -299,22 +315,6 @@
icon_ = ic;
}
-/**
- Finds the x/y offset of the current window relative to the top-level window.
- \param[out] xoff,yoff Returns the x/y offset
- \returns the top-level window
-*/
-Fl_Window* Fl_Window::top_window_offset(int& xoff, int& yoff) const {
- xoff = yoff = 0;
- const Fl_Window *win = (const Fl_Window*)this;
- while (win && win->window()) {
- xoff += win->x(); // accumulate offsets
- yoff += win->y();
- win = win->window(); // walk up window hierarchy
- }
- return (Fl_Window*)win;
-}
-
//
// End of "$Id$".
//
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit