Archive: Tabindex for Custom Page Elements


Tabindex for Custom Page Elements
Hi,
i made a Custom page for Database validation for my installer.
the page contains 2 radio buttons. on the basis i enable disable 2 text boxes. every thing is fine but in case when i use TAB button on keyboard with those radio buttons the loop is going infinite
here the code follows
in the .ini file

[Field 5]
Type=RadioButton
Text=" Windows Authentication"
State=1
Left=28
Right=140
Top=60
Bottom=77
Flags=NOTIFY

[Field 6]
Type=RadioButton
Text=" SQL Authentication"
State=0
Left=150
Right=232
Top=60
Bottom=77
Flags=NOTIFY

i used NOTIFY flag because i need to enable/disable 2 text boxes for username and password on page.

Page custom SelectDatabaseDialog ValidateDatabaseDialog ""
; Finish page
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Readme.txt"
!insertmacro MUI_PAGE_FINISH


the above is the pages i used

and the function follows
Function ValidateDatabaseDialog
ReadINIStr $Auth "$PLUGINSDIR\Database.ini" "Field 5" "State"
ReadINIStr $UserIdBox "$PLUGINSDIR\Database.ini" "Field 8" "HWND"
ReadINIStr $PasswordBox "$PLUGINSDIR\Database.ini" "Field 10" "HWND"
${If} $Auth == 1
EnableWindow $UserIdBox 0
EnableWindow $PasswordBox 0
${Else}

EnableWindow $UserIdBox 1
EnableWindow $PasswordBox 1
${EndIf}
call testDb

FunctionEnd



any help?


Hi
i found the problem
Function testDb
......
.....

${If} $0 == 0
MessageBox MB_OK "Connection Successful"
ClearErrors
Abort

${Else}
MessageBox MB_RETRYCANCEL "Database connection failed, Press Cancel for ignoring the database settings" IDRETRY idRet IDCANCEL idCan
idRet:
SetErrors
Abort
idCan:
ClearErrors
${EndIf}
FunctionEnd

the above function is used for database validation
after validation when i click the OK/Cancel on message box
ValidateDatabaseDialog is getting invoked again.
but this is not happening with mouse clicks, only with Key board TAB button its happening.
any clues?
help is highly appreciated
Thanks
R


i think this will be a good solution.
if i am able to differentiate Enable/Disable text boxes And
Data base validation.
1) i need to call the DB validation function only after Next Button click on Page.
2) i should n't call the DB validation function on changing the state of each radio button

any idea?
Thanks
R