developing a program, I see that the that the bUpdate of TEdit is never called, I found the problem on METHOD Command( nWParam, nLParam ) CLASS TDialog:
- Code: Select all Expand view
- METHOD Command( nWParam, nLParam ) CLASS TDialog
local oWnd, nNotifyCode, nID, hWndCtl, oCtrl
nNotifyCode = nHiWord( nWParam )
nID = nLoWord( nWParam )
hWndCtl = nLParam
do case
case ::oPopup != nil
::oPopup:Command( nID )
case hWndCtl == 0 .and. ::oMenu != nil .and. ;
If( nNotifyCode == BN_CLICKED, nID != IDCANCEL, .f. )
::oMenu:Command( nID )
case GetClassName( hWndCtl ) == "ToolbarWindow32"
oWndFromHwnd( hWndCtl ):Command( nWParam, nLParam )
return .T. // otherwise a child dialog gets closed
case ::oMenu != nil .and. nId != 2 .and. nNotifyCode != BN_CLICKED .and. ;
nNotifyCode != CBN_SELCHANGE
if nNotifyCode == 1
::oMenu:Command( nID )
endif
case nID == IDCANCEL .and. ! ::lModal
if ::lValid()
::bValid = nil
::End()
return .T.
endif
return .F.
case nID != 0
do case
case nNotifyCode == BN_CLICKED
if hWndCtl != 0 .and. nID != IDCANCEL
oWnd := oWndFromhWnd( hWndCtl )
if ValType( ::nResult ) == "O" // latest control which had focus
// There is a pending Valid, it is not a clicked button
if oWnd != nil
if ! oWnd:lCancel
if ::nResult:nID != nID .and. ! ::nResult:lValid()
return nil
endif
endif
else
if ::nResult:nID != nID .and. ! ::nResult:lValid()
return nil
endif
endif
endif
if AScan( ::aControls, { |o| o:nID == nID } ) > 0
SendMessage( hWndCtl, FM_CLICK, 0, 0 )
elseif nID == IDOK
::End( IDOK )
endif
else
if nID == IDOK
::GoNextCtrl( GetFocus() )
if ! ::lModal
return 0
endif
elseif hWndCtl != 0 .and. ; // There is a control for IDCANCEL
AScan( ::aControls, { |o| o:nID == nID } ) > 0
SendMessage( hWndCtl, FM_CLICK, 0, 0 )
return .F.
else
::End( IDCANCEL )
endif
endif
case nNotifyCode == CBN_SELCHANGE
SendMessage( hWndCtl, FM_CHANGE, 0, 0 )
case nNotifyCode == CBN_CLOSEUP
SendMessage( hWndCtl, FM_CLOSEUP, 0, 0 )
endcase
case GetClassName( hWndCtl ) == "Edit"
oCtrl := oWndFromHwnd( hWndCtl )
if oCtrl != nil .and. oCtrl:ClassName() == "TEDIT"
oCtrl:Command( nWParam, nLParam )
return nil
endif
endcase
return nil
The problem is that the edit has nID != 0 then it goes in the case before...
There is 2 possible solutions: move the case GetClassName( hWndCtl ) == "Edit" before the case nID!=0, or it inside the other do case, in this way only Edit with ID !=0 will works, ie every edit control (in FiveWin there is not possible ID=0)...
maybe this fix can be included in the next release?