AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Probleme mit vaList und vaCollection

Ein Thema von Prototypjack · begonnen am 16. Feb 2007
Antwort Antwort
Prototypjack

Registriert seit: 2. Feb 2003
611 Beiträge
 
Delphi 2009 Professional
 
#1

Probleme mit vaList und vaCollection

  Alt 16. Feb 2007, 13:45
Moin!

Wie manch einer vielleicht schon weiss, schreibe ich seit Montag an einem Multilingual System. Mittlerweile steht bereits ein voll funktionsfähiger Prototyp alles was noch fehlt ist die Unterstützung von den Typen vaList (TStrings z.B.) und vaCollection (Die Columns bei einem Listview z.B.).

Ich komme an die Daten so heran wie sie in der DFM Datei stehen, also Plaintext. Die Frage ist jetzt:
Wie bekomme ich genannte Daten zur Laufzeit per RTTI (oder auch anders, wenn ihr irgendeine andere Methode kennt) in die entsprechende Eigenschaft einer Komponente?

Ich denke es hilft nicht viel, aber hier mal meine bisherige Methode zum setzen normaler Strings.

Delphi-Quellcode:
function TLanguage.SetPropertyW(AInstance: TComponent; APropertyName: WideString;
  APropertyValue: WideString): Boolean;
var
  lProperty: WideString;
  lSubPropertys: WideString;
  lComponentWProps: TComponent;
begin
  Result := False;
  lSubPropertys := '';
  lProperty := APropertyName;
  // Get the pure property name
  while Pos('.', lProperty) <> 0 do
  begin
    lSubPropertys := lSubPropertys + Copy(lProperty, 1, Pos('.', lProperty));
    Delete(lProperty, 1, Pos('.', lProperty));
  end;

  // Get the right property/component
  lComponentWProps := AInstance;
  if Assigned(lComponentWProps) then
  begin
    while lSubPropertys <> 'do
    begin
      lComponentWProps := TComponent(GetObjectProp(lComponentWProps,
        Copy(lSubPropertys, 1, Pos('.', lSubPropertys) - 1)));
      Delete(lSubPropertys, 1, Pos('.', lSubPropertys));
    end;
  end;

  // Now set the property
  if Assigned(lComponentWProps) then
  begin
    if IsPublishedProp(lComponentWProps, lProperty) then
    begin
      SetWideStrProp(lComponentWProps, lProperty, APropertyValue);
      Result := True;
    end;
  end;
end;
Ich hoffe, dass mir jemand helfen kann
Gruß,
Max
Max
„If you have any great suggestions, feel free to mail me, and I'll probably feel free to ignore you.“ . Linus Torvalds
  Mit Zitat antworten Zitat
Antwort Antwort


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:13 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