BookmarkSubscribeSubscribe to RSS Feed

Set Menu Item State


Community Trekker


Feb 28, 2017

I am running into a problem where I have created an outline box that includes a red triangle menu. The only two menu choices determine whether an if box is visible or not visible. EG. Menu> 1.Not Visible 2. Visible

Obviously it either starts as visible or not visible, in this case not visible. But if I specifically <<Set Menu Item State(1,1,) then it always remains selected, even if the user selects the second menu option. The If Box is working as it should, the only problem I am having is getting the check mark on the menu item to appear and disappear as it should.


This is what I currently have, and it has no menu option "checked" currently. I want it to start out with "Simple Comparison" checked and if the user selects "Range" I want the check mark to move off of "Simple" and on to "Range".


Please help! Thanks!


obson = Outline Box("SalesOrderNbr",
				H List Box(
					rangeob=If Box(0, H List Box(nebson1 = Number Edit Box(),
					cbson1 = Combo Box( {">=", "<=", "<", ">", "="}, CBson1 = cbson1 << Get Selected ))),
					Text Box( "Sales Order Number" ),
					cbson2 = Combo Box( {">=", "<=", "<", ">", "="}, CBson2 = cbson2 << Get Selected ),
					nebson2 = Number Edit Box()
				obson<<Set Menu Item State(obson,rangeob<<Get),
				obson<<Set Menu Script(
					{"Simple Comparison", obson<<Set Menu Item State( 1, 1 ) ; obson<<Set Menu Item State( 2, 0 ) ;  rangeob<< Set( 0 ),
					"Range", <<Set Menu Item State( 1, 0 ) ; <<Set Menu Item State( 2, 1 ) ; rangeob << Set(1)}

Community Trekker


Sep 23, 2015

What are you using the variable "obson" for?  I couldn't get your code to compile.