I have problem with 2 xbrowse in one dialog. I've used TWbrowse for this dialog without problem. This is the following code and .RC file.
TWbrowse is work ok.
TXbrowse is not work.
Code: Select all
#include 'fivewin.ch'
#include 'xbrowse.ch'
Function main
local oDlg, oBrw1, oBrw2, oSay
Request DBFCDX, DBFFPT
RddSetDefault('DBFCDX')
USE CCRCODE ALIAS SUB SHARED NEW
SUB->(DBSETORDER(1))
SUB->(DbGoTop())
USE CCRCODE ALIAS MAN SHARED NEW
MAN->(DBSETORDER(1))
MAN->(cmxSetScope(0,'M '))
MAN->(cmxSetScope(1,'M '))
MAN->(Dbgotop())
DEFINE DIALOG oDlg RESOURCE 'CONMCODE'
SELECT('MAN')
REDEFINE XBROWSE oBrw1 FIELDS MAN->COD_CODE, MAN->COD_DESC ;
HEADERS TE('????','Code'), TE('??????','Description') ;
FIELDSIZES 50, 180 ;
UPDATE ;
ID 101
oBrw1:bChange := { || ( Brow_sCode( oBrw1 , oBrw2 , .F. ), oBrw1:Refresh() ) }
SELECT('SUB')
SUB->(DBseek(MAN->COD_CODE))
REDEFINE XBROWSE oBrw2 FIELDS SUB->COD_CODE, SUB->COD_DESC ;
HEADERS TE('????','Code'), TE('??????','Description') ;
FIELDSIZES 50, 180 ;
UPDATE ;
ID 102
ACTIVATE DIALOG oDlg ON INIT (Eval( oBrw1:bChange ) ) RESIZE16
Close all
SET RESOURCES TO
ResAllFree()
return .T.
function TE(T,E)
return E
*-----------------*
Function Brow_sCode( oBrw1 , oBrw2 , lDelete )
Select SUB
SUB->(cmxClrScope(0))
SUB->(cmxClrScope(1))
if lDelete
MsgAlert( 'Code : '+MAN->COD_CODE+' was deleted' )
end
SUB->(DbSeek(MAN->COD_CODE))
SUB->(cmxSetScope(0,MAN->COD_CODE))
SUB->(cmxSetScope(1,MAN->COD_CODE))
if SUB->(cmxKeyCount()) > 0
oBrw2:GoTop()
end
oBrw2:Refresh(.T.)
SELECT('MAN')
oBrw1:Refresh()
return nil
Function cmxSetScope( nScope, xVal )
return if(PCount() <= 1, OrdScope( nScope ), OrdScope( nScope, xVal ))
Function cmxClrScope( nScope )
return OrdScope( nScope, Nil)
Function cmxKeyNo()
return OrdKeyNo()
Function cmxKeyCount()
return OrdKeyCount()
Function cmxKeyCoun()
return OrdKeyCount()
Function cmxKeyGoTo(nKey)
return OrdKeyGoTo(nKey)
/*
CONMCODE DIALOG 6, 15, 393, 203
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "User Define Pick Box"
FONT 8, "MS Sans Serif"
{
CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 2, 14, 190, 152
CONTROL "", 102, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 199, 14, 190, 152
LTEXT "Main Group Code", 109, 2, 2, 65, 10
LTEXT "Pick Up Code", 110, 199, 2, 65, 10
PUSHBUTTON "&New Group", 11, 2, 169, 45, 30
PUSHBUTTON "&Edit Group", 12, 48, 169, 45, 30
PUSHBUTTON "&Delete Group", 13, 94, 169, 45, 30
PUSHBUTTON "Ne&w Code", 14, 199, 169, 45, 30
PUSHBUTTON "E&dit Code", 15, 245, 169, 45, 30
PUSHBUTTON "Delete &Code", 16, 291, 169, 45, 30
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 195, 2, 1, 197
}
*/