Antonio Linares wrote:Dear Silvio,
Please post a screenshot, thanks
Antonio,
the Panel seems to change its size but if there is another panel after the modified one, if the dimensions are small a large space is formed between the panels, if the modified panel has a larger space it is drawn above the panel that follows
If the taskPanel is bigger
if the taskpanel is smaller
the new test code
- Code: Select all Expand view RUN
- #include "FiveWin.ch"
//#include "ribbon.ch"
//----------------------------------------------------------------------------//
static oExBar
function Main()
local oWnd, oPanel1, oPanel2, oPanel3, oPanel4
local bClick := { | o | MsgInfo( o:GetText() ) }
local uVar, oBrw, oPanel, aDim, oFont
local aArray := { {"one",time(),DATE()},;
{"two",time(),DATE()},;
{"three",time(),DATE()},;
{"four",time(),DATE()},;
{"five",time(),DATE()} }
local cMsg := "Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla" + CRLF + ;
"Notice to users bla bla bla"
DEFINE WINDOW oWnd TITLE "FWH Class TExplorerBar"
oWnd:SetSize( 550, 600 )
oExBar = TExplorerBar():New()
oPanel1 = oExBar:AddPanel( "One", "..\bitmaps\32x32\people.bmp" )
oPanel1:lSpecial = .T.
oPanel1:AddLink( "First item", bClick, "..\bitmaps\16x16\additem.bmp" )
oPanel2 = oExBar:AddPanel( "Two", "..\bitmaps\32x32\case.bmp", 200 )
oPanel3 = oExBar:AddPanel( "Tree", "..\bitmaps\32x32\case.bmp", 200 )
Section_advice(oPanel2,cMsg,oPanel1)
oWnd:oClient = oExBar
ACTIVATE WINDOW oWnd CENTERED
return nil
Function Section_advice(oPanel2,cMsg,oPanel1)
local oFont,aDim
local oPanelText,oBrushtext
local oPanelshadow,oBrushShadow
local aGradShadow :={rgb(224,224,224),rgb(224,224,224) }
local aGradText :={ rgb(248,248,248),rgb(248,248,248) }
local bBoard := { | | ShareBoard(@cMsg,oPanel2,oPanelShadow,oPanelText) }
oPanel1:AddLink( "Edit board", bBoard, "..\bitmaps\16x16\copy.bmp" )
DEFINE BRUSH oBrushShadow GRADIENT aGradShadow
DEFINE BRUSH oBrushtext GRADIENT aGradText
DEFINE FONT oFont NAME "Verdana" SIZE 0, -12
aDim = GetLabelDim( oPanel2:hWnd, alltrim(cMsg), oFont:hFont )
//refresh the oPanel2
oPanel2:nHeight := aDim[ 2 ] + 50
oPanel2:nBodyHeight := oPanel2:nHeight - oPanel2:nTitleHeight
oPanel2:CoorsUpdate()
oPanel2:UpdateRegion()
//create a shadow effect
@ oPanel2:nTitleHeight+5, 10 PANEL oPanelShadow SIZE oPanel2:nwidth, oPanel2:nHeight-40 of oPanel2
oPanelShadow:SetBrush( oBrushShadow )
//create a panel with text
@ 5, 5 PANEL oPanelText SIZE oPanelShadow:nWidth-2, oPanelShadow:nBottom-45 of oPanelShadow
//oItem2:SetColor( "N/W*" )
oPanelText:SetBrush( oBrushText )
* oPanelText:bPainted = { | hDC | DrawTextTransparent( hDC, cMsg, { 10, 80, aDim[ 1 ] + 120, aDim[ 2 ] + 120 }, 1 ) }
oPanelText:bPainted = { | hDC | ;
FW_SayText( hDC, ;
alltrim( ( cMsg ) ), ;
{ 1 , 50, aDim[ 2 ] + 50, 300 },,oFont, RGB(255,165,0), nARGB(255,rgb(248,248,248) ) , .f. ) }
return nil
//----------------------------------------------------------------------------//
Function ShareBoard(cMessage,oPanel2,oPanelShadow,oPanelText)
local oDlgBacheca
local oBar
local oBold
local nWd := GetSysMetrics(0) * .45
local nHt := (GetSysMetrics(1) / 3 )
local oBtn := array(3)
local adim
local nTotRows
local oFonttext
IF Empty(cMessage)
cMessage:= "Notice to users bla bla bla"
Endif
DEFINE FONT oFonttext NAME "Verdana" SIZE 0, -12
DEFINE DIALOG oDlgBacheca SIZE nWd, nHt PIXEL ; //TRUEPIXEL
TITLE "Shared board" ;
FONT oFonttext COLOR CLR_BLACK, RGB( 245,245,235) ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX) //ICON oIcon
//----------------------------------------------------------------------------//
DEFINE BUTTONBAR oBar OF oDlgBacheca SIZE 80,70 BOTTOM NOBORDER 2015
oBar:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, RGB( 250,250,245), RGB( 250,250,245)} },;
{ { 1, RGB( 245,245,235), RGB( 245,245,235)} } ) }
DEFINE BUTTON oBtn[1] OF oBar ;
FILENAME "DLG_NO";
PROMPT "Exit" TOOLTIP "Esci" ;
ACTION ( oDlgBacheca:end( IDCANCEL ) )
DEFINE BUTTON oBtn[2] OF oBar ;
FILENAME "HLP_DLG";
PROMPT "Aiuto" TOOLTIP "Aiuto" ;
ACTION NIL GROUP
DEFINE BUTTON oBtn[3] OF oBar BTNRIGHT ;
FILENAME "DLG_OK";
PROMPT "Save" ;
TOOLTIP "Conferma i dati" ;
ACTION ( oDlgBacheca:end( IDOK ) )
//----------------------------------------------------------------------------//
@ 0, 4 SAY "Wall message shared by all users...." OF oDlgBacheca TRANSPARENT
@ 10, 4 GET oText VAR cMessage OF oDlgBacheca MEMO COLOR CLR_BLUE SIZE 280, 75 PIXEL
ACTIVATE DIALOG oDlgBacheca CENTERED ;
ON INIT ( oDlgBacheca:resize(), ChangeButtons( oBar ) )
IF oDlgBacheca:nresult == IDOK
//refresh the oPanel
aDim := GetLabelDim( oPanel2:hWnd, alltrim(cMessage) , oFonttext:hFont )
oPanel2:nHeight := aDim[ 2 ] + 70
oPanel2:nBodyHeight := oPanel2:nHeight - oPanel2:nTitleHeight
oPanel2:CoorsUpdate()
oPanel2:UpdateRegion()
//refresh the oPanel with shadow effect
oPanelShadow:nWidth:= oPanel2:nwidth-20
oPanelShadow:nBottom:= oPanel2:nHeight-80
oPanelShadow:refresh(.t.)
//refresh the oPanel with Text cMsg
oPanelText:nWidth:= oPanelShadow:nWidth-2
oPanelText:nBottom:= oPanelShadow:nBottom-90
oPanelText:bPainted = { | hDC | ;
FW_SayText( hDC, ;
alltrim( ( cMessage ) ), ;
{ 10, 50, 50, 300 },,oFonttext, RGB(255,165,0), nARGB(255,rgb(248,248,248) ) , .f. ) }
oPanelText:refresh(.t.)
// oExBar:Refresh()
// AEval( oExBar:aPanels, { | o | o:Refresh() } )
// oExBar:CheckScroll()
ENDIF
return nil
//----------------------------------------------------------------------------//
function ChangeButtons( oBar )
AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
return .T.
//----------------------------------------------------------------------------//