LOOK THIS :
HOW I CAN MODIFY THE HEIGHT BEETWEEN EACH OPTION OF MENU (ADDLINK)
METHOD AddLink( cPrompt,bAction, cBitmap,nheight,nleft,oFontItem ) CLASS TTaskPanel
local nTop := ::nTitleHeight + 10, n, oUrlLink
DEFAULT nHeight := 7
DEFAULT nLeft := 33
if oFontItem == nil
oFontItem := ::oFont
endif
if ! Empty( ::aControls )
for n = 1 to Len( ::aControls )
nTop += ::aControls[ n ]:nHeight + nHeight
next
endif
oUrlLink := TUrlLink():New( nTop, nLeft, Self, .T., .F., oFontItem, "", cPrompt )
oUrlLink:SetColor( oUrlLink:nClrText, ::nClrPane )
oUrlLink:nClrOver = ::nClrHover
oUrlLink:bAction = bAction
if File( cBitmap )
oUrlLink:hBmp = ReadBitmap( 0, cBitmap )
else
oUrlLink:hBmp = LoadBitmap( GetResources(), cBitmap )
endif
if oUrlLink:nTop + oUrlLink:nHeight > ::nHeight
::nHeight = oUrlLink:nTop + oUrlLink:nHeight + 10
::nBodyHeight = ::nHeight - ::nTitleHeight
::UpdateRegion()
endif
return nil
#include "FiveWin.ch"
#include "ribbon.ch"
#include "xbrowse.ch"
#include "TTitle.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oExBar, oPanel1, oPanel2, oPanel3, oPanel4
local bClick := { | o | MsgInfo( o:GetText() ) }
local uVar, oBrw, oTitle1, oBtn1, oBtn2, oBtn3, oBtn4
local aArray := { {"one",time(),DATE()},;
{"two",time(),DATE()},;
{"three",time(),DATE()},;
{"four",time(),DATE()},;
{"five",time(),DATE()} }
DEFINE WINDOW oWnd TITLE "FWH Class TExplorerBar"
oWnd:SetSize( 350, 600 )
oExBar = TExplorerBar():New()
oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
oPanel1:lSpecial = .T.
oPanel1:AddLink( "First item", bClick, "..\bitmaps\32x32\check.bmp" )
oPanel1:AddLink( "")
oPanel1:AddLink( "")
oPanel1:AddLink( "")
oPanel1:AddLink( "Second item", bClick, "..\bitmaps\32x32\edit.bmp" )
oPanel1:AddLink( "")
oPanel1:AddLink( "")
oPanel1:AddLink( "")
// -----------------
oPanel2 = oExBar:AddPanel( "Two", "..\bitmaps\32x32\case.bmp", 140 )
@ 25, -20 TITLE oTitle1 SIZE 350, 150 of oPanel2 NOBORDER SHADOW BOTTOMLEFT
oTitle1:aGrdBack := { { 0.87,128,16046754 }, { 0.87,16046754,128 } }
oTitle1:lRound := .F.
@ 15, 20 TITLEIMG oBtn1 OF oTITLE1 BITMAP "..\bitmaps\Alphabmp\Palm.bmp" TRANSPARENT ;
REFLEX ANIMA LEVEL 255 ;
ACTION MsgAlert( "Button with Action","Attention" )
@ 15, 90 TITLEIMG oBtn2 OF oTITLE1 BITMAP "..\bitmaps\Alphabmp\Video.bmp" TRANSPARENT ;
REFLEX ANIMA LEVEL 255 ;
ACTION MsgAlert( "Button with Action","Attention" )
@ 15, 170 TITLEIMG oBtn3 OF oTITLE1 BITMAP "..\bitmaps\Alphabmp\Pendrive.bmp" TRANSPARENT ;
REFLEX ANIMA LEVEL 255 ;
ACTION MsgAlert( "Button with Action","Attention" )
@ 15, 240 TITLEIMG oBtn4 OF oTITLE1 BITMAP "..\bitmaps\Alphabmp\Printer.bmp" TRANSPARENT ;
REFLEX ANIMA LEVEL 255 ;
ACTION MsgAlert( "Button with Action","Attention" )
// ---------------------
oPanel3 = oExBar:AddPanel( "Three", "..\bitmaps\32x32\case.bmp", 200 )
@ 40,10 say "This a say" of oPanel3 transparent pixel
@ 60,10 radio uVar prompt "This a radio" of oPanel3 pixel size 100, 25
@ 90, 10 COMBOBOX uVar ITEMS { "one", "two", "three" } of oPanel3 size 100, 100 pixel
@ 120, 10 RBBTN PROMPT "Ribbon Btn" of oPanel3 pixel size 100, 25 border transparent
@ 160, 10 btnbmp PROMPT "BtnBmp" of oPanel3 pixel size 100, 25 border 2007
@ 40, 120 xbrowse oBrw columns {1,2,3} array aArray of oPanel3 pixel size 180, 150
oBrw:CreateFromCode()
oWnd:oClient = oExBar
ACTIVATE WINDOW oWnd
return nil
CLASS TExplorerBar FROM TControl
// add
DATA nOrientation INIT 0
//---BMP-part of Panel area ( uses < nOrientation > Pixel from left ) ----//
METHOD Paint() CLASS TExplorerBar
...
...
// change
if ! Empty( ::aPanels )
for n = 1 to Len( ::aPanels )
if ! Empty( hBmpPanel := ::aPanels[ n ]:hBmpPanel )
if ::aPanels[ n ]:lHasAlpha
if ::nOrientation > 0
ABPaint( ::hDC, ;
::aPanels[ n ]:nLeft + ::nOrientation, ;
::aPanels[ n ]:nTop - ( nBmpHeight( hBmpPanel ) / 3 ),;
hBmpPanel, 255 )
else
ABPaint( ::hDC, ;
::aPanels[ n ]:nLeft - ( nBmpWidth( hBmpPanel ) / 3 ),;
::aPanels[ n ]:nTop - ( nBmpHeight( hBmpPanel ) / 3 ),;
hBmpPanel, 255 )
endif
else
if ::nOrientation > 0
DrawTransparent( ::hDC,hBmpPanel, ::aPanels[n]:nTop-(nBmpHeight(hBmpPanel )/3),;
::aPanels[n]:nLeft + ::aPanels[ n ]:nOrientation )
else
DrawTransparent( ::hDC,hBmpPanel, ::aPanels[n]:nTop-(nBmpHeight(hBmpPanel)/3),;
::aPanels[n]:nLeft - (nBmpWidth( hBmpPanel)/3 ) )
endif
endif
endif
next
endif
..
..
//--- BMP-part of Link area with Text ( uses < nOrientation > Pixel from left ) ---//
CLASS TTaskPanel FROM TControl
// add
DATA nOrientation INIT 0
...
...
METHOD Paint( nIndex ) CLASS TTaskPanel
// change ( If You like, You can add some space between BMP and Text ==> + 10 )
if ::nOrientation > 0
::Say( 6, 15 + If( ! Empty( ::hBmpPanel ), + 10 + ::nOrientation, ::cTitle,;
If( ::lSpecial, If( ::lOverTitle, ::nClrHover, ::nClrTextSpecial ),;
If( ::lOverTitle, ::nClrHover, ::nClrText ) ),, ::oFont, .T., .T. )
else
::Say( 6, 15 + If( ! Empty( ::hBmpPanel ), + 10 + nBmpWidth( ::hBmpPanel ) / 2, 0 ), ::cTitle,;
If( ::lSpecial, If( ::lOverTitle, ::nClrHover, ::nClrTextSpecial ),;
If( ::lOverTitle, ::nClrHover, ::nClrText ) ),, ::oFont, .T., .T. )
endif
..
..
if ::lHasAlpha
if ::nOrientation > 0
ABPaint( ::hDC, ;
::nOrientation, ;
- nBmpHeight( ::hBmpPanel ) / 3,;
::hBmpPanel, 255 )
else
ABPaint( ::hDC, ;
- nBmpWidth( ::hBmpPanel ) / 3,;
- nBmpHeight( ::hBmpPanel ) / 3,;
::hBmpPanel, 255 )
endif
else
if ::nOrientation > 0
DrawTransparent( ::hDC, ::hBmpPanel, - nBmpHeight( ::hBmpPanel ) / 3,;
::nOrientation )
else
DrawTransparent( ::hDC, ::hBmpPanel, - nBmpHeight( ::hBmpPanel ) / 3,;
- nBmpWidth( ::hBmpPanel ) / 3 )
endif
endif
...
...
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Enrico Maria Giordano and 97 guests