Mejoras para scintilla
Posted: Fri May 04, 2012 9:42 am
Añadidos a scintila.prg para ir implementando folding ...( ojo solo primeros pasos)
en el metodo Setup()
En el Methodo NotiFy cambiar:
Añadir en la parte #pragma BEGINDUMP
Saludos.
en el metodo Setup()
- Code: Select all Expand view
::Send( SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS )
::Send( SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS)
::Send( SCI_MARKERDEFINE,SC_MARKNUM_FOLDER ,SC_MARK_CIRCLEPLUS )
::Send( SCI_MARKERDEFINE,SC_MARKNUM_FOLDERSUB , SC_MARK_VLINE)
::Send(SCI_MARKERDEFINE ,SC_MARKNUM_FOLDERTAIL ,SC_MARK_LCORNERCURVE )
::Send(SCI_MARKERDEFINE ,SC_MARKNUM_FOLDEREND ,SC_MARK_CIRCLEPLUSCONNECTED )
::Send( SCI_MARKERDEFINE,SC_MARKNUM_FOLDEROPENMID ,SC_MARK_CIRCLEMINUSCONNECTED )
::Send(SCI_MARKERDEFINE ,SC_MARKNUM_FOLDERMIDTAIL ,SC_MARK_TCORNERCURVE )
::Send(SCI_SETMARGINSENSITIVEN , 0 ,1 )
::Send(SCI_SETMARGINSENSITIVEN , 2 ,1 )
En el Methodo NotiFy cambiar:
- Code: Select all Expand view
case nCode == SCN_MARGINCLICK
nPos = GetPosHdr( nPtrNMHDR )
nLine = ::Send( SCI_LINEFROMPOSITION, nPos, 0 )
if GETMARGHDR(nPtrNMHDR) == 2
::Send(SCI_TOGGLEFOLD, nLine)
endif
if GETMARGHDR(nPtrNMHDR) == 0
::SetToggle()
// ::MarkerAdd( nLine, 1 )
endif
// ::MarkerAdd( nLine, 1 )
case nCode == SCN_DOUBLECLICK
// ::SetToggle()
Añadir en la parte #pragma BEGINDUMP
- Code: Select all Expand view
static int GetMarHdr( LPARAM lParam )
{
struct SCNotification * pMsg = ( struct SCNotification * )lParam;
return ( pMsg->margin );
}
HB_FUNC( GETMARGHDR )
{
hb_retni( GetMarHdr( hb_parnl( 1 ) ));
}
Saludos.