summaryrefslogtreecommitdiff
path: root/src/Fl_Window.cxx
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2013-04-10 21:16:16 +0000
committerGreg Ercolano <erco@seriss.com>2013-04-10 21:16:16 +0000
commit9fc45db999147a80d490ec8a6ecd64735316280b (patch)
treecc807b0cb20747141921a753f07df33c733a9c15 /src/Fl_Window.cxx
parent3fe3f24427853500b1b2c63aa1c0f6a728896e6f (diff)
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(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9872 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window.cxx')
-rw-r--r--src/Fl_Window.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index f76615925..a3e0200b6 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -106,6 +106,22 @@ Fl_Window *Fl_Widget::top_window() const {
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 @@ void Fl_Window::icon(const void * ic) {
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$".
//