Please look it http://www.fivetech.com.tw/downloads/Video_2016-06-30_105725.wmv
Default I call ButtonBmp Action myself method no problem. but now I set button within TGet and get error.
- Code: Select all Expand view
METHOD ReGet() CLASS TUsersMsf
REDEFINE GROUP ::oGrp ID 400 OF ::oDlg TRANSPARENT
REDEFINE GET ::oUSERID VAR ::oDB:USERID ID 101 OF ::oDlg UPDATE
REDEFINE GET ::oPASSWD VAR ::oDB:PASSWD ID 102 OF ::oDlg UPDATE
REDEFINE GET ::oE_NO VAR ::oDB:E_NO ID 103 OF ::oDlg UPDATE BITMAP "SB_FIND1" ACTION( ::Find_EmpData(1) )
REDEFINE GET ::oFULLNAME VAR ::oDB:FULLNAME ID 104 OF ::oDlg UPDATE
::oE_NO:lBtnTransparent := .t.
RETURN NIL
//----------------------------------------------------------------------------//
METHOD ReBtn() CLASS TUsersMsf
::oSubBtn2 := Array(1)
REDEFINE BUTTONBMP ::oSubBtn2[1] ID 701 OF ::oDlg ;
BITMAP "SB_FIND1" ;
TOOLTIP "查詢員工編號資料" ;
MESSAGE "查詢員工編號資料" ;
ACTION ::Find_EmpData(1)
RETURN NIL
//---------------------------------------------------------------------------//
METHOD Find_EmpData( nPos ) CLASS TUsersMsf
LOCAL oDlg, oRdo, nRdo, oGet1, oGet2, oBtn[3], oGrp, oBrw, oCol
LOCAL lOK := .F.
LOCAL cNO := SPACE(6)
LOCAL cNAME := SPACE(12)
DEFAULT nPos := 1
nRdo := nPos
IF ::oEmployeeDB:LastRec() == 0
MsgAlert("資料檔中無任何資料,無法查詢 !","警告")
RETURN NIL
ENDIF
::oEmployeeDB:cQuery := "SELECT * FROM employeemsf WHERE comp_no = '"+cCP_NO+"' ORDER BY e_no"
::oEmployeeDB:Refresh()
DEFINE DIALOG oDlg RESOURCE "D_DR_WIN_USERSMSF_FINDEMP" FONT oFnt1
oBrw := TXBrowse():New( oDlg )
oBrw:SetMySQL(@::oEmployeeDB)
.............
Error occurred at: 2016.06.30, 10:57:09
Error description: Warning BASE/1004 Message not found: TGET:FIND_EMPDATA
Stack Calls
===========
Called from: source\rtl\tobject.prg => TGET:ERROR( 0 )
Called from: source\rtl\tobject.prg => TGET:MSGNOTFOUND( 0 )
Called from: source\rtl\tobject.prg => TGET:FIND_EMPDATA( 0 )
Called from: .\SOURCE32\Comm_Prg\TUsersMsf.prg => (b)TUSERSMSF:REGET( 497 )
Called from: .\source\classes\TGET.PRG => (b)TGET:CREATEBUTTON( 527 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 658 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 894 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1833 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3276 )
Called from: => DIALOGBOXW( 0 )
Called from: .\SOURCE32\Fwh_LIB\Dialog.prg => TDIALOG:ACTIVATE( 306 )
Called from: .\SOURCE32\Comm_Prg\TUsersMsf.prg => TUSERSMSF:FORMCREATE( 203 )
Called from: .\SOURCE32\Comm_Prg\TUsersMsf.prg => TUSERSMSF:NEW( 100 )
Called from: .\SOURCE32\Main.prg => TWINCRANEERP:RUNUSERSMSF( 1395 )
Called from: .\SOURCE32\Main.prg => (b)TWINCRANEERP:BUILD_FW_MENU( 638 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1085 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1084 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3276 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1040 )
Called from: .\SOURCE32\Main.prg => TWINCRANEERP:NEW( 555 )
Called from: .\SOURCE32\Main.prg => MAIN( 319 )
This is my main problem. second fix when TGet disable, button disable color