Tells the Ribbon control where to size and position a child control on the form.

Syntax

Send_Message(Ctrl, "OLE.LayoutChildControl", Handle, Rectangle)

Parameters

PropertyDescription
HandleThe window handle of the OI form to embed.
RectangleThe size and position information

Remarks

This method is recommended for OI 9 only. OI 10 users can ignore this method. See below.

The LayoutChildControl method tells the Ribbon control to override the sizing and positioning of the given child control on the OI form. In OI 9, the presentation server will attempt to auto size your controls based on several assumptions. Since the Ribbon control often overrides things like the sizes of border and caption areas, you might end up with your controls slightly off. In order to achieve pixel perfect positioning, you should call this method for each child control on your form. To do so, pass the HANDLE property of your control to the Handle parameter. Then set the positioning logic using the Rectangle parameter, which has the following structure:

PosNameDescription
<1>
LeftThe location of the left side of the control relative to the left of the form. If negative, this will be relative to the right side of the form.
<2>
TopThe location of the top side of the control relative to the bottom of the ribbon bar. If negative, this will be relative to the bottom of the form.
<3>
RightThe location of the right side of the control relative to the left of the form. If negative, this will be relative to the right side of the form.
<4>
BottomThe location of the bottom side of the control relative to the bottom of the ribbon bar. If negative, this will be relative to the bottom of the form.

Notice that you can set any of these values to negative to make them "stick" to the right or bottom of the form. If, for example, you set the Right side to "-0", then you are saying you want the right side of the control to be 0 pixels away from the right side of the form. Note also that coordinate (0, 0) starts at the pixel to the far left just below the bottom of the ribbon.

As noted above, you do not have to use this method in OI 10. OI 10 places all child controls on a single panel called the ClientFrame, thus the SRP Ribbon Control simply resizes that panel to make room for the ribbon bar and all the controls neatly resize accordingly. Since OI 9 has no such panel, and since OI 9 controls are extremely sensitive about not being moved off their parent form, this method was provided.

Example

// Set the desired position of the status bar during CREATE event. It should take care of itself after that
StatusSize = Get_Property(@Window:".OLE_FRAME_STATUS", "ORIG_SIZE")
Left       = "0"            ; // Anchor left to client left
Top        = -StatusSize<4> ; // Use control's original height to determine anchor from bottom
Right      = "-0"           ; // Anchor right zero pixels from client right
Bottom     = "-0"           ; // Anchor bottom zero pixels from client bottom
Handle     = Get_Property(@Window:".OLE_FRAME_STATUS", "HANDLE")
Send_Message(@Window:".OLE_RIBBON", "OLE.LayoutChildControl", Handle, Left:@FM:Top:@FM:Right:@FM:Bottom)

// Adjust the MDI client, taking the status bar into account
Left   = "0"                ; // Anchor left to client left
Top    = "0"                ; // Anchor top to pixel just beneath the ribbon bar
Right  = "-0"               ; // Negative Zero means Zero pixels from the right
Bottom = -StatusSize<4>     ; // Anchor bottom to be just above the status bar
Handle = Get_Property(@Window:".MDICLIENT", "HANDLE")
Send_Message(@Window:".OLE_RIBBON", "OLE.LayoutChildControl", Handle, Left:@FM:Top:@FM:Right:@FM:Bottom)
  • No labels