From 9527fee96d47a62a7e3e394478effa9d7ebe2008 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 5 Feb 2005 18:46:32 +0000 Subject: [PATCH] FLUID didn't update the widget panel X/Y/W/H values when moving the selected window (STR #701) fluid/Fl_Window_Type.cxx: - Fl_Window_Type::resize(): call update_xywh() on resize. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4012 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 2 ++ fluid/Fl_Window_Type.cxx | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 6b2df107a..ba7bff52e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.7 + - FLUID didn't update the widget panel X/Y/W/H values + when moving the selected window (STR #701) - FLUID didn't use the label type constant names for menu items, causing them to be drawn using the normal label type (STR #668) diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index dffd050a9..206e8b1be 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -52,6 +52,18 @@ extern int modflag; extern Fl_Preferences fluid_prefs; +#include "widget_panel.h" + +// Update the XYWH values in the widget panel... +static void update_xywh() { + if (current_widget && current_widget->is_widget()) { + widget_x_input->value(((Fl_Widget_Type *)current_widget)->o->x()); + widget_y_input->value(((Fl_Widget_Type *)current_widget)->o->y()); + widget_w_input->value(((Fl_Widget_Type *)current_widget)->o->w()); + widget_h_input->value(((Fl_Widget_Type *)current_widget)->o->h()); + } +} + void grid_cb(Fl_Input *i, long v) { int n = atoi(i->value()); if (n < 0) n = 0; @@ -310,7 +322,6 @@ void Fl_Window_Type::open() { } // control panel items: -#include "widget_panel.h" void modal_cb(Fl_Light_Button* i, void* v) { if (v == LOAD) { @@ -380,6 +391,7 @@ void Overlay_Window::resize(int X,int Y,int W,int H) { Fl_Widget* t = resizable(); resizable(0); Fl_Overlay_Window::resize(X,Y,W,H); resizable(t); + update_xywh(); // // make sure new window size surrounds the widgets: // int b = 0; // int r = 0; @@ -527,16 +539,6 @@ extern void fix_group_size(Fl_Type *t); extern Fl_Menu_Item Main_Menu[]; extern Fl_Menu_Item New_Menu[]; -// Update the XYWH values in the widget panel... -static void update_xywh() { - if (current_widget && current_widget->is_widget()) { - widget_x_input->value(((Fl_Widget_Type *)current_widget)->o->x()); - widget_y_input->value(((Fl_Widget_Type *)current_widget)->o->y()); - widget_w_input->value(((Fl_Widget_Type *)current_widget)->o->w()); - widget_h_input->value(((Fl_Widget_Type *)current_widget)->o->h()); - } -} - // move the selected children according to current dx,dy,drag state: void Fl_Window_Type::moveallchildren() {