Now it is possible to define the buttonbar and buttons in the same procedure/function creating the dialog, same way as in the case of a window.
\fwh\samples\barondlg.prg
- Code: Select all Expand view
- #include "fivewin.ch"
REQUEST DBFCDX
function TestDlgBar
local oDlg, oBar, oFont, oSegoe, oBrw
FWNumFormat( "A", .t. )
USE CUSTOMER NEW SHARED VIA "DBFCDX"
DEFINE FONT oFont NAME "ARIAL" SIZE 0,-12 BOLD
DEFINE FONT oSegoe NAME "Segoe UI" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont ;
TITLE "ButtonBar on Dialogs : FWH15.04"
DEFINE BUTTONBAR oBar OF oDlg SIZE 64,80 2007
DEFINE BUTTON OF oBar PROMPT "Add" FILE "c:\fwh\bitmaps\32x32\new.bmp" ACTION oBrw:EditSource( .t. )
DEFINE BUTTON OF oBar PROMPT "Edit" FILE "c:\fwh\bitmaps\32x32\edit.bmp" ACTION oBrw:EditSource()
DEFINE BUTTON OF oBar PROMPT "Delete" FILE "c:\fwh\bitmaps\delete.bmp" ACTION oBrw:Delete()
DEFINE BUTTON OF oBar PROMPT "Print" FILE "c:\fwh\bitmaps\print32.bmp" GROUP ACTION oBrw:Report()
DEFINE BUTTON OF oBar PROMPT "Excel" FILE "c:\fwh\bitmaps\excel.bmp" ACTION oBrw:ToExcel()
DEFINE BUTTON OF oBar PROMPT "PDF" FILE "c:\fwh\bitmaps\pdf.bmp" ACTION oBrw:Report( nil, .t., nil, nil, nil, "pdf" )
DEFINE BUTTON OF oBar PROMPT "Quit" FILE "c:\fwh\bitmaps\32x32\exit.bmp" GROUP ACTION oDlg:End()
@ 0,0 XBROWSE oBrw OF oDlg DATASOURCE Alias() ;
COLUMNS "First", "City", "State", "Age", "Salary" ;
FONT oSegoe ;
FOOTERS NOBORDER CELL LINES
oBrw:CreateFromCode()
oDlg:oClient := oBrw
ACTIVATE DIALOG oDlg CENTERED ON INIT oDlg:Resize()
RELEASE FONT oFont, oSegoe
CLOSE CUSTOMER
return nil