summaryrefslogtreecommitdiff
path: root/fluid/Fl_Window_Type.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-19 04:09:32 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-19 04:09:32 +0000
commit59004878f3c36ec693737b631f5769f511fd74cb (patch)
treeb50238e6908abf76db0570e3cef65a2d973b1f33 /fluid/Fl_Window_Type.cxx
parenta218f44b5db233bbbd588b5766ec6f3e5e6cb822 (diff)
Many FLUID updates...
fluid/align_widget.cxx: - Add widget_size_cb() to set default size and size of labels and text for selected widgets. fluid/factory.cxx: - More normalization of menus - "..." when opening a window, Capitalized Words. - cb(): Assign default label/text size and resize to ideal size. - Make sure that all buttons, input, and valuator widgets have default label strings. - Fl_*_Button::ideal_size(): fix ideal width calcs to match widget. fluid/Fl_Menu_Type.cxx: - Fl_Menu_Item_Type::make(): set default label size. fluid/Fl_Type.h: - Add Fl_Widget_Type::default_size global. - Fl_Menu_Item_Type::type_name(): return "Menu_Item". - Fl_Submenu_Type::type_name(): return "Submenu". - Update ideal_size() methods to use a default height that is evenly divisible by 5. - Fl_Choice_Type::ideal_size() and Fl_Menubutton_Type::ideal_size(): fix ideal width calcs to match widget. - Fl_Menu_Bar::ideal_size(): add, returning the window width. fluid/fluid.cxx: - Add "Layout/Widget Size" submenu. - "File/Write code..." becomes "File/Write Code..." and "File/Write strings..." becomes "File/Write Strings..." fluid/fluid.plist: - Bump version number and copyright info. fluid/Fl_Widget_Type.cxx: - Fl_Widget_Type::ideal_size(): add box dw/dh and enforce a minimum size of 15x15. - labelsize_cb(): use Fl_Widget_Type::default_size instead of FL_NORMAL_SIZE. - textsize_cb(): use Fl_Widget_Type::default_size instead of FL_NORMAL_SIZE. fluid/Fl_Window_Type.cxx: - Fl_Window_Type::newdx(): require at least 2 pixels of movement. - Fl_Window_Type::draw_overlay(): adjust bounding box for outside labels above and below. - Fl_Window_Type::handle(): reset dx/dy on FL_PUSH. fluid/function_panel.cxx: fluid/function_panel.fl: fluid/function_panel.h: - Update some of the windows for the "small" size. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4129 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
-rw-r--r--fluid/Fl_Window_Type.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index f77a0ffd7..828bbd932 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -409,6 +409,8 @@ void Fl_Window_Type::newdx() {
if (Fl::event_state(FL_ALT) || !snap) {
mydx = mx-x1;
mydy = my-y1;
+
+ if (abs(mydx) < 2 && abs(mydy) < 2) mydx = mydy = 0;
} else {
int dx0 = mx-x1;
int ix = (drag&RIGHT) ? br : bx;
@@ -614,6 +616,14 @@ void Fl_Window_Type::draw_overlay() {
int x,y,r,t;
newposition(myo,x,y,r,t);
if (!show_guides || !drag || numselected != 1) fl_rect(x,y,r-x,t-y);
+ if (!(myo->o->align() & FL_ALIGN_INSIDE)) {
+ // Adjust top/bottom for top/bottom labels...
+ int ww, hh;
+ hh = myo->o->labelsize();
+ myo->o->measure_label(ww, hh);
+ if (myo->o->align() & FL_ALIGN_TOP) y -= hh;
+ if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh;
+ }
if (x < mybx) mybx = x;
if (y < myby) myby = y;
if (r > mybr) mybr = r;
@@ -969,7 +979,7 @@ int Fl_Window_Type::handle(int event) {
case FL_PUSH:
x1 = mx = Fl::event_x();
y1 = my = Fl::event_y();
- drag = 0;
+ drag = dx = dy = 0;
// test for popup menu:
if (Fl::event_button() >= 3) {
in_this_only = this; // modifies how some menu items work.