Problem with checkBox

Champciaux Laurent (starnet!apple!info.emn.fr!lchamp)
Thu, 27 Apr 95 17:17:18 +0100

Hello,

Here is my problem :

We are making an AdressBook. There is a unique background with many controls :
fields (unshared text) for lastname, firstname, adress, etc... ; buttons for
create cards, search, sort, etc... and a check box (name = "Marquee") that
indicates if the current card is marked or not. Of course, there is one card
for each record in the adress book. We have the following script for the check
box :
on mouseUp
set the mark of this cd to the hilite of me
end mouseUp

In the background script there is the following handler :
on preOpenCard
...
...
set the hilite of btn "Marquee" to the mark of this card
end preOpenCard

All is Ok when we manually click on the check-box. That is when we navigate
through the cards, the check-box reflects correctly the status of the current
card (marked when the check-box is hilited, unmarked when the check-box is not
hilited).

The problem arise with our search button. The search button has the following
script (we want to mark the cards that contain a search-string):

on mouseUp
unmark all cards
ask "Channe ` rechercher ?" -- ask "String to search ?"
if it is not empty then
find it
if the result is "not found" then
answer "Pas trouvi" -- answer "Not found"
else
if marquage is true then -- marquage is a global var sets to true
mark cards by finding it
send preOpenCard to this cd
end if
end if
end if
end mouseUp

The command 'mark' marks correctly the cards, but when we navigate through the
cards the check-box does not reflect the correct status of the current card. If
we insist in navigating through the cards then the check-box works well again
but not at first glance!!!

We have verified that the property 'hilite' of the check-box is well affected
when the preOpenCard handler is runned (each time we go to a card).
Nota bene: the sharedHilite property of the check-box is set to false.

So, on a card the check-box should be hilited because its property (hilite) is
true but it's not the case.

We must admit that this phenomenon is a bit odd and difficult to explain. But
if you have an idea about that, your help is welcome.

If you want to have a look at the stack, try my WWW home page at the following
URL : http://mines1.info.emn.fr:8888/

Thanks in advance.

Laurent Champciaux.