The Auto Sizer is a program built into WinX which automatically updates the size and position of your controls when the window is resized. To use the Auto Sizer, you have to register your controls with it. You can re-register the controls if you need to change their size or position. If you want to manage the size and position of the controls yourself, use the controlSizer callback. This will disable the Auto Sizer.
The Auto Sizer places your controls into ordered lists called series. A series can be displayed horizontally or vertically. As well as controls, you can also put another series inside a series. This allows much more flexible control sizing. The diagram above diagram shows how it all works. It depicts a vertical series. The controls are placed one after the other, starting at the top. Optional spacing has been inserted between the controls. The last two controls are in a horizontal series that has been embedded within the main vertical series. When the vertical series is resized, the horizontal series is resized as if it were another control. The horizontal series responds by resizing it's controls. You can continue embedding series in this fashion untill you run out of memory.
To register a control with the Auto Sizer, use the WinXAutoSizer_SetSimpleInfo function. This function takes 5 parameters. The handle to the control to register (or the series to embed), the id of the series to add the control to (more about getting this in a moment), the amount of space to place between this and the next control, the size of the control and finnaly a set of flags which define how the other parameters are interpretted.
Each window comes with a single vertical series called the main series. You can get the id of the main series by calling WinXAutoSizer_GetMainSeries. You can create a new series with the WinXNewAutoSizerSeries function. If you are embedding a series in another Auto Sizer series you must include the $$SIZER_SERIES flag in the flags parameter. Other than that, the embedding of another series is no different to embedding a control.
space is the amount of space between this control and the previous control. For the first control, it will be the space from the top (or left) of the series. There are two possible ways of specifiying this parameter. You can give the absolute number of pixels, as long as it is greater than 1. You can also specify a proportion of the height (or width) of the entire series. To do this, use a value <= 1. For example, to make the space 25% of the height (or width) of the series, the value to use would be 0.25.
The size parameter specifies the amount of space that the control itself takes up in the series. For a vertical series, this is the height of the control. For a horixontal series it is the width. The control doesn't actually have to use up all this space, this is just how much space is reserved for the control. Like the space parameter, it can be specified as an absolute number of pixels or a proportion of the entire series. If you include the $$SIZER_SIZERELREST flag in the flags parameter, the size paremter has a different meaning. If it is <=1, it is the proportion of the remaining space in the series. If it is >1 then it is the number of remaining pixels not to use, i.e., the size reserved for the control will be the remaining space - the size parameter.
WinXAutoSizer_SetSimpleInfo
WinXAutoSizer_SetInfo
WinXNewAutoSizerSeries
WinXAutoSizer_GetMainSeries