Question about FOLDERS (Brushes) and DLG Transparent

Question about FOLDERS (Brushes) and DLG Transparent

Postby ukoenig » Fri Jan 16, 2009 12:47 am

Hello,

I reached the Folder-Part for testing.

The Gradient and Image-Display in combination with Alpha-BMP's works perfect ( Test 6 and 10 ).
Because of the oDLG5 with TRANSPARENT : < oFld:aDialogs[1]:SetBrush( oBrush1 ) > doesn't work.
If I delete TRANSPARENT, it is OK.

DEFINE DIALOG oDlg5 RESOURCE "Test_Fld" STYLE nSTYLE ; // TRANSPARENT ;
TITLE "Testing Folder-Backgrounds" FONT oFont

Image + Alpha-BMP ( different Images for Folder-Pages )
Page 1
Image
Page 2
Image

Gradient + Alpha-BMP
Image

Code: Select all  Expand view
...
// nArrayPos = Position in xBrowse-Selection
...
// ---------- FOLDER  - PREVIEW -------------------------------------

FUNCTION FOLDTEST(oDlg,oFont)
LOCAL oDlg5, oFld, oButton, oImage1, oBmp1
LOCAL oTITLE1, oTITLE2, oBrush1, Brush2
LOCAL nSTYLE := nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION )

oProgFont1 := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. )

DEFINE DIALOG oDlg5 RESOURCE "Test_Fld" STYLE nSTYLE ;   //   TRANSPARENT ;
TITLE  "Testing Folder-Backgrounds" FONT oFont

REDEFINE FOLDER oFld ID 110 OF oDlg5 ;
PROMPTS "    &Page 1    ", "     &Page 2     " ;
DIALOGS "Page1", "Page2"   FONT oProgFont 

// Colors
// ---------
IF nArrayPos = 2 .or. nArrayPos = 7 
   oFld:aDialogs[1]:SetColor( 0, 8388608 )
   oFld:aDialogs[2]:SetColor( 0, 8388608 )
ENDIF

// BMP-Brush
// ---------------
IF nArrayPos = 3 .or. nArrayPos = 8
   DEFINE BRUSH oBrush1  FILENAME "MARBLE.BMP" 
   DEFINE BRUSH oBrush2  FILENAME "FLOPPY.BMP"
   oFld:aDialogs[1]:SetBrush( oBrush1 )
   oFld:aDialogs[2]:SetBrush( oBrush2 )
   oBrush1:End()
   oBrush2:End()
ENDIF

// Style-Brush
// ---------------
IF nArrayPos = 4 .or. nArrayPos = 9
   DEFINE BRUSH oBrush1  STYLE "BRICKS" 
   DEFINE BRUSH oBrush2  STYLE "BORLAND"
   oFld:aDialogs[1]:SetBrush( oBrush1 )
   oFld:aDialogs[2]:SetBrush( oBrush2 )
   oBrush1:End()
   oBrush2:End()
ENDIF

REDEFINE BUTTONBMP oTITLE1  ID 110 OF oFld:aDialogs[1]  ;
ACTION MsgAlert("Testing Folder-Page 1" ) ;
BITMAP "Info1" PROMPT "  Testing Folder-Page 1" TEXTRIGHT
oTITLE1:cToolTip =  { "Click the Button" + CRLF + ;
   "for information","1. Color", 1, CLR_BLACK, 14089979 }

REDEFINE BUTTONBMP oTITLE2  ID 110 OF oFld:aDialogs[2]  ;
ACTION MsgAlert("Testing Folder-Page 2" ) ;
BITMAP "Info1" PROMPT "  Testing Folder-Page 2" TEXTRIGHT
oTITLE2:cToolTip =  { "Click the Button" + CRLF + ;
    "for information","1. Color", 1, CLR_BLACK, 14089979 }

REDEFINE BUTTONBMP oButton  ID 30 OF oDlg5 ;
ACTION oDlg5:End() ;
BITMAP "Quit" PROMPT "   Exit" TEXTRIGHT

ACTIVATE DIALOG oDlg5 CENTERED  ;
ON PAINT ( W_GRAD( hDC, oDlg5 ), ;
   IIF( nArrayPos = 1 .or. nArrayPos = 6, F_GRADIENT( oFld ), NIL ), ;  // Gradient
   IIF( nArrayPos = 7, F_ALPHA( hDC, oFld ), NIL ), ;  // Color
   IIF( nArrayPos = 8, F_ALPHA( hDC, oFld ), NIL ), ;  // Image-Brush
   IIF( nArrayPos = 9, F_ALPHA( hDC, oFld ), NIL ), ;  // Brush
   IIF( nArrayPos = 5 .or. nArrayPos = 10, F_IMAGE( oFld ), NIL ) )   // Image

oProgFont1:End()

RETURN(  NIL )

// ------ FOLDER - IMAGE  ----------------------

FUNCTION F_IMAGE( oFld )
LOCAL n, oDlg1, oImage1, oBmp1

DEFINE IMAGE oImage1 FILENAME "FANTASY1.jpg"
DEFINE IMAGE oImage2 FILENAME "FANTASY2.jpg"
FOR n = 1 to Len( oFld:aDialogs )
   oDlg1 = oFld:aDialogs[ n ]
   IF n = 1
      oDlg1:bPainted = { | hDC | ( PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , ;
      oDlg1:nWidth, oDlg1:nHeight, , .T. ), ;
      IIF( nArrayPos = 10, ABPaint( hDC, 50, 50, oBmp1:hBitmap, 220 ), NIL ) ) }
   ENDIF
   IF n = 2
      oDlg1:bPainted = { | hDC | ( PalBmpDraw( hDC, 0, 0, oImage2:hBitmap, , ;
      oDlg1:nWidth, oDlg1:nHeight, , .T. ), ;
      IIF( nArrayPos = 10, ABPaint( hDC, 50, 50, oBmp1:hBitmap, 220 ), NIL ) ) }
   ENDIF
   // If You want only 1 Image on all pages
   // -------------------------------------------
*      oDlg1:bPainted = { | hDC | ( PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , ;
*      oDlg1:nWidth, oDlg1:nHeight, , .T. ), ;
*      IIF( nArrayPos = 10, ABPaint( hDC, 50, 50, oBmp1:hBitmap, 220 ), NIL ) ) }
NEXT   

RETURN NIL   

// --------- FOLDER-ALPHA-BMP  --------------------------------------

STATIC FUNCTION F_ALPHA( hDC, oFld )
LOCAL n, oDlg1, oBmp1

DEFINE BITMAP oBmp1 FILENAME "A_LOGO.BMP" 
FOR n = 1 to Len( oFld:aDialogs )
   oDlg1 = oFld:aDialogs[ n ]
   oDlg1:bPainted = { | hDC |  ABPaint( hDC, 50, 50, oBmp1:hBitmap, 220 ) }
NEXT   

RETURN NIL





Regards
Uwe :lol:
Last edited by ukoenig on Mon Jan 19, 2009 9:19 am, edited 13 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Question about FOLDERS ( Brushes, Img, Colors )

Postby James Bott » Fri Jan 16, 2009 2:04 am

Uwe,

I notice in all your great screenshots that the themed buttons do not have a transparent background (the area outside the button). I guess we need to ask Antonio if there is a way to solve this. It sure would improve the appearance.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Question about FOLDERS (Brushes) and DLG Transparent

Postby ukoenig » Mon Jan 19, 2009 9:02 am

Hello James,

I changed the Text of the post-question, because I found the reason, why it didn't work.
I used Dialog with TRANSPARENT. That was the reason, the brushes in folders didn't work.
I deleted TRANSPARENT and it was OK.
Is there any working solution for it :
define TRANSPARENT for the dialog in combination with brushes-use in folders ?
otherwise You cannot use BMP's in folder-tabs.

Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests