Page 5 of 38
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 3:55 pm
by Marc Vanzegbroeck
Antonio,
This is what I get in MultiEdit if I press ALT-C, and then moving to the opposite corner with the arrow-keys
The blue background is the selected area, this I can copy, or delete...
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 4:02 pm
by Rick Lipkin
Antonio
Just a quick thought .. I do not see a reason to show the entire path of the file you have open .. just the file (.prg ) name should be enough. That would shorten the tab size and be easier to read if you have several files open.
Thanks
Rick Lipkin
ps .. ctrl-y to delete a line would be also nice
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 4:20 pm
by cnavarro
Antonio Linares wrote:Cristobal,
Pero no podriamos activar el modo columna y que solo tenga que usarse las flechas ?
me suena haber visto algo de este modo en la documentación de Scintilla
Antonio, yo antes de darme cuenta que el modo copia con la tecla ALT viene activado por defecto, tenia este codigo con un Bitmap en el Bar
Code: Select all | Expand
METHOD nModColumn() CLASS TEdtScint
Local nSw := ::SendEditor( SCI_GETMOUSESELECTIONRECTANGULARSWITCH, 0, 0 )
if Empty( nSw )
::SendEditor( SCI_SETMOUSESELECTIONRECTANGULARSWITCH, 1 , 0 )
::SendEditor( SCI_SETSELECTIONMODE, SC_SEL_RECTANGLE , 0 )
else
::SendEditor( SCI_SETMOUSESELECTIONRECTANGULARSWITCH, 0 , 0 )
::SendEditor( SCI_SETSELECTIONMODE, SC_SEL_STREAM , 0 )
endif
Return nil
Lo que quieres es solo poder usar las teclas para esta funcion?
Mirare a ver si se puede hacer, pero lo que yo he leido en los foros del autor es que viene activo por defecto, de todas formas, ademas de los comando que aparecen en el codigo anterior, tenemos las asignaciones a las teclas
http://www.scintilla.org/ScintillaDoc.h ... rdCommandsTodas las teclas en la forma:
SCI_*RECTEXTEND, se refieren a este tema
Si encuentro algo lo comento
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 4:23 pm
by cnavarro
Marc Vanzegbroeck wrote:Antonio,
This is what I get in MultiEdit if I press ALT-C, and then moving to the opposite corner with the arrow-keys
The blue background is the selected area, this I can copy, or delete...
No hace falta pulsar ALT-C
Pulsa ALT + SHIFT + Key Left/Right/Down/Up y el area queda marcada
No need to press ALT-C
Press ALT + SHIFT + Key Left / Right / Down / Up and the area is marked
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 4:26 pm
by cnavarro
Rick Lipkin wrote:Antonio
Just a quick thought .. I do not see a reason to show the entire path of the file you have open .. just the file (.prg ) name should be enough. That would shorten the tab size and be easier to read if you have several files open.
Thanks
Rick Lipkin
ps .. ctrl-y to delete a line would be also nice
++1
El nombre completo puede salir en el cToolTip de la pestaña del Folder
The full name can go on the cToolTip eyelash Folder
Excuse the bad translations
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 4:31 pm
by cnavarro
Antonio Linares wrote:Cristobal,
What about Colin's smart indenting request ?
Have you reviewed it already ? many thanks
Antonio
Puedes preguntarle si las sangrias inteligentes funcionan tambien cuando las estructuras estan anidadas?
Ya sabes que mi ingles es el de Google
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 6:22 am
by Antonio Linares
Cristobal,
Si, han de ser anidadas. De hecho asi funcionan en UEStudio.
Sabes como podemos implementarlas ?
muchas gracias
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 7:55 am
by Antonio Linares
Cristobal,
Esto es lo más aproximado que he podido implementar:
Code: Select all | Expand
METHOD AutoIndent() CLASS TScintilla
local nCurLine := ::GetCurrentLineNumber()
local nIndentation := ::GetLineIndentation( nCurLine )
local nPos := ::GetCurrentPos()
::PostMsg( SCI_SETLINEINDENTATION, nCurLine + 1, nIndentation )
::PostMsg( SCI_GOTOPOS, nPos + nIndentation )
return nil
funciona bien las primeras veces, luego no va bien.
La forma de llamarlo que uso es:
Code: Select all | Expand
::oEditor:bKeyDown = { | nKey | If( nKey == VK_RETURN .or. ;
nKey == VK_UP .or. nKey == VK_DOWN,;
::FillFuncList(),),;
If( nKey == VK_RETURN,;
::oEditor:AutoIndent(),) }
Igual debe llamarse cuando nos notifique scintilla de que ha cambiado, y no desde el bKeyDown.
te agradezco tu ayuda, a ver si lo solucionamos
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 8:13 am
by Antonio Linares
Rick,
Both requests implemented
Mark,
Alt-C is working now
Colin,
We are working to properly implement Method AutoIndent(), thanks
new version:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/fivedit.zip
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 9:00 am
by cnavarro
Antonio
El Metodo Autoindent lo tenia asi
Code: Select all | Expand
METHOD AutoIndent() CLASS TEdtScint
Local nCurLine := ::GetCurrentLine()
Local nIndentation := ::SendEditor( SCI_GETLINEINDENTATION, nCurLine-1 , 0 )
if ::GetLineCount() > nCurLine
::GoToLine( nCurLine+1 )
endif
::SendEditor( SCI_SETLINEINDENTATION, nCurLine, nIndentation )
::GotoPos( ::GetCurrentPos() + nIndentation )
return nil
Y lo tengo implementado en el Metodo Notify(
Code: Select all | Expand
case nCode == SCN_CHARADDED // 2001
cLine := ::GetLine( nLine - 1 )
Do Case
Case cChar = 13
.../...
::AutoIndent( cLine )
Pero ahora, como pruebas inciales, para poder implementar la indentacion inteligente estaba desarrollando lo siguiente
But now, as initials tests, in order to implement the smart indentation was developing the following
Code: Select all | Expand
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 := "" //::GetLine( nCurLine - 1 ) // OJO con el nCurLine - 1
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
else
nIndentation := nIndentation + nInd
endif
if ::GetLineCount() > nCurLine
::GoLine( nCurLine+1 )
endif
::SendEditor( SCI_SETLINEINDENTATION, nCurLine, nIndentation )
//::GotoPos( ::GetCurrentPos() + nIndentation )
::GotoPos( nPosInd + nIndentation )
return nil
Seguimos "hablando"
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 9:06 am
by cnavarro
Como nunca he usado ese Editor, tengo una duda
Si escribes
Do While
---> salta hasta aqui ( Ok ? )
---- Cuando escribes Enddo está en esta posicion
Qué hace el Editor?
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 9:52 am
by cnavarro
Como has implementado lo del ALT+C?, a mi personalmente no me gusta mucho pero lo voy a poner como opcional
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:06 am
by sambomb
Some tools Available in xDev Studio ( the editor I use ) that I think is very helpful:
- Bookmark lines by pressing CTRL+SHIFT+1(or 2,3,...,9,0 ) and go to the bookmark via CTRL+1 ( or 2,3,...,9,0 )
- Create/edit code templates with parameters and system info.
- Block tabulation, select x Lines, each line advance the to the next seted tabulation multiple ( I use 3 spaces ) with TAB or to the previous with SHIFT+TAB
xBrowse template
\%1 xBrowse object
\%2 Resource ID
\%3 Dialog
\%4 Array
\%D Date
\%T Time
\%W Windows User
\< Cursor position after include the template
Code: Select all | Expand
//-- Browse created \%D \%T by \%W
\%1 := TXBrowse():New( \%3 )
\%1:CreateFromResource( \%2 )
//-- Definir matriz de itens
\%1:SetArray( \%4,.T. )
//-- Definir estilo
xBrowseStyle(\%1)
\%1:lHScroll := .F.
\%1:nDataType := DATATYPE_ARRAY //2 se não estiver com o xBrowse.CH
//-- Definir cabeçalhos
\%1:aCols[1]:cHeader := ""
\<
//-- Definir tamanho das colunas
\%1:aCols[1]:nWidth := 0
//-- Definir alinhamento dos itens
\%1:aCols[1]:nDataStrAlign := AL_LEFT
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:30 am
by Antonio Linares
Cristobal,
la implementación Alt-C y las otras combinaciones:
Code: Select all | Expand
METHOD SysCommand( nType, nLoWord, nHiWord ) CLASS TScintilla
local oWnd
do case
case nType == SC_KEYMENU
do case
case nLoWord == Asc( "i" )
oWnd = WndMain()
if oWnd:oMsgBar != nil .and. ;
oWnd:oMsgBar:oKeyIns != nil
oWnd:oMsgBar:oKeyIns:lActive = ;
( ::Send( SCI_GETOVERTYPE ) == 1 )
oWnd:oMsgBar:oKeyIns:bMsg = nil
oWnd:oMsgBar:Refresh()
endif
::Send( SCI_EDITTOGGLEOVERTYPE )
case nLoWord == Asc( "l" )
if ::GetSelectionEnd() - ::GetSelectionStart() > 0
::SetSel( ::nCurrentPos, ::nCurrentPos )
else
::nCurrentPos = ::GetCurrentPos()
::SetSel( ::PositionFromLine( ::nLine() - 1 ),;
::PositionFromLine( ::nLine() + 1 ) - 1 )
endif
case nLoWord == Asc( "c" )
if Empty( ::Send( SCI_GETMOUSESELECTIONRECTANGULARSWITCH ) )
::Send( SCI_SETMOUSESELECTIONRECTANGULARSWITCH, 1, 0 )
::Send( SCI_SETSELECTIONMODE, SC_SEL_RECTANGLE, 0 )
else
::Send( SCI_SETMOUSESELECTIONRECTANGULARSWITCH )
::Send( SCI_SETSELECTIONMODE, SC_SEL_STREAM, 0 )
endif
otherwise
// MsgInfo( nLoWord )
endcase
endcase
return nil
Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:31 am
by Antonio Linares
Crsitobal,
De donde obtienes cChar ?
Code: Select all | Expand
case nCode == SCN_CHARADDED // 2001
cLine := ::GetLine( nLine - 1 )
Do Case
Case cChar = 13
.../...
::AutoIndent( cLine )