Browse Source

* Calling SetCursorX or SetCursorY with negative values will result in
setting these coordinates to 0 instead (as negative cursor coordinates
are impossible)

sg 26 years ago
parent
commit
d8a64cf039
1 changed files with 14 additions and 3 deletions
  1. 14 3
      fcl/shedit/shedit.pp

+ 14 - 3
fcl/shedit/shedit.pp

@@ -372,14 +372,20 @@ end;
 procedure TSHTextEdit.SetCursorX(NewCursorX: Integer);
 procedure TSHTextEdit.SetCursorX(NewCursorX: Integer);
 begin
 begin
   HideCursor;
   HideCursor;
-  FCursorX := NewCursorX;
+  if NewCursorX >= 0 then
+    FCursorX := NewCursorX
+  else
+    FCursorX := 0;
   ShowCursor;
   ShowCursor;
 end;
 end;
 
 
 procedure TSHTextEdit.SetCursorY(NewCursorY: Integer);
 procedure TSHTextEdit.SetCursorY(NewCursorY: Integer);
 begin
 begin
   HideCursor;
   HideCursor;
-  FCursorY := NewCursorY;
+  if NewCursorY >= 0 then
+    FCursorY := NewCursorY
+  else
+    FCursorY := 0;
   ShowCursor;
   ShowCursor;
 end;
 end;
 
 
@@ -401,7 +407,12 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-12-22 22:28:09  peter
+  Revision 1.7  1999-12-23 09:47:09  sg
+  * Calling SetCursorX or SetCursorY with negative values will result in
+    setting these coordinates to 0 instead (as negative cursor coordinates
+    are impossible)
+
+  Revision 1.6  1999/12/22 22:28:09  peter
     * updates for cursor setting
     * updates for cursor setting
     * button press event works
     * button press event works