Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dynamically resize an object

Featured Replies

GetLayoutObjectAttribute("blue_box";"bounds") returns the bounds of a manually drawn square named "blue_box" (e.g. 99 82 919 182 0).

But how do I alter these bounds, for example with data out of 5 number fields. It would be great if there was a function like:

PutLayoutObjectAttribute("blue_box"; var_1, var_2, var_3, var_4, var_5)

I made a sample in PHP of what I want to accomplish in Filemaker: http://www.arubaserver.com/beta/window/

Please comment.

You just answered your own question: use web publishing or a web viewer on a layout. FileMaker objects can't be resized programmatically.

Perhaps this example will give you some ideas.

  • Author

But then, will the filemaker webviewer resize according to the size of the generated image?

Wouldn't this be a great feature though, to include resizing layout objects from scripts or calculation fields?

  • Author

window.php?w=60&h=120&t=1&o=l&c=9

  • Author

Direct link in the filemaker webviewer field to:

http://www.arubaserver.com/beta/window/window.php?w=60&h=120&t=1&o=l&c=9

doesn't work either...

Wouldn't this be a great feature though, to include resizing layout objects from scripts or calculation fields?

It sure would. It would be nice to be able to programatically control all of the attributes of objects but I'm not sure our friends at FM will be heading in this direction anytime soon.

FM Pro seems to be aimed at regular folks who have a need for simple databases that they can build on their own. Being able to have total programatic control over object attributes probably isn't something that the average FM developer needs but obviously full-time FM developers could put such a feature to good use.

Your link doesn't show anything (or do anything) in a regular browser either, so...

In any case, you cannot programmatically* resize a layout object - including a web viewer. You can only resize objects SHOWN IN a web viewer.

---

(*) as opposed to resizing automatically when the window is resized.

  • Author

All at http://www.arubaserver.com/beta/window/ works fine.

The generated image though needs to be inside tags, otherwise it downloads right away and is not displayed in the browser.

Don, your URL is generating an image file that my browser asks to download. You could make that work, but you said it yourself, it won't work as is in a browser, so it's not going to work as is in a FileMaker web viewer.

Did you check out the example I linked above? I know it's not a work of art, but it seems to me it would be less overhead than your method. It doesn't require a server or even a separate web page file.

Are you from Aruba? I went there once long ago.

  • Author

I got it to work... ;-)

I made a new page where the image is embedded in html. (http://www.arubaserver.com/beta/window/test.php?w=80&h=120) Apparently it does NOT work if you either

- make a direct link to the image

or

- generate the html with the embedded image WITHIN Filemaker

So a Filemaker field named 'URL' where a calculated result is

"http://www.arubaserver.com/beta/window/test.php?w=80&h=120" does work flawless. (the '80' and '120' are set vars copied from manuel input fields within Filemaker)

Although this does open doors for me, it would still be way better if Filemaker came up with either "PutLayoutObjectAttribute( "blue_box"; var_1, var_2, var_3, var_4, var_5)" or "SetLayoutObjectAttribute( "blue_box"; var_1, var_2, var_3, var_4, var_5)".

If anybody needs a simple (or complex) PHP image creator let me know...

Keep posting.

Ooh, and yes. I live in Aruba. Actually ON Aruba since it's an island ;-). And we just had a 4.5 Earth Quake, weird feeling.

I'm glad you got it working. You never did say what your actual use for this is, or whether you ever looked into my CSS example.

If you do think PHP is the way to go, you may be interested in checking out SmartPill.

  • Author

I'm making a quotation app for a window fabricator... I need a scaled image of the window as an extra to the name and description. It's still not perfect as the Filemaker webviewer does not scale to the image size.

I will look closer into the CSS option also, although you cannot create diagonals with that (I think).

Thanks.

  • Author

One more thing...

What would be the purpose of naming objects (circles, squares, etc. - you can in the 'View' -> 'Object' pane) if you can't really do anything with it (besides reading it's 'bounds'). But why would one want to know an objects bounds anyway? For example you can not really act upon it by means of an If/Then/Else statement. This feature would have SO MUCH more value if it was the other way around, writing instead of reading.

Is there a way we can submit this feature to FileMaker?

I made a poll, please vote!

Edited by Guest

  • Author

Made an ever better solution with a local html file and javascript...

Dynamic input of color, width and height. Very nice!

Only need to replace the "file:///Users/michiel/Desktop/chart/chart.html" for your file path location. (This can probably be automatically, but for now just copy-past your path).

http://www.fmforums.com/attachments/uploads/1207973048-chart.jpg

Comments welcome.

URL: http://www.arubaserver.com/beta/chart/chart.html?w=800&h=500&c=ffaa30

chart.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.