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

Highlighted table frame

4 views
Skip to first unread message

Dave Loveridge

unread,
Nov 4, 2004, 8:27:45 PM11/4/04
to corel.developer.paradox

I have a table frame and I am using Lance Leonards Record Highlight code and
it works great (Thanks Lance). I also have some fields that are bound to the
same table and when I am on these fields and you move to a different record
the table frame does not update the highlight to the new record that you
moved to. I have tried everything I can think of and cannot get it to do it.

Thanks in advance

--
Sincerely,
Dave Loveridge

Bertil Isberg

unread,
Nov 5, 2004, 10:32:21 AM11/5/04
to corel.developer.paradox

Dave

<<
I have a table frame and I am using Lance Leonards Record Highlight code
>>

As I don't use that code it's very hard to give any advice unless you show
the code.
--
Bertil Isberg - CTECH
Paradox buglist:
online: http://w1.826.comhem.se/~u82608896/
FAQ newsgroup: corel.wpoffice.paradox-faq

Tony McGuire

unread,
Nov 5, 2004, 11:52:24 AM11/5/04
to corel.developer.paradox

"Dave Loveridge" wrote
:
: I have a table frame and I am using Lance Leonards Record Highlight code


and
: it works great (Thanks Lance). I also have some fields that are bound to
the
: same table and when I am on these fields and you move to a different
record


Do you mean that you have a tableframe, as well as bare fields on the form
(that are attached to the same table as the tableframe but not *in* hte
tableframe)?

And when in one of those bare fields and you move to a new record the
hilighting code doesn't work?


--
--
Paradox Support http://www.thedbcommunity.com/support/

Tony McGuire
_____________

Dave Loveridge

unread,
Nov 5, 2004, 11:44:23 AM11/5/04
to corel.developer.paradox

Sorry Bertil

This is attached to the table frames action method

; Now, highlight the selected record, if necessary

method action(var eventInfo ActionEvent)
if eventInfo.actionClass() = DataAction then

If not loHilite.isAssigned() then
return
endIf

; See if the record should be highlighted.

if loHilite = TRUE then

delayScreenUpdates( TRUE ) ; Make sure repaints happen at once
uiRec.Color = container.color ; Reset the record's color
loHilite = FALSE

doDefault ; Let the action take place

loHilite = TRUE
uiRec.attach( uiFld.containerName )
uiRec.color = HL_COLOR ; Highlight the current record
uiRec.Translucent = TRUE
delayScreenUpdates( False ) ; Allow repaints to happen now

endif
endif
EndMethod

This is attached to the tables close method

method close(var eventInfo Event)
uiRec.Color = Self.Color
endMethod

This is attached to the tables open method

method open(var eventInfo Event)
loHilite = FALSE
doDefault

;// Get first UI Field in tableframe and attach to it.

uiFld.attach( self.firstRow )
uiFld.attach( uiFld.first )
uiFld.attach( self.fullname + "." + uiFld.name )

;// Get UI Record in tableframe and attach to it.

uiRec.attach( uiFld.containerName )
loHilite = TRUE
endMethod

Dave Loveridge

unread,
Nov 5, 2004, 2:03:30 PM11/5/04
to corel.developer.paradox

Exactly!

"Tony McGuire" <cng.paradoxcommunity@com> wrote in message
news:418ba9ad$1_3@cnews...

Tony McGuire

unread,
Nov 5, 2004, 2:11:08 PM11/5/04
to corel.developer.paradox

"Dave Loveridge" wrote
:
: Exactly!
:

Without focus, I'd be surprised if the code on the TF worked.

Likely Bertil can suggest a different/additional location/level to place the
code for your situation.

Dave Loveridge

unread,
Nov 5, 2004, 2:13:27 PM11/5/04
to corel.developer.paradox

Your right, that is why the could is not working. I am just not sure how to
get around it.

"Tony McGuire" <cng.paradoxcommunity@com> wrote in message
news:418bca31_3@cnews...

Dennis Santoro

unread,
Nov 5, 2004, 3:46:47 PM11/5/04
to corel.developer.paradox

Well get those bare fields off the form and into a record object. Very bad idea
to have bare fields. Maybe with a record object to contain them you will have an
event you can trap for to do what you want.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and non-profits since
1982

Bertil Isberg

unread,
Nov 5, 2004, 3:44:34 PM11/5/04
to corel.developer.paradox

Dave

<<
Your right, that is why the could is not working. I am just not sure how to
get around it.
>>
I'm pretty sure the code is NOT written to handle your design with fields
belonging to the table being shown outside the tableframe, and I'm pretty
sure you will have to spend a lot of hours to find a solution for that
design.

