XBrowse online editing
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Trying with your Exe:
Let us take 4th line first column.
Enter 9 and press enter key. ( in your exe valid msg is shown only once).
and get retians focus and shows 9
click on some other program window outiside. Get still has focus.
Now come back to browse and click on any other cell.
9 is written and also wrongly justified ( as if painted by get object)
Please release your next exe with colored gets.
Let us take 4th line first column.
Enter 9 and press enter key. ( in your exe valid msg is shown only once).
and get retians focus and shows 9
click on some other program window outiside. Get still has focus.
Now come back to browse and click on any other cell.
9 is written and also wrongly justified ( as if painted by get object)
Please release your next exe with colored gets.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
In the above case:
9 seems to be in Get still. We can not navigate to the cell by left clicking on the cell. But if we block the 9 with mouse and press enter :
9 seems to be in Get still. We can not navigate to the cell by left clicking on the cell. But if we block the 9 with mouse and press enter :
Code: Select all
Path and name: C:\TESTS\Bin\mallorca1.exe (32 bits)
Size: 1,223,168 bytes
Time from start: 0 hours 0 mins 32 secs
Error occurred at: 12/24/07, 19:48:17
Error description: Error BASE/1005 No exported variable: NLASTKEY
Args:
[ 1] = U
[ 2] = N 13
Stack Calls
===========
Called from: => _NLASTKEY(0)
Called from: .\source\classes\XBROWSE.PRG => EDITGETKEYDOWN(0)
Called from: => (b)EDIT(0)
Called from: => TGET:KEYDOWN(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: => TCONTROL:HANDLEEVENT(0)
Called from: => TGET:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: => TWINDOW:ACTIVATE(0)
Called from: D:\FiveWin.20\samples\mallorca.prg => MAIN(34)
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Mr Antonio
There seem to some difference in the behavior between your exe and what I compile here.
I have made the changes in a derived class so that the changes are very clear. The zip file of the changes is here
XBROWED.zip (3.40 KB)
Can you kindly go through and advise me if there are any more modifications I need to make?
There seem to some difference in the behavior between your exe and what I compile here.
I have made the changes in a derived class so that the changes are very clear. The zip file of the changes is here
XBROWED.zip (3.40 KB)
Can you kindly go through and advise me if there are any more modifications I need to make?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Nageswararao,
Fixed. In METHOD Edit( nKey ) CLASS TXBrwColumn make this change:
and add this function to source\winapi\getwnd.c
Fixed. In METHOD Edit( nKey ) CLASS TXBrwColumn make this change:
Code: Select all
::oEditGet:bLostFocus := { | oGet, hWndFocus | If( GetWindowProcessId( hWndFocus ) != GetWindowProcessId( ::oBrw:hWnd ), ::oBrw:CancelEdit(), If( ::oEditGet != nil .and. ! ::oEditGet:lValidating, ::PostEdit(),) ) }
Code: Select all
HB_FUNC( GETWINDOWPROCESSID ) // hWnd --> nProcessId
{
DWORD dwProcessId;
GetWindowThreadProcessId( ( HWND ) hb_parnl( 1 ), &dwProcessId );
hb_retnl( dwProcessId );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
We can use GetWindowThreadProcessId() instead of GetWindowProcessId():
Code: Select all
HB_FUNC( GETWINDOWTHREADPROCESSID ) // hWnd --> nThread
{
_retnl( GetWindowThreadProcessId( ( HWND ) _parnl( 1 ), NULL ) );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
New mallorca.exe for testing:
http://www.hotshare.net/file/25644-4327956e7d.html
http://www.hotshare.net/file/25644-4327956e7d.html
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
This change cancels the editing before giving focus to another control in the application:
new static function inside Class TXBrowse:
Code: Select all
METHOD Edit( nKey ) CLASS TXBrwColumn
...
::oEditGet:bLostFocus := { | oGet, hWndFocus | EditGetLostFocus( oGet, hWndFocus, ::oBrw, ::oEditGet ) }
...
Code: Select all
static function EditGetLostFocus( oGet, hWndFocus, oBrw, oEditGet )
// focus goes to another control in the same application
if oWndFromHwnd( hWndFocus ) != nil
oBrw:CancelEdit()
return nil
endif
// focus goes to another application
if GetWindowThreadProcessId( hWndFocus ) != GetWindowThreadProcessId( oBrw:hWnd )
oBrw:CancelEdit()
return nil
endif
if oEditGet != nil .and. ! oEditGet:lValidating
oBrw:PostEdit()
endif
return nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
A new mallorca.exe build:
http://www.hotshare.net/file/25841-7828226dca.html
Please try to break it, thanks
http://www.hotshare.net/file/25841-7828226dca.html
Please try to break it, thanks
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
I have tested the exe provided by you. I have also rebuilt the samples adopting your changes.
Both are now working fine. I continue my tests.
Only one thing I dont understand. In the exe provided by you the valid block is executed only once, but with the exe i built it is executed twice. I am trying to figure out the reason.
Both are now working fine. I continue my tests.
Only one thing I dont understand. In the exe provided by you the valid block is executed only once, but with the exe i built it is executed twice. I am trying to figure out the reason.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
I have changed the function Valida in mallocra.prg as below
If i enter a valid value, ( example 6 ) it is not getting assigned.
Code: Select all
STATIC FUNCTION Valida( oGet )
local nnew := 0
IF oGet:Value() > 6
MsgAlert( "Must be lower than 7" )
if msgget('NEW VALUE','Enter number between 1 and 6',@nnew)
if nnew > 0 .and. nnew < 7
oGet:varput( nnew )
oget:refresh()
return .t.
else
return .f.
endif
endif
return .F.
ENDIF
RETURN .T.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Nageswararao,
That behavior is fine because the real assignment is done from here:
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aLin[ oBrw:nArrayAt,1] := xVal,) }
The VALID should not try to modify the edited value. It just jave to return .T. or .F., and a warning for the user, if needed
That behavior is fine because the real assignment is done from here:
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aLin[ oBrw:nArrayAt,1] := xVal,) }
The VALID should not try to modify the edited value. It just jave to return .T. or .F., and a warning for the user, if needed
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact: