[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] eric3, qscintilla and code folding
From:       Baz Walter <bazwal () ftml ! net>
Date:       2005-10-19 17:32:32
Message-ID: 200510191832.33213.bazwal () ftml ! net
[Download RAW message or body]

On Tuesday 18 Oct 2005 14:36, Brad Ralph wrote:
>
> The problem is I seem to be too fussy.  When you fold all of the children
> (Ctrl - Click) it becomes a bit annoying to have to unfold the if
> statements and triple quoted strings of any method that you are working in.
>  I know that this can be turned off in the settings (so that strings are
> not folded) but then we loose the option to do so if you want to on a case
> by case basis.
>

I thought it might be possible to get a bit closer to what you want if 
QScintilla had a "foldChildren" method, so I wrote one. You could use this to 
add a "Toggle Child Folds" and "Collapse Child Folds" to eric3's View Menu. 
If you also created keyboard shortcuts for these new menu items, it might 
make quite a nice improvement to the user interface.

This function should be added to eric3's QScintilla.Editor class:

def foldChildren(self, line, toggle=True):
	if toggle:
		btnstate = QextScintilla.SCMOD_CTRL
	else:
		btnstate = QextScintilla.SCMOD_SHIFT
	linepos = self.SendScintilla(
				QextScintilla.SCI_POSITIONFROMLINE, line, 0)
	self.emit(
		SIGNAL('SCN_MARGINCLICK(int,int,int)'),
		(linepos, btnstate, 2))

(A ctrl+click toggles all the child-folds of a foldable line.
 A shift+click expands all the child-folds of a foldable line).


HTH

-- 
Baz Walter

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic