[Pro] Adjusting the size of an item in the design view

I’ve a handful of actions that add stuff to the page. Each has options in the UI to change the resulting output and, in turn, change it’s dimensions.

For example an action that inserts banner ads based on fixed sizes.
When the action is added to the page I can specify the default size of the item easily enough but if the user selects the ‘Full horizontal banner’ option I really want the sketched item to resize to 234px x 60px. It’s generally not a problem if the action is bigger than the final banner ad but if it is smaller the final item can push the layout apart as it attempts to fit everything in.

So, how would I go about adjusting fwItem.fwWidth & fwItem.fwHeight and have this be reflected in the page layout? From where I stand these look like read only properties. Any ideas?

Thanks,
Tim.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Tim,

Yep, these are read only. There’s no way to change the size of an item
through the API currently. What you could do is use a Live Preview to
display the banner in the item though, this’ll show people how big the
item should be.

	function fwDrawItem()
	{
		var theHTML = "The HTML to be displayed"
		if (theHTML)
		{
			return new FWImage(	theHTML, 	// the HTML
								null, 		// default width (item width)
								null,  		// default height (item height)
								1, 			// flags (wait for resources to load)
								0.1);		// delay after load (to allow webkit time to render)
		}
		return null;
	}

Joe

On 3 Mar 2009, at 06:54, Tim Plumb wrote:

I’ve a handful of actions that add stuff to the page. Each has
options in the UI to change the resulting output and, in turn,
change it’s dimensions.

For example an action that inserts banner ads based on fixed sizes.
When the action is added to the page I can specify the default size
of the item easily enough but if the user selects the ‘Full
horizontal banner’ option I really want the sketched item to resize
to 234px x 60px. It’s generally not a problem if the action is
bigger than the final banner ad but if it is smaller the final item
can push the layout apart as it attempts to fit everything in.

So, how would I go about adjusting fwItem.fwWidth & fwItem.fwHeight
and have this be reflected in the page layout? From where I stand
these look like read only properties. Any ideas?

Thanks,
Tim.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for the prompt reply Joe. I’m already using the live preview to display
the banner preview but just wanted to flex the fwItem if the banner was
clipped. Oh well, I’ll warn the user and ask them to resize the item to fit.

On another, related, note I’ve been having problems with the HTML preview in the
action. Not so much the preview from a given HTML block as such but passing
through the design view preview. Let me explain. With this action applied the
user can choose any of a number of banner ads to add to a page. Choosing an ad
from the list populates the fwItem with the correct preview. All well and good
so far. However, if the box contains an image that the user wants to add
manually as the banner graphic I need to suppress the fwDrawItem function or
tell it to simply render the user’s image scaled and cropped to reflect the
design view.
Unfortunately I don’t have the action code with me or I would share it here.
Can you think of a way that I can switch fwDrawItem on and off like this?
Regards,
Tim.

Quoting Joe Billings email@hidden:

Hi Tim,

Yep, these are read only. There’s no way to change the size of an item
through the API currently. What you could do is use a Live Preview to
display the banner in the item though, this’ll show people how big the
item should be.

  function fwDrawItem()
  {
  	var theHTML = "The HTML to be displayed"
  	if (theHTML)
  	{
  		return new FWImage(	theHTML, 	// the HTML
  							null, 		// default width (item width)
  							null,  		// default height (item height)
  							1, 			// flags (wait for resources to load)
  							0.1);		// delay after load (to allow webkit time to render)
  	}
  	return null;
  }

Joe

Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options