Jeffrey Ren wrote:
Or, maybe the rectangle can be selected ONLY via Alt+mouse?

From: "Jeffrey Ren" <[EMAIL PROTECTED]>
Reply-To: Discussion of the Scintilla editing component<[email protected]>
To: [email protected]
Subject: [scintilla] How to select a rectangle in code
Date: Wed, 01 Mar 2006 17:36:09 +0800

How can I select a rectangle in code?
The following code can select a rectange, but the range is bigger than expected rectange.
The select range includes the current position.
But the anchor pos and current pos are right.

pCtrl->SetSel(AnchorPos, CurPos);
pCtrl->SetSelectionMode(SC_SEL_RECTANGLE);
pCtrl->CallMessage(SCI_CANCEL);

No, extensive support of keyboard has been added.
Search in Scintilla.iface the "rectang" string...

## RectExtended rectangular selection moves
# Move caret down one line, extending rectangular selection to new caret position.
fun void LineDownRectExtend=2426(,)

# Move caret up one line, extending rectangular selection to new caret position.
fun void LineUpRectExtend=2427(,)

# Move caret left one character, extending rectangular selection to new caret position.
fun void CharLeftRectExtend=2428(,)

# Move caret right one character, extending rectangular selection to new caret position.
fun void CharRightRectExtend=2429(,)

# Move caret to first position on line, extending rectangular selection to new caret position.
fun void HomeRectExtend=2430(,)

# Move caret to before first visible character on line.
# If already there move to first character on line.
# In either case, extend rectangular selection to new caret position.
fun void VCHomeRectExtend=2431(,)

# Move caret to last position on line, extending rectangular selection to new caret position.
fun void LineEndRectExtend=2432(,)

# Move caret one page up, extending rectangular selection to new caret position.
fun void PageUpRectExtend=2433(,)

# Move caret one page down, extending rectangular selection to new caret position.
fun void PageDownRectExtend=2434(,)

You can use SetSelectionMode to set to SC_SEL_RECTANGLE, and send ordinary moves to define the rectangle. Calling SetSelectionMode with the same parameter toggles between moveExtendsSelection active or deactivated.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to