Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 27.01.07 13:46 
Nehmen wir an, ich zeichne ein TRect per Canvas auf eine Paintbox.
Wie könnte man es anstellen, dass der Benutzer dieses TRect anklickt und mit Drag'n'Drop verschieben kann?
Mein Problem dabei ist, dass ich nicht weiß, wie ich die Bereiche entferne, aus denen es weggeschoben wird.
Sprich: Es ist an Position1. Ziehen -> An Position2 neuzeichnen -> Position1 Zeichnung entfernen -> Nur wie? :gruebel:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 27.01.07 14:20 
Einfach den ganzen Canvas neu zeichnen.

BTW: Wäre es nicht eifnacher ein Shape zu nehmen?

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 27.01.07 22:08 
user profile iconjakobwenzel hat folgendes geschrieben:
Einfach den ganzen Canvas neu zeichnen.

Gute Idee.
user profile iconjakobwenzel hat folgendes geschrieben:
BTW: Wäre es nicht eifnacher ein Shape zu nehmen?

Geht nicht, da TShape kein Canvas besitzt, soweit ich das mitbekommen habe.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 27.01.07 22:28 
user profile iconMarco D. hat folgendes geschrieben:
user profile iconjakobwenzel hat folgendes geschrieben:
BTW: Wäre es nicht eifnacher ein Shape zu nehmen?

Geht nicht, da TShape kein Canvas besitzt, soweit ich das mitbekommen habe.

Und wozu brauchst du den?
Ein Shape stellt doch bereits ein TRect dar. :wink:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 27.01.07 23:03 
Ich brauche Canvas, weil ich drauf zeichnen will.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 28.01.07 00:00 
Das Shape ist das Rect was bewegt werden soll. Wozu brauchst du auf dem Shape nen Canvas? :roll:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 28.01.07 13:28 
user profile iconjakobwenzel hat folgendes geschrieben:
Das Shape ist das Rect was bewegt werden soll. Wozu brauchst du auf dem Shape nen Canvas? :roll:

Ich sage ja nicht, dass ich ein Shape nehmen werde!
Gut, dann werde ich eben jedes mal das gesamte Canvas neu zeichnen müssen. :(

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: So 28.01.07 13:59 
user profile iconMarco D. hat folgendes geschrieben:
Gut, dann werde ich eben jedes mal das gesamte Canvas neu zeichnen müssen. :(
Wie soll es denn auch anders geben? Windows macht doch auch nix anderes, wenn auch etwas cleverer, da es nur die Bereiche neuzeichnet, die sich verändert haben. Das kannst du natürlich auch implementieren!

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 28.01.07 14:12 
user profile iconwulfskin hat folgendes geschrieben:
Wie soll es denn auch anders geben? Windows macht doch auch nix anderes, wenn auch etwas cleverer, da es nur die Bereiche neuzeichnet, die sich verändert haben. Das kannst du natürlich auch implementieren!

Danke für den Hinweis! Ich überlege mir mal, wie man das umsetzen könnte. ;)
Komme notfalls nochmal auf den Thread zurück :!:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot