From 43c98c7c90a311ed7e5e71f6924aa81f4eb847a4 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 17 Oct 2016 19:20:36 +0000 Subject: [PATCH] Bring over combined fix [r12044] from 1.3 current to the porting branch. Applied patch from STR #3335 to fix simple GUI issues. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12045 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/fluid.cxx | 5 +++++ fluid/template_panel.cxx | 4 ++-- fluid/template_panel.fl | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 404a1bfa3..8820da19b 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -610,6 +610,11 @@ void new_cb(Fl_Widget *, void *v) { template_panel->label("New"); + if ( template_browser->size() == 1 ) { // only one item? + template_browser->value(1); // select it + template_browser->do_callback(); + } + // Show the panel and wait for the user to do something... template_panel->show(); while (template_panel->shown()) Fl::wait(); diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 0ca40c0b6..9e4b110f7 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -147,13 +147,13 @@ Fl_Double_Window* make_template_panel() { template_preview->align(Fl_Align(69|FL_ALIGN_INSIDE)); Fl_Group::current()->resizable(template_preview); } // Fl_Box* template_preview - { template_name = new Fl_Input(144, 288, 306, 25, "Template Name:"); + { template_name = new Fl_Input(198, 288, 252, 25, "Template Name:"); template_name->labelfont(1); template_name->textfont(4); template_name->callback((Fl_Callback*)cb_template_name); template_name->when(3); } // Fl_Input* template_name - { template_instance = new Fl_Input(124, 288, 326, 25, "Instance Name:"); + { template_instance = new Fl_Input(198, 288, 252, 25, "Instance Name:"); template_instance->labelfont(1); template_instance->textfont(4); template_instance->hide(); diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl index ccef63c87..c3777ac9c 100644 --- a/fluid/template_panel.fl +++ b/fluid/template_panel.fl @@ -130,11 +130,11 @@ if (img) { template_submit->activate(); if (Fl::event_key() == FL_Enter) template_panel->hide(); } else template_submit->deactivate();} selected - xywh {144 288 306 25} labelfont 1 when 3 textfont 4 + xywh {198 288 252 25} labelfont 1 when 3 textfont 4 } Fl_Input template_instance { label {Instance Name:} - xywh {124 288 326 25} labelfont 1 textfont 4 hide + xywh {198 288 252 25} labelfont 1 textfont 4 hide } Fl_Group {} { xywh {10 323 440 25}