Mike Buess
USA
3037 Posts |
Posted - 08/07/2002 : 07:43:59 AM
|
The default OK button will always close the dialog after the [OnOk] scripts run, so you'll have to create your own OK button to do what you want.
Dialog Builder steps... 1> Delete the existing OK button and its string table entry (if it has one). 2> Create a new button and double-click on it to bring up its properties. 3> Change its caption to OK. 4> Make a note of its ID (e.g., IDC_BUTTON1) and close properties. 5> Open the string table and create a new entry. 6> Give it the ID of your new button (IDC_BUTTON1). 7> Enter a caption, e.g., DialogName.OK 8> Rebuild, etc.
LabTalk steps... 9> The name of the section for your button is determined by the caption you entered in step 7. As I wrote it, the section should be called [OK.OnClick]. 10> There are at least three LabTalk methods for creating your prompt, but 'type -c' is probably the simplest. It generates a prompt with OK and Cancel buttons and the Cancel button terminates script execution.
[OK.OnClick] -- previous OnOk scripts -- type -c "Are you sure?"; // actually, insert this line where appropriate in your previous OnOK scripts dialog.close(DllName,DialogName);
...Having said that, if you just want the ability to run the [OnOK] scripts without closing the dialog it would be better to create an Apply button. To do that, leave the default OK button alone and do the following.
Dialog Builder... 1> Create a new button and set the ID to ID_APPLY_NOW and the caption to Apply. 2> Create a string table entry with the same ID and the caption DialogName.Apply
LabTalk... 3> The [OnApply] section should already exist, but create it if not.
[OnApply] run.section(,OnOK);
I hope that helps.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 08/07/2002 07:47:11 AM
Edited by - Mike Buess on 08/07/2002 08:09:18 AM |
 |
|