In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)
+1
A:
Since the scripting in innosetup is loosely based on Delphi, the controls should have some events like OnEnter
(= control got focus) and OnExit
(= control lost focus). You can assign procedures to these events, something like this:
ComboBox.OnExit := ComboBoxExit;
procedure ComboBoxExit(Sender: TObject);
begin
end;
I don't have access to Innosetup right now, so you will need to lookup the available events and parameters for the procedures.
Otherside
2008-09-26 13:10:25
+3
A:
Took me some time to work it out, but after being pointed in the right direction by Otherside, I finally got it (works for version 5.2):
[Code]
var
MyCustomPage : TWizardPage;
procedure MyEditField_OnChange(Sender: TObject);
begin
MsgBox('TEST', mbError, MB_OK);
end;
function MyCustomPage_Create(PreviousPageId: Integer): Integer;
var
MyEditField: TEdit;
begin
MyCustomPage := CreateCustomPage(PreviousPageId, 'Caption', 'Description');
MyEditField := TEdit.Create(MyCustomPage);
MyEditField.OnChange := @MyEditField_OnChange;
end;
Treb
2008-10-01 13:44:34
Can you add the version of Inno Setup that you are using this code with? It looks like version 5. I ask this because I know there is quite a lot of difference regarding custom pages between versions 4 and 5.
Otherside
2008-10-02 13:00:24
Hi Otherside, I added the version number to my answer. Thanks again for the help!
Treb
2008-10-04 08:07:50