AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi TStringlist als Property - Werte nicht in Laufzeit übernomme
Thema durchsuchen
Ansicht
Themen-Optionen

TStringlist als Property - Werte nicht in Laufzeit übernomme

Ein Thema von Alexander Roth · begonnen am 10. Aug 2007 · letzter Beitrag vom 11. Aug 2007
 
Benutzerbild von Alexander Roth
Alexander Roth

Registriert seit: 17. Mai 2004
Ort: Kenn
574 Beiträge
 
Turbo Delphi für Win32
 
#7

Re: TStringlist als Property - Werte nicht in Laufzeit übern

  Alt 10. Aug 2007, 14:13
Ok:
Alle wäre ein bisschen zuviel, deswegen:


Delphi-Quellcode:
  TExpandPanels = class(TWinControl)
  private
    { Private-Deklarationen }

    PanelArray:TClassArray;

    // Properties
    FCountPanels:integer;
    FColors:TJvRollOutColors;
    FBehaviour:TExpandPanelsBehaviour;
    FCaptions,
    FExpandList,
    FHeightList:TStringList;
    procedure setCountPanels(value:Integer);
    procedure setColors(value:TJvRollOutColors);
    procedure setBehaviour(value:TExpandPanelsBehaviour);
    procedure setCaptions(value:TStringList);
    procedure setExpandList(value:TStringList);
    procedure setHeightList(value:TStringList);


    procedure JvRollOutClick(Sender: TObject);
    procedure ArrangePanels(WhatResize:TWhatResize);
    procedure HotTrackSetActivePanel(value:integer);
    procedure AddPanel;

    procedure CopyColorsTo(AimColors:TJvRollOutColors);

    procedure JvRollOut1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
  published
    { Published-Deklarationen }
    property CountPanels:integer read FCountPanels write setCountPanels;
    property Colors:TJvRollOutColors read FColors write setColors;
    property Behaviour:TExpandPanelsBehaviour read FBehaviour write setBehaviour;
    property Captions:TStringList read FCaptions;
    property ExpandList:TStringList read FExpandList;
    property HeightList:TStringList read FHeightList;

    constructor create(AOwner: TComponent); override;
    destructor destroy; override;
  end;



Delphi-Quellcode:
constructor TExpandPanels.create(AOwner: TComponent);
begin
  inherited create(AOwner);

  FCaptions:=TStringList.Create;
  FExpandList:=TStringList.Create;
  FHeightList:=TStringList.Create;
  FColors:=TJvRollOutColors.Create;
  PanelArray:=TClassArray.create(false);

  Self.Height:=300;
  Self.Width:=150;
  FColors.ButtonColor:=clBlue;
  FColors.HotTrackText:=clRed;

  CountPanels:=3;
end;
Delphi-Quellcode:
destructor TExpandPanels.destroy;
begin
  FCaptions.Free;
  FCaptions:=nil;
  FExpandList.Free;
  FExpandList:=nil;
  FHeightList.Free;
  FHeightList:=nil;
  FColors.Free;
  FColors:=nil;

  PanelArray.Free;
  PanelArray:=nil;

  inherited destroy;
end;
Delphi-Quellcode:
procedure TExpandPanels.setCaptions(value:TStringList);
var i:Integer;
begin
  FCaptions.Assign(value);

  for I := 0 to PanelArray.Count - 1 do
    if value.Count>=PanelArray.count then
      PanelArray[i].Caption:=value[i]
    else
      Continue;
end;




procedure TExpandPanels.setExpandList(value:TStringList);
var i:Integer;
begin
  FExpandList.Assign(value);

  for I := 0 to PanelArray.Count - 1 do
    if value.Count>=PanelArray.count then
      PanelArray[i].Collapsed:= pos('0',value[i])>0
    else
      Continue;

  ArrangePanels(WRRoot);
end;


procedure TExpandPanels.setHeightList(value:TStringList);
var i:Integer;
begin
  FHeightList.Assign(value);

  for I := 0 to PanelArray.Count - 1 do
    if value.Count>=PanelArray.count then
      PanelArray[i].Height:=strtoint(value[i])
    else
      Continue;

  ArrangePanels(WRRoot);
end;
So es ist allerdings egal, ob ich in den set... nur
  FHeightList.Assign(value); oder den anderen kram noch stehen habe.
Der Fehler bleibt!
Alexander Roth
Ich bin umgestiegen auf: Lazarus und Ubuntu! Alles OpenSource!

Besuch doch mal: www.roth.us.ms
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz