oi10:presentation_server:center_method_window

CENTER Method (Window)

Centers a window on the desktop or its parent.

NewSize = Exec_Method( WindowID,     

                          "CENTER",     

                          CenterParent, 

                          WindowSize,   

                          CalcOnly,     

                          ParentSize,   

                          Options )
NameRequiredDescription
CenterParentNoIf TRUE$ then the window is centered on its parent, otherwise it is centered on the desktop. Defaults to FALSE$.
WindowSizeNoThis is an @fm-delimited array specifying the desired coordinates and size to move the window to:



<1> Left-position (if -1 then the window is centered on the X-axis)

<2> Top-position (if -1 then the window is centered on the Y-axis)

<3> Width (-1 means do not adjust the window width)

<4> Height (-1 means do not adjust the window height)



All of these values default to -1.

They must be in the same scale units as the window being centered.
CalcOnlyNoIf TRUE$ then the window is not moved or resized, but the resulting coordinates are returned instead. Defaults to FALSE$.
ParentSizeNoThis is an @fm-delimited array that can be used to override the size of the parent (if CenterParent is TRUE$), or the Desktop (if CenterParent is FALSE$).



<1> Left-position

<2> Top-position

<3> Width

<4> Height



They must be in the same scale units as the window begin centered.
OptionsNoThis is an @fm-delimited array of options structured like so:



<1> Force boundary check. If this is TRUE$ then the window is kept within the boundary of the desktop even if the WindowSize Top and Left positions have been explicitly specified.

<2> Desktop "anchor" window. Contains the name of a window to

use when deciding which monitor to center the window on. The

window is centered on the same desktop as the anchor window.

The new size of the window in the same format as the standard SIZE property.

N/A

 
// Center a window on the desktop

   Call Exec_Method( @Window. "CENTER" )

   

   // Center a window on its parent window

   Call Exec_Method( @Window. "CENTER", TRUE$ )

   

   // Center a window on the desktop with a specific size of 800x600

   WinSize = -1 : @Fm : -1 : @Fm : 800 : @Fm : 600

   Call Exec_Method( @Window. "CENTER", FALSE$, WinSize )

   

   // Center a window on the desktop with a specific size of 800x600

   // but only return the coordinates - do not update the window.

   WinSize = -1 : @Fm : -1 : @Fm : 800 : @Fm : 600

   NewSize = Exec_Method( @Window. "CENTER", FALSE$, WinSize, TRUE$ )

   

   // Center a window on the same desktop as the RTI_IDE window and

   // ensure it stays within the desktop boundary.

   WinSize    = -20 : @Fm : 10 : @Fm : 800 : @Fm : 600

   Options    = TRUE$

   Options<2> = "RTI_IDE"

   Call Exec_Method( @Window. "CENTER", FALSE$, WinSize, FALSE$, "", Options )
 
 
 

SIZE common property, SYSTEM MONITORLIST property.

  • oi10/presentation_server/center_method_window.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1