The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 intercept a dialog

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Malab Posted - 08/07/2002 : 03:24:02 AM
I have designed a dialog with the dialog builder.
I starts it in Origin and it works proberly. With Labtalk I can react on events like [onInit] or [onOk]! But if I click OK the dialog unloads whatever in the script is written. Can I intercept the dialog with a message "Are you sure? Yes/No"! Is it possible to hinder the dialog on closing?
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000