Hi,
I try to use TPages. I try TestPag3.prg. I have set the color dlg1 using Dlg1:SetColor(). It is working without using xp manifest. But I use xp manifest.
How Can I solve this?
Thanks in advance.
oDlg:SetColor( <your colors> )
AEval( oDlg:aControls, { |o| o:SetBrush( oDlg:oBrush ) } )
nageswaragunupudi wrote:please try
- Code: Select all Expand view
oDlg:SetColor( <your colors> )
AEval( oDlg:aControls, { |o| o:SetBrush( oDlg:oBrush ) } )
#include "FiveWin.ch"
#include "xBrowse.ch"
#include "Folder.ch"
#include "Slider.ch"
#include "Image.ch"
#include "ttitle.ch"
static oWnd, oDlg, hDC, oFld
FUNCTION MAIN()
LOCAL oBMP1
nWidth := GetSysMetrics(0)
nHeight := GetSysMetrics(1)
lOPEN := .F.
DEFINE WINDOW oWnd TITLE "VTitle Painter"
DEFINE IMAGE oBMP1 FILENAME c_path + "\Images\BACKGRD.JPG"
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( DRAWBITMAP( hdc, oBMP1:hbitmap, 0, 0,;
nWidth, nHeight ), W_ALPHA( hDC ) ) ;
ON INIT ( Tools() )
RETURN ( NIL )
// --------- W-ALPHA-BMP 3 Logos --------------------------------------
FUNCTION W_ALPHA( hDC )
LOCAL oBmp1, oBmp2, oBmp3
cALPHA1 := c_path + "\IMAGES\Deco1.BMP"
cALPHA2 := c_path + "\IMAGES\Deco2.BMP"
cALPHA3 := c_path + "\IMAGES\Deco3.BMP"
// Left / Top
IF File( "&cALPHA1" )
DEFINE BITMAP oBmp1 FILENAME "&cALPHA1"
ABPaint( hDC, 730, 30, oBmp1:hBitmap, 220 )
oBmp1:End()
ENDIF
IF File( "&cALPHA2" )
DEFINE BITMAP oBmp2 FILENAME "&cALPHA2"
ABPaint( hDC, 750, 200, oBmp2:hBitmap, 220 )
oBmp2:End()
ENDIF
IF File( "&cALPHA3" )
DEFINE BITMAP oBmp3 FILENAME "&cALPHA3"
ABPaint( hDC, 750, 370, oBmp3:hBitmap, 220 )
oBmp3:End()
ENDIF
RETURN NIL
// --------- Dialog with Folder and Gradient-Background -----------------------
STATIC FUNCTION Tools()
DEFINE DIALOG oDlg RESOURCE "Maindlg" OF oWnd TRANSPARENT ;
TITLE "VTitle - Painter Version 1.0 / 10.09"
REDEFINE FOLDER oFld ID 100 OF oDlg UPDATE ;
PROMPTS "&Background ", " &Circle ", " VTitle-&Body ", " &Base ", " &VTitle-Size / Pos. ", " VTitle-&Text ", " &Buttons ", " &Devider " ;
DIALOGS "Painter", "Circle", "TBody", "Base", "Background", "TText", "TButtons", "Devider" FONT oFoldFont // ;
FOLDER_1(oDlg,oFld) // Background
FOLDER_2(oDlg,oFld) // Circle
FOLDER_3(oDlg,oFld) // Body
FOLDER_4(oDlg,oFld) // Base
FOLDER_5(oDlg,oFld) // Position
FOLDER_6(oDlg,oFld) // Title-Text
FOLDER_7(oDlg,oFld) // Title-Buttons
FOLDER_8(oDlg,oFld) // Devider
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( SetImages(oDlg,oFld), ;
GradBrush( oDlg, { { 0.50, 14853684, 16314573 }, ;
{ 0.50, 16314573, 14853684 } }, .T. ), MAKEBAR(oDlg) ) ;
ON PAINT SetFoldGrad( oFld )
RETURN NIL
// ------------- VTITLE Buttonbar ---------------------------------
FUNCTION MAKEBAR(oDlg)
LOCAL oBar3, oBar4, oBtn1, oBtn2, oBtn3
nSCR0 := oDlg:nWidth() // Screen-Width
nSCR17 := oDlg:nHeight() // Screen-Hight - Title-Height
nSCR4 := GetSysMetrics(4) // Title-Hight ???
//Title 4 Vertical ( Right )
// Top, Left - Width / Height
@ 0, nSCR0 - 100 TITLE oBar3 size 100, nSCR17 of oDlg SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
@ 0, nSCR0 - 115 TITLE oBar4 size 15, nSCR17 of oDlg SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
// ------ The Preview-Button ------------------------
@ 40, 18 TITLEIMG OF oBar3 BITMAP c_path + "\Images\preview.bmp" SIZE 45, 45 REFLEX ANIMA LEVEL 255 ;
ACTION ( aPICTURES2 := aPICTURES1, NEW_TITLE() )
@ 120, 20 TITLETEXT OF oBar3 TEXT "Preview" FONT oProgFont COLOR CLR_BLACK
@ 140, 23 TITLETEXT OF oBar3 TEXT "VTitle" FONT oButtFont1 COLOR 65535
RETURN( NIL )
// -------- Folder-Gradient ------------------------------------
FUNCTION SetFoldGrad( oFld )
LOCAL n, oDlg
FOR n = 1 to Len( oFld:aDialogs )
oDlg = oFld:aDialogs[ n ]
oDlg:bPainted = { | hDC | GradientFill( hDC, 0, 0, oDlg:nHeight, ;
oDlg:nWidth, { { 0.50, 14853684, 16314573 }, ;
{ 0.50, 16314573, 14853684 } }, .T. ) }
NEXT
RETURN NIL
// ------------- Tab-Images ----------------------------
function SetImages(oDlg, oFld)
local oImageList
DEFINE IMAGELIST oImageList SIZE 16, 16
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "show",, oDlg ), nRGB( 192, 192, 192 ) )
oFld:SetImageList( oImageList )
return nil
// -------- Gradient-Brush for Transparent-Painting -----------------------
FUNCTION GradBrush( oDlg, aColors, lPos )
local hDC, hBmp, hBmpOld, oBrush
if Empty( oDlg:oBrush:hBitmap )
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lPos )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
RETURN NIL
// ------------- Dialog-Gradient ----------------------------------
STATIC FUNCTION D_GRAD( hDC, oDlg70, aGrad )
local oNewbrush
aRect := GETCLIENTRECT( oDlg70:hWnd )
IF W_DIRECT = 1 // Horizontal
GradientFill( hDC, 0, 0, oDlg70:nHeight, oDlg70:nWidth, aGrad, .T. )
ELSE // Vertical
GradientFill( hDC, 0, 0, oDlg70:nHeight, oDlg70:nWidth, aGrad, .F. )
ENDIF
RETURN NIL
// ------------ Dialog-Color -----------------------------------
STATIC FUNCTION D_COLOR( oDlg70 )
local oNewbrush
DEFINE BRUSH oNewBrush COLOR W_COLOR1
SET BRUSH OF oDlg70 TO oNewBrush
RELEASE BRUSH oNewbrush
RETURN NIL
//------------ Dialog-Brush from BMP ---------------------
FUNCTION DB_IMAGE( oDlg70 )
LOCAL oImage2
cNEWLOGO := "&c_path\IMAGES\" + ALLTRIM(W_BRUSH)
IF ! Empty( cNEWLOGO ) .and. File( "&cNEWLOGO" )
DEFINE BRUSH oImage2 FILE "&cNEWLOGO"
SET BRUSH OF oDlg70 TO oImage2
RELEASE BRUSH oImage2
ELSE
MsgAlert("No file selected !","Attention" )
ENDIF
RETURN NIL
//------------ Dialog-Image ---------------------
FUNCTION DL_IMAGE( hDC, oDlg70 )
LOCAL oImage2
cNEWLOGO := "&c_path\IMAGES\" + ALLTRIM(W_IMAGE)
IF ! Empty( cNEWLOGO ) .and. File( "&cNEWLOGO" )
aRect := GETCLIENTRECT( oDlg70:hWnd )
@ 0, 0 IMAGE oImage2 SIZE aRect[4], aRect[3] OF oDlg70 ADJUST
oImage2:Progress( .f. )
oImage2:LoadBmp( "&cNEWLOGO" )
ELSE
MsgAlert("No file selected !","Attention" )
ENDIF
RETURN NIL
// ----------- Preview of Dialog-Titles --------------------------------
FUNCTION NEW_TITLE()
LOCAL oDlg70, hDC
LOCAL aGrad1 := { { W_MOVE, W_COLOR1, W_COLOR2 }, ;
{ W_MOVE, W_COLOR2, W_COLOR1 } }
// Color selected
// -----------------
IF W_BACKGRD = 2
D_COLOR( oDlg70 )
ENDIF
// ImageBrush selected
// ------------------------
IF W_BACKGRD = 4
DEFINE BRUSH oBrush2 FILENAME c_path + "\Images\" + ALLTRIM(B_BRUSH)
DB_IMAGE( oDlg70 )
ENDIF
// ON PAINT needed for Gradient and Image-Background
// ON INIT show a VTitle
// ---------------------------------------------------------------
ACTIVATE DIALOG oDlg70 CENTERED ;
ON INIT ( SHOW_TITLE(oDlg70,oShowFont,oBrush2) ) ;
ON PAINT ( IIF( W_BACKGRD = 1, D_GRAD( hDC, oDlg70, aGrad1 ), NIL ), ; // Gradient selected
IIF( W_BACKGRD = 3, DL_IMAGE( hDC, oDlg70 ), NIL ) ) // Image selected
RETURN( NIL )
// ---------- VTitle-Painting ------------------
FUNCTION SHOW_TITLE(oDlg70,oShowFont,oBrush2)
LOCAL oBar1, xxx, I
LOCAL nSCR1 := oDlg70:nWidth() // Screen-Width
LOCAL nSCR2 := oDlg70:nHeight() // Screen-Hight - Title-Height
//Title 4 Vertical ( Right )
// Top, Left - Width / Height
// A Title
@ B_TOP, B_LEFT TITLE oBar1 SIZE B_WIDTH, B_HEIGHT of oDlg70 SHADOW TOPLEFT SHADOWSIZE BS_MOVE
RETURN ( NIL )
Horizon wrote:Hi,
I try to use TPages. I try TestPag3.prg. I have set the color dlg1 using Dlg1:SetColor(). It is working without using xp manifest. But I use xp manifest.
How Can I solve this?
Thanks in advance.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 54 guests