by Colin Haig » Thu Dec 13, 2007 12:54 am
Hi Tim
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT(AddBar(oData,oLbx,nNum,oStock));
VALID(WinOpen(oMainWnd,0),lExit)
static function AddBar(oData,oLbx,nNum,oStock)
local oBar,oBtn,oBtn1,oBtn2,oBtn3,cExitTip := '',cAddTip := '',cDelTip := '',cPrintTip := '',lRecs := FALSE
if nNum == 1
cExitTip := 'Exit Department Code Screen'
cAddTip := 'Add Department Code'
cPrintTip := 'Print Department Codes'
cDelTip := 'Delete Deparment Code'
elseif nNum == 2
cExitTip := 'Exit Timesheet Code Screen'
cAddTip := 'Add TimeSheet Code'
cPrintTip := 'Print Timesheet Codes'
cDelTip := 'Delete Timesheet Code'
elseif nNum == 3
cExitTip := 'Exit Stock Codes'
cAddTip := 'Add Stock Code'
cPrintTip := 'Print Stock Codes'
cDelTip := 'Delete Stock Code'
elseif nNum == 4
cExitTip := 'Exit Store Codes'
cAddTip := 'Add Store Code'
cPrintTip := 'Print Store Codes'
cDelTip := 'Delete Store Code'
elseif nNum == 5
cExitTip := 'Exit Tasks'
cAddTip := 'Add Task'
cPrintTip := 'Print Tasks'
cDelTip := 'Delete Task'
endif
if oData:reccount() > 0
lRecs := TRUE
endif
DEFINE BUTTONBAR oBar 3DLOOK SIZE 45, 45 OF oDlg 2007
DEFINE BUTTON oBtn of oBar RESOURCE "BTN_EXIT";
FLAT ;
PROMPT "Exit" ;
ACTION(lExit := TRUE,oDlg:End());
TOOLTIP(cExitTip)
DEFINE BUTTON oBtn1 of oBar RESOURCE "PLUS";
FLAT ;
PROMPT "Add" ;
ACTION(oData:Blank(),oData:append(),oLbx:Refresh(),oLbx:SetFocus(),oLbx:GoToCol(1));
TOOLTIP(cAddTip)
DEFINE BUTTON oBtn2 of oBar RESOURCE "PRINTER";
FLAT ;
PROMPT "Print" ;
ACTION(PrntCodes(oData,nNum),oLbx:Refresh(),oLbx:SetFocus());
TOOLTIP('Print Time Data')
DEFINE BUTTON oBtn3 of oBar RESOURCE "DELETE";
FLAT ;
PROMPT "Delete" ;
ACTION(lRecs := DelRec(lRecs,nNum,oData,oStock),if(lRecs,(oLbx:Refresh(),oLbx:SetFocus()),oLbx:Hide()));
TOOLTIP(cDelTip)
return(oBar)
HTH
Colin