How do I define an event handler for an OptionGroup in VBA-compatible Sax Basic Engine?
I have the following OptionGroup defined in dialog in VBA compatible Sax Basic Engine (embedded for scripting in the localization application Passolo):
Sub Main
.
.
Begin Dialog UserDialog 690,404,"Export and Import Text Files" ' %GRID:10,7,1,1
.
.
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 20,221,190,14,"Import translations",.optImport
I would like to assign an event handler to capture the change in selection so that I can enable/disable some other controls in the dialog depending on the current selection.
How do I define an event handler for an OptionGroup? Should it be defined at OptionGroup-level or at OptionButton-level (i.e. one event handler for each radio button)?
vba sax winwrap
add a comment |
I have the following OptionGroup defined in dialog in VBA compatible Sax Basic Engine (embedded for scripting in the localization application Passolo):
Sub Main
.
.
Begin Dialog UserDialog 690,404,"Export and Import Text Files" ' %GRID:10,7,1,1
.
.
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 20,221,190,14,"Import translations",.optImport
I would like to assign an event handler to capture the change in selection so that I can enable/disable some other controls in the dialog depending on the current selection.
How do I define an event handler for an OptionGroup? Should it be defined at OptionGroup-level or at OptionButton-level (i.e. one event handler for each radio button)?
vba sax winwrap
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17
add a comment |
I have the following OptionGroup defined in dialog in VBA compatible Sax Basic Engine (embedded for scripting in the localization application Passolo):
Sub Main
.
.
Begin Dialog UserDialog 690,404,"Export and Import Text Files" ' %GRID:10,7,1,1
.
.
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 20,221,190,14,"Import translations",.optImport
I would like to assign an event handler to capture the change in selection so that I can enable/disable some other controls in the dialog depending on the current selection.
How do I define an event handler for an OptionGroup? Should it be defined at OptionGroup-level or at OptionButton-level (i.e. one event handler for each radio button)?
vba sax winwrap
I have the following OptionGroup defined in dialog in VBA compatible Sax Basic Engine (embedded for scripting in the localization application Passolo):
Sub Main
.
.
Begin Dialog UserDialog 690,404,"Export and Import Text Files" ' %GRID:10,7,1,1
.
.
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 20,221,190,14,"Import translations",.optImport
I would like to assign an event handler to capture the change in selection so that I can enable/disable some other controls in the dialog depending on the current selection.
How do I define an event handler for an OptionGroup? Should it be defined at OptionGroup-level or at OptionButton-level (i.e. one event handler for each radio button)?
vba sax winwrap
vba sax winwrap
edited Nov 12 at 22:09
K.Dᴀᴠɪs
6,792112139
6,792112139
asked Mar 24 '16 at 19:13
Pep
98321333
98321333
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17
add a comment |
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17
add a comment |
1 Answer
1
active
oldest
votes
In Sax Basic/WinWrap Basic the closest thing to an event handler that I am aware of is the (dialogfunc) prototype. Your implementation should handle changes to OptionGroup values in case 2: the top radio button will have SuppValue 0.
The dialogfunc in the example below will output text to the Passolo Messages window when you select a radio button:
Sub Main
Begin Dialog UserDialog 690,404, "Export and Import Text Files",.ExpImpDlgFunct
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 30,221,190,14,"Import translations",.optImport
OKButton 30,280,60,20
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Private Function ExpImpDlgFunct(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Case 2 ' Value changing or button pressed
If DlgItem = "ExportImport" Then
Select Case SuppValue
Case 0:
PSL.Output("Export")
Case 1:
PSL.Output("Import")
End Select
End If
Rem DlgFunc = True ' Prevent button press from closing the dialog box
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
Case 6 ' Function key
End Select
End Function
You can find additional examples of dialogfuncs here and here.
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36208247%2fhow-do-i-define-an-event-handler-for-an-optiongroup-in-vba-compatible-sax-basic%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Sax Basic/WinWrap Basic the closest thing to an event handler that I am aware of is the (dialogfunc) prototype. Your implementation should handle changes to OptionGroup values in case 2: the top radio button will have SuppValue 0.
The dialogfunc in the example below will output text to the Passolo Messages window when you select a radio button:
Sub Main
Begin Dialog UserDialog 690,404, "Export and Import Text Files",.ExpImpDlgFunct
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 30,221,190,14,"Import translations",.optImport
OKButton 30,280,60,20
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Private Function ExpImpDlgFunct(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Case 2 ' Value changing or button pressed
If DlgItem = "ExportImport" Then
Select Case SuppValue
Case 0:
PSL.Output("Export")
Case 1:
PSL.Output("Import")
End Select
End If
Rem DlgFunc = True ' Prevent button press from closing the dialog box
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
Case 6 ' Function key
End Select
End Function
You can find additional examples of dialogfuncs here and here.
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
add a comment |
In Sax Basic/WinWrap Basic the closest thing to an event handler that I am aware of is the (dialogfunc) prototype. Your implementation should handle changes to OptionGroup values in case 2: the top radio button will have SuppValue 0.
The dialogfunc in the example below will output text to the Passolo Messages window when you select a radio button:
Sub Main
Begin Dialog UserDialog 690,404, "Export and Import Text Files",.ExpImpDlgFunct
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 30,221,190,14,"Import translations",.optImport
OKButton 30,280,60,20
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Private Function ExpImpDlgFunct(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Case 2 ' Value changing or button pressed
If DlgItem = "ExportImport" Then
Select Case SuppValue
Case 0:
PSL.Output("Export")
Case 1:
PSL.Output("Import")
End Select
End If
Rem DlgFunc = True ' Prevent button press from closing the dialog box
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
Case 6 ' Function key
End Select
End Function
You can find additional examples of dialogfuncs here and here.
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
add a comment |
In Sax Basic/WinWrap Basic the closest thing to an event handler that I am aware of is the (dialogfunc) prototype. Your implementation should handle changes to OptionGroup values in case 2: the top radio button will have SuppValue 0.
The dialogfunc in the example below will output text to the Passolo Messages window when you select a radio button:
Sub Main
Begin Dialog UserDialog 690,404, "Export and Import Text Files",.ExpImpDlgFunct
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 30,221,190,14,"Import translations",.optImport
OKButton 30,280,60,20
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Private Function ExpImpDlgFunct(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Case 2 ' Value changing or button pressed
If DlgItem = "ExportImport" Then
Select Case SuppValue
Case 0:
PSL.Output("Export")
Case 1:
PSL.Output("Import")
End Select
End If
Rem DlgFunc = True ' Prevent button press from closing the dialog box
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
Case 6 ' Function key
End Select
End Function
You can find additional examples of dialogfuncs here and here.
In Sax Basic/WinWrap Basic the closest thing to an event handler that I am aware of is the (dialogfunc) prototype. Your implementation should handle changes to OptionGroup values in case 2: the top radio button will have SuppValue 0.
The dialogfunc in the example below will output text to the Passolo Messages window when you select a radio button:
Sub Main
Begin Dialog UserDialog 690,404, "Export and Import Text Files",.ExpImpDlgFunct
OptionGroup .ExportImport
OptionButton 30,77,190,14,"Export for translation",.optExport
OptionButton 30,221,190,14,"Import translations",.optImport
OKButton 30,280,60,20
End Dialog
Dim dlg As UserDialog
Dialog dlg
End Sub
Private Function ExpImpDlgFunct(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Case 2 ' Value changing or button pressed
If DlgItem = "ExportImport" Then
Select Case SuppValue
Case 0:
PSL.Output("Export")
Case 1:
PSL.Output("Import")
End Select
End If
Rem DlgFunc = True ' Prevent button press from closing the dialog box
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
Case 6 ' Function key
End Select
End Function
You can find additional examples of dialogfuncs here and here.
answered Mar 30 '16 at 12:25
Jenszcz
45928
45928
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
add a comment |
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
Thanks, it seems to do the trick!
– Pep
Mar 30 '16 at 15:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36208247%2fhow-do-i-define-an-event-handler-for-an-optiongroup-in-vba-compatible-sax-basic%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you sure this is VBA and not VB.NET? If it's VBA please specify the application you are using it with. If it's not VBA, please edit your post accordingly
– Sam
Mar 24 '16 at 19:15
@MacroMan That does not look like VB.NET at all, however it looks like this.
– GSerg
Mar 24 '16 at 19:19
@GSerg agreed, a tad too much of a coincidence methinks
– Sam
Mar 24 '16 at 19:20
Edited the question to clarify that is the VBA compatible Sax Basic engine that the SDL Passolo localization application uses.
– Pep
Mar 24 '16 at 20:17