The LM_SimpleDialog class is used to create dialog boxes - windows that can be filled with other user interface controls. An LM_SimpleDialog object automatically provides OK and Cancel buttons.
Creates a new LM_SimpleDialog object.
Return value (LM_Menu): the newly-created menu title (string): the dialog's title subClass (table): an empty table to set up as a dialog subclassReturns the layout object that belongs to the dialog. This layout object can be used to add and arrange user interface objects to the dialog.
Return value (LM_LayoutView): the LM_LayoutView object associated with this dialogDisplays the dialog box on screen in a modal fashion (meaning that nothing else will happen in Moho until the user presses OK or Cancel in the dialog).
Return value (int): LM.GUI.MSG_OK if the user presses OK, or LM.GUI.MSG_CANCEL if the user presses CancelDisplays the dialog box on screen in a modeless fashion (meaning that the user is free to work in other parts of the Moho application while the dialog is open).
Return value: noneThis function tests that the value of a numerical text field falls within a certain range. This can be useful if you only want the dialog to allow certain ranges of numbers.
Return value (bool): true if the numerical value is within the range of low to high pCtrl (LM_TextControl): an LM_TextControl object whose numerical value you wish to test low (float): the minimum desired value for the text field high (float): the maximum desired value for the text fieldThe following functions can be over-ridden in your dialog sub-class in order to handle input from the user.
This function is called when the user interface controls need to be updated. Typically, it is called once when the dialog is first displayed. When this function is called, you should adjust the values of the user interface controls to match the underlying data.
Return value: noneThis function is called if the user presses the dialog's OK button. This function should text the values of the user interface controls and determine if they are all within allowed ranges (the Validate function above can be helpful for this). If this function determines that the dialog settings are all allowed, it should return true. Otherwise, it should return false - the user will then have the opportunity to correct illegal values and try pressing the OK button again.
Return value (bool): true if the dialog's values are legal, otherwise falseThis function is called if the user presses the dialog's OK button. When this function is called, you should read the values from the user interface controls and act on them in some way appropriate to the dialog's intended purpose.
Return value: noneThis function is called when a user interface object in the dialog sends a message. Often, you can ignore these messages, but if your dialog needs to respond to one or more messages, it can do so by implementing this function.
Return value: none msg (LM_Message): a message object generated by the user interacting with the dialog