New topic: 

Webcontainers + Scrolling

<http://forums.realsoftware.com/viewtopic.php?t=39778>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        ALEXIZZY          Post subject: Webcontainers + ScrollingPosted: 
Sun Jul 10, 2011 4:05 pm                         
Joined: Sun Sep 05, 2010 1:28 am
Posts: 2                Hello,

I have, on my webpage, a webimageview inside a webcontainer. As a simple 
exercise, I would like to paint something on the picture in the web image view 
when I click on it (ie. paint a dot at the coordinates that I clicked). This 
seems fairly simple to do, however, I am having a problem when the webcontainer 
on the page has scroll bars. I was using the MouseClick event and using the X,Y 
parameters to determine where on the picture the user pressed the mouse. When 
scroll bars are present, however, the X,Y coordinates are the same in the same 
spot on the screen regardless of where the scroll bar is positioned. This makes 
sense (X,Y variables determine where mouse is on the screen), however, how 
would I then work around this and determine where the mouse is on the picture? 
The scrollbars are automatically generated (as the webcontainer is embedded on 
the page smaller than its actual size) and thus I can't find a way to check the 
value of the scrollbars and use that to compensate. Had they been manually 
placed there, I suppose I could use something like 'scrollbar1.value' to 
compensate?

Any help would be much appreciated! 

Thanks
Alex   
                             Top                 KikoLobo          Post 
subject: Re: Webcontainers + ScrollingPosted: Sun Jul 10, 2011 8:17 pm          
               
Joined: Sat Oct 01, 2005 12:51 am
Posts: 175
Location: Monterrey, Mexico                If you find a way to do this let me 
know...

I am guessing this will have to be done outside of RS... And directly using 
Java.      
_________________
------------------ 
Do what you can with what you have. 
Its often more than enough.  
                             Top                ALEXIZZY          Post subject: 
Re: Webcontainers + ScrollingPosted: Mon Jul 11, 2011 12:22 am                  
       
Joined: Sun Sep 05, 2010 1:28 am
Posts: 2                Turns out you can use a work around.

I'm sure this is not the best way to do this, so please, if anyone can think of 
anything better let me know.

Basically, I changed the ScrollBarsVisible property to "never". Thus, the 
automatic scroll bars never appear. Instead I put scrollbar controls into the 
web container. As the user moves those scroll bars, the controls inside the 
webcontrol (which is just a Webimageview) shift (I just change the top and left 
properties proportionately with the value of the scrollbars) so that even if 
the imageview is too large to be seen at once, you can move the scrollbars to 
move it around.

It's not ideal, but so far its working just fine!   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to