Autor Beitrag
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 28.04.03 17:59 
Hi,

mir stellt sich hier die Frage, wie ich am besten irgendwelche visuellen Komponenten neu auf dem Bildschirm zeichne. Z.B. eine Titelleiste in einem Grid, oder ein Button in anderer Farbe oder Größe usw. Gibt es dazu irgendwelche Grundlegenden Informationen? Tutos etc.?

_________________
Gruß
Hansa
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Fr 02.05.03 19:23 
hmmm, in der Regel reicht es, eine neue Komponente abzuleiten und nur die onpaint() Methode zu überschreiben. Da hast du ein Canvas und Rect und kannst so ziemlich alles neu zeichnen. Bei Komponenten, wo Aktionen unterschiedliche Zeichnungen hervorrufen (Button-> gedrückt, markiert, nicht gedrückt) mußt du dann noch den Status in deiner Zeichenroutine abfragen.
Ich hoffe, es hilft ein wenig.
grez
msch
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 02.05.03 19:59 
Mist, im Moment wenig Zeit, aber wie soll ich das OnPaint - Ereignis überschreiben ? Ich glaube mittlerweile das Zauberwort heißt INVALIDATE.

_________________
Gruß
Hansa
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Sa 03.05.03 07:21 
hä ? Invalidate() macht nichts weiter, als das Element für ungültig zu erklären und damit die Methode auffordert, sich neu zu zeichnen. Allerdings mit den Standardmethoden.

Warum so kompliziert?

ausblenden Quelltext
1:
2:
3:
4:
type TMyButton = Class(TButton)
...
procedure Paint()
...


fertig ist die Ableitung.

grez
msch
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 05.05.03 08:17 
Hallo,

also um eine Methode zu überschreiben muss man noch Override dahinter setzen:
ausblenden Quelltext
1:
2:
3:
4:
type 
  TMyButton = Class (TButton) 
    ... 
    procedure Paint(); override;

gruß
Tino


Zuletzt bearbeitet von Tino am Di 06.05.03 08:20, insgesamt 1-mal bearbeitet
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mo 05.05.03 17:43 
jeap, sorry, hat ich vergessen
msch