Resizing browser object (Mac)

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Location: Rome, Italy
Contact:

Resizing browser object (Mac)

Post by andy60 » Thu Feb 12, 2015 8:22 am

Hi, i studied this example http://lessons.runrev.com/m/4071/l/2384 ... is-resized.

In the card script:

Code: Select all

on resizeStack cardWidth, cardHeight
.....
  set the height of the image field "browser image" to cardWidth-50
.....
end resizeStack
With textfield and buttons i have no problem in resizing coding script.
My problem is resize the image object used for browser container.
In both livecode mode (execution or programming) i have difficulties to
manual resize the image. The image seems to be blocked and duplicated.
So i can delete the image e restart my operation. Do you know this problem?
bad coding the closeCard or closeBrowser script? Other consideration on browser:
with edit pointer set to 'on' browser is also active. Why? I can't resize the image field.

Here is the code on card, it works well but i don't know about closeCard and browserClose
because browser image object freeze on edit mode:

Code: Select all

global myBrowser

on openCard
   browserOpen
   send "mouseUp" to button "ButtonHome"
end openCard

on browserOpen
   put revBrowserOpen(the windowid of this stack,"") into myBrowser
   revBrowserSet myBrowser, "showborder","true"
   revBrowserSet myBrowser, "visible","true"
   revBrowserSet myBrowser, "rect",rect of image "browser image"
end browserOpen

# provide a status message that indicates loading has started
on browserBeforeNavigate myBrowser,pUrl
  put "Started loading:" && pUrl into field "Status"
end browserBeforeNavigate

# provide a status message that indicates loading has ended
on browserNavigateComplete mybrowser,pUrl
   put pURL into field "url"
   put "Finished loading:" && pUrl into field "Status"
   wait for 2 seconds
   put " " into field "Status"
end browserNavigateComplete

on browserClose
   revBrowserClose myBrowser
   put empty into myBrowser
end browserClose

on closeCard
   if myBrowser is not empty then
      revBrowserClose myBrowser
      put empty into myBrowser
   end if
end closeCard
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Resizing browser object (Mac)

Post by Dixie » Thu Feb 12, 2015 9:18 am

Hi Andy...

I have attached a stack that shows 'google' maps in a browser object, resizing the card resizes the browser object... I have commented the script, the handlers of which are all in the card script... hope it helps :D

Dixie
Attachments
resizeBrowser.zip
(80.25 KiB) Downloaded 241 times

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Location: Rome, Italy
Contact:

Re: Resizing browser object (Mac)

Post by andy60 » Thu Feb 12, 2015 10:18 am

Dixie wrote:Hi Andy...

I have attached a stack that shows 'google' maps in a browser object, resizing the card resizes the browser object... I have commented the script, the handlers of which are all in the card script... hope it helps :D

Dixie
thx for your help
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Klaus
Posts: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Resizing browser object (Mac)

Post by Klaus » Thu Feb 12, 2015 1:14 pm

Hi Andy,

please get used to the LC terminology!
set the height of the image field "browser image" to cardWidth-50
We have a FIELD object and an IMAGE object in Livecode, but no "image field"! 8)

So proposed you have an IMAGE object as a size reference for your browser, this should do:
set the height of image "browser image" to (cardWidth - 50)
Is cardWidth a variable and did you fill it with the correct value?
If not, use -> the width of this cd

And do not use THE, when addressing LC objects!
Good:
put fld "xyz" into tXYZ
Bad:
## put THE fld "xyz" into tXYZ


Best

Klaus

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Location: Rome, Italy
Contact:

Re: Resizing browser object (Mac)

Post by andy60 » Thu Feb 12, 2015 2:49 pm

Klaus wrote:Hi Andy,

please get used to the LC terminology!
set the height of the image field "browser image" to cardWidth-50
We have a FIELD object and an IMAGE object in Livecode, but no "image field"! 8)

So proposed you have an IMAGE object as a size reference for your browser, this should do:
set the height of image "browser image" to (cardWidth - 50)
Is cardWidth a variable and did you fill it with the correct value?
If not, use -> the width of this cd

And do not use THE, when addressing LC objects!
Good:
put fld "xyz" into tXYZ
Bad:
## put THE fld "xyz" into tXYZ


Best

Klaus

very good Klaus :P thx
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”