HELP for explorerbar on a dialog

HELP for explorerbar on a dialog

Postby Silvio » Fri Jul 09, 2010 6: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: Select all  Expand view

#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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: HELP for explorerbar on a dialog

Postby Daniel Garcia-Gil » Sun Jul 11, 2010 5:38 pm

Silvio Try
Code: Select all  Expand view


#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
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: HELP for explorerbar on a dialog

Postby Silvio » Mon Jul 12, 2010 8: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests