Help for ExplorerBar to Daniel or Antonio

Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Wed Jun 30, 2010 8:52 pm

I try to insert a explorerBar into a dialog with success but I want ask U some questions


First Question
I'd like to change the bitmaps of button colllapse of each panel with mine,
how I can make if the button for open is open.bmp and for close is close.bmp
as this picture Image

and if not want show any button (as this picture) how I can make ?
Image

Second question
On each panel I must use addlink to insert a item
I want use a big bitmap for each item, can I create a space from a item to another ? or create a link to n position ?
Can I set the font for each item ( link) ? and How ?





Third question
I'd like to create on each panel a black border because is professional and elegant border as this picture
Image


Another question
can insert a watermark image trasparent on each panel ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Wed Jun 30, 2010 9:28 pm

Domenico,

1) Class TExplorerBar manages Class TTaskPanel objects. These objects call to functions BmpEBExpanded() and BmpEBCollapsed() that return the bitmaps to paint for both states.

Simply implement your own functions BmpEBExpanded() and BmpEBCollapsed() in your own PRG and you will be overiding the ones provided by FWH.

You can read the bitmaps from files (BMP) in the disk, or load them from your resources, i.e.:
Code: Select all  Expand view
function BmpEBExpanded()

return ReadBitmap( 0, "expanded.bmp" ) // reading it from an external BMP file
 

or
Code: Select all  Expand view
function BmpEBExpanded()

return LoadBitmap( GetResources(), "expanded" ) // load it from your resources, where "expanded" is the identifier of your bitmap
 

With these questions and surely more to come, we will be completing the wiki docs about Class TExplorerBar:
http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_texplorerbar
Class TTaskPanel docs:
http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_ttaskpanel
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Wed Jun 30, 2010 10:09 pm

and if not want show any button (as this picture) how I can make ?

Simply make those functions return a zero:
Code: Select all  Expand view
function BmpEBExpanded()

return 0
 

or
Code: Select all  Expand view
function BmpEBExpanded()

return 0
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Wed Jun 30, 2010 10:14 pm

Second question
On each panel I must use addlink to insert a item
I want use a big bitmap for each item, can I create a space from a item to another ? or create a link to n position ?
Can I set the font for each item ( link) ? and How ?


By default the Class TTaskPanel expects to manage a 16x16 pixels bitmap for each item. If you want to use a different size then the logic of the Class TTaskPanel should be modified.

TTaskPanel objects are true Windows controls, so in fact you can place any control on top of them, simply using the typicall FWH sintax: @ ..., ... OF oPanel

By default TTaskPanel items are FWH Class TUrlLink objects, so you can modify all the properties that are available to those objects: http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_turllink
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Wed Jun 30, 2010 10:20 pm

Third question
I'd like to create on each panel a black border because is professional and elegant border as this picture


You can easily modify Class TTaskPanel Method Paint() to enhance it the way you may want it.

Just keep in mind that Class TTaskPanel obejcts use a Windows "region" to obtain the curved effect on its top corners. So you can use FWH functions to paint boxes to implement such border, but the corners will require a special coding surely using function Ellipse() calls.

When you review the source code and the docs of the Class TExplorerBar and its related classes, you will realize the amount of complexity that automatically manages. This is the first version of this Class, and you may expect enhancements for it in next versions based on users requirements. By now we do believe that if offers an very good level of functionality.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Wed Jun 30, 2010 10:25 pm

Another question
can insert a watermark image trasparent on each panel ?


As Class TTaskPanel objects are true Windows controls, you can easily modify the Method Paint() to display a background image, etc. Full source code is available so feel free to modify it for your own needs :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Thu Jul 01, 2010 8:20 am

thanks antonio,
I made one add for now on your class Explorer
I insert a border ( to simulate a shadow on each panel or insert a border with another color)
it run ok only there is an error on round right angle

but when I use a panel with lspecial = .t. it not show the error as you can see on this picture

Image

any Idea ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Thu Jul 01, 2010 8:32 am

RESOLVED !!!

