When the user wish show the buttonbar the browse change the initial sizes :
I show you the features :
When I open the browse I can select to show or to not show the buttonbar
I f I select to not show the buttonbat it calculate the resize of xbrowse
I wish to implement this but I not Know How make it
I made a test
- Code: Select all Expand view
#include 'fivewin.ch'
#include 'xbrowse.ch'
static lToolbar:=.f.
function Main()
local oDlg, oBrw, oFont
SET DATE ITALIAN
SET CENTURY ON
FwNumFormat( 'E', .t. )
USE C:\WORK\FWH\SAMPLES\CUSTOMER ALIAS CUST
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'XBrowse Change Size'
@ 10,20 XBROWSE oBrw OF oDlg SIZE -10,-20 PIXEL ;
COLUMNS "First", "State", "Age", "HireDate", "Salary" ;
ALIAS 'CUST' NOBORDER
oBrw:lRecordSelector := .f.
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
oBrw:bRCLicked := {|nRow,nCol| MenuOption(oDlg,nRow,nCol,"CUST",oBrw) }
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
Function MenuOption(oDlg,nRow,nCol,cDbf,oGrid)
LOCAL oMenu
MENU oMenu POPUP 2007
SEPARATOR
MENUITEM "Show ToolBar" ACTION (ChangeSize(oGrid,ltoolBar),oGrid:refresh())
SEPARATOR
ENDMENU
ACTIVATE POPUP oMenu OF oDlg AT oGrid:nTop+nRow, oGrid:nLeft+nCol
RETURN (NIL)
Function ChangeSize(oGrid,ltoolBar)
nOldTop:= oGrid:ntop
nOldBottom:=oGrid:nBottom
If ltoolBar
CreateToolBar( oGrid,oDlg,ltoolBar)
oGrid:nTop:= nOldTop -40
oGrid:nHeight:=oGrid:nBottom -40
Else
oGrid:nTop:=nOldTop +40
oGrid:nHeight:=oGrid:nBottom +40
Endif
Retur nil
Function CreateToolBar( oGrid,oDlg,ltoolBar)
Local oExit
If ltoolBar
DEFINE BUTTONBAR oBar SIZE 40, 46 OF oDlg 2007
oBar:bRClicked := { || .t. }
DEFINE BUTTON OF oBar ;
RESOURCE "RB_CLIENTI" ;
TOOLTIP i18n( "Gestión de documentos" ) ;
MESSAGE i18n( "Gestión de del fichero de documentos." ) ;
ACTION NIL ;
NOBORDER
DEFINE BUTTON oExit OF oBar ;
RESOURCE "BB_EXIT" ;
TOOLTIP i18n( "Salir del programa" ) ;
MESSAGE i18n( "Finalizar el uso del programa." ) ;
ACTION odlg:End() ;
GROUP NOBORDER
ELSE
If oBar!=NIL
oBar:End()
Endif
ENDIF
oDlg:refresh()
return nil