diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-24 01:20:08 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-03-24 01:20:08 +0000 |
| commit | 4a31fd7aed27f2429724922f2dc77c83f608c904 (patch) | |
| tree | a5dc238569974398c24b730731eed963c174ab7e /src/Fl_win32.cxx | |
| parent | abc12cd376a615af7182b81a435fa2ccb63e4e5d (diff) | |
Provide Fl_Window_Driver accessor methods for public Fl_Window attributes.
These methods are intended to be used instead of pWindow->method()
for better code readability and easier porting of methods from
Fl_Window to Fl_Window_Driver.
New methods: x(), y(), y(), h(), shown(), parent(), border(),
visible(), and visible_r().
We should add more such methods if appropriate.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11414 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_win32.cxx')
| -rw-r--r-- | src/Fl_win32.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 72d191617..be2067ba1 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1563,10 +1563,10 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) void Fl_WinAPI_Window_Driver::resize(int X,int Y,int W,int H) { UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER; - int is_a_resize = (W != pWindow->w() || H != pWindow->h()); + int is_a_resize = (W != w() || H != h()); int resize_from_program = (pWindow != resize_bug_fix); if (!resize_from_program) resize_bug_fix = 0; - if (X != pWindow->x() || Y != pWindow->y()) { + if (X != x() || Y != y()) { force_position(1); } else { if (!is_a_resize) return; @@ -1574,7 +1574,7 @@ void Fl_WinAPI_Window_Driver::resize(int X,int Y,int W,int H) { } if (is_a_resize) { pWindow->Fl_Group::resize(X,Y,W,H); - if (pWindow->visible_r()) { + if (visible_r()) { pWindow->redraw(); // only wait for exposure if this window has a size - a window // with no width or height will never get an exposure event @@ -1586,9 +1586,9 @@ void Fl_WinAPI_Window_Driver::resize(int X,int Y,int W,int H) { x(X); y(Y); flags |= SWP_NOSIZE; } - if (!pWindow->border()) flags |= SWP_NOACTIVATE; - if (resize_from_program && pWindow->shown()) { - if (!pWindow->resizable()) pWindow->size_range(pWindow->w(), pWindow->h(), pWindow->w(), pWindow->h()); + if (!border()) flags |= SWP_NOACTIVATE; + if (resize_from_program && shown()) { + if (!pWindow->resizable()) pWindow->size_range(w(), h(), w(), h()); int dummy_x, dummy_y, bt, bx, by; //Ignore window managing when resizing, so that windows (and more //specifically menus) can be moved offscreen. @@ -2200,7 +2200,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { //static inline int can_boxcheat(uchar b) {return (b==1 || (b&2) && b<=15);} void Fl_WinAPI_Window_Driver::show() { - if (!pWindow->shown()) { + if (!shown()) { // if (can_boxcheat(box())) fl_background_pixel = fl_xpixel(color()); Fl_X::make(pWindow); } else { @@ -2356,7 +2356,7 @@ void Fl_WinAPI_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top { Fl_RGB_Image *r_top, *r_left, *r_bottom, *r_right; top = left = bottom = right = NULL; - if (!pWindow->shown() || pWindow->parent() || !pWindow->border() || !pWindow->visible()) return; + if (!shown() || parent() || !border() || !visible()) return; int wsides, hbottom, bt; RECT r = border_width_title_bar_height(wsides, hbottom, bt); int htop = bt + hbottom; @@ -2367,7 +2367,7 @@ void Fl_WinAPI_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top Fl::check(); void* save_gc = fl_graphics_driver->gc(); fl_graphics_driver->gc(GetDC(NULL)); - int ww = pWindow->w() + 2 * wsides; + int ww = w() + 2 * wsides; // capture the 4 window sides from screen fl_window = NULL; // force use of read_win_rectangle() by fl_read_image() uchar *rgb; @@ -2378,12 +2378,12 @@ void Fl_WinAPI_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top top = Fl_Shared_Image::get(r_top); } if (wsides) { - rgb = fl_read_image(NULL, r.left, r.top + htop, wsides, pWindow->h()); - r_left = new Fl_RGB_Image(rgb, wsides, pWindow->h(), 3); + rgb = fl_read_image(NULL, r.left, r.top + htop, wsides, h()); + r_left = new Fl_RGB_Image(rgb, wsides, h(), 3); r_left->alloc_array = 1; left = Fl_Shared_Image::get(r_left); - rgb = fl_read_image(NULL, r.right - wsides, r.top + htop, wsides, pWindow->h()); - r_right = new Fl_RGB_Image(rgb, wsides, pWindow->h(), 3); + rgb = fl_read_image(NULL, r.right - wsides, r.top + htop, wsides, h()); + r_right = new Fl_RGB_Image(rgb, wsides, h(), 3); r_right->alloc_array = 1; right = Fl_Shared_Image::get(r_right); rgb = fl_read_image(NULL, r.left, r.bottom-hbottom, ww, hbottom); |
