XBROWSE determine FOOTER coordinates
XBROWSE determine FOOTER coordinates
Hi to all
How to determine coordinates of the FOOTER for some column nTop, nLeft, nBottom, nRight
For example
I need on oBrw:bKEyDown if nKey == VK_F2 and
if oBrw:nAt() ==2 or oBrw:nAt() == 3 to create a GET object on the same place (on the FOOTER of that column) with the same size
Or some other solution please
Best regardds,
How to determine coordinates of the FOOTER for some column nTop, nLeft, nBottom, nRight
For example
I need on oBrw:bKEyDown if nKey == VK_F2 and
if oBrw:nAt() ==2 or oBrw:nAt() == 3 to create a GET object on the same place (on the FOOTER of that column) with the same size
Or some other solution please
Best regardds,
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: XBROWSE determine FOOTER coordinates
top: oBrw:BrwHeight() - oBrw:nFooterHeight + 3
left: oCol:nDisplayPos
bottom: oBrw:BrwHeight()
right: oCol:nDisplayPos + oCol:nWidth
left: oCol:nDisplayPos
bottom: oBrw:BrwHeight()
right: oCol:nDisplayPos + oCol:nWidth
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: XBROWSE determine FOOTER coordinates
Hi Rao
Thanks for reply
Please look this error:
Error description: Warning BASE/1004 Message not found: TXBRWCOLUMN:NDISPLAYPOS
Stack Calls
===========
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:ERROR( 0 )
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:MSGNOTFOUND( 0 )
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:NDISPLAYPOS( 0 )
Called from: .\procedur.PRG => F_OK_CITAJ( 1867 )
If you think oCol:nDisplayCol ... i have returned value and tested
But problem is that created GET is always on the same place on screen whatever dialog or window where xbrowse is placed is moved
I need to do something like this
Probably need some combination with oBrw:oCol:DataRect() or GetClientRect() or GetWndRect() ... or some other solution
Or Can i use something like this ?
DEFINE DIALOG oDlg OF oCol:oFooter .... ????
I will be verry grateful for some sample
Best Best regards,
Thanks for reply
Please look this error:
Error description: Warning BASE/1004 Message not found: TXBRWCOLUMN:NDISPLAYPOS
Stack Calls
===========
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:ERROR( 0 )
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:MSGNOTFOUND( 0 )
Called from: source\rtl\tobject.prg => TXBRWCOLUMN:NDISPLAYPOS( 0 )
Called from: .\procedur.PRG => F_OK_CITAJ( 1867 )
If you think oCol:nDisplayCol ... i have returned value and tested
But problem is that created GET is always on the same place on screen whatever dialog or window where xbrowse is placed is moved
I need to do something like this
Code: Select all | Expand
//----------------------------------------------------------------------------//
FUNCTION F_OK_CITAJ( nKey, oBrw )
local nBrPole := oBrw:nAt()
local oCol := oBrw:aCols[ nBrPole ]
*local nTop := oBrw:BrwHeight() - oBrw:nFooterHeight + 3
*local nLeft := oCol:nDisplayPos
*local nBottom := oBrw:BrwHeight()
*local nRight := oCol:nDisplayPos + oCol:nWidth
local nTop := oBrw:BrwHeight() - oBrw:nFooterHeight + 3
local nLeft := oCol:nDisplayCol
local nBottom := oBrw:BrwHeight()
local nRight := oCol:nDisplayCol + oCol:nWidth
LOCAL oDlg, oGet
LOCAL cCitaj := SPACE(50)
IF nKey > 31 .OR. nKey == 13
DEFINE DIALOG oDlg OF oBrw:oWnd ;
// need here coordinates of footer for taht column nevermind where is dialog with xBrowse placed
FROM nTop, nLeft TO nBottom, nRight ;
STYLE nOR( WS_VISIBLE, WS_POPUP ) ;
PIXEL
@ 0, 0 GET oGet VAR cCitaj OF oDlg SIZE 100, 12 ; // ?? need same size as created dialog
PIXEL ;
FONT oFont1 ;
VALID oDlg:End()
oDlg:bStart := {|| oGet:KeyChar( nKey ) }
ACTIVATE DIALOG oDlg
ENDIF
RETURN ALLTRIM( cCitaj )
Probably need some combination with oBrw:oCol:DataRect() or GetClientRect() or GetWndRect() ... or some other solution
Or Can i use something like this ?
DEFINE DIALOG oDlg OF oCol:oFooter .... ????
I will be verry grateful for some sample
Best Best regards,
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: XBROWSE determine FOOTER coordinates
You are right. It is oCol:nDisplayCol not nDisplayPos. Sorry for my mistake,
These coordinates are relative to oBrw:hWnd. You need to derive coordinates relative to the screen for use to create a dialog. You may consider using the function ClientToScreen(...).
These coordinates are relative to oBrw:hWnd. You need to derive coordinates relative to the screen for use to create a dialog. You may consider using the function ClientToScreen(...).
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: XBROWSE determine FOOTER coordinates
Instead of this code
we can use
Unlike other browses, when using XBrowse, let us not deal with column numbers but only with column objects. Nth column at the time of creation may not be nth column at run-time.
There are many built-in features of xbrowse like incremental searches, filters, wild-seeks/filters which can be invoked just by setting some switches instead of writing code, just like we do not have to write any code for inline edits.
Please consider if you can use any of these features before planning to write your special code.
May we also know the purpose of creating the dialog and get?
Code: Select all | Expand
local nBrPole := oBrw:nAt()
local oCol := oBrw:aCols[ nBrPole ]
we can use
Code: Select all | Expand
oCol := oBrw:SelectedCol()
Unlike other browses, when using XBrowse, let us not deal with column numbers but only with column objects. Nth column at the time of creation may not be nth column at run-time.
There are many built-in features of xbrowse like incremental searches, filters, wild-seeks/filters which can be invoked just by setting some switches instead of writing code, just like we do not have to write any code for inline edits.
Please consider if you can use any of these features before planning to write your special code.
May we also know the purpose of creating the dialog and get?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: XBROWSE determine FOOTER coordinates
This is a sample function to create a dialog to fit over the footer
Code: Select all | Expand
static function FooterDlg( oBrw )
local oDlg, oCol, nTop, nLeft, nHeight, nWidth, aPoint, oGet
local c := space(20)
oCol := oBrw:SelectedCol()
nHeight := oBrw:nFooterHeight - 3
nWidth := oCol:nWidth
nTop := oBrw:BrwHeight() - nHeight
nLeft := oCol:nDisplayCol
aPoint := ClientToScreen( oBrw:hWnd, { nTop, nLeft } )
if aPoint[ 1 ] > 0x8000
aPoint[ 1 ] -= 0xFFFF
endif
if aPoint[ 2 ] > 0x8000
aPoint[ 2 ] -= 0xFFFF
endif
DEFINE DIALOG oDlg SIZE nWidth, nHeight PIXEL STYLE (WS_VISIBLE+WS_POPUP)
@ 0,0 GET oGet VAR c SIZE nWidth/2,nHeight/2 PIXEL OF oDlg
@ 1000,1000 BUTTON "" SIZE 10,10 PIXEL OF oDlg DEFAULT ACTION oDlg:End()
ACTIVATE DIALOG oDlg ON INIT ( oDlg:Move( aPoint[ 1 ], aPoint[ 2 ] ) )
msginfo( c )
return c
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: XBROWSE determine FOOTER coordinates
Rao,
MANY Many thanks ... this is good function just i needd ..
My plan was to SEEK the value from the GET byt i will try to use standard xbrowse seek and may be on that window of the footer oSeek object will be placed
I have few problems with SEEKing
1- I dont like to click with mouse everytime the header of column where i want to seek value but to use cursor keys to move to other column and seek some value
2- I have problem with seeking on numeric columns
Test TESTXBR3.PRG, exclude fastedit and try seek on Salary column
If it is descending sort, SEEK DONT WORK at all
If it is ascending sort and for example we want to find valye 13200
When we
click digit "1" xbrowse is going to first (smallest valye) row
click digit "3" still on first row
click digit "2" still on first row
click digit "0" still on first row
click digit "0" NOW is going to row with Salary valye 13200
Probably BUG or i am missing something ...
Best regards,
MANY Many thanks ... this is good function just i needd ..
There are many built-in features of xbrowse like incremental searches, filters, wild-seeks/filters which can be invoked just by setting some switches instead of writing code, just like we do not have to write any code for inline edits.
Please consider if you can use any of these features before planning to write your special code.
My plan was to SEEK the value from the GET byt i will try to use standard xbrowse seek and may be on that window of the footer oSeek object will be placed
May we also know the purpose of creating the dialog and get?
I have few problems with SEEKing
1- I dont like to click with mouse everytime the header of column where i want to seek value but to use cursor keys to move to other column and seek some value
2- I have problem with seeking on numeric columns
Test TESTXBR3.PRG, exclude fastedit and try seek on Salary column
If it is descending sort, SEEK DONT WORK at all
If it is ascending sort and for example we want to find valye 13200
When we
click digit "1" xbrowse is going to first (smallest valye) row
click digit "3" still on first row
click digit "2" still on first row
click digit "0" still on first row
click digit "0" NOW is going to row with Salary valye 13200
Probably BUG or i am missing something ...
Best regards,
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: XBROWSE determine FOOTER coordinates
- I have problem with seeking on numeric columns
Test TESTXBR3.PRG, exclude fastedit and try seek on Salary column
I guess you want to start the seek when the user presses a key even before the dbf is sorted on that column. Right?
But before you seek, you got to change the index anyway.
What you can do is to change the order the moment user presses a key and allow the built-in seek system to take over.
Where do we display the seek expression? Showing on the footer may be one way, but in some browses we may use footer to diplay several aggregates and in such cases we may need to place the display of seek expression at a different place. It may be better to display the seek expression consistently at a place which does not clash with other requirement of footers.
have problem with seeking on numeric columns
Not a bug. Logic is to softseek on the expression entered till that keystroke.
I shall look into how to deal with this on descend sorts.
In any case I provided you the function you were looking for.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India