transparency etc.

Workarounds and usability notes.

transparency etc.

Postby John Robin Dove » Mon Aug 28, 2017 7:53 am

Hi Clifton,

Any idea what's happening here? I have a group of 60 white transparent fields on the background. On the layer above them there is a field of the same color as the background. Because the fields are transparent AND because of the field above them, they are invisible; (a bit belt and braces - English expression meaning excessive safety precautions are being used). When the fields are used, they change position and then either change color and size or use a css class to change their appearance. Their layer does not change. Sometimes this use is cancelled by the user; in which case their className is set to "", their rgbFill to "255, 255, 255" and their transparent to true; and then their width and position are reset to the original values i.e. where they were before they were moved and 10 px wide.

So they should be invisible again. They're not! They are no longer transparent and apparently above the field that is supposed to hide them. WHY?

To return them to their original state I use userProperty and pgTBObjSet.

I can work around this by using a covering object on the page rather than the background so don't spend too much time on this.

John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: transparency etc.

Postby Clifton » Mon Aug 28, 2017 8:16 am

Please check if the class of the objects is being cleared. I have a feeling the classes is not being removed during the reset process with userProperty().

Plus, I would use pgStyleObject() to set styles on objects like this as it manipulates the CSS inline styles directly in a way that may be more reliable in this particular case, and just plain easier than ToolBook's clunky property setters.
    Example:
    tbfunction_pgStyleObject( "myObject", "background", "transparent");
    Comment: OR if the color is important too then ...
    tbfunction_pgStyleObject( "myObject", "backgroundColor, background", "white, transparent");

However, it is still important to determine if your class is being removed from the object(s). You may need to set to userProperty() parameter [get_set] = "toggle". It was provided to expressly turn classes on/off like you are attempting to do.
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: transparency etc.

Postby John Robin Dove » Mon Aug 28, 2017 9:54 am

Thanks Clifton,

pgStyleObject solves the problem. I did not know that transparent was acceptable as a property. I had tried with opacity. Both "" and toggle remove the class in userProperty.

I don't know why the object was apparently above the layer of the covering field on the background but never mind.

John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: transparency etc.

Postby Clifton » Mon Aug 28, 2017 10:18 am

Regarding the layer changing:
    If the object is draggable by the user, then its layer automatically changes to be on top so they will not lose focus on the object. Usually, the release of the mouse puts the object back to its default layer, but if there are many of these, I wouldn't be surprised if the layer gets permanently changed at some point. The solution would be to use changeObjectLayer() to make sure all the objects stay below a specific object on the page. You would execute changeObjectLayer() as a user event on each object because a user event is sent to the object each time the object drag ends.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: transparency etc.

Postby John Robin Dove » Mon Aug 28, 2017 12:07 pm

None of the objects are draggable.

Re: unexpected problems I now have an even worse problem:

In the past i.e. more than two months ago I had 2 functions that operated normally: showRequest and showRequest2. They work in tandem and both are in the b.js external file. If showRequest is not called from within the b.js file both functions operate normally. If showRequest is called from within the b.js file it fails: showRequest2 is not called. This is catastrophic because it it used in this way many, many times, possibly hundreds.

showRequest receives XML translation database coordinates which it sends to an object on the background which in turn retrieves the corresponding text from an XML file. This is then sent to showRequest2 which displays a (fake) dialog box displaying the appropriate text and button captions.

This is very reminiscent of the snapObjectToCenter problem. There was no problem in the past. NOW THERE IS! Surely something must have been modified either Powerpac, the browsers or Windows!
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: transparency etc.

Postby Clifton » Mon Aug 28, 2017 1:26 pm

More than likely the problem is with the XML files. Have you check if they are being read in completely.
If the XML Parser encounters a problem it will stop reading the file.

In Firefox, you can check the array pg_xml using Firefox's developer tools to make sure all your data is present.
Here is a typical XML tree which has been correctly read for a little project I'm working on:
    Image 1.png
    XML Doc Tree
    Image 1.png (28.43 KiB) Viewed 734 times
An XML file which cannot be read, will likely throw an error, but if you are calling this from a custom JS file, you may have a try block which is hiding an error thread. I've recently added some XML read error feedback, but it is still possible that custom JS files may block the display of error messages.

Additional posts about this may not really fit this topic and a new topic should be opened for them.
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron