#include "Fivewin.ch"
#define CR CHR( 13 )
#define BS_MULTILINE 8192
FUNCTION MAIN()
LOCAL oDlg, oBtn
DEFINE DIALOG oDlg
@ 1, 1 BUTTON oBtn PROMPT "&Close" + CHR( 13 ) + "the dialog";
SIZE 50, 30;
ACTION oDlg:End()
oBtn:nStyle = NOR( oBtn:nStyle, BS_MULTILINE )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
#include "Fwce.ch"
#define BS_MULTILINE 8192
FUNCTION MAIN()
LOCAL oDlg, oBtn
DEFINE DIALOG oDlg
@ 1, 1 BUTTON oBtn PROMPT "&Close" + CHR( 13 ) + "the dialog";
SIZE 50, 30;
ACTION oDlg:End()
oBtn:nStyle = NOR( oBtn:nStyle, BS_MULTILINE )
ACTIVATE DIALOG oDlg
RETURN NIL
#include "Fwce.ch"
#define GWL_STYLE -16
#define BS_MULTILINE 8192
FUNCTION MAIN()
LOCAL oWnd, oBtn
DEFINE WINDOW oWnd
@ 1, 1 BUTTON oBtn PROMPT "&Close" + CHR( 13 ) + "the window";
SIZE 60, 50;
ACTION oWnd:End()
ACTIVATE WINDOW oWnd;
ON INIT SETWINDOWLONG( oBtn:hWnd, GWL_STYLE, NOR( GETWINDOWLONG( oBtn:hWnd, GWL_STYLE ), BS_MULTILINE ) )
RETURN NIL
DEFINE DIALOG oDlg FROM 0, 0.2 TO nHeight,nWidth ;
PIXEL
for n := 1 to 21
MakeBtn( n, oDlg, nRow, nCol, aPost )
if nRow >= 72
nRow := 0
nCol += 36
else
nRow += 12
end
next
@ 96.8,85 BTNBMP FILENAME (cPath+"ARRUP.BMP") ;
SIZE 23,13 ;
WHEN (nPage>1) ;
ACTION KeyPage( oDlg, aPost, .T. , .F. )
@ 110,85 BTNBMP FILENAME (cPath+"ARRDN.BMP") ;
SIZE 23,12 ;
WHEN (nEndPage=0) ;
ACTION KeyPage( oDlg, aPost, .F. , .T. )
Return
*------------------*
Static Procedure MakeBtn(n,oDlg,nRow,nCol,aPost)
if empty(ACT->ACCT_CODE)
MadeBtn( n, oDlg, nRow, nCol, ACT->ACCT_CODE, rtrim(ACT- >ACCT_EDESC ), ACT->ACCT_TYPE, aPost )
end
ACT->(DbSkip())
*----------------------------*
Procedure MaeBtn( n, oDlg, nRow, nCol, cTrn, cDesc, cType, aPost )
if !empty(cTrn)
@ (nRow), (nCol) BUTTON oBtns[n] ;
PROMPT left(cDesc,14) ;
FONT oFnts ;
SIZE 35, 12 ;
PIXEL ;
ACTION ( aadd( aPost,{ str(len(aPost)+1,2), cDesc, str(iif (empty(cQty),1,val(cQty)),7,2), cTrn } ), (cQty := '') )
oBtns[n]:nStyle := NOR( oBtns[n]:nStyle, BS_MULTILINE )
else
@ (nRow), (nCol) BUTTON oBtns[n] ;
FONT oFnts ;
SIZE 35, 12 ;
PIXEL
end
return
*------------------*
Function KeyPage( oDlg, aPost, lPrev, lNext )
local n, nRow, nCol
local lChk := .F.
local nMultiple := 2
local cCap, aMenuItems := {}
if (nPage > 1 .and. lPrev) .or. (nEndPage=0.and.lNext)
if lNext
nPage += 1
elseif lPrev
nPage -= 1
ACT->(DbGoTop())
if nPage > 1
ACT->(DbSkip((nPage-1)*21))
end
end
for n := 1 to 21
if !empty(ACT->ACCT_CODE)
aadd( aMenuItems, { ACT->ACCT_CODE , rtrim(ACT->ACCT_EDESC) } )
else
oBtns[n]:Hide()
oBtns[n]:Refresh()
end
if !empty(ACT->ACCT_CODE)
ACT->(DbSkip())
end
next
end
// Last page checking
if !empty(ACT->ACCT_CODE)
if nEndPage > 0
nEndPage -= nEndPage
end
end
for n := 1 to len(aMenuItems)
ShowMenu( aMenuItems, n )
next
return
*--------------------------------*
Function ShowMenu( aMenuItems, n )
local cCap, cTrn
cTrn := aMenuItems[n][1]
cCap := left( aMenuItems[n][2], 28 )
oBtns[n]:cCaption := cCap
oBtns[n]:bAction := {|| ( aadd( aPost,{ str(len(aPost)+1,2), cCap , str(iif(empty(cQty),1,val(cQty)),7,2), } ), (cQty := '') ) }
oBtns[n]:Show()
oBtns[n]:Refresh()
return
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 38 guests