Autor Beitrag
Soapy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 88

Windows 2000
Delphi 2005 Personal
BeitragVerfasst: Fr 21.03.08 17:10 
Jetzt bin ich mal wieder da :oops: :lol:

Es geht darum:
Ich will feststellen, ob sich TImages unter einem von mir gezogenen Viereck befinden.

Ich hab mir sowas überlegt:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.MainMapStartDrag(Sender: TObject; var DragObject: TDragObject);
begin
RectX1 := ScreenToClient(Mouse.CursorPos).X;
RectY1 := ScreenToClient(Mouse.CursorPos).Y;
end;

procedure TForm1.MainMapEndDrag(Sender, Target: TObject; X, Y: Integer);
var i: integer;
begin
RectX2 := ScreenToClient(Mouse.CursorPos).X;
RectY2 := ScreenToClient(Mouse.CursorPos).Y;
Rselect := Rect(RectX1,RectY1,RectX2,RectY2);
for i := 0 to (length(FImages)-1do begin
  if (FImagesKoordsX[i] > RectX1) and (FImagesKoordsX[i] < RectX2) then begin
    if (FImagesKoordsX[i] > RectX1) and (FImagesKoordsY[i] < RectX2) then begin
      FImages[i].Visible := false;
    end;
  end;
end;

end;


Dies funktioniert leider nicht, und ich weiß nicht ob ich die OnStartDrag und die OnEndDrag- Ereignisse richtig eingesetzt habe, da ich diese Funktionen zum ersten mal eingesetzt habe.

Ich bedanke mich im vorraus schon mal für die Antworten!

_________________
Linux wird nie das meistinstallierte Betriebssystem sein, wenn man bedenkt, wie oft man Windows neu installieren muss!
Soapy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 88

Windows 2000
Delphi 2005 Personal
BeitragVerfasst: Sa 22.03.08 16:58 
hat niemand ne idee? :cry:

_________________
Linux wird nie das meistinstallierte Betriebssystem sein, wenn man bedenkt, wie oft man Windows neu installieren muss!
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 22.03.08 17:03 
imho is start und enddrag zum ziehen von objekten als von Images oder Labels oder so.

ich würd eher MouseUp und MouseDown verwenden. vielleicht funktionierts dann.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Soapy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 88

Windows 2000
Delphi 2005 Personal
BeitragVerfasst: Sa 22.03.08 17:15 
Ok vielen dank!
Ich probiers mal!

_________________
Linux wird nie das meistinstallierte Betriebssystem sein, wenn man bedenkt, wie oft man Windows neu installieren muss!