I personally don't like the idea of criticizing a users use-case. I too have controlled and do control the added buttons that modal windows can create. Note that if you create your own button called "OK" then the modal window will not add an "OK" button, but if you do want to get rid of an added button, here is an example showing how using the <<On Open()
method. I use the <<XPath( "//ButtonBox" )
method to grab a list of all button boxes then hide the last one (the added button box will always be the last)
new window( "test",
<<Modal,
<<On Open(
button boxes = ((tree <<Parent) <<Parent) << XPath( "//ButtonBox" );
button boxes[N Items( button boxes )] << Visibility( "Collapse" );
)
,
tree = V List Box(
Button Box( "My button " )
,
Button Box( "My Other Button!!" )
,
Button Box( "My awesome button for doing all the things " )
,
Button Box( "This button erases your HD" )
,
Button Box( "all your base are belong to us" )
)
)
Or you can use this cheeky way (since creating a button labeled "OK" stops JMP from adding an OK button):
new window( "test",
<<Modal,
tree = V List Box(
Button Box( "OK", <<Visibility( "Collapse" ) )
,
Button Box( "My Other Button!!" )
,
Button Box( "My awesome button for doing all the things " )
,
Button Box( "This button erases your HD" )
,
Button Box( "all your base are belong to us" )
)
)
The advantage with this second method is that you can do something like this, which will trigger the normal Modal Window closing mechanism (including running any validation script)
new window( "test",
<<Modal,
tree = V List Box(
window:OK Button = Button Box( "OK", <<Visibility( "Collapse" ) )
,
Button Box( "My Other Button!!" )
,
Button Box( "My awesome button for doing all the things " )
,
Button Box( "This button erases your HD" )
,
Button Box( "all your base are belong to us" )
,
Button Box( "Submit", window:OK Button << Click )
)
)
Jordan