Jump to content

Lock/Unlock toggle key?


buz

Recommended Posts

You could use the Workspace Editor and assign a shortcut keystorke for the 2 menu items.

Please refer to the User's Guide for information on how to use the workspace editor if you are not familiar with it.

Link to comment
  • 2 months later...

This has come up several times before. Though there is no direct way to query VS for the Locked attribute, you can use the following function to get the answer. The concept is, if it moves, it's unlocked.

Function IsLocked(Hnd: Handle) :Boolean;

{ Determine LOCKED? by moving object, if it does not move it is locked. }

VAR

x1, y1, x2, y2, x3, y3 :Real;

Begin

GetBBox(Hnd, x1, y1, x2, y2); { Get position in (X1, Y1) }

HMove(Hnd, 1, 0); { try to move it }

GetBBox(Hnd, x2, y2, x3, y3); { Get new position in (X2, Y2) }

HMove(Hnd, -1, 0); { if it moved, move it back }

IsLocked := x1 = x2;

End; { End IsLocked }

HTH,

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...