Author Topic: Display a value in a textbox that updates as the cursor moves  (Read 200 times)

donnieworld

  • Member
  • *
  • Posts: 13
Display a value in a textbox that updates as the cursor moves
« on: December 01, 2017, 11:03:37 AM »
How can I display a value in a textbox that updates as the cursor moves in the drawing? Specifically I want the user to select a polyline and I want to show the distance in a textbox from the beginning as the cursor moves.

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1999
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Display a value in a textbox that updates as the cursor moves
« Reply #1 on: December 01, 2017, 11:47:20 AM »
Hi, (dcl-control-settext <textcontrol> (rtos (distance ptStart ptEnd) 2 2)) should do the trick.
It will only work with one of the modeless forms.
The hardest work should be to get noticed about mousecursor moves. I believe you should study the available Lisp-reactors or open a question in any Lisp forum.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Peter2

  • Sr. Member
  • ****
  • Posts: 380
Re: Display a value in a textbox that updates as the cursor moves
« Reply #2 on: December 04, 2017, 05:09:54 AM »
...The hardest work should be to get noticed about mousecursor moves...
What's about "grread"?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1999
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Display a value in a textbox that updates as the cursor moves
« Reply #3 on: December 04, 2017, 06:59:34 AM »
Hi, Peter, yes, I thought about it, but I wasn't sure whether grread would work while gripediting is active.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]