Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   TNewCheckListBox: Welche Box wurde (dynamisch) ausgewählt (https://www.delphipraxis.net/137712-tnewchecklistbox-welche-box-wurde-dynamisch-ausgewaehlt.html)

Raute50 27. Jul 2009 08:54


TNewCheckListBox: Welche Box wurde (dynamisch) ausgewählt
 
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! :oops:

Viele Grüße,
#50


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz