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