Rectangular Selection in wx.stc

Hello,

2 small questions:

1) I saw in scite, that with keyboard only, a rectangular selection
   is possible via Alt-Shift cursor-keys.
   Is this possible in wx.stc too?

2) If I have a selecion say:
   abc
   def
   ghi

   then select the rectangle ab, de, gh (first to char)
   and want to paste it into the pos before 'c', I get:

   abab
   de
   gh
   c
   def
   ghi

   but I want:
   ababc
   dedef
   ghghi

   is there an easy way to do this?

thank you in advance,

···

--
Franz Steinhäusler

DrPython (Project Developer)
http://drpython.sourceforge.net/
http://sourceforge.net/projects/drpython/

Hello,

2) If I have a selecion say:
  abc
  def
  ghi

then select the rectangle ab, de, gh (first to char)
  and want to paste it into the pos before 'c', I get:

  abab
  de
  gh
  c
  def
  ghi

but I want:
  ababc
  dedef
  ghghi

is there an easy way to do this?

the second question: for that, I have found a solution:
as part of a plugin:

(section paste)

if sel_is_rectangle:
        text = do.GetText() # from clipboard
        ind = 0
        pos = self.GetCurrentPos()
        oldpos = pos
        line = self.GetCurrentLine()
        col = self.GetColumn(self.GetCurrentPos())
        while text.find('\n', ind) != -1:
                newind = text.find('\n', ind)
                temp = text [ind:newind-1]
                self.AddText(temp)
                self.GotoPos(pos)
                self.CmdKeyExecute (wx.stc.STC_CMD_LINEDOWN)
                pos = self.GetCurrentPos()
                line += 1
                ind = newind+1
        self.GotoPos(oldpos)

remains only the first question:
rectangular selection with keyboard only.

···

On Thu, 16 Sep 2004 10:22:10 +0200, Franz Steinhäusler <franz.steinhaeusler@gmx.at> wrote:
--
Franz Steinhäusler

DrPython (Project Developer)
http://drpython.sourceforge.net/

Franz Steinhäusler wrote:

Hello,

2 small questions:

1) I saw in scite, that with keyboard only, a rectangular selection
   is possible via Alt-Shift cursor-keys.
   Is this possible in wx.stc too?

Not yet. Some tricks need to be done in the ScintillaWX.cpp layer to make it work.

2) If I have a selecion say:
   abc
   def ghi

   then select the rectangle ab, de, gh (first to char)
   and want to paste it into the pos before 'c', I get:

   abab
   de
   gh
   c
   def
   ghi

   but I want:
   ababc
   dedef
   ghghi

   is there an easy way to do this?

Once the rectangle work in ScintillaWX is done it will probably work that way.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!