Autor Beitrag
Darkpara
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Do 19.07.07 14:42 
hiho,

ich hab ein kleines problem:
ich hab eine komponente (wie TLabel TEdit..) selbst gebastelt und hab eine property wie diese:
ausblenden Delphi-Quelltext
1:
2:
published
    property    CardType: TCardType Read FCardType Write SetFCardTyp;

nun meine frage kann ich diese property disable machen in abhängigkeit von einem boolean?
habe leider nichts gefunden ich weis nicht mal ob es möglich ist.
alternatif würd ein hide auch reichen

danke im voraus :)

darkpara..
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 19.07.07 14:50 
Wenn ich dich richtig verstehe gar nicht, wenn nicht durch bedingte Kompilierung.

_________________
Markus Kinzler.
Biergeneral
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

WIN XP
Delphi 7 Ent., Delphi 2007 Ent., C/C++ (Eclipse)
BeitragVerfasst: So 22.07.07 16:28 
So ganz verstanden hab ich es auch nicht...
Also du willst, dass die property unter einer bestimmten Bedingung schreibgeschützt ist?

Wenn ja... Leg doch einfach eine Variable an, und prüf das bei der SetCardType-Methode.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  private
  [...]
  FCardTypeReadOnly : Boolean;
  [...]

[...]
procedure TBlaClass.SetCardType(Value: TCardType);
begin
  if not FCardTypeReadOnly then
  begin
    FCardType := Value; // Oder sowas
  end;
end;
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 23.07.07 08:30 
hm wär ne notlösung jo, ging aber eher darum das wenn es schreibgeschützt ist man sieht das man da nichts eintragen muss also in grau oder eben invisible aber das scheint ja ned zu gehen :/
Biergeneral
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

WIN XP
Delphi 7 Ent., Delphi 2007 Ent., C/C++ (Eclipse)
BeitragVerfasst: Fr 27.07.07 23:34 
Geht schon... Ist aber keine Superlösung:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
published 
{$IFNDEF CARDREADONLY}
    property    CardType: TCardType Read FCardType Write SetFCardTyp;
{$ENDIF}


Dann müsstest du das nur unter den Projektoptionen die Direktive CARDREADONLY eintragen.. Jenachdem ob die eben sichtbar sein soll oder nicht... Aber huh =) Wiegesagt.. Toll ist das sicher nicht ;)
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 28.07.07 10:33 
So meint er es vermutlich nicht. Er will das zur Laufzeit ändern.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Biergeneral
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

WIN XP
Delphi 7 Ent., Delphi 2007 Ent., C/C++ (Eclipse)
BeitragVerfasst: So 29.07.07 18:17 
Wenn das ganze zur Laufzeit passiert, wäre das Unsichtbarmachen einer property aber nicht sehr sinnvoll oder? =)


Zuletzt bearbeitet von Biergeneral am So 29.07.07 18:21, insgesamt 2-mal bearbeitet
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 29.07.07 18:19 
Mehr oder weniger zur Laufzeit :mrgreen:.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)