Thanks for your sugegstions, but for now we are focusing on the basic functionality.
Once it is complete, then we will enhance Fivedit.
Our goal now is to complete it and that it works properly

Code: Select all
Local cChar := GetCharHdr( nPtrNMHDR )
.../...
//----------------------------------------------------------------------------//
static int GetCharHdr( LPARAM lParam )
{
struct SCNotification * pMsg = ( struct SCNotification * )lParam;
return ( pMsg->ch );
}
//----------------------------------------------------------------------------//
HB_FUNC( GETCHARHDR )
{
hb_retni( GetCharHdr( hb_parnl( 1 ) ));
}
//----------------------------------------------------------------------------//
Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguirAntonio Linares wrote:Cristobal,
Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias
Code: Select all
METHOD AutoIndent( cLine ) CLASS TEdtScint
Local nCurLine := ::GetCurrentLine()
Local nIndentation := ::SendEditor( SCI_GETLINEINDENTATION, nCurLine-1 , 0 )
Local x
Local nPos := 0
Local nInd := ::SendEditor( SCI_GETINDENT, 0, 0 )
Local aCad1 := {"for ", "while ", "if ", "with ", "case " }
Local aCad2 := {"next ", "enddo ", "endif ", "end ", "endcase ", ;
"endwhile ", "endwith ", "else ", "otherwise " }//loop switch "
Local nPosInd := ::SendEditor( SCI_GETLINEINDENTPOSITION, nCurLine, )
DEFAULT cLine := ""
For x = 1 to Len( aCad1 )
nPos := At( aCad1[ x ], Lower( cLine ) )
if !Empty( nPos )
x := Len( aCad1 ) + 1
endif
Next x
if Empty( nPos )
/*
For x = 1 to Len( aCad2 )
nPos := At( aCad2[ x ], Lower( cLine ) )
if !Empty( nPos )
x := Len( aCad2 ) + 1
endif
Next x
*/
/*
if !Empty( nPos )
nIndentation := nIndentation - nInd
endif
*/
nPosInd := 0
else
nIndentation := nIndentation + nInd
endif
if ::GetLineCount() > nCurLine
::GoLine( nCurLine + 1 )
endif
::SendEditor( SCI_SETLINEINDENTATION, nCurLine, nPosInd + nIndentation )
::GotoPos( ::GetCurrentPos() + nIndentation )
return nil
The bookmark looks simple, I could do it myself but I don't have the last edition of fivewin.Antonio Linares wrote:Samir,
Thanks for your sugegstions, but for now we are focusing on the basic functionality.
Once it is complete, then we will enhance Fivedit.
Our goal now is to complete it and that it works properly
Habria que añadir las mayúsculas, no?Antonio Linares wrote:Cristobal,
la implementación Alt-C y las otras combinaciones:
Code: Select all
METHOD SysCommand( nType, nLoWord, nHiWord ) CLASS TScintilla .../... case nLoWord == Asc( "i" ) .or. nLoWord == Asc( "I" )
Perhaps this could be an option? Then we could turn it off and on as needed or desired.I think it is quite useful to have methods listed twice, one for the Class header and another for the implementation.
You have the Class TScintilla in your current FWH version, so you can modify it.sambomb wrote:The bookmark looks simple, I could do it myself but I don't have the last edition of fivewin.Antonio Linares wrote:Samir,
Thanks for your sugegstions, but for now we are focusing on the basic functionality.
Once it is complete, then we will enhance Fivedit.
Our goal now is to complete it and that it works properly
Las pulsaciones Alt+... son rutadas automaticamente al método SysCommand, pues Windows genera un mensaje WM_SYSCOMMAND.cnavarro wrote:Habria que añadir las mayúsculas, no?Antonio Linares wrote:Cristobal,
la implementación Alt-C y las otras combinaciones:
Code: Select all
METHOD SysCommand( nType, nLoWord, nHiWord ) CLASS TScintilla .../... case nLoWord == Asc( "i" ) .or. nLoWord == Asc( "I" )
Antonio, por qué crear un nuevo Metodo y no utilizar el que ya existe? -> HandleEvent
Hay algun motivo?
Gracias
La clave me la distes con usar el método Notifycnavarro wrote:Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguirAntonio Linares wrote:Cristobal,
Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias
Hacia la derecha ya funciona bastante bien
--------------------------------------------- EDITADO
De momento, esto funciona muy bien
Currently, this works very wellCode: Select all
METHOD AutoIndent( cLine ) CLASS TEdtScint Local nCurLine := ::GetCurrentLine() Local nIndentation := ::SendEditor( SCI_GETLINEINDENTATION, nCurLine-1 , 0 ) Local x Local nPos := 0 Local nInd := ::SendEditor( SCI_GETINDENT, 0, 0 ) Local aCad1 := {"for ", "while ", "if ", "with ", "case " } Local aCad2 := {"next ", "enddo ", "endif ", "end ", "endcase ", ; "endwhile ", "endwith ", "else ", "otherwise " }//loop switch " Local nPosInd := ::SendEditor( SCI_GETLINEINDENTPOSITION, nCurLine, ) DEFAULT cLine := "" For x = 1 to Len( aCad1 ) nPos := At( aCad1[ x ], Lower( cLine ) ) if !Empty( nPos ) x := Len( aCad1 ) + 1 endif Next x if Empty( nPos ) /* For x = 1 to Len( aCad2 ) nPos := At( aCad2[ x ], Lower( cLine ) ) if !Empty( nPos ) x := Len( aCad2 ) + 1 endif Next x */ /* if !Empty( nPos ) nIndentation := nIndentation - nInd endif */ nPosInd := 0 else nIndentation := nIndentation + nInd endif if ::GetLineCount() > nCurLine ::GoLine( nCurLine + 1 ) endif ::SendEditor( SCI_SETLINEINDENTATION, nCurLine, nPosInd + nIndentation ) ::GotoPos( ::GetCurrentPos() + nIndentation ) return nil
Code: Select all
METHOD AutoIndent() CLASS TScintilla
local nPrevLine := ::GetCurrentLineNumber() - 1
local nIndentation := ::GetLineIndentation( nPrevLine )
local nPos := ::GetCurrentPos()
::Send( SCI_SETLINEINDENTATION, nPrevLine + 1, nIndentation )
::InsertText( nPos, Space( nIndentation ) )
::Send( SCI_GOTOPOS, nPos + nIndentation )
return nil
Antonio, es que el tema de las teclas lo tenia implementado asi:Antonio Linares wrote:Cristobal,
cnavarro wrote:Las pulsaciones Alt+... son rutadas automaticamente al método SysCommand, pues Windows genera un mensaje WM_SYSCOMMAND.Antonio Linares wrote:Cristobal,
Antonio, por qué crear un nuevo Metodo y no utilizar el que ya existe? -> HandleEvent
Hay algun motivo?
Gracias
Code: Select all
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TEdtScint
.../...
Case nMsg == WM_SYSCOMMAND
Do Case
Case nWParam == SC_KEYMENU
.../...
Antonio, a mi tambien me funciona sin necesidad de:Antonio Linares wrote:Cristobal,
La clave me la distes con usar el método Notifycnavarro wrote:Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguirAntonio Linares wrote:Cristobal,
Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias
Hacia la derecha ya funciona bastante bien
--------------------------------------------- EDITADO
De momento, esto funciona muy bien
Currently, this works very wellCode: Select all
METHOD AutoIndent( cLine ) CLASS TEdtScint Local nCurLine := ::GetCurrentLine() Local nIndentation := ::SendEditor( SCI_GETLINEINDENTATION, nCurLine-1 , 0 ) Local x Local nPos := 0 Local nInd := ::SendEditor( SCI_GETINDENT, 0, 0 ) Local aCad1 := {"for ", "while ", "if ", "with ", "case " } Local aCad2 := {"next ", "enddo ", "endif ", "end ", "endcase ", ; "endwhile ", "endwith ", "else ", "otherwise " }//loop switch " Local nPosInd := ::SendEditor( SCI_GETLINEINDENTPOSITION, nCurLine, ) DEFAULT cLine := "" For x = 1 to Len( aCad1 ) nPos := At( aCad1[ x ], Lower( cLine ) ) if !Empty( nPos ) x := Len( aCad1 ) + 1 endif Next x if Empty( nPos ) /* For x = 1 to Len( aCad2 ) nPos := At( aCad2[ x ], Lower( cLine ) ) if !Empty( nPos ) x := Len( aCad2 ) + 1 endif Next x */ /* if !Empty( nPos ) nIndentation := nIndentation - nInd endif */ nPosInd := 0 else nIndentation := nIndentation + nInd endif if ::GetLineCount() > nCurLine ::GoLine( nCurLine + 1 ) endif ::SendEditor( SCI_SETLINEINDENTATION, nCurLine, nPosInd + nIndentation ) ::GotoPos( ::GetCurrentPos() + nIndentation ) return nil
Ya lo tengo funcionando asi:
Code: Select all
METHOD AutoIndent() CLASS TScintilla local nPrevLine := ::GetCurrentLineNumber() - 1 local nIndentation := ::GetLineIndentation( nPrevLine ) local nPos := ::GetCurrentPos() ::Send( SCI_SETLINEINDENTATION, nPrevLine + 1, nIndentation ) ::InsertText( nPos, Space( nIndentation ) ) ::Send( SCI_GOTOPOS, nPos + nIndentation ) return nil
Code: Select all
::InsertText( nPos, Space( nIndentation ) )
-------------------------- EDITADO --------------------------------------------Antonio Linares wrote:Cristobal,
A mi sin el InsertText() el cursor se va varias líneas más abajo.
Code: Select all
.../...
::SendEditor( SCI_SETUSETABS, 0 )
::SendEditor( SCI_SETTABWIDTH, 3, 0 )
//Set autoindentation con 3 spaces
::SendEditor( SCI_SETINDENT, ::SendEditor( SCI_GETTABWIDTH, 0, 0 ), 0 )
::SendEditor( SCI_SETTABINDENTS, 0, 0 )
::SendEditor( SCI_SETBACKSPACEUNINDENTS, 1, 0 )
.../...