#include "FiveWin.ch"
#include "Folder.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, oFld, oCbx, oSay
local nValue := 2, oChk, lChk := .t.
local cItem, oImageList
SET _3DLOOK ON
DEFINE DIALOG oDlg RESOURCE "Test"
REDEFINE FOLDER oFld ID 110 OF oDlg ;
PROMPT "Cli&pper", "&and", "&Windows", "&Magic" ;
DIALOGS "Sub1", "Sub2","Sub3", "Sub4"
REDEFINE BUTTON ID 120 OF oDlg ;
ACTION oDlg:End()
oFld:aEnable = { .t., .t., .t., .t. }
oFld:bChange := {|| SetImages( oDlg, oFld ) }
ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Want to end ?" ) ;
ON INIT SetImages( oDlg, oFld )
return nil
//----------------------------------------------------------------------------//
function DoBrowse()
USE Customer
Browse()
USE
return nil
//----------------------------------------------------------------------------//
function SetImages( oDlg, oFld )
local oImageList, n
DEFINE IMAGELIST oImageList SIZE 16, 16
for n = 1 to len( oFld:aPrompts )
if n == oFld:nOption
oImageList:AddMasked( TBitmap():Define( "open",, oDlg ), nRGB( 192, 192, 192 ) )
else
oImageList:AddMasked( TBitmap():Define( "close",, oDlg ), nRGB( 192, 192, 192 ) )
endif
next
oFld:SetImageList( oImageList )
return nil
#define IDC_CHECKBOX1 92
#include ".\..\include\WinApi.ch"
#ifdef __FLAT__
1 24 "winxp\WindowsXP.Manifest"
#endif
#ifdef __64__
1 24 "WinXP/WindowsXP.Manifest64"
#endif
open BITMAP "../bitmaps/on.bmp"
close BITMAP "../bitmaps/off.bmp"
Test DIALOG 19, 47, 233, 124
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "FiveWin Folders Demo"
{
CONTROL "", 110, FOLDER32, 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 4, 5, 225, 99
PUSHBUTTON "&OK", 120, 98, 108, 37, 14
}
sub1 DIALOG 18, 18, 205, 80
STYLE WS_CHILD | 4
{
}
sub2 DIALOG 18, 18, 142, 67
STYLE WS_CHILD | 4
{
}
sub3 DIALOG 18, 18, 142, 67
STYLE WS_CHILD | 4
{
}
sub4 DIALOG 18, 18, 142, 67
STYLE WS_CHILD | 4
{
}
oBrw = TXBrowse():New( oDlgAlb )
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lRecordSelector := .t.
oBrw:nHeaderLines := 1
oBrw:nDataLines := 1
oBrw:nRowSel := 1
oBrw:nMarqueeStyle := 3 //Highlight row //MARQSTYLE_HIGHLCELL
oBrw:bClrSelFocus := {||{CLR_WHITE,RGB(176,196,222 )}}
oBrw:cAlias := cAlias1
oBrw:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(255,248,220) } } // colores para lineas normales
oBrw:bClrSel := {|| { nRGB(0,0,0), nRGB(241,222,088) } } // para barra de linea selecc cuando el control no tiene el foco
oBrw:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(248,195, 34) } } // para barra de linea selecc cuando el control tiene el foco
oBrw:lFastEdit := .T.
oBrw:bPastEof = {|| (cAlias1)->(Dbappend()), oBrw:GoLeftMost(),oBrw:Refresh(),;
oBrw:aCols[ 1 ]:Edit() }
//agrega registro y "oprime" enter
oCol = oBrw:AddCol()
oCol:bStrData := { ||TRANSFORM((cAlias1)->codigo,"99999") }
oCol:nEditType := EDIT_GET
oCol:cHEADER := "CODIGO"
oCol:bEditValid = {|o| if ( VAL(o:value()) == 0 , .f., .t.) }
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0,( DbAppend(), oBrw:Refresh() ),) ,;
If( nKey == VK_RETURN, If(Barticulo(oBrw,xVal),oBrw:Refresh(),oBrw:GoleftMost()),),;
If( nKey == VK_ESCAPE .and. VAL((cAlias1)->codigo)=0,( (cAlias1)->(dbDelete()),;
(cAlias1)->(__dbPack()),(cAlias1)->(dbGoBottom()),oBrw:Refresh() ), ) }
@ 0, 0 XBROWSE oBrw OF oWndChild ALIAS "test"
oBrw:nMarqueeStyle = 3
oBrw:nColDividerStyle = LINESTYLE_BLACK
oBrw:nRowDividerStyle = LINESTYLE_BLACK
oBrw:lHScroll = .T.
oBrw:lColDividerComplete = .T.
oBrw:lAutoAppend = lAuto
oBrw:lFastEdit = .T.
oBrw:bPastEof = {|| Dbappend(), oBrw:refresh(), oBrw:aCols[ 1 ]:Edit() }
oBrw:bKeyDown = {|nKey| if( nKey == VK_DELETE ,;
( nLast:=recno(),test->( dbdelete() ), __Dbpack(), dbgoto(nLast) ),), oBrw:refresh() }
oCol = oBrw:AddCol()
oCol:bStrData = { || test->First }
oCol:cHeader = "First"
oCol:nEditType = EDIT_GET
oCol:bOnPostEdit = ;
{ | oCol, xVal, nKey | if( xVal == space( 20 ) .and. nKey == VK_ESCAPE,;
( nLast:=recno(),test->( dbdelete() ), __Dbpack(),dbgoto(nLast-1) ),;// Afirmacion
( If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), ;//Negativa
If( nKey == VK_RETURN, test->First := xVal,) )), oBrw:refresh() }
oCol:bEditValid = {|o| if ( o:value() == space(20), .f., .t.) }
function SetImages( oDlg, oFld )
local oImageList, n
oFld:oImageList:End() // aqui
DEFINE IMAGELIST oImageList SIZE 16, 16
...
Application
===========
Path and name: C:\Proyectos\Gfactu\GFACTU.Exe (32 bits)
Size: 737,280 bytes
Time from start: 0 hours 0 mins 8 secs
Error occurred at: 03-01-2009, 19:35:29
Error description: Error BASE/1004 Class: 'NIL' has no exported method: END
Args:
[ 1] = U
Stack Calls
===========
Called from: => END(0)
Called from: gesh0110.prg => SETIMAGES(287)
Called from: gesh0110.prg => (b)CTRARTI(239)
Called from: DIALOG.PRG => TDIALOG:INITIATE(0)
Called from: DIALOG.PRG => TDIALOG:HANDLEEVENT(0)
Called from: => DIALOGBOX(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: gesh0110.prg => CTRARTI(239)
Called from: gesh0110.prg => (b)ARTICULOS(58)
Called from: WINDOW.PRG => TCONTROL:LDBLCLICK(0)
Called from: WBROWSE.PRG => TWBROWSE:LDBLCLICK(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TWBROWSE:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: geshinic.prg => MAIN(179)
procedure dbfs()
local oBrw, oWndChild, oBar, oCol
local nLast
local lAuto := .t.
set delete on
USE test
DEFINE DIALOG oWndChild SIZE 300,300
//define buttonbar oBar of oWndChild
@ 1,1 btnBMP of oWndChild prompt "ON" action( oBrw:lAutoappend := lAuto:= .t. ) top when !lAuto
@ 1, 100 btnBMP of oWndChild prompt "OFF" action( oBrw:lAutoappend := lAuto:= .f.) top when lAuto
@ 1, 200 btnBMP of oWndChild prompt "Exit" action( oWndChild:end() ) top
@ 2, 0 XBROWSE oBrw OF oWndChild ALIAS "test" SIZE 130,130
oBrw:nMarqueeStyle = 3
oBrw:nColDividerStyle = LINESTYLE_BLACK
oBrw:nRowDividerStyle = LINESTYLE_BLACK
oBrw:lHScroll = .T.
oBrw:lColDividerComplete = .T.
oBrw:lAutoAppend = lAuto
oBrw:lFastEdit = .T.
oBrw:bPastEof = {|| Dbappend(), oBrw:refresh(), oBrw:aCols[ 1 ]:Edit() }
oBrw:bKeyDown = {|nKey| if( nKey == VK_DELETE ,;
( nLast:=recno(),test->( dbdelete() ), __Dbpack(), dbgoto(nLast) ),), oBrw:refresh() }
oCol = oBrw:AddCol()
oCol:bStrData = { || test->First }
oCol:cHeader = "First"
oCol:nEditType = EDIT_GET
oCol:bOnPostEdit = ;
{ | oCol, xVal, nKey | if( xVal == space( 20 ) .and. nKey == VK_ESCAPE,;
( nLast:=recno(),test->( dbdelete() ), __Dbpack(),dbgoto(nLast-1) ),;// Afirmacion
( If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), ;//Negativa
If( nKey == VK_RETURN, test->First := xVal,) )), oBrw:refresh() }
oCol:bEditValid = {|o| if ( o:value() == space(20), .f., .t.) }
oCol = oBrw:AddCol()
oCol:bStrData = { || test->Last }
oCol:cHeader = "Last"
oCol:nEditType = EDIT_GET
oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, DbAppend(),), If( nKey == VK_RETURN, ( test->Last := xVal, oBrw:Refresh() ),) }
oBrw:CreateFromCode()
// oWndChild:oClient := oBrw
ACTIVATE DIALOG oWndChild
return
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 15 guests