diff options
| author | Manolo Gouy <Manolo> | 2016-03-22 17:47:44 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-22 17:47:44 +0000 |
| commit | 6ec8ebc4f83fa2c143bff54e66672226cdf7d85c (patch) | |
| tree | f91bde6630403fd3961ae4bdf9a2c554ea5c12d1 /src/Fl_x.cxx | |
| parent | 6302b3da00f8116e1bf62629c6d3ab0f719d1a33 (diff) | |
Rewrite Fl_Window::show() and Fl_Menu_Window::show() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11400 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 2e3d49183..4ca3ad67d 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2901,29 +2901,17 @@ void Fl_X11_Window_Driver::label(const char *name, const char *iname) { // Fl_Window *fl_boxcheat; static inline int can_boxcheat(uchar b) {return (b==1 || ((b&2) && b<=15));} -void Fl_Window::show() { - image(Fl::scheme_bg_); - if (Fl::scheme_bg_) { - labeltype(FL_NORMAL_LABEL); - align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); - } else { - labeltype(FL_NO_LABEL); - } - Fl_Tooltip::exit(this); - if (!shown()) { +void Fl_X11_Window_Driver::show() { + if (!pWindow->shown()) { fl_open_display(); // Don't set background pixel for double-buffered windows... - if (type() != FL_DOUBLE_WINDOW && can_boxcheat(box())) { - fl_background_pixel = int(fl_xpixel(color())); + if (pWindow->type() != FL_DOUBLE_WINDOW && can_boxcheat(pWindow->box())) { + fl_background_pixel = int(fl_xpixel(pWindow->color())); } - Fl_X::make_xid(this); + Fl_X::make_xid(pWindow); } else { - XMapRaised(fl_display, i->xid); + XMapRaised(fl_display, fl_xid(pWindow)); } -#ifdef USE_PRINT_BUTTON -void preparePrintFront(void); -preparePrintFront(); -#endif } @@ -2932,11 +2920,13 @@ FL_EXPORT Window fl_xid_(const Fl_Window *w) { return temp ? temp->xid : 0; } +//#define USE_PRINT_BUTTON 1 #ifdef USE_PRINT_BUTTON + // to test the Fl_Printer class creating a "Print front window" button in a separate window -// contains also preparePrintFront call above #include <FL/Fl_Printer.H> #include <FL/Fl_Button.H> + void printFront(Fl_Widget *o, void *data) { Fl_Printer printer; @@ -2987,11 +2977,7 @@ void copyFront(Fl_Widget *o, void *data) o->window()->show(); } -void preparePrintFront(void) -{ - static int first=1; - if(!first) return; - first=0; +static int prepare_print_button() { static Fl_Window w(0,0,140,60); static Fl_Button bp(0,0,w.w(),30, "Print front window"); bp.callback(printFront); @@ -2999,7 +2985,11 @@ void preparePrintFront(void) bc.callback(copyFront); w.end(); w.show(); + return 0; } + +static int unused = prepare_print_button(); + #endif // USE_PRINT_BUTTON #endif |
