Tool to admin the fivewin demos
Posted: Mon Nov 26, 2007 3:03 pm
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.
****************
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
*************************************************************
- 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.
****************
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