Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Anzahl der Ord in Propertys herausfinden (https://www.delphipraxis.net/113283-anzahl-der-ord-propertys-herausfinden.html)

Net7 5. Mai 2008 17:49


Anzahl der Ord in Propertys herausfinden
 
Hi,

gibt es eine Möglichkeit die Anzahl von möglichen Einstellungen eines Objectpropertys herauszufinden??

Beispiel:
Delphi-Quellcode:
var
ordindex:integer; // gewählter index
ordname:string; // name des eingestellten ords
begin
test := GetPropValue(memo1, 'Name', true);
  memo1.Lines.Add(test);
  ordindex := GetOrdProp(memo1, 'ScrollBars');
  ordname := GetEnumProp(memo1, 'ScrollBars');
  memo1.Lines.Add(test);
...
Bei Defaulteinstellungen des Memos.ScrollBars gibt mir ordname natürlich SSNone zurück. Es gibt insgesamt 4 mögliche Einstellungen ssNone, ssBoth, usw.
Wie bekomme ich aber die Anzahl 4 heraus??? Gibt es dazu eine Funktion??

Mfg Net7

sirius 5. Mai 2008 19:13

Re: Anzahl der Ord in Propertys herausfinden
 
In etwa so:
Delphi-Quellcode:
var PropInfo:PPropInfo;
    TypeData:PTypeData;
begin

  PropInfo:=getpropinfo(memo1,'ScrollBars');
  TypeData:=getTypeData(PropInfo^.PropType^);
 
  memo1.lines.add(inttostr(TypeData^.MinValue));
  memo1.lines.add(inttostr(TypeData^.MaxValue));

Net7 6. Mai 2008 15:39

Re: Anzahl der Ord in Propertys herausfinden
 
:hello:

@sirius genau das suchte ich...

Vielen Dank!

PS:
Delphi-Quellcode:
...
case TTypeKind of
          tkInteger, tkChar, tkEnumeration, tkWChar: (
            MinValue: Longint;
            MaxValue: Longint;
...
Dabei war das immer wieder genau vor meinen Augen :wall:

Mfg Net7


Alle Zeitangaben in WEZ +1. Es ist jetzt 06: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