Card Placer

by Daniel Smith

A card windows point of origin is it’s parent window’s top/left content area and once a card is open the parent window’s size cannot be retrieved, which makes positioning card windows cumbersome.

FileMaker’s Adjust Window [Resize to Fit] step only constrain’s the card to the screen. This module will keep the card window within the content area of the parent, which is useful when a card window should allow scrolling.

This module can also assist with placing a card relative to a named layout object. This is uefull when you want a card to open directly below a button the user clicked.

Co-created with Joshua Willing

Download Module

or view it on GitHub


12 responses to “Card Placer”

  1. Ben says:

    This is a really useful module for working with card windows. Thank you. Unfortunately it doesn’t see to work properly if the parent window is on a second monitor to the left f the main monitor. I will try and investigate this further – I guess it is due to negative numbers. Have you found this problem? My users usually have 2 monitors and I can’t control how they are set up, so for me it needs to work on all monitors, whatever the arrangement to be useful.

  2. Daniel Smith says:

    Thanks for pointing that out; I hadn’t noticed it yet. On my system it looks like the only part that fails is the window was too far to the left only when placing the card window relative to an object. Is that what you experienced as well? If not, can you click “Run Tests” and take a video of the the window while it runs through the tests? That should give me the info I need to at least know where it fails for you.

  3. Ben says:

    The new version has fixed the issue. All good now. Thank you Dan 🙂

  4. Steve Nadeau says:

    I just integrated this with my solution. It works great, but it doesn’t support placing a card window besides a button when the button is part of a portal. Actually it does work, but it always places the card window besides the first instance of the button.

    It might be because the technique is working with the object’s name.

  5. Daniel Smith says:

    When you call the module, you have to send it the coordinates of the object to align the window to. That means the code you write controls which portal row to align the window to. The good news is, all you should have to do is add the portalRowNumber to the GetLayoutObjectAttribute function., so it should look something like:

    GetLayoutObjectAttribute ( $object ; “right” ; “” ; Get ( ActivePortalRowNumber ) )

  6. Steve Nadeau says:

    I did not know that, what a pleasant discovery.
    and I call myself a “certified Filemaker developer”, such a shame!
    Thank you Daniel!

  7. Steve says:

    Eeeeeeeyah this seems like swatting flies with a sledgehammer…. I really don’t want to integrate a “module” with my production solution that I don’t thoroughly understand how it works. Does anybody have a simple calculation or function to position a card window relative to an object? I don’t want a script to do it, I can write a script that opens a card window myself, I’m just trying to figure out how to calculate the coordinates. I tried to pull apart this module but it’s way too complicated for me to understand.

  8. Olly says:

    Super useful module, thanks for sharing Dan.

  9. Phil says:

    I am wondering if it can work for new windows that are not card window – so that you can open two windows with different layouts from different tables and work between them

    • Daniel Smith says:

      I don’t think this is the best tool for that job. It’s designed to place windows on top of a parent based on inner content dimension/location as opposed to outer window size, which is probably what you’d want. If, for example, you want two equally sized windows to fill the screen, that’s probably easier to do on your own than with this module.

Leave a Reply

Your email address will not be published. Required fields are marked *