Is it possible to have 2 rows of BUTTONBAR?

Re: Is it possible to have 2 rows of BUTTONBAR?

Postby James Bott » Tue Oct 29, 2013 4:06 pm

Alejandro,

Thanks for the sample. I will take a look at it.

I found a simpler example using a panel object in my old notes.

James

Code: Select all  Expand view
/*
Purpose  : Use panel to attach extra buttonbar, browse, and tabs.
Date     : 02/16/01
Author   : James Bott
Language : Clipper 5.2e/Fivewin 2.0a
Revised  :
Notes    :
*/


#include "fivewin.ch"

function main()
   local oWnd,oBar1,oPanel,oBar2,oTabs,oBrw

   define window oWnd title "Testing Panel Class"

   define buttonbar oBar1 of oWnd 3d size 26,28
   define button of oBar1
   define button of oBar1
   define button of oBar1

   oPanel:= TPanel():new(,,,,oWnd)

   @ 205,300 tabs oTabs prompts "Charges","Contacts","Documents";
      of oPanel pixel
   oPanel:oBottom:=oTabs

   define buttonbar oBar2 of oPanel 3d size 26,28
   define button of oBar2

   use customer alias "cust"
   @ 0,0 XBROWSE oBrw of oPanel ALIAS "CUST"
   oBrw:CreateFromCode()

   oPanel:oClient:= oBrw

   set message of oWnd to "Right-click on the toolbars to move them."

   activate window oWnd ;
     on resize  oPanel:adjclient()

return nil
Last edited by James Bott on Tue Oct 29, 2013 8:09 pm, edited 1 time in total.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Is it possible to have 2 rows of BUTTONBAR?

Postby betoncu » Tue Oct 29, 2013 4:32 pm

A sample from FWH\Samples

Code: Select all  Expand view

#INCLUDE "FiveWin.ch"

FUNCTION Main()

   local oWnd, oReBar, oToolBar1, oImageList1, oToolBar2, oImageList2

   DEFINE WINDOW oWnd PIXEL FROM 0, 0 TO 600,650

   DEFINE STATUSBAR OF oWnd PROMPT ""

   DEFINE IMAGELIST oImageList1 SIZE 32, 32
   DEFINE IMGBITMAP OF oImageList1 NAME "BTN_NEW"    COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList1 NAME "BTN_OPEN"   COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList1 NAME "BTN_SEARCH" COLOR nRGB( 255, 0, 255 )


   DEFINE IMAGELIST oImageList2 SIZE 32, 32
   DEFINE IMGBITMAP OF oImageList2 NAME "BTN_PRINT"    COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList2 NAME "BTN_INTERNET" COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList2 NAME "BTN_KEYS"     COLOR nRGB( 255, 0, 255 )

   oReBar = TReBar():New( oWnd )

   oToolBar1 = TToolBar():New( oReBar, 50, 35, oImageList1 )
   DEFINE TBBUTTON OF oToolBar1 ACTION MsgInfo(1)
   DEFINE TBBUTTON OF oToolBar1 ACTION MsgInfo(2)
   DEFINE TBBUTTON OF oToolBar1 ACTION MsgInfo(3)

   oToolBar2 = TToolBar():New( oReBar, 50, 35, oImageList2 )
   DEFINE TBBUTTON OF oToolBar2 ACTION MsgInfo(4)
   DEFINE TBBUTTON OF oToolBar2 ACTION MsgInfo(5)
   DEFINE TBBUTTON OF oToolBar2 ACTION MsgInfo(6)

   oReBar:InsertBand( oToolBar1 )
   oReBar:InsertBand( oToolBar2 )

   ACTIVATE WINDOW oWnd VALID (oImageList1:End(), oImageList2:End(), .T. )

RETURN NIL
 


.RC File
Code: Select all  Expand view

#ifdef __FLAT__
   1 24 "./WinXP/WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif

BTN_NEW      BITMAP "../bitmaps/32x32/new.bmp"
BTN_OPEN     BITMAP "../bitmaps/32x32/open.bmp"
BTN_SEARCH   BITMAP "../bitmaps/32x32/search.bmp"
BTN_PRINT    BITMAP "../bitmaps/32x32/print.bmp"
BTN_INTERNET BITMAP "../bitmaps/32x32/internet.bmp"
BTN_KEYS     BITMAP "../bitmaps/32x32/keys.bmp"
 


Regards,
Birol Betoncu
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: Is it possible to have 2 rows of BUTTONBAR?

Postby cnavarro » Tue Oct 29, 2013 5:48 pm

James Bott wrote:As I mentioned in a previous message in this thread, there is a problem using two buttonbars in a window if you are using oWnd:oClient. The oClient control is painted over the second buttonbar. See the example below.

James



Can be also creating two ButtonBar within a window ButtonBar
So, yes respects OCLIENT area.

Code: Select all  Expand view

FUNCTION MAIN()

    LOCAL oWnd
    Local oBr

    LOCAL oBar1, oBar2, oBar3, oBar4
    Local oBrw
    Local aData  := {}

    aadd(aData,"100")
    aadd(aData,"200")
    aadd(aData,"300")
    aadd(aData,"400")

    cName1 := "Test"

    DEFINE BRUSH oBr COLOR CLR_WHITE

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR OF oWnd 2007 ;
           SIZE 1610, 67

    @ -1, 0 BUTTONBAR oBar1 OF oWnd:oBar;
             SIZE 1600, 34;
             BUTTONSIZE 60, 33 //;

    oBar1:l2007 = .F.

    DEFINE BUTTON OF oBar1;
           FILE "C:\FWH\BITMAPS\SAVE.BMP";
           ACTION MSGINFO( "Second bar Ok!" )

    @ 33, 0 BUTTONBAR oBar2 OF oWnd:oBar;
             SIZE 1600, 34;
             BUTTONSIZE 60, 33 //;

    oBar2:l2007 = .F.

    DEFINE BUTTON OF oBar2;
           FILE "C:\FWH\BITMAPS\OPEN.BMP";
           ACTION MSGINFO( "Tercer bar Ok!" )

    @ 0,0 XBROWSE oBrw OF oWnd ARRAY aData

    oBrw:CreateFromCode()

    oWnd:oClient:= oBrw



    ACTIVATE WINDOW oWnd

    RETURN NIL

//----------------------------------------------------------------------------//
 


Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Is it possible to have 2 rows of BUTTONBAR?

Postby James Bott » Tue Oct 29, 2013 8:28 pm

Wow, four different solutions! I like options. Good work everyone.

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests