el h / SimpleGUI

Fork of SimpleGUI by Duncan McIntyre

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ContainerWidget.h Source File

ContainerWidget.h

00001 #ifndef SIMPLEGUI_CONTAINER_WIDGET_H
00002 #define SIMPLEGUI_CONTAINER_WIDGET_H
00003 
00004 #include "Widget.h"
00005 #include "Window.h"
00006 
00007 /**
00008 * Simple container hold widgets side-by-side and draws a border
00009 * It will expand as needed to hold the widgets
00010 **/
00011 class ContainerWidget : public Window
00012 {
00013 
00014 public:
00015 
00016     enum Layout { VERTICAL_LEFT, VERTICAL_RIGHT, VERTICAL_CENTER, HORIZONTAL, FIXED };
00017 
00018     ContainerWidget(GraphicsContext *context);
00019     
00020     /**
00021     * Overrides
00022     **/
00023     virtual void setSize(int width, int height);
00024     virtual void attach(Widget *child);
00025 
00026     void setLayout(Layout l);
00027     
00028 protected:
00029 
00030     int _minWidth, _minHeight;
00031     Layout _layout;
00032     
00033     /**
00034     * Override
00035     **/
00036     virtual void _adjust();
00037 
00038 };
00039 
00040 #endif