changeset 141:6f69a9c111eb

Fix for using BoolContentWidget in a menu. Made popups' widths match their parents under certain conditions. Removed dummy testing menu items.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 08 Feb 2009 15:49:45 +0000
parents c94ec5594449
children 9dabcc44f515
files codeDoc/jobs.txt data/conf/guiDemo.mtt mde/gui/widget/AChildWidget.d mde/gui/widget/PopupMenu.d mde/gui/widget/layout.d mde/menus.d
diffstat 6 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/codeDoc/jobs.txt	Sun Feb 08 15:20:11 2009 +0000
+++ b/codeDoc/jobs.txt	Sun Feb 08 15:49:45 2009 +0000
@@ -3,17 +3,17 @@
 
 
 In progress:
-Changing content from menu.
+
 
 
 To do (importance 0-5: 0 pointless, 1 no obvious impact now, 2 todo sometime, 3 useful, 4 important, 5 urgent):
 Also search for FIXME/NOTE/BUG/WARNING comment marks.
 4   Revise widgets/functions available
 3   Glyph 's' drawn incorrectly in release mode - ??
-3   Improvements for non-button popup widgets.
 3   Widget saving: how to deal with modifier functions, esp. when they discard parameters? Remove feature except for dimdata and handle gui editing separately?
 3   glBindTexture not working with non-0 index - perhaps use a higher level graphics library at some point.
 3   Windows compatibility - no registry support (useful to find path).
+2   Layout alignment issue when attempting to align things which cannot have the same dimensions (e.g. a parent forces width to other's width + k). Solutions: let one column be forcibly enlarged without affecting others, or only share alignment if parents do or parents are same (would also remove some unwanted alignment)..
 2   Popup help boxes on hover/right click to display content description.
 2   Options need a "level": simple options, for advanced users, for debugging only, etc.
 2   Command-line options for paths to by-pass normal path finding functionality.
--- a/data/conf/guiDemo.mtt	Sun Feb 08 15:20:11 2009 +0000
+++ b/data/conf/guiDemo.mtt	Sun Feb 08 15:49:45 2009 +0000
@@ -31,7 +31,7 @@
 <WidgetData|optName={0:[0x4040, 0,1]}>
 <WidgetData|optDesc={0:[0x4040, 0,2]}>
 <WidgetData|optVal={0:[0x6030,4,0],1:["optEnum"]}>
-<WidgetData|optEnum={0:[0x4100,0,1,2],1:["optVal","optName"]}>
+<WidgetData|optEnum={0:[0x4100,0,1,2],1:["optName","optVal"]}>
 <WidgetData|optSep={0:[0x21, 0xff],1:[" = "]}>
 {Basic}
 <WidgetData|root={0:[0x21,0x90D970],1:["A string!"]}>
--- a/mde/gui/widget/AChildWidget.d	Sun Feb 08 15:20:11 2009 +0000
+++ b/mde/gui/widget/AChildWidget.d	Sun Feb 08 15:49:45 2009 +0000
@@ -246,16 +246,15 @@
     /// Handles the down-click
     override int clickEvent (wdabs, wdabs, ubyte b, bool state) {
         if (b != 1) return 0;
-        if (state) {
+        if (parentIPPW.menuActive) {
+            parentIPPW.menuDone;
+            activated;
+        } else if (state) {
             pushed = true;
             mgr.requestRedraw;
             mgr.addClickCallback (&clickWhilePushed);
             mgr.addMotionCallback (&motionWhilePushed);
         }
-        if (parentIPPW.menuActive) {
-            parentIPPW.menuDone;
-            activated;
-        }
 	return 0;
     }
     
--- a/mde/gui/widget/PopupMenu.d	Sun Feb 08 15:20:11 2009 +0000
+++ b/mde/gui/widget/PopupMenu.d	Sun Feb 08 15:49:45 2009 +0000
@@ -71,6 +71,8 @@
 	    if (!pushed) {
                 parentIPPW.addChildIPPW (this);
                 parentIPPW.menuActive = true;
+                if (popup.width != w && popup.minWidth <= w)
+                    popup.setWidth (w, -1);		// neatness
                 mgr.positionPopup (this, popup);
                 pushed = true;
             } else if (!parentIPPW.parentMenuActive) {	// if not a submenu
@@ -89,8 +91,13 @@
         if (state && !pushed && parentIPPW.menuActive) {
             parentIPPW.addChildIPPW (this);
             menuActive = true;
-            mgr.positionPopup (this, popup,
-                               parentIPPW.parentMenuActive ? 1 : 0);
+            if (parentIPPW.parentMenuActive)
+                mgr.positionPopup (this, popup, 1);
+            else {
+                if (popup.width != w && popup.minWidth <= w)
+                    popup.setWidth (w, -1);		// neatness
+                mgr.positionPopup (this, popup);
+            }
             pushed = true;
         }
     }
--- a/mde/gui/widget/layout.d	Sun Feb 08 15:20:11 2009 +0000
+++ b/mde/gui/widget/layout.d	Sun Feb 08 15:49:45 2009 +0000
@@ -740,7 +740,7 @@
             genPositions;
         }
         
-        debug logger.trace ("newMW for col: minWidth: {}, nmw: {}, col: {}, nd: {}, mw: {}, w: {}", minWidth, nmw, col, nd, mw, w);
+        //debug logger.trace ("newMW for col: minWidth: {}, nmw: {}, col: {}, nd: {}, mw: {}, w: {}", minWidth, nmw, col, nd, mw, w);
         foreach (cb; cbs)
             cb.newMW ();
         return true;
--- a/mde/menus.d	Sun Feb 08 15:20:11 2009 +0000
+++ b/mde/menus.d	Sun Feb 08 15:49:45 2009 +0000
@@ -36,10 +36,4 @@
         debug logger.trace ("Quit (from menu)");
         run = false;
     });
-    debug {
-        new EventContent ("menus.main.a");
-        new EventContent ("menus.main.b");
-        new EventContent ("menus.main.submenu.c");
-        new EventContent ("menus.main.submenu.d");
-    }
 }