SECControlBar::CalcDynamicLayout
CSizeSECControlBar::CalcDynamicLayout(intnLength, intnLength)
Returns the control bar size, in pixels, in a CSize object.
Defined in: sbarcore.cpp
Return Value
CSize
Parameters
nLength
The requested dimension of the control bar, either horizontally or vertically, depending on dwMode.
nLength
DWORD dwMode The following predefined flags are used to determine the height and width of the dynamic control bar. Use the bitwise-OR operator to combine the flags.
LM_STRETCHIndicates whether the control bar should be stretched. Unlike CControlBar::CalcDynamicSize, LM_STRETCH does not cause the control bar to be stretched to the size of the frame. Instead, the control bar is stretched to a percentage of the nLength parameter (where the percentage is CControlBar->m_fPctWidth). Notice the LM_STRETCH and the control bar style CBRS_EX_STRETCH_ON_SIZE have nothing to do with one another. LM_STRETCH guarantees the control bar width will be a percentage of nLength whereas CBRS_EX_STRETCH_ON_SIZE actually repositions and resizes the children of a control bar to exactly fit the size of their parent. LM_STRETCH can be used with or without CBRS_EX_STRETCH_ON_SIZE and vice versa.
LM_HORZIndicates that the bar is horizontally or vertically oriented. Set if the bar is horizontally oriented, and if it is vertically oriented, it is not set. LM_HORZ works similarly to the the bHorz parameter used in CalcFixedLayout; see that member function for more information about the relationship between stretching and orientation.
LM_MRUWIDTHMost Recently Used Dynamic dimension. The dimension is width when LM_HORZ is set and height when it is not. If LM_COMMIT is set, the nLength parameter is stored as the control bar dimension when floating and the new dimensions are returned. If LM_COMMIT is not set, the previously stored control bar dimensions are returned.
LM_HORZDOCKHorizontal Docked Dimensions. The dimension is width when LM_HORZ is set and height when it is not. If LM_COMMIT is set, the nLength parameter is stored as the control bar dimensions when horizontally docked and the new dimensions are returned. If LM_COMMIT is not set, the previously stored control bar dimensions are returned.
LM_VERTDOCKVertical Docked Dimensions. The dimension is width when LM_HORZ is set and height when it is not. If LM_COMMIT is set, the nLength parameter is stored as the control bar dimensions when vertically docked and the new dimensions are returned. If LM_COMMIT is not set, the previously stored control bar dimensions are returned.
LM_LENGTHYSet if nLength indicates height (Y-direction) instead of width.
LM_COMMITSetting this flag constitutes a write, unsetting it constitutes a read. When the flag is set, the value of the nLength parameter is stored. When it is unset, the size from the previous call in which LM_COMMIT was set is returned. In the CControlBar definition of CalcDynamicLayout, LM_COMMIT is only used when LM_MRUWIDTH is set. In the SECControlBar definition, it is used for all control bar docking states (i.e., LM_MRUWIDTH, LM_HORZDOCK, and LM_VERTDOCK).