Post by Mohamed HamzaPost by lohenPost by lohenPost by Mohamed HamzaPost by lohenPost by Mohamed HamzaPost by Mohamed HamzaPost by Mohamed HamzaHi All,
@0, 0, 10, maxcol() GET u1 TBROWSE oTB1
@11, 0, maxcol(),maxrow() GET u2 TBROWSE oTB2
READ
oTB1 is displayed normaly but oTB2 is not showed until I click on 11,0,maxcol(),maxrow() zone or when I use the TAB key!
Is it possible to display oTB1 and oTB2 at the same time?
Nb: I believe that oTB2 is displayed when we set the focus on it?
Regards.
Med
@ 0,0,10,maxcol() GET u1 TBROWSE oTB1 SEND display()
@ 11,0,maxrow(),maxcol() GET u2 TBROWSE oTB2 SEND display() //
maxrow(),maxcol() was in wrong order in your sample
hth,
lohen
I got the same result
@ 0, 0,10,maxcol() get u tbrowse otb1 send display()
@ 11,0,maxrow(),maxcol() get u2 tbrowse otb2 send display()
I fact, the correct way is
@ 0,0,10,maxcol() get u tbrowse otb1 send control:forcestable()
@ 11,0,maxrow(),maxcol() get u2 tbrowse otb2 send control:forcestable()
Med
Hadn't thought of that! :-) Thanks for sharing
lohen
Now I want to get the active get tbrowse otb1 or otb2 I tried
@0, 0, 10, maxcol() GET u1 TBROWSE oTB1 send .... when getalias()
@11, 0, maxcol(),maxrow() GET u2 TBROWSE oTB2 send ....when getalias()
function getalias()
local otb
otb:=getactive():control
return .t.
otb is not the control I expected?
Med
@ 0, 0, 10, maxcol() GET u1 TBROWSE oTB1 send .... when { |
oControl | getalias( oControl ) }
@11, 0, maxcol(),maxrow() GET u2 TBROWSE oTB2 send .... when { |
oControl | getalias( oControl ) }
function getalias( otb )
// otb is your get's :control
return .t.
?
lohen
For example
When I click on u2 I mean otb2 the getactive is u and when I click on u getactive is u2
but when I use Tab key to navigate everything's good.
function getalias( otb )
alert ( getactive:name)
return .t.
getactive() is not being updated from the internals of the GET system,
then only _after_ the when clause yields .T.
For the mouseing misbehaviour in your sample (when you write u i suppose
you mean u1), of the top of my head, only adapting the GET system code
itself will help
@ 1,0,10,maxcol() get u tbrowse otb1 send control:forcestable() MESSAGE( otb1:cargo) when {|c|alert(c:control:cargo),.T. }
@ 11,0,maxrow(),maxcol() get u2 tbrowse otb2 send control:forcestable() message( otb2:cargo) when {|c|alert(c:control:cargo),.T. }
By the way (c:control:cargo) contains the ALIAS of the DBF we are browsing.
After this example I plan to code a master-detail tbrowse
Beware that when evaluating the WHEN clause, as far as i saw in the GET
system code, the argument from the internals to the WHEN Block isn't the
GET object itself, but the GET:control object, so that your two WHEN
clauses (perhaps?) need to be
when {| control |alert(control:cargo),.T.}
.oO although the GET system i draw this conclusion from is a heavily adapted one
lohen
In
FUNCTION getAlias(ctrl)
LOCAL objGet
objGet := GETACTIVE(ctrl)
alert(ctrl:classname+' '+objget:classname) // GIVE GET object
So ctrl:control :classname and objget:classname are TBROWSE
Med
what is said earlier, control being oGet:control wasn't correct, it
should have read:
@ 0, 0, 10, maxcol() GET u1 TBROWSE oTB1 send .... when { | oGet,
oControl | getalias( oControl ) }
@11, 0, maxcol(), maxrow() GET u2 TBROWSE oTB2 send .... when { | oGet,
oControl | getalias( oControl ) }
when calling GETACTIVE() with an argument, it is pbly best to restore
the return value of that first GETACTIVE() call with another call to
GETACTIVE() providing the return variable of the first call - and doing
so is only meaningful during a READ
So ctrl:control :classname and objget:*control:*classname are TBROWSE
l