AGB  ·  Datenschutz  ·  Impressum  







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

Unterproperty in Objektinstpektor

Ein Thema von Taladan · begonnen am 2. Sep 2003 · letzter Beitrag vom 5. Sep 2003
Antwort Antwort
Benutzerbild von Leuselator
Leuselator

Registriert seit: 18. Mär 2003
Ort: Berlin
589 Beiträge
 
Delphi 8 Architect
 
#1

Re: Unterproperty in Objektinstpektor

  Alt 2. Sep 2003, 12:49
z.B.:

Delphi-Quellcode:
type
  TMyComponent = class(TWinControl)
  private
    FVisible,
    FStayOnTop,
    FPopUp,
    FFlashing : Boolean;
  protected
    procedure SetValue(index : Integer; Value : Boolean);
  public

  published
    property Visible : Boolean index 0 read FVisible write SetValue;
    property StayOnTop : Boolean index 1 read FStayOnTop write SetValue;
    property PopUp : Boolean index 2 read FPopUp write SetValue;
    property Flashing : Boolean index 3 read FFlashing write SetValue;
  end;

implementation

procedure TMyComponent.SetValue(index : Integer; Value : Boolean);
begin
  case index of
    0: FVisible := Value;
    1: FStayOnTop := Value;
    2: FPopUp := Value;
    3: FFlashing := Value;
  end;
end;
oder:

Delphi-Quellcode:
type
  TShowMode = (smVisible,smStayOnTop,smPopUp,smFlashing);
  TShowModeSet = set of TShowMode;

  TMyComponent = class(TWinControl)
  private
    FShowMode : TShowModeSet;

    FVisible,
    FStayOnTop,
    FPopUp,
    FFlashing : Boolean;
  protected
    procedure SetValue(Value : TShowModeSet);
  public
    property Visible : Boolean read FVisible ;
    property StayOnTop : Boolean read FStayOnTop;
    property PopUp : Boolean read FPopUp ;
    property Flashing : Boolean read FFlashing ;
  published
    property ShowMode : TShowModeSet read FShowMode write SetValue;
  end;

implementation

procedure TMyComponent.SetValue(Value: TShowModeSet);
begin
    FShowMode := Value;
    FStayOnTop := (smVisible in FShowMode);
    FFlash := (smStayOnTop in FShowMode);
    FPopUp := (smPopUp in FShowMode);
    FFlashing := (smFlashing in FShowMode);
end;

Gruß
Tim Leuschner
  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:13 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