![]() |
Re: Stringgrid selection Problem !
Liste der Anhänge anzeigen (Anzahl: 1)
:hi: Richard
Hab mal ein Bildchen angehängt. Willst Du sowas in der Art? mfg Tobias |
Re: Stringgrid selection Problem !
halli Miri! : :-D
ja, ja, jaaaaaaaaaaa , genau so will ich das haben wie haste das gemacht ????? Ps: kannste mir vielleicht ma dein testproject schicken, von dem du denn screenshot gemacht hast, das sieht ziemlich nuetzlich aus mit den cellpositionen :dance: |
Re: Stringgrid selection Problem !
:hi:
Es ist eben noch nicht so perfekt :oops: :mrgreen: Ich poste Dir den Code wenns besser läuft. Ok? mfg Tobias |
Re: Stringgrid selection Problem !
@richard_boderich
Na ja, den kleinen Bug in meiner Lösung hättest Du ja auch selbst entfernen können :mrgreen: Einfach mal die Methode CellInRange austauschen.
Delphi-Quellcode:
...:cat:...
function TForm1.CellInRange(aGrid: TCustomDrawGrid; aCol, aRow: Integer
): Boolean; var Dummy, StartPoint, EndPoint: TGridCoord; begin Result := False; StartPoint.X := aGrid.Col; StartPoint.Y := aGrid.Row; if aGrid.Selection.Left <> StartPoint.X then EndPoint.X := aGrid.Selection.Left else EndPoint.X := aGrid.Selection.Right; if aGrid.Selection.Top <> StartPoint.Y then EndPoint.Y := aGrid.Selection.Top else EndPoint.Y := aGrid.Selection.Bottom; if StartPoint.Y > EndPoint.Y then begin Dummy := StartPoint; StartPoint := EndPoint; EndPoint := Dummy; end; if aRow < StartPoint.Y then Exit; if aRow = StartPoint.Y then if aCol < StartPoint.X then Exit; if aRow > EndPoint.Y then Exit; if aRow = EndPoint.Y then if aCol > EndPoint.X then Exit; Result := True; end; |
Re: Stringgrid selection Problem !
hi miri,
ja, ok machma so. :cheers: ist deine loesung sauber programmiert, oder sind da irgentwelche dirty tricks drin ?? gib mir mal n ansatz, dann kann ich selber proggen, weil komme ohne das nich weiter :wink: |
Re: Stringgrid selection Problem !
Und meine Lösung :cry: Die ist jetzt doch sauber und sollte gehen :cry:
...:cat:... |
Re: Stringgrid selection Problem !
:hi: Richard,
Nimm Sakuras Variante, er hat etwa das selbe gemacht wie ich und es funktioniert. mfg Tobias [Edit] :gruebel: nachdem ich meine Source gelöscht habe funktioniert dein Code auch nicht mehr ^^ [/Edit] |
Re: Stringgrid selection Problem !
hallo sakura,
hab grad nochmal deinen neuen code getestet, funktioniert auch nicht !!! haste das aus dem gedaechtnis geschrieben oder getestet ? wenn du es getestet hast, dann hast mein problem nich verstanden, aber ich danken trotzdem für deine hilfe :) |
Re: Stringgrid selection Problem !
Zitat:
Zitat:
Jetzt werden doch alle Felder von x1,y1 ... x2,y2 horizontal markiert. Was ist denn noch nicht so wie Du es erwartest :gruebel: ...:cat:... |
Re: Stringgrid selection Problem !
Okay, einen Fehler habe ich noch gefunden:
Code:
...:cat:...
function TForm1.CellInRange(aGrid: TCustomDrawGrid; aCol, aRow: Integer
): Boolean; var Dummy, StartPoint, EndPoint: TGridCoord; begin Result := False; StartPoint.X := aGrid.Col; StartPoint.Y := aGrid.Row; if aGrid.Selection.Left <> StartPoint.X then EndPoint.X := aGrid.Selection.Left else EndPoint.X := aGrid.Selection.Right; if aGrid.Selection.Top <> StartPoint.Y then EndPoint.Y := aGrid.Selection.Top else EndPoint.Y := aGrid.Selection.Bottom; [color=#f50000][s]if StartPoint.Y > EndPoint.Y then[/s] if (StartPoint.Y > EndPoint.Y) or ((StartPoint.Y = EndPoint.Y) and (StartPoint.X > EndPoint.X)) then[/color] begin Dummy := StartPoint; StartPoint := EndPoint; EndPoint := Dummy; end; if aRow < StartPoint.Y then Exit; if aRow = StartPoint.Y then if aCol < StartPoint.X then Exit; if aRow > EndPoint.Y then Exit; if aRow = EndPoint.Y then if aCol > EndPoint.X then Exit; Result := True; end; P.S.: Wenn es das nicht ist, dann solltest Du noch einmal von Grund auf erklären was Du eigentlich willst :gruebel: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:36 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz