AGB  ·  Datenschutz  ·  Impressum  







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

Property-Editor

Offene Frage von "cYaONE"
Ein Thema von cYaONE · begonnen am 31. Jul 2003 · letzter Beitrag vom 1. Aug 2003
Antwort Antwort
cYaONE

Registriert seit: 18. Mai 2003
Ort: Sand am Main
192 Beiträge
 
Delphi 7 Personal
 
#1

Re: Property-Editor

  Alt 31. Jul 2003, 12:06
Ich hab den Code von dir jetzt bei mir eingefügt:

Delphi-Quellcode:
unit TestComponent;

interface

uses
  SysUtils, Classes, DesignEditors, DesignIntf;

type
  TTestComponent = class(TComponent)
  private
    { Private-Deklarationen }
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
  published
    { Published-Deklarationen }

  end;
  TComponentMeineAuswahlEditor = class(TStringProperty)
  public
    procedure GetValues(Proc: TGetStrProc); override;
    function GetAttributes: TPropertyAttributes; override;

  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('cYaONE', [TTestComponent]);
  RegisterPropertyEditor(TypeInfo(String), TTestComponent,
      'MeineAuswahl', TComponentMeineAuswahlEditor);

end;

function TComponentMeineAuswahlEditor.GetAttributes: TPropertyAttributes;
begin
  // the property editor will provide a sorted list of possible values
  Result := [paValueList, paSortList];
end;

procedure TComponentMeineAuswahlEditor.GetValues(Proc: TGetStrProc);
begin
  // for each possibility call proc with the string
  Proc('Wert 1');
  Proc('Wert 2');
  Proc('Wert 3');
  Proc('Wert 4');
  Proc('Wert 5');
  Proc('Wert 6');
end;

end.
Das lässt sich auch einwandfrei kompilieren, doch im Objektinspektor ist nichts zu sehn ...
... ich weiß, das liegt daran das ich noch keine Property gesetzt habe, aber auf was muss die Property verweisen?
  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 04:51 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 by Thomas Breitkreuz