Image
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Thu Jul 01, 2010 9:59 am

and i add also the method WaterImage() as you ca see on this picture

Image

only I can use alpha bitmap because I not found the solution with normal bitmap because it show the bitmap on white color
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby Antonio Linares » Thu Jul 01, 2010 11:46 am

Domenico,

Very good :-)

If you share your changes with all of us, then we will incude them for next FWH 10.7 version :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41435
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Thu Jul 01, 2010 1:22 pm

It ok for me only I have a problem with normal bitmaps because when I use them the taskpanel show it bad ( on reverse white)
Only it show good the bitmap only Alpha Bitmap tyoe.
as you can seee on this picture
Image

then I made also a small include to create panel object

for sample

ADD PANEL oPanel1 of oExBar PROMPT "One" ;
BITMAP "..\bitmaps\32x32\people.bmp" ;
BORDER BORDERCOLOR CLR_BLACK ;
WATERIMAGE "user.bmp" ;
COLORS CLR_RED,CLR_YELLOW
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Fri Jul 02, 2010 10:24 am

ANTONIO,

I made a test with

if SetAlpha()
ABPaint( ::hDC, nLeft, nTop, ::hWaterImage, nAlphaLevel )
else
DrawTransparent( ::hDC,::hWaterImage, nTop, nLeft )
endif


When the bitmap is NO ALPHA BITMAP it show the bitmap in white as you can see on picture

Image



H0w I can make to show the image on trasparency as the image you can see on window xp explorer as this picture ?

Image
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Fri Jul 02, 2010 10:43 am

Antonio,
Now I saw the Daniel Function FwWater but It not run ok here :

METHOD WaterImage() CLASS TTaskPanel //add by MdaSolutions
if !Empty(::cWaterImage ) .and. !::lCollapsed

::hWaterImage := ::LoadImage( ::cWaterImage )


if ::hWaterImage != 0
nWidth = nBmpWidth( ::hWaterImage )
nHeight = nBmpHeight( ::hWaterImage )
nTop := ::nHeight - nHeight-1
nLeft := ::nWidth - nWidth-10
nBottom := nTop + nHeight
nRight := nLeft + nWidth
nAlphaLevel := 20
FWWaterMark (::hWaterImage)

if SetAlpha()
ABPaint( ::hDC, nLeft, nTop, ::hWaterImage, nAlphaLevel )
else
DrawBitmap( ::hDC, ::hWaterImage, nLeft, nTop )
endif
DeleteObject( ::hWaterImage )
ENDIF
ENDIF
return nil
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: Help for ExplorerBar to Daniel or Antonio

Postby Daniel Garcia-Gil » Fri Jul 02, 2010 11:53 am

Mda...


FWWaterMark return a Bitmap handle


Code: Select all  Expand view

METHOD WaterImage() CLASS TTaskPanel //add by MdaSolutions
   local hBmp

   if !Empty(::cWaterImage ) .and. !::lCollapsed
   
      hBmp := ::LoadImage( ::cWaterImage )
     
      if ::hWaterImage != 0
         nWidth = nBmpWidth( hBmp )
         nHeight = nBmpHeight( hBmp )
         nTop := ::nHeight - nHeight-1
         nLeft := ::nWidth - nWidth-10
         nBottom := nTop + nHeight
         nRight := nLeft + nWidth
         nAlphaLevel := 20
         ::hWaterImage = FWWaterMark( hBmp )
   
         if SetAlpha()
            ABPaint( ::hDC, nLeft, nTop, ::hWaterImage, nAlphaLevel )
         else
            DrawBitmap( ::hDC, ::hWaterImage, nLeft, nTop )
         endif
         DeleteObject( hBmp )
      ENDIF
   ENDIF
return nil
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Help for ExplorerBar to Daniel or Antonio

Postby MdaSolution » Fri Jul 02, 2010 1:58 pm

thanks Daniel now run but I see also the bitmaps square not transparent !!!
look it please

Image

and i tried also with a Alphabitmap ( fwh\bitmaps\AlphaBmp\trash.bmp) same error
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests