// Test file to test kate's clipper highlighting
// kate: hl Clipper;

<beginfold id='8'>//BEGIN INCLUDES</beginfold id='8'>
#include <clip-ui.ch>
#include "logo.ch"

#define PRGVERSION	"0.0.1"
<endfold id='8'>//END</endfold id='8'>

<beginfold id='8'>//BEGIN CODE</beginfold id='8'>
static ws, win
static driver := getDriver()
<beginfold id='9'>/*</beginfold id='9'> a multiline
     comment
<endfold id='9'>*/</endfold id='9'>

<beginfold id='1'>function</beginfold id='1'> main( formName )
	local form
	local fileName

	<beginfold id='6'>if</beginfold id='6'> empty(formName)
		?? "Usage: ./form_ui <form.xfl>&\n"
		CANCEL
	<endfold id='6'>else</endfold id='6'><beginfold id='6'>else</beginfold id='6'>
		fileName := formName
	<endfold id='6'>endif</endfold id='6'>
	ws  := UIWorkSpace()

	form := UIForm( fileName )
	win  := form:parseFile()
//	?? valtype(win),chr(10)
	<beginfold id='6'>if</beginfold id='6'> win == NIL
		CANCEL
	<endfold id='6'>endif</endfold id='6'>
	win:show()

	ws:run()
	ws:quit()
<endfold id='1'>return</endfold id='1'> 0

<beginfold id='9'>/*</beginfold id='9'> Setting dialog <endfold id='9'>*/</endfold id='9'>
<beginfold id='1'>function</beginfold id='1'> settingsDialog()
	?? "TODO: Settings dialog&\n"
<endfold id='1'>return</endfold id='1'>

<beginfold id='9'>/*</beginfold id='9'> About dialog <endfold id='9'>*/</endfold id='9'>
<beginfold id='1'>function</beginfold id='1'> aboutDialog()
	local dlg := UIWindow("About", win, "aboutDlg", .F.)
	local hl, lside, t, bb, bD

	hl  := UIHBox(,4,8)
	lside := UIVBox()
	lside:add(UIImage(eas_logo_mini,.T.))
	hl:add(lside,.F.,.F.)
	dlg:userSpace:add(hl,.T.,.T.)
	t   := UIVBox()
	hl:add(t,.T.,.T.)

	t:add(UILabel("License: GPL version 2 or later"))
	bb  := UIButtonBar()
	t:add(bb)
	bD := UIButton(win, "&Close", {|o,e| dlg:close() } )
	bb:add( bD )

	dlg:setFocus(bD)
	dlg:setDefault(bD)
	dlg:setPlacement( .T. )
	dlg:show()
<endfold id='1'>return</endfold id='1'>
<endfold id='8'>//END</endfold id='8'>
