![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, group - I've got a question about identifying whether a window is visible or hidden. On a Mac using FM 11 Advanced, I have a database that opens three windows offscreen at startup and names them "Customers," "Vendors" and "Prospects." Two of the windows get hidden and the third – whichever the user designates as his default table – is brought onscreen as the active window. The status area is locked down and standard operations are done through custom menus, scripting and a button bar, allowing full developer control of window behavior. I want users to be able to click tabs at the top of the screen to navigate to the other windows. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
So I think the only answer that gets me there is how to determine the visibility of open windows, which seems like something you ought to be able to do with a function like Get(WindowVisible) combined with a design function like WindowNames. Except that Get(WindowVisible) only identifies the status of the current window (not all windows), and WindowNames only identifies which windows are open (although it does list them in their current stacking order, with visible windows first, minimized windows next, and hidden windows last -- getting us so close to what we need, it's almost perverse that FM doesn't go the final mile). Any other ideas? I feel like I'm overlooking something simple, because it's obviously info that FM has at its disposal, since the WindowNames function relies on it. But I can't quite see how to crack it open. Thanks again. Best, -J. |
#5
| |||
| |||
|
|
Hi, David - [snip] So I think the only answer that gets me there is how to determine the visibility of open windows, which seems like something you ought to be able to do with a function like Get(WindowVisible) combined with a design function like WindowNames. Except that Get(WindowVisible) only identifies the status of the current window (not all windows), and WindowNames only identifies which windows are open (although it does list them in their current stacking order, with visible windows first, minimized windows next, and hidden windows last -- getting us so close to what we need, it's almost perverse that FM doesn't go the final mile). |
#6
| |||
| |||
|
|
With regard to Select Window and Adjust Window: these are all useful for manipulating windows, but they won't tell me whether a window is visible or hidden before FM acts on a window -- and in this design, the window's visibility status determines how it should be handled. Basically I want to achieve three things: I want to keep different found sets in separate windows; I want to give the user the ability to look at those datasets simultaneously; and I want to hide extra windows if the user only wants to look at one of them. In order to do all three of these seamlessly, the database needs to make a decision about what to do when a user clicks on a tab, and that decision changes based on whether a user is looking at multiple windows or only one. |
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Hi, David - Thanks for spending time on this. You're right that the visibility status of a window doesn't matter -- except when it does. Unfortunately, explaining it in writing is a little cumbersome, so I apologize in advance for that. Here's the setup: Three windows named Customers, Vendors and Prospects. A simple click on one of the tabs hides the current window and makes the destination window visible in the same location and with the same dimensions as the current window. For example, say I'm in Customers; if I click the Vendors tab, FM will show the Vendors window using the location and dimensions of Customers, then hide Customers. This scenario might be called "single-window emulation." The visibility status of any given window doesn't matter; the script works by using the current window's name and the destination window's name. The important thing to note in this process is that, in order to emulate a single-window, the destination window has to be set to the same location and dimensions as the current window. If it didn't do that, windows would become visible wherever they were last located, which would be pretty strange behavior from a user perspective. Second scenario: A shift-click on one of the tabs indicates that the user wants to see the destination table in a different window. "Different" means different from the user's perspective, since in actuality the tables are always being displayed in a different window. So we might say that shift-clicking means "let me see two windows simultaneously" (or three, or six, or however many tables the user wants to open at the same time). So when the user shift-clicks a tab, FM makes the destination window visible, but this time offsets it by, say, 25 pixels, and instead of hiding the current window, leaves it visible. For example, I'm in Customers; I shift-click the Vendors tab. The script will display the Vendors window next to the Customers window -- that is, make it visible in a location offset from Customers. So far so good; the visibility status of any given window still doesn't matter. But then, in order to go back to Customers, the user reflexively clicks the Customers tab in the Vendors window, even though he could just click the Customers window with his mouse or hit Command-tilde or whatever. There are multiple ways to get back to the Customers window, and the one he chooses is to click the Customers tab. If the database knew that the Customers window was visible, it would just select Customers. But since it doesn't know that, it does what it always does when you click a tab, which is to make the destination window visible in the same location as the current window. In other words, instead of just selecting the Customers window, it yanks it out of its place and puts it where the Vendors window was located, then hides Vendors. From a user's perspective, this is pretty disconcerting. The database should've known that he was looking at two windows (that is, that he had two windows visible) and adjusted its behavior by simply selecting the Customers window instead of moving it. This problem is similar if he's looking at two tables -- Vendors in the foreground and Customers in the background -- and shift-clicks the Customers tab. Now instead of just selecting the Customers window, it yanks it out of place and offsets it from the Vendors window. Again, from a user's perspective disconcerting. And all of these issues apply not just to when users click the main navigation tabs at the top of the screen, but also GTRR buttons throughout the layout. So if the database is going to emulate a single-window system as well as give users the ability to see windows side by side, it needs to know the visibility status of other windows. That's because it should behave differently if the user can see a window in the background vs. if he can't. If he can, leave it where it is and just select it. If he can't, make it visible either in the location of the current window (simple click) or offset from the location of the current window (shift-click). But Ursus' solution does the trick by storing the state of the windows in variables. Does that make sense? It's not exactly an easy issue to describe on paper and I appreciate your suggestions. Best, -J. |
#10
| |||
| |||
|
|
Hi, David - Thanks for spending time on this. You're right that the visibility status of a window doesn't matter -- except when it does. Unfortunately, explaining it in writing is a little cumbersome, so I apologize in advance for that. Here's the setup: Three windows named Customers, Vendors and Prospects. A simple click on one of the tabs hides the current window and makes the destination window visible in the same location and with the same dimensions as the current window. For example, say I'm in Customers; if I click the Vendors tab, FM will show the Vendors window using the location and dimensions of Customers, then hide Customers. This scenario might be called "single-window emulation." The visibility status of any given window doesn't matter; the script works by using the current window's name and the destination window's name. The important thing to note in this process is that, in order to emulate a single-window, the destination window has to be set to the same location and dimensions as the current window. If it didn't do that, windows would become visible wherever they were last located, which would be pretty strange behavior from a user perspective. Second scenario: A shift-click on one of the tabs indicates that the user wants to see the destination table in a different window. "Different" means different from the user's perspective, since in actuality the tables are always being displayed in a different window. So we might say that shift-clicking means "let me see two windows simultaneously" (or three, or six, or however many tables the user wants to open at the same time). So when the user shift-clicks a tab, FM makes the destination window visible, but this time offsets it by, say, 25 pixels, and instead of hiding the current window, leaves it visible. For example, I'm in Customers; I shift-click the Vendors tab. The script will display the Vendors window next to the Customers window -- that is, make it visible in a location offset from Customers. So far so good; the visibility status of any given window still doesn't matter. But then, in order to go back to Customers, the user reflexively clicks the Customers tab in the Vendors window, even though he could just click the Customers window with his mouse or hit Command-tilde or whatever. There are multiple ways to get back to the Customers window, and the one he chooses is to click the Customers tab. If the database knew that the Customers window was visible, it would just select Customers. But since it doesn't know that, it does what it always does when you click a tab, which is to make the destination window visible in the same location as the current window. In other words, instead of just selecting the Customers window, it yanks it out of its place and puts it where the Vendors window was located, then hides Vendors. From a user's perspective, this is pretty disconcerting. The database should've known that he was looking at two windows (that is, that he had two windows visible) and adjusted its behavior by simply selecting the Customers window instead of moving it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |