I was doing a search to see if there are any discussions or samples for using button bars on folders but I couldn't find any.
I have an idea for what I need to do, but I thought I'd ask first to be sure I head down the right path !
....
....
REDEFINE FOLDER oFld ID 100 OF oDlg TRANSPARENT ;
PROMPTS " Page 1 ", " Page 2 ", " Page 3 ", " Page 4 ", " Page 5 " ;
DIALOGS "Page1", "Page2", "Page3", "Page4", "Page5" FONT oFoldFont
// Dialog- and FolderGradient
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( SetImages(oDlg,oFld), ;
GradBrush( oDlg, { { 0.50, 14853684, 16314573 }, ;
{ 0.50, 16314573, 14853684 } }, .T. ), MAKEBAR(oFld) ) ;
ON PAINT SetFoldGrad( oFld )
RETURN NIL
// ----------------------------------------------
FUNCTION MAKEBAR(ofld)
LOCAL oBar1, oBar2, oTitle1
LOCAL oBtn1, oBtn2, oBtn3, oBtn4
LOCAL oBtn11, oBtn12, oBtn13, oBtn14
// using VTitles ( much better ) :
@ 0, 0 TITLE oTitle1 size 820, 60 OF oFld:aDialogs[1] SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
@ 20, 20 TITLETEXT OF oTitle1 TEXT "Using VTitles inside Folder-Pages" ;
FONT oTextFont COLOR CLR_BLACK
DEFINE BUTTONBAR oBar1 OF oFld:aDialogs[1] SIZE 80, 67 2007 RIGHT
DEFINE BUTTON oBtn1 OF oBar1 ACTION ( NIL ) ;
FILENAME aPICTURES[9][3] PROMPT "Windows" TOOLTIP "Windows and Dialog"
DEFINE BUTTON oBtn2 OF oBar1 ACTION ( NIL ) ;
FILENAME aPICTURES[10][3] PROMPT "xBrowse" TOOLTIP "xBrowse"
DEFINE BUTTON oBtn3 OF oBar1 ACTION ( NIL ) ;
FILENAME aPICTURES[11][3] PROMPT "BTN-Bars" TOOLTIP "Folder"
DEFINE BUTTON oBtn4 OF oBar1 ACTION ( NIL ) ;
FILENAME aPICTURES[12][3] PROMPT "Folder" TOOLTIP "Button-Bar"
// ------ Next Page -----
DEFINE BUTTONBAR oBar2 OF oFld:aDialogs[2] SIZE 80, 67 2007 RIGHT
DEFINE BUTTON oBtn11 OF oBar2 ACTION ( NIL ) ;
FILENAME aPICTURES[9][3] PROMPT "Windows" TOOLTIP "Windows and Dialog"
DEFINE BUTTON oBtn12 OF oBar2 ACTION ( NIL ) ;
FILENAME aPICTURES[10][3] PROMPT "xBrowse" TOOLTIP "xBrowse"
DEFINE BUTTON oBtn13 OF oBar2 ACTION ( NIL ) ;
FILENAME aPICTURES[11][3] PROMPT "BTN-Bars" TOOLTIP "Folder"
DEFINE BUTTON oBtn14 OF oBar2 ACTION ( NIL ) ;
FILENAME aPICTURES[12][3] PROMPT "Folder" TOOLTIP "Button-Bar"
RETURN( NIL )
// --------- VTitle - Solution ( with 2 Vtitles Vertical ) ----------------------
FUNCTION MAKEBAR1(oDlg)
LOCAL oBar1, oBar2, 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 - 90 TITLE oBar1 size 90, nSCR17 of oDlg SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
@ 0, nSCR0 - 105 TITLE oBar2 size 15, nSCR17 of oDlg SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
@ 50, 15 TITLEIMG OF oBar1 BITMAP c_path + "\Images\preview.bmp" SIZE 45, 45 REFLEX ANIMA LEVEL 255 ;
ACTION ( NEW_SKIN(), DLG_BTN1() )
@ 130, 20 TITLETEXT OF oBar1 TEXT "Preview" FONT oProgFont COLOR CLR_BLACK
@ 160, 15 TITLEIMG OF oBar1 BITMAP c_path + "\Images\preview.bmp" SIZE 45, 45 REFLEX ANIMA LEVEL 255 ;
ACTION ( NEW_SKIN(), DLG_BTN2() )
@ 240, 20 TITLETEXT OF oBar1 TEXT "Preview" FONT oProgFont COLOR CLR_BLACK
@ 460, 18 TITLEIMG OF oBar1 BITMAP c_path + "\Images\exit.bmp" SIZE 45, 45 REFLEX ANIMA LEVEL 255 ;
ACTION ( oDlg:End() )
@ 540, 30 TITLETEXT OF oBar1 TEXT "Exit" FONT oProgFont COLOR CLR_BLACK
oBar1:lRound := .F.
oBar1:aGrdBack := { { 0.9, 14853684, 16314573 },{ 0.9, 16314573, 14853684 } }
oBar2:lRound := .F.
oBar2:aGrdBack := { { 0.1, 16314573, 128 },{ 0.1, 128, 14853684 } }
RETURN( NIL )
// -----------------------------------------
function SetImages(oDlg, oFld)
local oImageList
DEFINE IMAGELIST oImageList SIZE 16, 16
oImageList:AddMasked( TBitmap():Define( "colors",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "write",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "write",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "favorite",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "favorite",, oDlg ), nRGB( 192, 192, 192 ) )
oFld:SetImageList( oImageList )
return nil
// ------------------------
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
// --------------------------------------------
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 67 guests