# HG changeset patch # User Diggory Hardy # Date 1234108185 0 # Node ID 6f69a9c111eb73ee4fdf6f2bc74601f568a2492d # Parent c94ec559444970425fe9f95d71afaac4c5df8b3d Fix for using BoolContentWidget in a menu. Made popups' widths match their parents under certain conditions. Removed dummy testing menu items. diff -r c94ec5594449 -r 6f69a9c111eb codeDoc/jobs.txt --- 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. diff -r c94ec5594449 -r 6f69a9c111eb data/conf/guiDemo.mtt --- 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 @@ - + diff -r c94ec5594449 -r 6f69a9c111eb mde/gui/widget/AChildWidget.d --- 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; } diff -r c94ec5594449 -r 6f69a9c111eb mde/gui/widget/PopupMenu.d --- 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; } } diff -r c94ec5594449 -r 6f69a9c111eb mde/gui/widget/layout.d --- 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; diff -r c94ec5594449 -r 6f69a9c111eb mde/menus.d --- 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"); - } }