Dave Loveridge

unread,
Nov 5, 2004, 5:44:30 PM11/5/04
to corel.developer.paradox

I dont' know that I understand by what you mean bare field vs. a record
object.
the fields are bound to the same table as the table frame. But what do you
mean by putting them in a record object.
I have only been using paradox for a little while and so I am not quite up
on all the lingo, so have some patience with me, thanks for the replies.

"Dennis Santoro" <RDA...@RDAWorldWideSPAMFILTER.com> wrote in message
news:418BE6B7...@RDAWorldWideSPAMFILTER.com...

Dennis Santoro

unread,
Nov 5, 2004, 7:00:08 PM11/5/04
to corel.developer.paradox

Dave,

I strongly suggest you get my Database Basics paper and my Normalization paper
from our Paradox resources page (link in my signature). It will help you with a
lot of best practices and avoiding common pitfalls. Also pick up my
containership on forms paper while you are there

As for bare fields, fields bound to a table should always be contained in an MRO
(Mutlirecord object) or a TF (TableFrame). These objects contain a record object
(right click on one and look in the object explorer). Record objects handle
record level events (posts, unlocks etc.) and you need the default behaviors
they generate for controlling and managing the actions of your forms, your users
and your data. So get those fields inside a singe record MRO (SRO). You can link
it to the TF so the current active record in the TF is what is displayed in the
MRO. You will need to use table aliases though. See the database Basics paper
for more on that.

Dave Loveridge

unread,
Nov 8, 2004, 10:36:30 AM11/8/04
to corel.developer.paradox

Dennis,
Forgive me for sounding stupid here, I read both papers you suggested
and I still am not understanding what you mean. If I create a table frame
and assign it some fields from the data model and then I place an mro and
try to assign it some fields the fields are all greyed out and I cannot
select them. How do you go about linking a table to an mro. This I have
never done before.

Thanks for your help,
Dave

Dave Loveridge

unread,
Nov 8, 2004, 11:21:11 AM11/8/04
to corel.developer.paradox

Tony I sent you an email.
Thanks
Dave

"Tony McGuire" <cng.paradoxcommunity@com> wrote in message
news:418bca31_3@cnews...

Dave Loveridge

unread,
Nov 8, 2004, 1:25:49 PM11/8/04
to corel.developer.paradox

Dennis,
I just spoke with Tony and he straightened me out on this. I think I
understand now what I need to do. I will go this route and see what happens.
Thanks for all your help.
Dave

Tony McGuire

unread,
Nov 8, 2004, 1:46:13 PM11/8/04
to corel.developer.paradox

Denn,

: and your data. So get those fields inside a singe record MRO (SRO). You


can link
: it to the TF so the current active record in the TF is what is displayed
in the
: MRO. You will need to use table aliases though. See the database Basics
paper

One-to-One between the TF and the 'bare fields' moving into a [M,S]RO, so
actual linking isn't possible.

Code to keep them in sync is needed.

Dennis Santoro

unread,
Nov 8, 2004, 8:16:59 PM11/8/04
to corel.developer.paradox

OK, in that case you would need to create a secondary for it that would link
1:M. But the code to setrange on the unlinked MRO is probably easier.

Dave Loveridge

unread,
Nov 9, 2004, 10:13:01 AM11/9/04
to corel.developer.paradox

Denn,
What is the best way to link this by code?

Dave Loveridge

unread,
Nov 9, 2004, 10:51:04 AM11/9/04
to corel.developer.paradox

This is how I came up to do it, I placed the code in the action method of
the tableframe

UIObject.SetRange(FilterObject)

Do I need to do more than just this.


--
Sincerely,
Dave Loveridge
Loveridge Machine Co.
VP/Senior Programmer
4097 South West Temple
Murray, UT 84107
www.loveridgemachine.com
d...@loveridgemachine.com
Phone (801)-262-1414
Fax (801)-261-1818
"Dave Loveridge" <ddl.loveridgemachine@com> wrote in message
news:4190d868$1_1@cnews...

Dennis Santoro

unread,
Nov 9, 2004, 2:35:55 PM11/9/04
to corel.developer.paradox

Well, you have to decide what the trigger will be if you put it in the action
of the tableframe. More likely you want it on the arrive of the record object
of the TF. Where you put it depends on when you want to change what shows in
the MRO. And basically you have it right (consider improving your naming
conventions so you and we can tell what is what when looking at the code. You
want to setrange on the MRO based on the value of the linking field(s). And
you want it in a test (if then) so you know if it worked.
0 new messages