Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GET TBROWSE

124 views
Skip to first unread message

Mohamed Hamza

unread,
Jun 29, 2023, 2:54:25 PM6/29/23
to
Hi All,

I wrote this simple code to show my problem:

@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

lohen

unread,
Jun 29, 2023, 11:32:12 PM6/29/23
to
Op 2023-06-29 om 20:54 schreef Mohamed Hamza:
Can you use the @ ... GET SEND ... clause as in

@ 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

Mohamed Hamza

unread,
Jun 30, 2023, 11:03:17 AM6/30/23
to
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()

Mohamed Hamza

unread,
Jun 30, 2023, 11:50:02 AM6/30/23
to
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

lohen

unread,
Jun 30, 2023, 12:51:52 PM6/30/23
to
Op 2023-06-30 om 17:50 schreef Mohamed Hamza:
Hadn't thought of that! :-) Thanks for sharing

lohen

Mohamed Hamza

unread,
Jun 30, 2023, 3:29:00 PM6/30/23
to
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



lohen

unread,
Jul 1, 2023, 2:16:23 AM7/1/23
to
Op 2023-06-30 om 21:28 schreef Mohamed Hamza:
Just a guess:

@ 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

Mohamed Hamza

unread,
Jul 1, 2023, 2:36:57 AM7/1/23
to
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.

lohen

unread,
Jul 1, 2023, 3:20:07 AM7/1/23
to
Op 2023-07-01 om 08:36 schreef Mohamed Hamza:
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

l

Mohamed Hamza

unread,
Jul 1, 2023, 6:21:16 AM7/1/23
to
> You are right. Now the code becomes:

@ 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





lohen

unread,
Jul 1, 2023, 6:44:22 AM7/1/23
to
Op 2023-07-01 om 12:21 schreef Mohamed Hamza:
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

Mohamed Hamza

unread,
Jul 1, 2023, 12:15:56 PM7/1/23
to
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

lohen

unread,
Jul 1, 2023, 12:56:23 PM7/1/23
to
Op 2023-07-01 om 18:15 schreef Mohamed Hamza:
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

Mohamed Hamza

unread,
Jul 1, 2023, 2:02:15 PM7/1/23
to
Did you try to make a sample to show the result ?

Regards
Med

lohen

unread,
Jul 1, 2023, 3:55:11 PM7/1/23
to
Op 2023-07-01 om 20:02 schreef Mohamed Hamza:
No, all written above is untested, but behaviour consulted from the
sources to the GET system
From the fact you mention @... GET ... TBROWSE i derive that this is
CA-Clipper 5.3
The CA-Clipper 5.2 GET system is quite less complicated

l
0 new messages