FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour HELP for explorerbar on a dialog
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
HELP for explorerbar on a dialog
Posted: Fri Jul 09, 2010 06:40 PM
I saw the explorerbar object not refresh ( and the panels on it)

the sample test show a dialog into a oWnd.

to shw the dialo press the first button on the ribbonbar

try this small test please
try to resize the window and you can see it not refresh the explorerbar object


Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "RIBBON.ch"

static oWnd,oDlg

Function Main()
 Local  aMenuRibbon := { "test 1","test2" }

 DEFINE WINDOW oWnd
 obar:=TRibbonBar():New(oWnd, aMenuRibbon,,,,160,25 )

     ADD GROUP oGr RIBBON obar TO OPTION 1 PROMPT "Empresa" width 135

   @ 2,5 ADD BUTTON oBtn1 PROMPT "Empresa" BITMAP ".\bitmaps\.bmp" GROUP oGr  ;
   ROUND SIZE 65,70  ACTION TEST()

 oWnd:bResized := {|| ResizeWndMain() }

  SET MESSAGE OF oWnd TO "test explorer" CENTER NOINSET  2007
 ACTIVATE WINDOW oWnd

retu nil


Function Test()
   Local nSplit:=112,oExBar
Local nGridBottom
Local aClient := GetClientRect (oWnd:hWnd )

define DIALOG odlg

   odlg:nTop    = oBar:nHeight-1
   odlg:nLeft   = 0
   odlg:nBottom = aClient[3] - 1
   odlg:nRight  = aClient[4]
   odlg:nStyle  = nOR( WS_CHILD, 4 )
   odlg:setcolor(,RGB(143,172,230))

   nGridBottom:= (oDlg:nBottom / 2) - oBar:nHeight

oExBar = TExplorerBar():New(0, 0, nSplit, nGridBottom, oDlg)



ACTIVATE DIALOG oDlg NOWAIT;
on init buildExplorerbar(oDlg,oExBar)



Function ResizeWndMain()
   local  aClient := GetClientRect ( oWnd:hWnd )
   IF oDlg != NIL
     oDlg:SetSize( aClient[4], aClient[3] - oBar:nHeight - oWnd:oMsgBar:nHeight )
     oDlg:Refresh()
   ENDIF




 oWnd:oMsgBar:Refresh()
retu nil

function buildExplorerbar(oDlg,oExBar)
        local oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }

   oPanel1 = oExBar:AddPanel( "One", "people" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "additem" )
   oPanel1:AddLink( "Second item", bClick, "copy" )

   oPanel2 = oExBar:AddPanel( "Two", "case" )
   oPanel2:AddLink( "First item", bClick, "adddbf" )
   oPanel2:AddLink( "Second item", bClick, "delete" )
   oPanel2:AddLink( "Third item", bClick, "envelope" )
   oPanel2:AddLink( "Fourth item", bClick, "envelope")



retur ni
Best Regards, Saludos



Falconi Silvio
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: HELP for explorerbar on a dialog
Posted: Sun Jul 11, 2010 05:38 PM
Silvio Try
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "RIBBON.ch"

static oWnd,oDlg

Function Main()
 Local  aMenuRibbon := { "test 1","test2" }

 DEFINE WINDOW oWnd
 obar:=TRibbonBar():New(oWnd, aMenuRibbon,,,,160,25 )

     ADD GROUP oGr RIBBON obar TO OPTION 1 PROMPT "Empresa" width 135

   @ 2,5 ADD BUTTON oBtn1 PROMPT "Empresa" BITMAP ".\bitmaps\.bmp" GROUP oGr  ;
   ROUND SIZE 65,70  ACTION TEST()

 oWnd:bResized := {|| ResizeWndMain() }

  SET MESSAGE OF oWnd TO "test explorer" CENTER NOINSET  2007
 ACTIVATE WINDOW oWnd

retu nil


Function Test()
   Local nSplit:=112,oExBar
Local nGridBottom
Local aClient := GetClientRect (oWnd:hWnd )

define DIALOG odlg

   odlg:nTop    = oBar:nHeight-1
   odlg:nLeft   = 0
   odlg:nBottom = aClient[3] - 1
   odlg:nRight  = aClient[4]
   odlg:nStyle  = nOR( WS_CHILD, 4 )
   odlg:setcolor(,RGB(143,172,230))

//   nGridBottom:= (oDlg:nBottom / 2) - oBar:nHeight





ACTIVATE DIALOG oDlg NOWAIT;
on init buildExplorerbar(oDlg)



Function ResizeWndMain()
   local  aClient := GetClientRect ( oWnd:hWnd )
   IF oDlg != NIL
     oDlg:SetSize( aClient[4], aClient[3] - oBar:nHeight - oWnd:oMsgBar:nHeight )
     oDlg:Refresh()
   ENDIF




 oWnd:oMsgBar:Refresh()
retu nil

function buildExplorerbar(oDlg)
        local oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }
   local oExBar

   oExBar = TExplorerBar():New(, ,200 , , oDlg)
   
   oDlg:oLeft = oExBar

   oPanel1 = oExBar:AddPanel( "One", "people" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "additem" )
   oPanel1:AddLink( "Second item", bClick, "copy" )

   oPanel2 = oExBar:AddPanel( "Two", "case" )
   oPanel2:AddLink( "First item", bClick, "adddbf" )
   oPanel2:AddLink( "Second item", bClick, "delete" )
   oPanel2:AddLink( "Third item", bClick, "envelope" )
   oPanel2:AddLink( "Fourth item", bClick, "envelope")



retur nil
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: HELP for explorerbar on a dialog
Posted: Mon Jul 12, 2010 08:00 AM

the test run
but when I insert it on application it not run
I use a splitter to move and at right I insert a xbrowse
the explorer created id middle and the splitter not run ok
I sent a test to explain my error

Best Regards, Saludos



Falconi Silvio

Continue the discussion