Dear All,
I try BTNTRNS, it works fine for DIALOG but it doesn't "Translucent background" on WINDOW.
Can it use with WINDOW?
Thanks in advance,
Dutch
Antonio Linares wrote:Dear Dutch,
Please post a small PRG to test, thanks
#include 'Fivewin.ch'
#include 'TSbutton.ch'
#include 'Image.ch'
Static oWnd, nWndWidth, nWndHeight, oFont40
*------------------------------*
Function Main
local oBtn[4]
local aImage1
nWndWidth := GetSysMetrics(0)
nWndHeight := GetSysMetrics(1)
DEFINE FONT oFont40 NAME 'Tahoma' SIZE 0, -40
DEFINE WINDOW oWnd TITLE 'Test Button on Image Background' ;
STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
COLOR CLR_WHITE, CLR_HGRAY
aImage1 := Fw_ReadImage( oWnd, '.\testsbtn.jpg' )
@ 200, 400 SBUTTON oBtn[1] PROMPT 'Check-Out' OF oWnd ;
SIZE 460,460 PIXEL ;
FILE "..\bitmaps\alphabmp\android.bmp" ;
FONT oFont40 ;
NOBOXTR ;
TEXT ON_BOTTOM ; // COLORS CLR_BLACK, CLR_GRAY ;
COLORS CLR_WHITE ;
ACTION (MsgInfo('ok1'))
@ 200,1000 SBUTTON oBtn[2] PROMPT 'Check-In' OF oWnd ;
SIZE 460,460 PIXEL ;
FILE "..\bitmaps\alphabmp\design.bmp" ;
FONT oFont40 ;
NOBOXTR ;
TEXT ON_BOTTOM ;
COLORS CLR_WHITE ;
ACTION CheckIn()
@ 700, 400 BTNBMP oBtn[3] PROMPT " Translucent" + CRLF + "Buttons " OF oWnd ;
FILE "..\bitmaps\alphabmp\ichat.bmp" ;
SIZE 400,200 PIXEL LEFT 2007 NOBORDER FLAT ;
FONT oFont40 COLOR CLR_WHITE,CLR_BLACK
oBtn[3]:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }
@ 700,1000 SBUTTON oBtn[4] PROMPT 'Exit' OF oWnd ;
SIZE 300,100 PIXEL ;
FONT oFont40 ;
LOOK W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ;
COLORS CLR_WHITE ;
ACTION oWnd:End()
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT Fw_DrawImage( oWnd, aImage1, {120, 0, nWndHeight-100, nWndWidth }, nil, .T., 40, nil )
RELEASE FONT oFont40
return nil
*-----------------*
Function CheckIn()
local oFnt, oDlg, oBtn[4], oSay, oBmp, oDlgCLose, oImg, aImage1, oBrush
DEFINE DIALOG oDlg SIZE nWndWidth, nWndHeight ;
STYLE nOr( WS_CHILD, WS_POPUP ) ;
COLOR CLR_BLACK, CLR_WHITE ;
TRANSPARENT
oDlg:lHelpIcon := .F.
ACTIVATE DIALOG oDlg CENTER ON INIT (ShowImg( oDlg, oBtn ), oDlg:nOpacity := 180)
return .T.
*-------------------------------------*
Function ShowImg( oDlg, oBtn )
local oImg
local cImage := '.\TESTSBTN.JPG'
@ 120, 0 XIMAGE oImg SOURCE cImage NOBORDER SIZE nWndWidth, nWndHeight-220 OF oDlg UPDATE
oImg:FitWidth()
oImg:FitHeight()
oImg:lBmpTransparent := .T.
@ 200, 400 SBUTTON oBtn[1] PROMPT 'Walk-In' OF oImg ;
SIZE 460, 460 PIXEL ;
RESOURCE "WALKIN" ;
FONT oFont40 ;
LOOK W97 ;
TEXT POSITION ON_BOTTOM ;
ACTION MsgInfo('ok')
@ 200,1000 SBUTTON oBtn[2] PROMPT 'Booking' OF oImg ;
SIZE 460, 460 PIXEL ;
RESOURCE "BOOKING" ;
FONT oFont40 ;
LOOK W97 ;
TEXT POSITION ON_BOTTOM ;
ACTION MsgInfo('ok')
@ 700,1000 SBUTTON oBtn[2] PROMPT 'Back' OF oImg ;
SIZE 150,150 PIXEL ;
FONT oFont40 ;
LOOK W97 ;
ROUNDRECT ;
TEXT ON_BOTTOM ;
COLORS CLR_BLACK ;
ACTION oDlg:End()
@ 700, 400 BTNBMP oBtn[3] PROMPT " Translucent" + CRLF + "Buttons " OF oImg ;
FILE "..\bitmaps\alphabmp\ichat.bmp" ;
SIZE 400,200 PIXEL LEFT 2007 NOBORDER FLAT ;
FONT oFont40 COLOR CLR_WHITE,CLR_BLACK
oBtn[3]:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }
return .T.
Antonio Linares wrote:Please post a small PRG to test
karinha wrote:Dutch, see if I understand what you want to do.
Dutch, a ver si entiendo lo que quieres hacer.
https://imgur.com/sNg5eE7
Regards, saludos.
// C:\DUTCH\TESTSBTN.PRG-Modified by: kapiabafwh@gmail.com - 05/05/2023 Ver: 3
#include 'Fivewin.ch'
STATIC oWnd, nWndWidth, nWndHeight, oFont40
FUNCTION Main()
LOCAL oCursorBtn := TCursor():New(, 'HAND' )
LOCAL aImage1, oBtn:= ARRAY(12), oFont, oBrush
LOCAL cImage := '.\TESTSBTN.JPG'
SkinButtons()
nWndWidth := GetSysMetrics( 0 )
nWndHeight := GetSysMetrics( 1 )
DEFINE BRUSH oBrush FILE cImage RESIZE // ".\sea.bmp" RESIZE
DEFINE FONT oFont40 NAME 'Tahoma' SIZE 0, -40 BOLD
// RESOLUTION: 1024 X 768
DEFINE WINDOW oWnd TITLE 'Test Button on Image Background' ;
STYLE nOr( WS_POPUP, WS_VISIBLE ) BRUSH oBrush
// 200, 400 ONLY TEST IN MY COMPUTER - ROUNDRECT
@ 100, 0015 BTNBMP oBtn[01] PROMPT "Check-Out" OF oWnd SIZE 460, 460 PIXEL ;
RESOURCE "CHECKIN" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE 2007 ;
COLOR CLR_HCYAN, CLR_WHITE ACTION ( MsgInfo( 'ok1' ) )
oBtn[01]:lTransparent := .T.
oBtn[01]:oCursor := oCursorBtn
// 200, 1000
@ 100, 0550 BTNBMP oBtn[02] PROMPT "Check-In" OF oWnd SIZE 460, 460 PIXEL ;
RESOURCE "CHECKOUT" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE ;
2007 COLOR CLR_HCYAN, CLR_WHITE ACTION CheckIn( oBtn )
oBtn[02]:lTransparent := .T.
oBtn[02]:oCursor := oCursorBtn
// 700, 700 Great Resolution
@ 600, 0462 BTNBMP oBtn[03] PROMPT "Exit" OF oWnd SIZE 100, 100 PIXEL ;
RESOURCE "EXIT" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE 2007 ;
COLOR CLR_HCYAN, CLR_WHITE ACTION( oWnd:End() )
oBtn[03]:lTransparent := .T.
oBtn[03]:lCancel := .T.
oBtn[03]:oCursor := oCursorBtn
ACTIVATE WINDOW oWnd MAXIMIZED
oFont40:End()
RETURN NIL
FUNCTION CheckIn( oBtn )
LOCAL oDlg, oBrush, cImage := '.\TESTSBTN.JPG'
DEFINE BRUSH oBrush FILE cImage RESIZE // ".\sea.bmp" RESIZE
DEFINE DIALOG oDlg SIZE nWndWidth, nWndHeight STYLE nOr( WS_CHILD, WS_POPUP ) ;
BRUSH oBrush TRANSPARENT
ACTIVATE DIALOG oDlg CENTERED ON INIT ( ShowImg( oDlg, oBtn ) )
RETURN NIL
FUNCTION ShowImg( oDlg, oBtn )
LOCAL oCursorBtn := TCursor():New(, 'HAND' )
// 200,400
@ 090, 0015 BTNBMP oBtn[04] PROMPT "Walk-In" OF oDlg SIZE 460, 460 PIXEL ;
RESOURCE "WALKIN" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE ;
2007 COLOR CLR_HCYAN, CLR_WHITE ACTION MsgInfo( "Walk-In" )
oBtn[04]:lTransparent := .T.
oBtn[04]:oCursor := oCursorBtn
@ 090, 0550 BTNBMP oBtn[05] PROMPT "Booking" OF oDlg SIZE 460, 460 PIXEL ;
RESOURCE "BOOKING" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE ;
2007 COLOR CLR_HCYAN, CLR_WHITE ACTION MsgInfo( "Walk-In" )
oBtn[05]:lTransparent := .T.
oBtn[05]:oCursor := oCursorBtn
@ 600, 0462 BTNBMP oBtn[06] PROMPT "Back" OF oDlg SIZE 100, 100 PIXEL ;
RESOURCE "EXIT" FONT oFont40 NOBORDER TEXT ON_BOTTOM FLAT UPDATE 2007 ;
COLOR CLR_HCYAN, CLR_WHITE ACTION( oDlg:End() )
oBtn[06]:lTransparent := .T.
oBtn[06]:lCancel := .T.
oBtn[06]:oCursor := oCursorBtn
RETURN( .T. )
// FIN / END - kapiabafwh@gmail.com - Joao Santos - Sao Paulo - Brazil.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 37 guests