pgGotoUrl()

Help for using specific functions

pgGotoUrl()

Postby John Robin Dove » Mon Mar 30, 2015 6:38 am

Hi Clifton,

I am using this to display several things including a Toolbook DHTML. The field containing the Toolbook DHTML has an unwanted border line of about 1 pixel in width on the left and top sides. I have tried setting the Toolbook viewer borderStyle to none in the embedded application but this makes no difference. I've also tried setting the posLeft and posTop parameters to negative values in the main application. I've set the field strokeColor to its fillColor and set the field borderStyle to none. The problem is still there. Any ideas please?

UPDATE

I've found a fix. I've changed the matColor of the viewer of the embedded TB DTML and set the posLeft and posTop parameters to - 5. (Maybe the matcolor alone would have solved the problem.)
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: pgGotoUrl()

Postby Clifton » Mon Mar 30, 2015 7:24 am

Can you show us a screenshot?
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgGotoUrl()

Postby John Robin Dove » Tue Mar 31, 2015 5:46 am

Hi Clifton,

Don't waste a lot of time on this because I've found a solution but you may want to know what's happening. I am loading a Toolbook dhtml into a field on the main Toolbook dhtml with pgGotoURL(). I am doing this because the secondary app displays an animation which seems to interfere with certain functions in the main app. Loading it this way solves the problem but on my first attempt I noticed that the left and top sides of the field displayed an unwanted border line:

Image

The secondary app dimensions are 4770 X 4770 page units (318 px * 15) X (318 px * 15) and it has a 318 px X 318 px background image. It is loaded into a 4770 X 4770 Toolbook field. In the secondary app I have used the default values for a new book: main viewer sizes to page etc.

To correct this problem I have just set the matcolor of the mainwindow of the secondary app to the color (orange) used in the background image.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: pgGotoUrl()

Postby Clifton » Tue Mar 31, 2015 7:34 am

Try using setBrowserWindowStyles() on the app that is being loaded to drop out the background color altogether. This allows anything in the main application to show through as the background for the secondary app. I would also consider using setPageContentPosition() on the app being loaded to set the page content position to left to 0 and top to 0. This should fix the problem. What I think is happening is the black mat color of black is displaying because the field into which the app is loaded is just a pixel or so too large. But the technique I described will fix it.
Please note:
  • setBrowserWindowStyles() can be run on book load, though it is not restricted to this event.
  • setPageContentPosition() must be run on load page for the first page of the book. You can't run setPageContentPosition() on book load because a valid page hasn't loaded at that level.
After running these two functions, it won't matter what the matColor of your book is as these will override all of that and set things exactly as you need them for the best appearance. From a development point of view, a matColor different from page color is important at author level. Otherwise it can be difficult to position objects relative to the boundaries of your page.

I run these two functions a lot on embedded applications like in situations you have described.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgGotoUrl()

Postby John Robin Dove » Tue Mar 31, 2015 9:44 am

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


Return to Function Help

Who is online

Users browsing this forum: No registered users and 6 guests

cron