cwidget 0.5.16
|
00001 // center.h -*-c++-*- 00002 // 00003 // A simple container/layout widget which centers its child in itself. 00004 00005 #ifndef CENTER_H 00006 #define CENTER_H 00007 00008 #include "bin.h" 00009 00010 namespace cwidget 00011 { 00012 namespace widgets 00013 { 00014 class center:public bin 00015 { 00016 void layout_me(); 00017 00018 protected: 00019 center(const widget_ref &w = NULL); 00020 00021 public: 00022 static util::ref_ptr<center> create(const widget_ref &w = NULL) 00023 { 00024 util::ref_ptr<center> rval(new center(w)); 00025 rval->decref(); 00026 return rval; 00027 } 00028 00029 int width_request(); 00030 int height_request(int width); 00031 }; 00032 00033 typedef util::ref_ptr<center> center_ref; 00034 } 00035 } 00036 00037 #endif