diff options
| author | Manolo Gouy <Manolo> | 2016-01-10 19:08:16 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-01-10 19:08:16 +0000 |
| commit | eeb65bef23b2d269ea38474c04a55ffca5c6e63e (patch) | |
| tree | e00061d0a9dfd7b28e031b1f976ae31c852fac39 /test/device.cxx | |
| parent | acc50806538da470ba18a2f7b76ea65a64cb5f5c (diff) | |
1) Replicate in branch-1.3-porting all recent changes of branch-1.3
2) Advance branch-1.3-porting with new function Fl_X::capture_titlebar_and_borders()
that contains all the platform-specific code of all operations related to drawing
window borders and title bars. What is platform-specific and what is not
is therefore much clearer, to ease porting.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11002 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/device.cxx')
| -rw-r--r-- | test/device.cxx | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/test/device.cxx b/test/device.cxx index 1ad26890f..971e4eee7 100644 --- a/test/device.cxx +++ b/test/device.cxx @@ -551,15 +551,30 @@ const char *operation; void copy(Fl_Widget *, void *data) { if (strcmp(operation, "Fl_Image_Surface") == 0) { - Fl_Image_Surface *rgb_surf = new Fl_Image_Surface(target->w()+20, target->h()+10); + Fl_Image_Surface *rgb_surf; + int W, H, decorated; + if (target->as_window() && !target->parent()) { + W = target->as_window()->decorated_w(); + H = target->as_window()->decorated_h(); + decorated = 1; + } + else { + W = target->w(); + H = target->h(); + decorated = 0; + } + rgb_surf = new Fl_Image_Surface(W, H); rgb_surf->set_current(); - fl_color(FL_BLUE);fl_rectf(0,0,1000,1000); - rgb_surf->draw(target,10,5); + if (decorated) + rgb_surf->draw_decorated_window(target->as_window()); + else + rgb_surf->draw(target); Fl_Image *img = rgb_surf->image(); delete rgb_surf; Fl_Display_Device::display_device()->set_current(); - Fl_Window* g2 = new Fl_Window(img->w(), img->h()); - Fl_Box *b = new Fl_Box(FL_NO_BOX,0,0,img->w(), img->h(),0); + Fl_Window* g2 = new Fl_Window(img->w()+10, img->h()+10); + g2->color(FL_YELLOW); + Fl_Box *b = new Fl_Box(FL_NO_BOX,5,5,img->w(), img->h(),0); b->image(img); g2->end(); g2->show(); @@ -709,7 +724,7 @@ int main(int argc, char ** argv) { g1->end(); Fl_Group *g2 = new Fl_Group(w3->x(),w3->y(),w3->w(),w3->h()); - rb = new Fl_Radio_Round_Button(170,5,150,12, "Window"); + rb = new Fl_Radio_Round_Button(170,5,150,12, "Decorated Window"); rb->set(); rb->callback(target_cb, w2); target = w2; rb = new Fl_Radio_Round_Button(170,22,150,12, "Sub-window"); rb->callback(target_cb, w3); rb = new Fl_Radio_Round_Button(170,39,150,12, "Group"); rb->callback(target_cb, group); |
