March 7, 201510 yr Does anyone have a script for resizing a window so it (fills any size display) on Windows 7 and 8? I am aware of the maximize script option but I am trying to avoid using it so I can open multiple windows without them getting all messed up.
March 8, 201510 yr if i remember correctly resize to Get ( WindowContentHeight ) - 1 and Get ( WindowContentWidth ) - 1 if you make this part of the on last window close script when the file is open locally it will be "sticky" and the new settings will become the default.
March 8, 201510 yr Hey Kris, I'm wondering if you meant Get ( ScreenHeight ) and Get ( ScreenWidth ), in order for Halburn to maximize his window without "maximizing" it? Mark
March 8, 201510 yr I'm voting for get( WindowDesktopWidth ) and get( WindowDesktopHeight ) https://fmhelp.filemaker.com/fmphelp_13/en/html/func_ref2.32.102.html#1031984
March 8, 201510 yr Author So it seems like I need to grab the WindowDesktop dimensions and then figure out the dimensions of the other Windows interface elements (scroll bars, dock, etc.). Then subtract these from the Desktop dimensions to determine the exact Window size? And then do this for all of the necessary versions of Windows. My goodness!!! I am not too familiar with the Windows OS but can't the user change the dimensions of the interface elements by changing the theme of the Windows OS?
March 9, 201510 yr I'm voting for get( WindowDesktopWidth ) and get( WindowDesktopHeight ) https://fmhelp.filemaker.com/fmphelp_13/en/html/func_ref2.32.102.html#1031984 Thanks, Bruce! My solution would have failed to take menu bars into account. Mark
March 9, 201510 yr I use this script to open layouts in windows (called OpenLayout): Set Variable [ $Parameter; Value:Get ( ScriptParameter ) ] Set Variable [ $LayoutName ; Value:If ( PatternCount ( $Parameter; ";" ) ; Left ( $Parameter; Position ( $Parameter; ";"; 1; 1 ) -1 ); $Parameter ) ] If [ IsEmpty ( $LayoutName ) ] Show Custom Dialog [ Title: "No Layout Name Specified"; Message: "Calling Script Error: no layout name specified."; Default Button: “OK”, Commit: “Yes” ] Exit Script [ ] End If If [ WindowExists ( $LayoutName ) ] Select Window [ Name: $LayoutName; Current file ] Exit Script [ ] End If Set Variable [ $Dialog; Value:If ( PatternCount ( $Parameter; ";Dialog" ); 1; 0 ) ] Set Variable [ $DocWindow; Value:If ( PatternCount ( $Parameter; ";DocWindow" ); 1; 0 ) ] If [ $Dialog or $DocWindow ] Set Variable [ $WindowHeight; Value:Let ( [ PosH = Position ( $Parameter; ";h="; 1; 1 ) + 3; PosHEnd = Position ( $Parameter; ";"; PosH; 1 ); Chars = If ( PosHEnd = 0; Length ( $Parameter ) + 1; PosHEnd ) - PosH ] ; Middle ( $Parameter; PosH; Chars ) ) ] Set Variable [ $WindowWidth; Value:Let ( [ PosH = Position ( $Parameter; ";w="; 1; 1 ) + 3; PosHEnd = Position ( $Parameter; ";"; PosH; 1 ); Chars = If ( PosHEnd = 0; Length ( $Parameter ) + 1; PosHEnd ) - PosH ] ; Middle ( $Parameter; PosH; Chars ) ) ] Set Variable [ $WindowTop; Value:( Get ( WindowDesktopHeight )-$WindowHeight - 8 )/2 ] Set Variable [ $WindowLeft ; Value:( Get ( WindowDesktopWidth )-10-$WindowWidth )/2 ] If [ $Dialog ] New Window [ Name: $LayoutName; Height: $WindowHeight; Width: $WindowWidth; Top: $WindowTop; Left: $WindowLeft; Style: Dialog ; Close: “No”; Minimize: “No”; Maximize: “No”; Zoom Control Area: “No”; Resize: “No” ] End If If [ $DocWindow ] New Window [ Name: $LayoutName; Height: $WindowHeight; Width: $WindowWidth; Top: $WindowTop; Left: $WindowLeft; Style: Floating Document ; Close: “Yes” ; Minimize: “No”; Maximize: “No”; Zoom Control Area: “No”; Resize: “No” ] End If Else Set Variable [ $WindowWidth; Value:Get (WindowDesktopWidth)-10 ] Set Variable [ $WindowHeight; Value:Get(WindowDesktopHeight)-8 ] New Window [ Name: $LayoutName; Height: $WindowHeight; Width: $WindowWidth; Top: 1; Left: 5; Style: Document ; Close: “Yes” ; Minimize: “Yes” ; Maximize: “Yes” ; Zoom Control Area: “Yes” ; Resize: “Yes” ] End If Go to Layout [ $LayoutName ] Show/Hide Toolbars [ Lock; Hide ] Show/Hide Text Ruler [ Hide ] If [ Get ( LayoutName ) ≠ $LayoutName ] Close Window [ Current Window ] End If I invoke the script with at least the name of the layout I want to open, and optionally specify "DocWindow", or "Dialog". I can also specify the height and width if I want "h=500;w=1000". If I specify every option the syntax looks as follows: "LayoutName;Dialog;h=500;w=1000". I could have used a List () instead to specify the various parameters.
Create an account or sign in to comment