Page 3 of 38
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 4:46 pm
by James Bott
Sorry I am not fully awake yet. This is not valid syntax:
::oFunList:SetItems( ASort( Upper( aFuncs ) ) )
What I meant was that we cannot just convert all the data in aFuncs to uppercase before sorting because it will then be displayed in all uppercase which is not what we want.
I think this will do it:
::oFunList:SetItems( ASORT(aFuncs,,, { |x, y| UPPER(x) < UPPER(y) }) )
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 4:57 pm
by cnavarro
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:06 pm
by Antonio Linares
James,
What about this way:
Code: Select all | Expand
METHOD FillFuncList() CLASS TFivedit
local nLines := ::oEditor:GetLineCount(), n
local aFuncs := {}, aTemp := {}, cToken, cLine
local a, nItem := 0
::aFunLines = {}
for n = 1 to nLines
cToken = Lower( Left( cLine := LTrim( ::oEditor:GetLine( n ) ), 4 ) )
if cToken $ "static func,func,proc,clas,meth,hb_f"
AAdd( aTemp, { cLine, n, n, Upper( cLine ) } )
endif
if cToken $ "retu" .or. Left( cToken, 1 ) == "}"
if ! Empty( ATail( aTemp ) )
ATail( aTemp )[ 3 ] = n
endif
endif
next
ASort( aTemp,,, { | x, y | x[ 1 ] < y[ 1 ] } )
for n = 1 to Len( aTemp )
AAdd( ::aFunLines, { aTemp[ n ][ 2 ], aTemp[ n ][ 3 ] } )
next
ASort( aTemp,,, { | x, y | x[ 4 ] < y[ 4 ] } )
for n = 1 to Len( aTemp )
AAdd( aFuncs, aTemp[ n ][ 1 ] )
next
::oFunList:SetItems( aFuncs )
return nil
Please try it and let me know if that is what you meant, thanks
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:08 pm
by Antonio Linares
Its failing to properly jump
Still something to fix...
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:10 pm
by Antonio Linares
Fixed
Code: Select all | Expand
METHOD FillFuncList() CLASS TFivedit
local nLines := ::oEditor:GetLineCount(), n
local aFuncs := {}, aTemp := {}, cToken, cLine
local a, nItem := 0
::aFunLines = {}
for n = 1 to nLines
cToken = Lower( Left( cLine := LTrim( ::oEditor:GetLine( n ) ), 4 ) )
if cToken $ "static func,func,proc,clas,meth,hb_f"
AAdd( aTemp, { cLine, n, n, Upper( cLine ) } )
endif
if cToken $ "retu" .or. Left( cToken, 1 ) == "}"
if ! Empty( ATail( aTemp ) )
ATail( aTemp )[ 3 ] = n
endif
endif
next
ASort( aTemp,,, { | x, y | x[ 4 ] < y[ 4 ] } )
for n = 1 to Len( aTemp )
AAdd( ::aFunLines, { aTemp[ n ][ 2 ], aTemp[ n ][ 3 ] } )
AAdd( aFuncs, aTemp[ n ][ 1 ] )
next
::oFunList:SetItems( aFuncs )
return nil
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:12 pm
by Antonio Linares
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:15 pm
by Antonio Linares
Last locals were not needed:
Code: Select all | Expand
METHOD FillFuncList() CLASS TFivedit
local nLines := ::oEditor:GetLineCount(), n
local aFuncs := {}, aTemp := {}, cToken, cLine
::aFunLines = {}
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:15 pm
by James Bott
I am getting an error when trying to compile the editor.
Error prsht.h 1081 1: '#endif' before '#if'
This file is part of Borland 582.
I am using FWH ver 13.04
Any ideas?
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:20 pm
by Antonio Linares
James,
viewtopic.php?p=147360#p147360You need FWH 15.01 to build Fivedit, as new methods and enhancements were needed.
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:31 pm
by James Bott
OK, I already have it downloaded but I haven't installed it yet.
The sorting works great now.
When looking a the jumplist I notice that all methods are listed twice--once for the class definition and once again for the actual method code. I think other editors ignore the keyword triggers (function, method, etc) when they are indented, thus the class definition method is ignored. This would be a nice feature to add.
I like the addition of the "class" keyword in the jumplist. I have not seen this with my other editors, but I have missed not having it.
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:46 pm
by Antonio Linares
James,
I think it is quite usefull to have methods listed twice, one for the Class header and another for the implementation.
Using that, I just found that method BuildProject() was missing lDebug parameter in the Class header
Its a great way to check that the Class header methods and the implemented methods names match.
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 5:48 pm
by Antonio Linares
Hey, testing it I just found some more to fix
Re: Introducing FiveTech's fivedit
Posted: Tue Jan 20, 2015 6:41 pm
by Marc Vanzegbroeck
Antonio,
I installed Fivedit, but have a problem running in on a dual-screen.
The screen where the programs starts, has a higher resolution then the screen I want it to use in on.
The program loog like this a startup
and this after dragging
So after dragging, you should recalculate the screen.
What I also do with in my programs, is saving on the screen the programs was running the last time it was used. So it start up on the same screen again.
If the screen doesn't exist anymore (after undocking the laptop), then I start the program on screen 0 again.
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 5:12 am
by Antonio Linares
Re: Introducing FiveTech's fivedit
Posted: Wed Jan 21, 2015 6:51 am
by Otto
Dear Antonio,
For learning purpose:
would you be so kind to post the part where you handle the resizing.
Thank you in advance
Otto