00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OMGUI_TABLELAYOUT_H
00024 #define OMGUI_TABLELAYOUT_H
00025
00026 #include <omgui/initializer/tablelayout.h>
00027 #include <omgui/panel.h>
00028 #include <memory>
00029
00030 namespace omgui {
00031 namespace common {
00032 namespace tablelayoutdetails { class LayoutData; }
00033 }
00034
00035
00044 class OMGUI_API TableLayoutInfo
00045 {
00046 public:
00047 TableLayoutInfo();
00048 ~TableLayoutInfo();
00049 TableLayoutInfo(const TableLayoutInfo &other);
00050 TableLayoutInfo &operator = (const TableLayoutInfo &other);
00051
00057 TableLayoutInfo &flags(int flags);
00058
00062 int get_flags() const;
00063
00067 TableLayoutInfo &add_flags(int flags);
00068
00072 TableLayoutInfo &remove_flags(int flags);
00073
00095 TableLayoutInfo &anchor(int left, int top, int right, int bottom);
00096
00100 TableLayoutInfo &anchor(int column, int row);
00101
00105 TableLayoutInfo &left_anchor(int column);
00106
00110 TableLayoutInfo &top_anchor(int row);
00111
00115 TableLayoutInfo &right_anchor(int column);
00116
00120 TableLayoutInfo &bottom_anchor(int row);
00121
00122 TableLayoutInfo &padding(int pad);
00123 TableLayoutInfo &padding(int left, int top, int right, int bottom);
00124 TableLayoutInfo &padding_left(int pad);
00125 TableLayoutInfo &padding_right(int pad);
00126 TableLayoutInfo &padding_top(int pad);
00127 TableLayoutInfo &padding_bottom(int pad);
00128
00129 const omgui::common::tablelayoutdetails::LayoutData &get_data() const;
00130
00131 private:
00132 omgui::common::tablelayoutdetails::LayoutData *m_data;
00133 };
00134
00150 class OMGUI_API TableLayout : public Panel
00151 {
00152 public:
00153 typedef omgui::api::TableLayout api_type;
00154 typedef TableLayoutInitializer Initializer;
00155
00161 static Pointer<TableLayout> create(const Initializer &initializer, object_id id = OBJECT_ID_ANY);
00162
00168 void set_widget_layout_info(Pointer<Widget> widget, const TableLayoutInfo &info);
00169
00175
00176
00180 TableLayout &set_column_weight(int column, float weight);
00181
00185 TableLayout &set_row_weight(int row, float weight);
00186
00190 TableLayout &set_column_gap(int gap);
00191
00195 TableLayout &set_row_gap(int gap);
00196
00200 TableLayout &set_gap(int gap);
00201
00205 TableLayout &set_margins(int margin);
00206
00210 TableLayout &set_margins(int left, int top, int right, int bottom);
00211
00215 TableLayout &set_left_margin(int margin);
00216
00220 TableLayout &set_top_margin(int margin);
00221
00225 TableLayout &set_right_margin(int margin);
00226
00230 TableLayout &set_bottom_margin(int margin);
00231
00232 private:
00233 api_type *m_impl;
00234
00235 protected:
00236 TableLayout(object_id id);
00237 TableLayout(object_id id, api_type *impl);
00238
00242 void initialize(const Initializer &initializer);
00243
00244 public:
00245 api_type *get_impl() const;
00246 };
00247
00248 }
00249
00250 #endif // OMGUI_TABLELAYOUT_H