CONTROL "", 100, "TBar", 0|WS_CHILD|WS_VISIBLE, 0,0, 660, 30
// Define the button bar
REDEFINE BUTTONBAR oBarInv ID 100 SIZE 60,55 OF oDiw 2015
oBarInv:bClrGrad := aPubGrad
DEFINE BUTTON oBtn1 OF oBarInv RESOURCE "HRADD" PROMPT "Add" TOOLTIP "Add a new part record" ;
ACTION ( oLbxin:gobottom(), ::oInventory:AddNewPart(), oLbxin:refresh( ),;
::oPart:load(), oDiw:update( ), oNum:setfocus( ) ) GROUP LABEL "Parts"
DEFINE BUTTON oBtn2 OF oBarInv RESOURCE "HRSAVE" PROMPT "Save" TOOLTIP "Save this record" ;
ACTION ( ::oPart:save( ), oLbxin:refresh(), oDiw:update( ), oLbxin:setfocus( ), oLbxin:skip(0) )
DEFINE BUTTON oBtn4 OF oBarInv RESOURCE "HRDELETE" PROMPT "Delete" TOOLTIP "Delete the selected part";
ACTION ( ::oInventory:DeletePart( ), oLbxin:skip(1), ::oPart:load(), oDiw:update(), oLbxin:setfocus( ) ) ;
//. Add in more buttons here
//
DEFINE BUTTON oBtn0 OF oBarInv RESOURCE "HRHELP" PROMPT "Help" TOOLTIP "OnLine Manual" ;
ACTION WinExec( "hh asw10.chm" ) GROUP BTNRIGHT
DEFINE BUTTON oBtn7 OF oBarInv RESOURCE "HREXIT" PROMPT "Exit" TOOLTIP "Exit inventory" ;
ACTION ( oDiw:end( ), ::oInventory:end( ) ) BTNRIGHT
reds wrote:Mr Rao
When when adding a new record in a lot of cases the blank fields will need to be auto filled
with data from the previous edit dialog.So I was going to make a copy of oRec:Data and on the
new blank record overwrite the current oRec:aData and oRec:aOrg with data from the copy.
Is there a better way of doing this ?
Regards
Peter
@ 200,160 BTNBMP oBtn RESOURCE FWBitmap( "new16" ) SIZE 32,32 PIXEL OF oDlg FLAT TOOLTIP "New" ;
WHEN !Empty( oRec:RecNo ) ACTION ( oRec:Copy(),oRec:Load( .t. ),oRec:Paste(), oDlg:Update() )
@ 100,190 BTNBMP NOBORDER OF oDlg SIZE 30,15;
FILE IIF( oRec:MARRIED, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp" ) ;
ACTION ( oRec:MARRIED := ! oRec:MARRIED, ;
::SetImages( IIF( oRec:MARRIED, "..\bitmaps\on.bmp", "..\bitmaps\off.bmp" ) ) ) UPDATE
// @ 100,200 CHECKBOX oRec:Married PROMPT "" SIZE 26,26 PIXEL OF oDlg UPDATE
Also I would like to use the toggle switch (green for on) bitmap that is used in the browser default edit dialog,where
is this located.
@ 103,180 SWITCH oRec:Married SIZE 40,18 PIXEL OF oDlg UPDATE OVALSTYLE BORDERSIZE 1 THUMBSIZE 1
@ 100,190 BTNBMP oBtn ;
FILE "c:\fwh\bitmaps\on.bmp", nil, "c:\fwh\bitmaps\off.bmp" ;
SIZE 26,26 PIXEL OF oDlg CENTER NOBORDER UPDATE ;
ACTION ( oRec:Married := !oRec:Married, ::Refresh() )
oBtn:bBmpNo := { || If( oRec:Married, 1, 3 ) }
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 47 guests