On Window, In order: Menu, BtnBar, Tabs, Browse, Status

On Window, In order: Menu, BtnBar, Tabs, Browse, Status

Postby arpipeline » Fri May 28, 2010 3:54 am

I am having difficulty making a tab control behave properly. I have an SDI window with a menu, button bar, browse and status bar. I want to wedge a tab control between the button bar and browse so that users can click a tab and change the state of the browse data.

Like so stacked:
Button Bar
Tabs
Browse
Status

When using oBtnBar:oBottom := oTabs, the tabs are inset and cover the bitmaps - same problem with oBrowse:oBottom := oTabs.

Even if I decide to put the tabs at the bottom of the window below the browse ( oWnd:oBottom := oTabs ), causes the tabs to cover the status bar of the window.

How do I handle this so that everything is stacked properly, and resizes properly when the main window is resized.

TIA,

Andy
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: On Window, In order: Menu, BtnBar, Tabs, Browse, Status

Postby nageswaragunupudi » Sat May 29, 2010 12:27 am

Please see xbrswap1.prg in the fwh\samples folder
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: On Window, In order: Menu, BtnBar, Tabs, Browse, Status

Postby arpipeline » Sat May 29, 2010 3:27 am

Thanks, but I don't have the file in my samples folder. I am using FW 9.04.

Andy
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: On Window, In order: Menu, BtnBar, Tabs, Browse, Status

Postby nageswaragunupudi » Sat May 29, 2010 12:09 pm

Sample code:
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"

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

function Main()

   local oWnd, oPanel, oBar, oTabs
   local aBrw[ 2 ]
   local aData1 := { {1,2,3},{4,5,6},{7,8,9} }
   local aData2 := { {'AA','BB','CC','DD'},{'EE','FF','GG','HH'}, ;
                     {'II','JJ','KK','LL'},{'MM','NN','OO','PP'}}

   aData2 := { {10,20,30},{40,50,60},{70,80,90} }


   DEFINE WINDOW oWnd
   DEFINE BUTTONBAR oBar OF oWnd  2007
   SET MESSAGE OF oWnd to '' 2007

   oPanel   := TPanel():New( ,,,, oWnd )
   oWnd:oClient := oPanel

   @ 0,0 XBROWSE aBrw[ 1 ] OF oPanel ;
      HEADERS 'One', 'Two', 'Three' ;
      ARRAY aData1 AUTOCOLS CELL LINES FOOTERS

   aBrw[ 1 ]:CreateFromCode()

   @ 0,0 XBROWSE aBrw[ 2 ] OF oPanel ;
      HEADERS 'AAAA', 'BBBB', 'CCCC' ;
      ARRAY aData2 AUTOCOLS CELL LINES

   aBrw[ 2 ]:CreateFromCode()
   aBrw[ 2 ]:Hide()

   oPanel:oClient := aBrw[ 1 ]

   @ 400,0 TABS oTabs PROMPTS 'First', 'Second' OF oPanel ;
      ON CHANGE ChangeBrw( nOption, nOldOption, aBrw )

   oPanel:oBottom := oTabs

   ACTIVATE WINDOW oWnd

return ( 0 )

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

static function ChangeBrw( nNew, nOld, aBrw )

   aBrw[ nOld ]:Hide()
   aBrw[ nNew ]:oWnd:oClient := aBrw[ nNew ]
   aBrw[ nNew ]:Enable()
   aBrw[ nNew ]:Show()
   aBrw[ nNew ]:oWnd:Resize()

return nil

//------------------------------------------------------------------//
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10628
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: On Window, In order: Menu, BtnBar, Tabs, Browse, Status

Postby arpipeline » Sat May 29, 2010 4:54 pm

Thank you! A panel was the ticket - I was trying to do everything at the window level.

Andy
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft, Google [Bot] and 85 guests

cron