BUTTON question?
BUTTON question?
Dear Antonio,
1. BUTTON class does still support CRLF for seperate line?
2. BUTTON Caption can define left alignment?
Best regards,
Dutch
1. BUTTON class does still support CRLF for seperate line?
2. BUTTON Caption can define left alignment?
Best regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Even from code:
EMG
Code: Select all
#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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
It works with DIALOGs but not with WINDOWs and I don't know why:
EMG
Code: Select all
#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
It works perfect.
Dear Antonio&Enrico,
It works perfect now.
#define BS_MULTILINE 8192 and CR CHR(13)
Best regards,
Dutch
It works perfect now.
#define BS_MULTILINE 8192 and CR CHR(13)
Best regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Confirmed!
EMG
Code: Select all
#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
#DefineBS_LEFTTET 32 is not working?
Dear Antonio&Enrico,
This code does not work.
oBtn:nStyle := NOR( oBtn:nStyle, BS_LEFTTEXT )
Best regards,
Dutch
This code does not work.
oBtn:nStyle := NOR( oBtn:nStyle, BS_LEFTTEXT )
Best regards,
Dutch
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
BUTTON question again?
Dear Antonio,
Can I change oBtn:cCaption that create from source code in FWPPC. In FW/Clipper I do it from Resource and change :cCaption and :Refresh(). It works ok but I try with FWPPC. It doesn't change.
oBtn:cCaption := 'Next Caption"
oBtn:Show()
oBtn:Refresh()
Example
======
Best regards,
Dutch
Can I change oBtn:cCaption that create from source code in FWPPC. In FW/Clipper I do it from Resource and change :cCaption and :Refresh(). It works ok but I try with FWPPC. It doesn't change.
oBtn:cCaption := 'Next Caption"
oBtn:Show()
oBtn:Refresh()
Example
======
Code: Select all
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
Dutch
Code: Select all
Code: Select all
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
It works ok now.
Dear Antonio,
It works perfect now.
Thanks&Regards,
Dutch
It works perfect now.
Thanks&Regards,
Dutch