Autor Beitrag
Jann1k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 866
Erhaltene Danke: 43

Win 7
TurboDelphi, Visual Studio 2010
BeitragVerfasst: Sa 17.02.07 23:28 
Ich hab diesmal ein Problem mit der Klasse TRadioGroup:

In einem Spiel soll man unter verschiedenen Designs wählen können, diese Wahl geschieht mithilfe der Einträge in einer TRadioGroup. Allerdings soll man das Designset nicht während das Spiel läuft umstellen können.

Wie mach ich also meiner Instanz von TRadioGroup klar, dass es das "gecheckte" Item nur umstellt, wenn das spiel nicht läuft ( spiel=false)?

Bin für jeden ratschlaf dankbar.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Sa 17.02.07 23:40 
Moin!

Hmm, warum nicht so? ;)
ausblenden Delphi-Quelltext
1:
RadioGroupDesign.Enabled := NOT Spiel;					

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Jann1k Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 866
Erhaltene Danke: 43

Win 7
TurboDelphi, Visual Studio 2010
BeitragVerfasst: Sa 17.02.07 23:42 
ja aber die lösung ist doch irgendwie ziemlich brutal, gibts da nicht was eleganteres?

vorerst nehm ichs mal trotzdem^^
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Sa 17.02.07 23:44 
Moin!


user profile iconJann1k hat folgendes geschrieben:
ja aber die lösung ist doch irgendwie ziemlich brutal, gibts da nicht was eleganteres?

Hä? :gruebel: Seit wann ist die De-/aktivierung von Komponenten in der GUI denn "brutal"... :? Ich halte das für einen ganz normalen Vorgang. :nixweiss:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Jann1k Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 866
Erhaltene Danke: 43

Win 7
TurboDelphi, Visual Studio 2010
BeitragVerfasst: Sa 17.02.07 23:59 
ja, vielleicht störts mich auch einfach, dass der Anwender das sofort mitkriegt, weil die Groupbox sich farblich ändert.

Und wie würde man denn das machen wenn nur bestimmte Elemente aus der Gropbox angeklickt werden dürften?
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 18.02.07 00:39 
Naja, quick&dirty wäre, wenn du dir einfach in ner Variable merkst, welches Item angewählt ist. Und wenn dann ein neues ausgewählt wurde, was nicht ausgewählt werden darf, setzt du dem Index des ausgewählten Items einfach wieder zurück. Aber eigentlich ist die Methode von Narses die übliche und normalerweise soll man doch auch mitbekommen, wenn man da nimmer drauf rumklicken darf ;)

Gruß
alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 18.02.07 23:35 
Hallo,

leg doch die RadioGroup auf ein Panel, das dann bei Bedarf auf Enabled = False setzen,
dann ist die RadioGroup auch deaktiviert und man sieht es nicht.

Aber eigentlich ist es doch schön wenn der Anwender sieht, das das Programm mitdenkt :wink:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )