Tool to admin the fivewin demos

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Tool to admin the fivewin demos

Post by Otto »

I add here a CHANGE LOG and replace the source to the newest one.
*************************************************************
- direct visualization, order in the header, enter and dblclick to compile by Marcelo Via Giglio
- button for “Open with TextEditor” by Otto
*************************************************************

Maybe there are tools around to manage the FW demos.
I don’t know. For my private use I made this little tool.


Image

****************
2007-11-27 13:55
****************

#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//

function Main()

local oWnd, oBmp
local oBrw, oCol
local aStruc
local oRes, cRes
LOCAL aInhalt := directory("*.prg","D")
LOCAL oFnt

DEFINE FONT oFnt NAME "ARIAL" SIZE 6 ,15 BOLD

DEFINE WINDOW oWnd TITLE "DemoTool" ;
FROM 50,50 TO 700,1030 PIXEL
oWnd:SetFont(oFnt)

oBrw := TXBrowse():New( oWnd )
oBrw:nTop := 10
oBrw:nLeft := 20
oBrw:nBottom := 600
oBrw:nRight := 300

aStruc :={}
aadd(aStruc,{"SOURCE"})
aadd(aStruc,{"2"})
aadd(aStruc,{"3"})

oBrw:SetArray( ainHalt, .T. )
oBrw:aCols[1]:cHeader := 'Source'
oBrw:aCols[1]:nWidth := 157

oBrw:aCols[2]:cHeader := 'Size'
oBrw:aCols[3]:cHeader := 'Date'


oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nRowDividerStyle := LINESTYLE_BLACK

oBrw:lRecordSelector := .f.

oBrw:bChange := {|| fmemoread(oBrw,oRes) }

oBrw:bLDblClick := {|| compile( oBrw ) }

oBrw:bKeyDown := {|nkey| iF( nkey = 13, compile( oBrw ), ) }

oBrw:lHScroll := .f.

oBrw:CreateFromCode()

@ 10,350 GET oRes VAR cRes OF oWnd PIXEL;
MULTILINE ;
SIZE 600, 550 COLOR CLR_BLUE, CLR_WHITE READONLY

@ 570, 350 BUTTON "&Compile" OF oWnd PIXEL SIZE 100,30;
ACTION compile( oBrw )

@ 570, 850 BUTTON "&Exit" OF oWnd PIXEL SIZE 100,30;
ACTION oWnd:end()

@ 570, 500 BUTTON "&Open with TextEditor" OF oWnd PIXEL SIZE 150,30;
ACTION TextEditor( oBrw )

ACTIVATE WINDOW oWnd ON INIT fmemoread(oBrw,oRes)
return nil

//----------------------------------------------------------------------------//
func fmemoread(oBrw,oRes)
local cFile := oBrw:aArrayData[oBrw:nArrayAt,1]
oRes:cText( MemoRead( cFile ) )
return nil

//----------------------------------------------------------------------------//
function compile( oBrw )
//winexec("buildx.bat " + substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) )
winexec("buildh.bat " + substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) )
return nil

//----------------------------------------------------------------------------//
function TextEditor( oBrw )
winexec("c:\MEW8\MEW32.exe " + oBrw:aArrayData[oBrw:nArrayAt,1] )
return nil
Last edited by Otto on Tue Nov 27, 2007 12:56 pm, edited 3 times in total.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Post by Marcelo Via Giglio »

Otto,

interesting and usefull, I added some things, direct visualization, order in the header, enter and dblclick to compile.

saludos y gracias

Marcelo

Code: Select all

#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//

function Main()

local oWnd, oBmp
local oBrw, oCol
local aStruc
local oRes, cRes
LOCAL aInhalt := directory("*.prg","D") 
LOCAL oFnt

DEFINE FONT oFnt NAME "ARIAL" SIZE 6 ,15 BOLD

DEFINE WINDOW oWnd TITLE "DemoTool" ;
FROM 50,50 TO 700,1030 PIXEL
oWnd:SetFont(oFnt)

oBrw := TXBrowse():New( oWnd )
oBrw:nTop := 10
oBrw:nLeft := 20
oBrw:nBottom := 600
oBrw:nRight := 300

aStruc :={}
aadd(aStruc,{"SOURCE"})
aadd(aStruc,{"2"})
aadd(aStruc,{"3"})

oBrw:SetArray( ainHalt,  .T. )
oBrw:aCols[1]:cHeader := 'Source'
oBrw:aCols[1]:nWidth := 157

oBrw:aCols[2]:cHeader := 'Size'
oBrw:aCols[3]:cHeader := 'Date'


oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nRowDividerStyle := LINESTYLE_BLACK

oBrw:lRecordSelector := .f.

oBrw:bChange := {|| fmemoread(oBrw,oRes) }

oBrw:bLDblClick := {|| compile( oBrw ) }

oBrw:bKeyDown := {|nkey| iF( nkey = 13, compile( oBrw ), ) }

oBrw:lHScroll := .f.

oBrw:CreateFromCode()

@ 10,350 GET oRes VAR cRes OF oWnd PIXEL;
MULTILINE ;
SIZE 600, 550 COLOR CLR_BLUE, CLR_WHITE READONLY

@ 570, 350 BUTTON "&Compile" OF oWnd PIXEL SIZE 100,30;
ACTION compile( oBrw )

@ 570, 850 BUTTON "&Exit" OF oWnd PIXEL SIZE 100,30;
ACTION oWnd:end()

ACTIVATE WINDOW oWnd ON INIT fmemoread(oBrw,oRes) 
return nil

//----------------------------------------------------------------------------//
func fmemoread(oBrw,oRes)
local cFile := oBrw:aArrayData[oBrw:nArrayAt,1]
oRes:cText( MemoRead( cFile ) )
return nil

//----------------------------------------------------------------------------//
function compile( oBrw )
        winexec("buildx.bat " + substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) ) 
return nil
[/code]
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello,

thank you for your contribution.

I added an new button for “Open with TextEditor”

I have replaced the source in the first post of this thread.
IMO, a button for renaming the prg-files next to be done. Who has time?

Regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

Don't you use a professional file manager ? Windows file manager is not enough, its just for final users

We use "Total commander" since many years ago and we can't do any professional programming without it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Antonio,
I as well use wincmd since ever.

But in this case you should have – IMO – a inside possibility to easy rename.

Why do we need an easy tool to manage the demo prgs?

For example:
Yesterday I saw that copyright in xbrowser is from 2002. I could have used this component for years. Only the first try ended badly because the setup was for ADS. And at that moment I had not time to exanimate the error.
Since then I never touched it again up to now (over 5 years!!!). Although the demo testxbrw is very impressive. But I couldn’t look at the demo because it did not compile on my site. And if I see all the questions about TC browser and the few xbrowser entries in the forum I calculate that not much of us use this wonderful browser. This must not happen.


I would like to have all the samples in the fivewin folder to compile on a click and that we could extend them and if there are interesting questions on the forum build immediately a demo prg and distribute it that all users can profit.

Now where can rename the prg files with user friendly names (now more 8 character limitation).

I thought much about a organization of the demo prgs – creating a database, etc. – like the fivedemo – project in sample folder … but who does the work, who maintains the database???

With comments inside the prg-files we have all the information with no extra effort.

Next step I think shoult be a ftp-server where we can share code snips and publish code contributions. Then all can download the files save them to there sample folder and the demotool shows immediately the new files and with the compile button one can run the demos.

Regards,
Otto
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Otto,

I agree, Otto, if the samples were updated with keywords in the comments we could eliminate the database and use fivedemo or a similar program that searches the PRGs for a keyword.

What I use now instead is Copernic Desktop Search. This will find any PRG with any specified keyword in a second or two. A double-click on the file will load it into my editor and another click will compile it. Nothing we could make would be as fast as Copernic. Copernic has a free version of their desktop search (which is what I use).

www.copernic.com

James
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello James,
I too use Copernic Desktop Search. But most times you get too much results back.

I must be honest. I rewrote my ECR software in VB because of the limitations listbox had.
All the work and money (TrueDbGrid from ComponentOne, Apollo database engine to access the dbf files,VB,… ) and that in a time where xBrowser was there. And I didn’t know about. Although I am around frequently in the forum.
As this is a touch screen software I needed higher rows and this was only possible to handle with the font. And the large font does not look very good.
I think the sample prgs should also be included as exe files, too.

I can remember well when Patrick did a great marketing job for FW. But now the fivewin.info user contribution page is nearly dead.
Therefore I think we should establish a new user contribution page because user contributions and 3rd party are very important for our community.


Regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

We are planning to open a new website page just for user contributions and add ons for FiveWin.

We used rapidshare and other similar hosting companies in the past ( see http://fivetechsoft.com/forums/viewforum.php?f=17 ) but the problem is that files get erased, though we have local copies of all of them here in our company
regards, saludos

Antonio Linares
www.fivetechsoft.com
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Post by MOISES »

Hi,

I think it would be a good idea to create a demo to show the latest controls and features (Outlook XP, XP bars...) all together.

In fact, the xbrowse demo should have all the features.

Best regards,
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Otto,

>I too use Copernic Desktop Search. But most times you get too much results back.

You can limit the search to a specific file type or directory. For instance, I get 4 results searching for "xbrowse" in the FWH\samples directory.

James
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Post by Marcelo Via Giglio »

Hello,

here another improve to admin samples tools original of Otto :-), I tryed to use TtxtEdit class but this has some bug to display the code

Regards

Code: Select all

#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//

function Main()

local oWnd
local oBrw, oCol
local oRes, cRes
LOCAL aInhalt := directory("*.prg","D") 
LOCAL oFnt
LOCAL ob0, ob1, ob2, ob3, ob4, ob5, xRes

