I was able to make the default File-Edit-Help pull-down menu in a clean stack using Menu Builder on Win7 without issue. Thanks LiveCode! (Tools > Menu Builder, click "New", click "Auto Script" for each hilited menu).
I was disappointed the auto scripts didn't contain any actual menuItem code, just the framework. So each person must struggle with creating standardized menuItem routines on their own?
I searched the Forum and LC Lessons but couldn't find any examples. I did find some examples on Jacque's website,
http://www.hyperactivesw.com/mctutorial ... Menus.html. Thanks Jacque.
Could someone share a few of their File-Edit-Help code snippets?
In the spirit of sharing, I modified Jacque's code slightly to be more specific to the task of moving all controls in a stack down 22 pixels to make room for a new pull-down menu. Put the code in a button and temporarily paste on the first card of a COPY of a stack. Delete button when done. Thanks again Jacque.
Edit1: Background groups, substacks, and data grid sub-controls required screening to work as intended. Updated to v1.1
Edit2: Menu Builder has an undocumented feature to move existing stack controls down too. Tools > Menu Builder > New. At the bottom of the dialog is a checkbox to "Move objects down to accommodate a menu bar." It also increases the stack height appropriately. Tested and works with data grids.
Code: Select all
on mouseUp --v1.1, make room for a pull-down menu
local tVert = "22", tResize
answer "Move controls down 22 pixels to make room for a pull-down menu?" with "OK" or "Cancel" titled "Move Controls Down"
if it = "Cancel" then exit to top
set the cursor to watch
lock screen for visual effect
repeat with i = 1 to number(grps in this stack) --background group controls
if the backgroundBehavior of grp i of this stack = "false" then next repeat
set the top of grp i of this stack to (the top of grp i of this stack + tVert)
end repeat
repeat with i = 1 to number(cds in this stack) --cards
repeat with j = 1 to number(controls of cd i of this stack) --card controls
if the short name of control j of cd i of this stack begins with "dg" then next repeat --data grid parts
if the short name of control j of cd i of this stack begins with "group id" and the backgroundBehavior of control j of cd i of this stack = "true" then next repeat --bg grp controls
if the long name of control j of cd i of this stack contains "of group" then next repeat --subcontrols
set the top of control j of cd i of this stack to (the top of control j of cd i of this stack + tVert)
end repeat
end repeat
put the resizable of this stack into tResize --store
set the resizable of this stack to "true"
set the height of this stack to (the height of this stack + tVert) --resize stack
set the minHeight of this stack to (the minHeight of this stack + tVert)
set the resizable of this stack to tResize --reset
unlock screen with visual effect dissolve
end mouseUp