Cool Card Window Tricks

When something new comes into fashion, sometimes, you just can't ignore it. Such was the case with Card Windows. They just opened up so many possibilities within the world of FileMaker development.

While Button Bars, Popovers and Sliders have changed the way many things are done within your FileMaker user interface, the way Card Windows can be used should be your first consideration for many of your standard UI tasks.

Understanding what happens when a card window comes forward allows you to take advantage of some of the various features it provides.

In this video I walk through some helpful positioning functions and how the Card Window really behaves in relation to it's parent window and what you can do to take advantage of these cool new features.

AttachmentSize
CoolCardWindowTricks.zip1.55 MB

Comments

Thanks, Matt for another cool video.

Hi Matt,

Thanks for this awesome video. Lots of Lots of learning.

Re; eliminating the on timer script, Couldn't we use the "OnWindowClose" script trigger to set $$MENU.VISIBLE variable and refresh the button bar if we use below script as the trigger script:

If [ Get(WindowName) = "Menu" ]
Close Window [ Current Window ]
Set Variable [ $$MENU.VISIBLE; Value:False ]
Refresh Object [ Object Name: "bar.menu" ]
End If

Do you see any down side on above method? Personally, I am not really fund of On Timer script step.

Thank you!

Hi Matt, thanks for another useful video. getLayoutObjectAttribute on multiple monitors is a problem - the technique only works on the main monitor I think, I'm looking into this myself as I always need things to work with multiple monitors. It may only be a problem if the monitors have different sizes? It just seems to be a problem with the fromTop position, but I can't work out why it shouldn't work. Any thoughts?
PS - I suspect this may be a problem with mixed Retina & non-Retina screens! Ouch! (Tested on Mac only)

Hi Matt, you can use fractions of a second when setting the interval for Install onTimer Script and Pause/Resume script.
I hope this helps!

Thanks for the techniques, but I gave up the idea of exactly positioning a card window when I found the presence of a horizontal scroll bar would mess up the following calculation (tested in macOS):

GetLayoutObjectAttribute ( objectName; "top" ) - Get ( WindowTop ) - ( Get ( WindowHeight ) - Get ( WindowContentHeight ) )

When a horizontal scroll bar is present, the target Y coordinate is too high by the height of the scroll bar (because the difference between the window height and the content height includes the status bar but also the scroll bar), and I don't know of a way for the calculation engine to determine the presence or absence of the scroll bar.

I just rewatched this and I don't think the OnTimer behaviour is a bug. Going back to v16 the help notes for this feature state:

•If the active window has an installed timer and the user or a script opens a new window, the new window inherits the timer.
•Each window can have a separate timer operating at the same time. Timers continue to run even if windows are in the background or hidden. If you’re using dialog windows and timers, see About window styles.

...my interpretation of what happens in this situation is that the card window inherits (a copy of) the OnTimer script, which proceeds to run on the IDLE card window, while the parent is in a non idle state due to the card window.

The bit missing from feature help notes for FM16 (but has been documented elsewhere) is that the window must be idle for the OnTimer script to run, so I'd guess that FileMaker doesn't consider a parent window idle where child/card windows are concerned. Therefore the original OnTimer script stays suspended until the child window is closed.

I tested by adding a 10 second delay to the timer along with a custom dialogue stating the layout name. The result was that the card window took 10 seconds to throw the dialogue. When I closed the card window the parent dialogue was instant, indicating it had been counting down but couldn't fire the script while the card window was open.