DEFINE FONT oFnt NAME "ARIAL" SIZE 6 ,15 BOLD

DEFINE WINDOW oWnd TITLE "DemoTool" ;
FROM 50,50 TO 700,1030 PIXEL
oWnd:SetFont(oFnt)

oBrw := TXBrowse():New( oWnd )
oBrw:nTop := 10
oBrw:nLeft := 20
oBrw:nBottom := 600
oBrw:nRight := 330

oBrw:SetArray( ainHalt,  .T. )
oBrw:aCols[1]:cHeader := 'Source'
oBrw:aCols[1]:nWidth := 157

oBrw:aCols[2]:cHeader := 'Size'
oBrw:aCols[3]:cHeader := 'Date'

oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nRowDividerStyle := 4

oBrw:lRecordSelector := .t.

oBrw:bChange := {|| fmemoread( oBrw, oRes ), xRes := cRes,;
                    IF( FILE(substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) + ".exe" ), ob4:enable(), ob4:disable() ),;
                    IF( FILE(substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) + ".rc" ), ob5:enable(), ob5:disable() ) }

oBrw:bLDblClick := {|| compile( oBrw ) }

oBrw:bKeyDown := {|nkey| iF( nkey = 13, compile( oBrw ), ) }

oBrw:lHScroll := .f.

oBrw:CreateFromCode()

@ 10, 350 GET oRes VAR cRes MEMO OF oWnd SIZE 600, 550 PIXEL ;
ON CHANGE ( ob1:enable(), oBrw:disable(), ob3:enable(), ob0:disable() )

@ 570, 350 BUTTON ob0 PROMPT "&Compile" OF oWnd PIXEL SIZE 80,30;
ACTION compile( oBrw )

@ 570, 435 BUTTON ob1 PROMPT "&Save" OF oWnd PIXEL SIZE 80,30;
ACTION ( memowrit( oBrw:aArrayData[oBrw:nArrayAt,1], cRes ), ob1:disable(), ob3:disable(), oBrw:Enable(), ob0:enable() )

@ 570, 520 BUTTON ob2 PROMPT "Save &As" OF oWnd PIXEL SIZE 80,30;
ACTION ( saveas( oBrw, cRes ), ob1:disable(), ob3:disable(), oBrw:Enable(), ob0:enable() )

@ 570, 605 BUTTON ob3 PROMPT "&Cancelar" OF oWnd PIXEL SIZE 80,30;
ACTION ( ob1:disable(), oBrw:Enable(), ob3:disable(), ob0:enable(), cRes := xRes, oRes:refresh() )

@ 570, 690 BUTTON ob4 PROMPT "&Run" OF oWnd PIXEL SIZE 80,30;
ACTION winexec( substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4)  ) ) 

@ 570, 775 BUTTON ob5 PROMPT "RC &File" OF oWnd PIXEL SIZE 80,30;
ACTION ShellExecute( oWnd:hWnd, 'Open', substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) + ".rc" ) 
       
@ 570, 870 BUTTON "&Exit" OF oWnd PIXEL SIZE 80,30;
ACTION oWnd:end()

ACTIVATE WINDOW oWnd ON INIT ( fmemoread(oBrw,oRes), ob1:disable(), ob3:disable(),;
                               IF( FILE(substr(oBrw:aArrayData[1,1],1,( len(oBrw:aArrayData[1,1])-4) ) + ".exe" ), ob4:enable(), ob4:disable() ),;
			       IF( FILE(substr(oBrw:aArrayData[1,1],1,( len(oBrw:aArrayData[1,1])-4) ) + ".rc" ), ob5:enable(), ob5:disable() ) ) 
return nil

//----------------------------------------------------------------------------//
func fmemoread(oBrw,oRes)
local cFile := oBrw:aArrayData[oBrw:nArrayAt,1]
oRes:cText( MemoRead( cFile ) )
return nil

//----------------------------------------------------------------------------//
function compile( oBrw )
        winexec("buildx.bat " + substr(oBrw:aArrayData[oBrw:nArrayAt,1],1,( len(oBrw:aArrayData[oBrw:nArrayAt,1])-4) ) ) 
return nil

//----------------------------------------------------------------------------//
function saveas( oBrw, cRes )
local cFileName
      cFileName := oBrw:aArrayData[oBrw:nArrayAt,1] + SPACE(10)
      IF  msgget("Save as....","File Name", @cFileName )
          memowrit( cFileName, cRes )
          oBrw:SetArray( directory("*.prg","D"),  .T. )	  
	  oBrw:gotop()
	  oBrw:skip( ASCAN( oBrw:aArrayData,{|a| ALLTRIM(a[1]) == ALLTRIM(cFileName) } ) - 1 )
	  oBrw:refresh()
   ENDIF
return nil
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thank you, Marcelo. I put the code on www.FWCodeSnips.com
Regards,
Otto
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Marcelo, could you contact me to send you the latest changes I made.
Regards,
Otto
datron@aon.at
Post Reply