Subject:Switch cursor to opposite end of selection
Posted by: CharlesK
Date:12/11/2014 10:50:46 PM
How can I switch the cursor from the left end of a selection to the right edge of a selection within a script? I need to insure the cursor is at the left edge of the selection. Assume I have an open file with an active selection. (Using the keyboard, I'd press NumPad 5.) Thank you. |
Subject:RE: Switch cursor to opposite end of selection
Reply by: roblesinge
Date:12/12/2014 11:31:05 AM
There's a method to set the cursor position. I'll try and look it up when I get home. Try checking the SDK documentation. -Rob. |
Subject:RE: Switch cursor to opposite end of selection
Reply by: CharlesK
Date:12/12/2014 2:29:22 PM
I've looked at this three different ways: 1) Sending a keystroke to the data window. If I could figure out the ForwardKey method for ISfDataWnd, I'd send the comma keystroke to the data window. That would probably be the simplest way. Unfortunately, I have not figured this out. 2) Using DoMenu(). Looking at the DoMenuCommands.xls, I see this information like this: IDS_DEFKEYBIND_CURSORTODATAHOME with “CursorTo.DataHome” as the text argument to pass to DoMenu(). Then, I find this: IDS_DEFKEYBIND_CURSORTOGGLEBETWEEENSELECTIONEDGES Hot dog! That's what I want. The problem is there is no text string associated with this, so I can't pass it to DoMenu(). The reason is ToggleSelectionEdge is not in the menu structure of Forge. 3) Digging into the SDK help file, I cannot find any reference to toggling which edge of a selection the cursor is located. The SDK says that SelectionLength is negative if the cursor is at the left edge of a selection and is positive if the cursor is at the right edge of a selection. This does not appear to be true.
I can create a region from right to left or left to right and the selection length is always positive. I'm stumped, as usual. Message last edited on1/13/2015 11:57:30 PM byCharlesK. |
Subject:RE: Switch cursor to opposite end of selection
Reply by: CharlesK
Date:12/13/2014 1:16:58 PM
I finally got it.
Message last edited on12/13/2014 6:47:58 PM byCharlesK. |