Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDTechnicalLine, Update for TechnicalLine.Left very slow in OnDragOver after upgrading LMD


Been using LMD tools for a number of years in an application. Just upgraded Delphi from D2007 to XE2 and with that I upgraded LMD tools.

I have been using LMD TechnicalLine on a form that acts as a "Vernier" for the user to indicate a subjective response on an analog (typically 1-100 scale). The user can Drag the TechnicalLine, use arrow keys or simply mouse click on the scale and the TechnicalLine moves to that spot then displays the value selected/indicated on the scale which in turn allows the user to record that with a click of a button. (I tried to upload an image of what this looks like and the upload does not work for this png file.)

Before the upgrade/update of Delphi and LMD Tools, Dragging the TechnicalLine toward either end of the scale caused the edit area or label to increase or decrease equally rapidly. Now if I drag the line to the right it works as expected, but if I drag it to the left, the update is very slow and often the scale position does not catch up with the display value. Not sure if this is an issue in OnDragOver or not, but the TechnicalLine.Left value is what is slow to change when decreasing its value, i.e. it is not a problem with the Editor or Label display nor with my simple conversion routine of the TechnicalLine.Left value to a scale position value.

Since this "Vernier" scale is used throughout my application and by the user many times in a patient session, I would appreciate a fix for this. I have tried simply TechnicalLine.update before displaying the change on the Editor/Label, which helps a little, but the difference between the left and right drag is still very dramatic. 

Thank you,

Chuck Belanger


  • 3 Comments sorted by Votes Date Added
  • Hi, All:

    Ok, I think I figured out what is going on here. 
    First, I apologize since it has been literally years since I looked at my "vernier" code. There are two OnDragOvers: one for the panel on which the TLMDTechnical line lays and the TLMDTechnical Line OnDragOver itself. 

    What was working before was the Panel OnDragOver was assigning LMDTechLine.Left its X position then LMDTechLine OnDragOver was calling a routine to process that Left property to get a display position on the scale, which is an image laying over the Panel. 

    For what ever the reason the OnDragOver firing order has changed depending on the direction the drag is initiated; now LMDTechline is firing first when dragged LEFT which means the Left property is not set until after it is needed. The reason it works one direction and not the other seems to be an issue around the way the two drags interpret when the drag starts: if I am moving the cursor RIGHT, the order of the OnDragOver firing changes to allow the TechLine.Left property to be assigned before the position calculation. When I move LEFT the cursor tends to be slightly behind the Techline and the left property is not set via the Panel.OnDragOver. 

    I admit this is bizarre having two OnDragOvers going. When I eliminated the TechLine.OnDragOver, I then had the cursor not changing to a Hand, rather turning into the "Not" image (circle with cross) when I dragged RIGHT. Now, I have moved all the code into the Panel.OnDragOver and use the TechLine.OnDragOver merely to change the cursor properly depending on which direction I am dragging the TechLine over the scale. 

    Whew! I hope that was clear.

    Chuck Belanger
  • >>I hope that was clear.<<

    Not sure :-) Anyway - I already wondered why TechnicalLine should cause problems, because code is really pretty straightforward.

Sign In or Register to comment.