Einzelnen Beitrag anzeigen

Raute50

Registriert seit: 12. Jan 2009
5 Beiträge
 
#1

TNewCheckListBox: Welche Box wurde (dynamisch) ausgewählt

  Alt 27. Jul 2009, 08:54
Salut!


Ich habe ein Problem, bei dem ich nicht weiter komme und sowohl Goolge als auch meine Delphi/Pascal Tutorials mir nicht weiter helfen.

Es geht um die Verwendung von PASCAL innerhalb von InnoSetup, bei der ich eine TNewCheckListBox verwende mit mehreren Auswahlmöglichkeiten. Dazu befindet sich zusätzlich ein TNewStaticText auf der Seite.


Ich möchte jetzt dynamisch den Text ändern, in Abhängigkeit der Zeile, die angeklickt wurde.

Dazu habe ich mal ein Beispiel vorbereitet, bei dem ich hoffe, dass es hier verwendet werden kann:
Delphi-Quellcode:

  ExampleArray : TArrayOfString;
  ExamplePage : TWizardPage;
  ExampleStaticText : TNewStaticText;
  ExampleCheckListBox : TNewCheckListBox;

  ExamplePage := CreateCustomPage(MyInstallationTypPage.ID, 'Choose something','');

  ExampleStaticText := TNewStaticText.Create(ExamplePage);
  ExampleStaticText.Top := ExamplePage.SurfaceHeight - 20;
  ExampleStaticText.AutoSize := True;
  ExampleStaticText.Parent := ExamplePage.Surface;
  ExampleStaticText.Caption := 'ExampleStaticText{DEBUG}';

  ExampleCheckListBox := TNewCheckListBox.Create(ExamplePage);
  ExampleCheckListBox.Width := ExamplePage.SurfaceWidth;
  ExampleCheckListBox.Height := ExampleStaticText.Top;
  ExampleCheckListBox.Flat := False;
  ExampleCheckListBox.Parent := ExamplePage.Surface;

  ExampleCheckListBox.AddCheckBox('zero', ' is zero',
                                              0, True, True, False, False, nil);
  iPW_CBIndex := iMainBoxCount;
  iMainBoxCount := iMainBoxCount +1;

  ExampleArray[0] := ' this is EA[0]';
  ExampleArray[1] := ' this is EA[1]';
  ExampleArray[2] := ' this is EA[2]';

  if iNumberOfTotalSetups > 0 then
  begin
    ExampleCheckListBox.AddCheckBox('one', 'another one', 0, True, True, False, False, nil);
    ExampleCheckListBox.AddCheckBox(ExampleArray[0], ' - 0 ', 1, True,True, False, True, nil);
    ExampleCheckListBox.AddCheckBox(ExampleArray[1], ' - 1 ', 1, True,True, False, True, nil);
    ExampleCheckListBox.AddCheckBox(ExampleArray[2], ' - 2 ', 1, True,True, False, True, nil);
   end;
PERFEKT wäre für mich:
ExampleStaticText.Caption wird auf ExampleArray[ i ] gesetzt, jenachdem welche der drei letzten Zeilen angeklickt wurde.



Weiß jemand zu helfen an dieser Stelle?

Würde mich sehr freuen!

Ich habe leider keine Ahnung, welche Programmiersprache von INNO genau genutzt wird!? Sorry!

Viele Grüße,
#50
  Mit Zitat antworten Zitat