This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Preselect RadioButton
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 14, 2008
11:09 AM
Preselect RadioButton
Hello!
How can I preselect a Radio Button on my Custom Dialog? I know that this:
CtrlSetState("DlgCertificate", RB_CERTIFICATE_ZEITAG, BUTTON_CHECKED);
is the command to set my Radio Button, but I don't want to execute that everytime the User comes to my dialog, only the first time or anywhere before my CustomDialog, but this code doesn't work outside of my dialog-script...here's the code of my dialog:
Thanks!
Kind regards,
Peter
How can I preselect a Radio Button on my Custom Dialog? I know that this:
CtrlSetState("DlgCertificate", RB_CERTIFICATE_ZEITAG, BUTTON_CHECKED);
is the command to set my Radio Button, but I don't want to execute that everytime the User comes to my dialog, only the first time or anywhere before my CustomDialog, but this code doesn't work outside of my dialog-script...here's the code of my dialog:
//===========================================================================
//
// File Name: DlgCertificate.rul
//
// Description: Script-File for the certificate dialog
//
// Comments: Dialog used to get the certificate from the user
//
//===========================================================================
#define NEXT 1
#define BACK 12
#define CANCEL 9
#define DLG_CERTIFICATE_DIALOG 10103
#define RB_CERTIFICATE_ZEITAG 76
#define RB_CERTIFICATE_OTHER 77
#define EDIT_CERTIFICATE_PATH 4
#define EDIT_CERTIFICATE_PASSWORD 55
#define BTN_BROWSE 31
//Variables to store the certificate values
NUMBER nCertificateZeitag;
STRING szCertificatePath;
STRING szCertificatePassword;
NUMBER hwndDlg;
NUMBER hwndItem;
//Declares the function
prototype NUMBER dlgCertificate();
prototype disableComponents();
prototype enableComponents();
//---------------------------------------------------------------------------
// DlgCertificate
//
// Called for the certificate dialog
//---------------------------------------------------------------------------
function NUMBER dlgCertificate()
BOOL bDone;
NUMBER nControl;
NUMBER nReturn;
begin
EzDefineDialog("DlgCertificate",ISUSER,"", DLG_CERTIFICATE_DIALOG);
//Disable the certificate path, if the certificate of Zeit AG is selected
nCertificateZeitag = CtrlGetState("DlgCertificate", RB_CERTIFICATE_ZEITAG);
if( nCertificateZeitag == BUTTON_CHECKED)
then
disableComponents();
endif;
//WaitOnDialog called repeatly, until the user clicks NEXT, BACK OR ABORT
while (!bDone)
nControl = WaitOnDialog("DlgCertificate");
switch (nControl)
case BACK:
//User has clicked BACK
nReturn = BACK;
bDone = TRUE;
case NEXT:
//USER has clicked NEXT
nReturn = NEXT;
bDone = TRUE;
case RB_CERTIFICATE_ZEITAG:
disableComponents();
case RB_CERTIFICATE_OTHER:
enableComponents();
case CANCEL:
//USER has clicked CANCEL
Do (EXIT);
endswitch;
endwhile;
//Stores the configuration typed by the user
nCertificateZeitag = CtrlGetState("DlgCertificate", RB_CERTIFICATE_ZEITAG);
if(nCertificateZeitag == BUTTON_CHECKED)
then
szCertificatePath = INSTALLDIR;
else
CtrlGetText("DlgCertificate", EDIT_CERTIFICATE_PATH, szCertificatePath);
endif;
CtrlGetText("DlgCertificate", EDIT_CERTIFICATE_PASSWORD, szCertificatePassword);
EndDialog("DlgConfiguration");
ReleaseDialog("DlgConfiguration");
return nReturn;
end;
function disableComponents()
begin
hwndDlg = CmdGetHwndDlg("DlgCertificate");
hwndItem = GetDlgItem(hwndDlg, EDIT_CERTIFICATE_PATH);
EnableWindow(hwndItem, FALSE);
hwndItem = GetDlgItem(hwndDlg, BTN_BROWSE);
EnableWindow(hwndItem, FALSE);
end;
function enableComponents()
begin
hwndDlg = CmdGetHwndDlg("DlgCertificate");
hwndItem = GetDlgItem(hwndDlg, EDIT_CERTIFICATE_PATH);
EnableWindow(hwndItem, TRUE);
hwndItem = GetDlgItem(hwndDlg, BTN_BROWSE);
EnableWindow(hwndItem, TRUE);
end;
Thanks!
Kind regards,
Peter
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 14, 2008
05:48 PM
Perhaps associate the checked state with a variable, and use that in CtrlSetState in the DLG_INIT block of the WaitOnDialog loop instead of hard-coding BUTTON_CHECKED?