16 YGWidget (YWidget *ywidget, YWidget *yparent,
17 GType type,
const char *property_name, ...);
19 YGWidget (YWidget *ywidget, YWidget *yparent,
20 GtkWidget *gtkwidget,
const char *property_name, ...);
25 static YGWidget *
get (YWidget *y_widget);
27 virtual inline GtkWidget *getWidget() {
return m_widget; }
28 GtkWidget *getLayout() {
return m_adj_size; }
29 virtual GtkWidget *getContainer() {
return m_widget; }
32 virtual bool doSetKeyboardFocus();
33 virtual void doSetEnabled (
bool enabled);
34 virtual void doSetUseBoldFont (
bool useBold);
35 virtual void doAddChild (YWidget *child, GtkWidget *container);
36 virtual void doRemoveChild (YWidget *child, GtkWidget *container);
39 virtual int doPreferredSize (YUIDimension dimension);
40 virtual void doSetSize (
int width,
int height);
43 const char *getWidgetName()
const {
return m_ywidget->widgetClass(); }
44 virtual std::string getDebugLabel()
const
45 {
if (m_ywidget->hasChildren())
return std::string();
return m_ywidget->debugLabel(); }
48 void setBorder (
unsigned int border);
49 virtual unsigned int getMinSize (YUIDimension dim) {
return 0; }
54 { DELAY_EVENT = 2, IGNORE_NOTIFY_EVENT = 4, IF_NOT_PENDING_EVENT = 8 };
55 void emitEvent (YEvent::EventReason reason, EventFlags flags = (EventFlags) 0);
59 void connect (gpointer
object,
const char *name,
60 GCallback callback, gpointer data,
bool after =
true);
62 void unblockSignals();
67 void construct (YWidget *ywidget, YWidget *yparent,
68 GtkWidget *gtkwidget,
const char *property_name, va_list args);
72 GtkWidget *m_widget, *m_adj_size;
79 { m_widget->blockSignals(); }
81 { m_widget->unblockSignals(); }
91 #define YGWIDGET_IMPL_COMMON(ParentClass) \
92 virtual bool setKeyboardFocus() { \
93 return doSetKeyboardFocus(); } \
94 virtual void setEnabled (bool enabled) { \
95 ParentClass::setEnabled (enabled); \
96 doSetEnabled (enabled); \
98 virtual int preferredWidth() { return doPreferredSize (YD_HORIZ); } \
99 virtual int preferredHeight() { return doPreferredSize (YD_VERT); } \
100 virtual void setSize (int width, int height) { doSetSize (width, height); }
102 #define YGWIDGET_IMPL_USE_BOLD(ParentClass) \
103 virtual void setUseBoldFont (bool useBold) { \
104 ParentClass::setUseBoldFont (useBold); \
105 doSetUseBoldFont (useBold); \
108 #define YGWIDGET_IMPL_CONTAINER(ParentClass) \
109 YGWIDGET_IMPL_COMMON (ParentClass) \
110 virtual void addChild (YWidget *ychild) { \
111 ParentClass::addChild (ychild); \
112 doAddChild (ychild, getContainer()); \
114 virtual void removeChild (YWidget *ychild) { \
115 ParentClass::removeChild (ychild); \
116 doRemoveChild (ychild, getContainer()); \
126 const std::string &label_text, YUIDimension label_ori,
127 GType type,
const char *property_name, ...);
129 const std::string &label_text, YUIDimension label_ori,
130 GtkWidget *gtkwidget,
const char *property_name, ...);
133 virtual inline GtkWidget* getWidget() {
return m_field; }
135 void setLabelVisible (
bool show);
136 void setBuddy (GtkWidget *widget);
137 virtual void doSetLabel (
const std::string &label);
139 YUIDimension orientation() {
return m_orientation; }
140 GtkWidget *getLabelWidget() {
return m_label; }
143 GtkWidget *m_label, *m_field;
144 YUIDimension m_orientation;
147 #define YGLABEL_WIDGET_IMPL(ParentClass) \
148 YGWIDGET_IMPL_COMMON (ParentClass) \
149 virtual void setLabel (const std::string &label) { \
150 ParentClass::setLabel (label); \
151 doSetLabel (label); \
159 GType type,
const char *property_name, ...);
162 const std::string &label_text, YUIDimension label_ori,
163 GType type,
const char *property_name, ...);
166 virtual inline GtkWidget *getWidget() {
return m_widget; }
169 void setPolicy (GtkPolicyType hpolicy, GtkPolicyType vpolicy);
172 void construct(GType type,
const char *property_name, va_list args);