diff options
Diffstat (limited to 'test')
| -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); |
