Introducing FiveTech's fivedit

Re: Introducing FiveTech's fivedit

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

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 :-)
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby cnavarro » Thu Jan 22, 2015 11:48 am

Antonio

Code: Select all  Expand view


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 ) ));
}
//----------------------------------------------------------------------------//

 


-- ------------------------------- EDITADO
Se me habia olvidado la otra funcion :oops: :P :D :shock:
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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Thu Jan 22, 2015 12:17 pm

Antonio Linares wrote:Cristobal,


Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias :-)


Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguir
Hacia la derecha ya funciona bastante bien

--------------------------------------------- EDITADO
De momento, esto funciona muy bien

Currently, this works very well
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      := ""

   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
 
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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby sambomb » Thu Jan 22, 2015 1:28 pm

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 :-)


The bookmark looks simple, I could do it myself but I don't have the last edition of fivewin.
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 cnavarro » Thu Jan 22, 2015 2:05 pm

Antonio Linares wrote:Cristobal,

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

Code: Select all  Expand view
METHOD SysCommand( nType, nLoWord, nHiWord ) CLASS TScintilla
 .../...
             case nLoWord == Asc( "i" ) .or. nLoWord == Asc( "I" )
 
 




Habria que añadir las mayúsculas, no?

Antonio, por qué crear un nuevo Metodo y no utilizar el que ya existe? -> HandleEvent
Hay algun motivo?
Gracias
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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby James Bott » Thu Jan 22, 2015 3:44 pm

Antonio,

I think it is quite useful to have methods listed twice, one for the Class header and another for the implementation.


Perhaps this could be an option? Then we could turn it off and on as needed or desired.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Thu Jan 22, 2015 4:41 pm

James,

yes, good idea :-)
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Sat Jan 24, 2015 7:50 am

Samir,

sambomb wrote:
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 :-)


The bookmark looks simple, I could do it myself but I don't have the last edition of fivewin.


You have the Class TScintilla in your current FWH version, so you can modify it.

Help us implementing the bookmarks and whatever else you may want to add, and I will gift you a FWH 15.01 :-)
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Sat Jan 24, 2015 7:51 am

Cristobal,

cnavarro wrote:
Antonio Linares wrote:Cristobal,

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

Code: Select all  Expand view
METHOD SysCommand( nType, nLoWord, nHiWord ) CLASS TScintilla
 .../...
             case nLoWord == Asc( "i" ) .or. nLoWord == Asc( "I" )
 
 




Habria que añadir las mayúsculas, no?

Antonio, por qué crear un nuevo Metodo y no utilizar el que ya existe? -> HandleEvent
Hay algun motivo?
Gracias


Las pulsaciones Alt+... son rutadas automaticamente al método SysCommand, pues Windows genera un mensaje WM_SYSCOMMAND.

Buena sugerencia lo de las mayúsculas, gracias :-)
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Sat Jan 24, 2015 7:55 am

Cristobal,

cnavarro wrote:
Antonio Linares wrote:Cristobal,


Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias :-)


Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguir
Hacia la derecha ya funciona bastante bien

--------------------------------------------- EDITADO
De momento, esto funciona muy bien

Currently, this works very well
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      := ""

   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
 


La clave me la distes con usar el método Notify :-) Ya lo tengo funcionando asi:

Code: Select all  Expand view
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
 
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby cnavarro » Sat Jan 24, 2015 8:10 am

Antonio Linares wrote:Cristobal,

cnavarro wrote:
Antonio Linares wrote:Cristobal,

Antonio, por qué crear un nuevo Metodo y no utilizar el que ya existe? -> HandleEvent
Hay algun motivo?
Gracias


Las pulsaciones Alt+... son rutadas automaticamente al método SysCommand, pues Windows genera un mensaje WM_SYSCOMMAND.



Antonio, es que el tema de las teclas lo tenia implementado asi:

Code: Select all  Expand view

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TEdtScint

.../...

      Case nMsg == WM_SYSCOMMAND
           Do Case
              Case nWParam == SC_KEYMENU

.../...

 


por eso te preguntaba donde era mejor implementarlo, en el SysCommand o en este metodo?
Last edited by cnavarro on Sat Jan 24, 2015 1:09 pm, 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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby cnavarro » Sat Jan 24, 2015 8:22 am

Antonio Linares wrote:Cristobal,

cnavarro wrote:
Antonio Linares wrote:Cristobal,


Te está funcionando bien la indentación ? Esperaré a que esté bien y la incluyo. Gracias :-)


Antonio, en mi anterior post te preguntaba como funcionaba el cierre de indentacion, mira a ver si me puedes decir algo para seguir
Hacia la derecha ya funciona bastante bien

--------------------------------------------- EDITADO
De momento, esto funciona muy bien

Currently, this works very well
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      := ""

   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
 


La clave me la distes con usar el método Notify :-) Ya lo tengo funcionando asi:

Code: Select all  Expand view
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, a mi tambien me funciona sin necesidad de:

Code: Select all  Expand view

  ::InsertText( nPos, Space( nIndentation ) )
 
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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Sat Jan 24, 2015 9:49 am

Cristobal,

A mi sin el InsertText() el cursor se va varias líneas más abajo.
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby Antonio Linares » Sat Jan 24, 2015 9:52 am

Colin,

Smart indenting already implemented :-)

James,

On preferences dialogbox new "Duplicates on functions panel" checkbox to remove duplicates :-)

https://bitbucket.org/fivetech/fivewin-contributions/downloads/fivedit.zip
regards, saludos

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

Re: Introducing FiveTech's fivedit

Postby cnavarro » Sat Jan 24, 2015 7:29 pm

Antonio Linares wrote:Cristobal,

A mi sin el InsertText() el cursor se va varias líneas más abajo.


-------------------------- EDITADO --------------------------------------------

Antonio, prueba con lo siguiente en el Setup, y quita la linea de insercion de espacios

Code: Select all  Expand view

.../...

   ::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 )

.../...
 
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: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 24 guests

cron