FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Introducing FiveTech's fivedit
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 03:55 PM
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...

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 04:02 PM

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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 04:20 PM
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 (fw): Select all Collapse
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 ... rdCommands

Todas las teclas en la forma:
SCI_*RECTEXTEND, se refieren a este tema
Si encuentro algo lo comento
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 04:23 PM
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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 04:26 PM
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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 04:31 PM
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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 06:22 AM

Cristobal,

Si, han de ser anidadas. De hecho asi funcionan en UEStudio.

Sabes como podemos implementarlas ?

muchas gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 07:55 AM
Cristobal,

Esto es lo m谩s aproximado que he podido implementar:

Code (fw): Select all Collapse
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 (fw): Select all Collapse
   ::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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 08:13 AM
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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 09:00 AM
Antonio
El Metodo Autoindent lo tenia asi

Code (fw): Select all Collapse
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 (fw): Select all Collapse
聽 聽 聽 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 (fw): Select all Collapse
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"
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 09:06 AM

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?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 09:52 AM
Antonio Linares wrote: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


Como has implementado lo del ALT+C?, a mi personalmente no me gusta mucho pero lo voy a poner como opcional
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:06 AM
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[/*]
    [/list:u]

    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 (fw): Select all Collapse
    聽 聽//-- 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
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:30 AM
Cristobal,

la implementaci贸n Alt-C y las otras combinaciones:

Code (fw): Select all Collapse
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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Introducing FiveTech's fivedit
Posted: Thu Jan 22, 2015 11:31 AM
Crsitobal,

De donde obtienes cChar ?

Code (fw): Select all Collapse
      case nCode == SCN_CHARADDED           // 2001
           cLine     := ::GetLine( nLine - 1 )
           Do Case
              Case cChar = 13             
                     .../...
                     ::AutoIndent( cLine )
regards, saludos

Antonio Linares
www.fivetechsoft.com