Introducing FiveTech's fivedit

Re: Introducing FiveTech's fivedit

Postby Marc Vanzegbroeck » Wed Jan 21, 2015 3: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...

Image
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Introducing FiveTech's fivedit

Postby Rick Lipkin » Wed Jan 21, 2015 4: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
User avatar
Rick Lipkin
 
Posts: 2606
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Introducing FiveTech's fivedit

Postby cnavarro » Wed Jan 21, 2015 4: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: Select all  Expand view

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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Wed Jan 21, 2015 4: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...

Image


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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Wed Jan 21, 2015 4: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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Wed Jan 21, 2015 4: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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 7:55 am

Cristobal,

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

Code: Select all  Expand view
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 view
  ::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
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Introducing FiveTech's fivedit

Postby cnavarro » Thu Jan 22, 2015 9:00 am

Antonio
El Metodo Autoindent lo tenia asi

Code: Select all  Expand view

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 view


      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 view

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"
Last edited by cnavarro on Thu Jan 22, 2015 9:09 am, edited 1 time in total.
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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Thu Jan 22, 2015 9: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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Thu Jan 22, 2015 9: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
User avatar
cnavarro
 
Posts: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby sambomb » 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

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 view

   //-- 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
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 11:30 am

Cristobal,

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

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 11:31 am

Crsitobal,

De donde obtienes cChar ?

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 13 guests