You can force a minimum size in your code by watching EVENT_PANEL_SIZE. This way, if the user tries to resize to a smaller size than you want, your code will resize the panel to your specified minimums as soon as the user lets go of the mouse button.
1. In the UI editor, double click on a blank spot on your panel to edit the panel.
2. Enter a function name (e.g. PanelCallback) in the box labeled Callback Function, and click OK.
3. In the UI editor, click on Code >> Generate >> Panel Callback.
4. In the UI editor, click on Code >> View >> Panel Callback.
5. At the top of your PanelCallback function, add variable declarations:
int panelWidth, panelHeight;
int resize = 0;
6. Under switch(event), add a new case:
case EVENT_PANEL_SIZE:
GetPanelAttribute (panelHandle
, ATTR_HEIGHT, &panelHeight);
GetPanelAttribute (panelHandle, ATTR_WIDTH, &panelWidth);
if (panelHeight < MINPANELHEIGHT)
{
panelHeight = MINPANELHEIGHT;
resize = 1;
}
if (panelWidth < MINPANELWIDTH)
{
panelWidth = MINPANELWIDTH;
resize = 1;
}
if (resize)
SetPanelSize (panelHandle, panelHeight, panelWidth);
break;
6. At the top of your .c file, or in your .h file, add the definitions:
#define MINPANELWIDTH 300 //or whatever
#define MINPANELHEIGHT 200 //or whatever