Page 1 of 1

tbfunction_pgStyleObject

PostPosted: Sun Nov 19, 2023 9:32 am
by John Robin Dove
Hi Clifton,
I have noticed a new problem yesterday and today related to pgStyleObject. It would appear to have occurred because I re-exported several tbks (for the final time I hoped). Could it be that the latest version of Powerpac is causing this? The 'auto' propVal parameters for 'width' and 'height' do not function unless I repeat them. Here is an example:
Code: Select all
<info>
  <pgStyleObject>
  <![CDATA[
  { theStyle : "padding, width, height, box-shadow, cursor",
  propVal  : "4px, auto, auto, 5px 5px 5px, default" }
  ]]>
  </pgStyleObject>
 
  <function name="myUser" event="user" params="evt,value" useTB="true">
  <![CDATA[
  //info shows info relevant to buttons etc on all pages
  tbfunction_pgTBObjSet("info", "visible", false);  //user event sent after 8 seconds when there is no mouse and user taps to see contextual help messages.
  ]]> 
  </function>
  </info>

Then when I try to use this, I find it necessary to redefine 'width' and 'height':
Code: Select all
<function name="showInfo" event="" params="long,txt,pos,white,">
  <![CDATA[
  //System to display contextual help messages for all main pages.
    if (keys.showHelp == true)
    {
      if (white == true )
      {
      tbfunction_pgStyleObject("info", "background-color", "white");
      }
      else
      {
      tbfunction_pgStyleObject("info", "background-color", "#FCFCBD");
      }
    tbfunction_pgStyleObject("info", "width", "auto");   //Why has this become necessary now? It has worked for years without a problem!!!
    tbfunction_pgStyleObject("info", "height", "auto");
      if (long == false)
      {
      tbfunction_pgStyleObject("info", "max-width", "175px");
      }
      else
      {
      tbfunction_pgStyleObject("info", "max-width", "1000px");
      }
    tbfunction_pgTBObjSet("info", "text", txt);
    tbfunction_pgTBObjSet("info", "position", pos);
    tbfunction_pgTBObjSet("info", "visible", true);
    }
  ]]>
  </function>

I won't export any more tbks for the time being.
John
UPDATE It is definitely occuring because of the export to web process. I downloaded earlier versions from my web server and the problem does not exist in these.

Re: tbfunction_pgStyleObject

PostPosted: Sun Nov 19, 2023 10:04 am
by Clifton
I will see if I can duplicate this and report back on what I find.
The most recent fix to pgStyleObject() (PowerPac v15.300.2) fixed a bug that would occur if you tried to set height to a fixed value (e.g., 50px) when the original setting was "auto" (set in an xml call). Basically the function didn't know what to do with this scenario so it prevented the fixed value from being set at all and left the setting at "auto". This should not have had any bearing on setting the value to "auto" from a previously fixed value.

Clifton

Re: tbfunction_pgStyleObject

PostPosted: Sun Nov 19, 2023 4:36 pm
by Clifton
Hi John,

Can you provide a flawed example that uses pgStyleObject() to set width/height to "auto"?
I tested a project which does this in the XML file and the output is working as expected.

Clifton

Re: tbfunction_pgStyleObject

PostPosted: Mon Nov 20, 2023 5:36 am
by John Robin Dove
Hi Clifton,
The error is still present in my system. I have made a test app, using the same objects and code as in my program, to demonstrate it and put a zip here https://www.mediacours.com/tb_examples/testAuto.zip containing testAuto.tbk, testAuto1.xml, and error.mp4 which shows what happens. I am using Toolbook 9.01 but ,as we have already established, my copy, updated from 9.0 by a patch, is not identical to yours.
John

Re: tbfunction_pgStyleObject

PostPosted: Mon Nov 20, 2023 6:26 pm
by Clifton
Hi John,

Thank you for submitted your test app. This issue has been resolved in PowerPac v15.300.3.

Clifton

Re: tbfunction_pgStyleObject

PostPosted: Tue Nov 21, 2023 4:56 am
by John Robin Dove
Thanks Clifton. I'll wait for v15.300.3 before exporting anything.

Re: tbfunction_pgStyleObject

PostPosted: Tue Nov 21, 2023 7:41 am
by Clifton
PowerPac 15.300.3 is already online.