16 YGWidget (YWidget *ywidget, YWidget *yparent,
17 GType type,
const char *property_name, ...);
21 static YGWidget *
get (YWidget *y_widget);
23 virtual inline GtkWidget *getWidget() {
return m_widget; }
24 GtkWidget *getLayout() {
return m_adj_size; }
25 virtual GtkWidget *getContainer() {
return m_widget; }
28 virtual bool doSetKeyboardFocus();
29 virtual void doSetEnabled (
bool enabled);
30 virtual void doSetUseBoldFont (
bool useBold);
31 virtual void doAddChild (YWidget *child, GtkWidget *container);
32 virtual void doRemoveChild (YWidget *child, GtkWidget *container);
35 virtual int doPreferredSize (YUIDimension dimension);
36 virtual void doSetSize (
int width,
int height);
39 const char *getWidgetName()
const {
return m_ywidget->widgetClass(); }
40 virtual std::string getDebugLabel()
const
41 {
if (m_ywidget->hasChildren())
return std::string();
return m_ywidget->debugLabel(); }
44 void setBorder (
unsigned int border);
45 virtual unsigned int getMinSize (YUIDimension dim) {
return 0; }
50 { DELAY_EVENT = 2, IGNORE_NOTIFY_EVENT = 4, IF_NOT_PENDING_EVENT = 8 };
51 void emitEvent (YEvent::EventReason reason, EventFlags flags = (EventFlags) 0);
55 void connect (gpointer
object,
const char *name,
56 GCallback callback, gpointer data,
bool after =
true);
58 void unblockSignals();
63 void construct (YWidget *ywidget, YWidget *yparent,
64 GType type,
const char *property_name, va_list args);
67 GtkWidget *m_widget, *m_adj_size;
74 { m_widget->blockSignals(); }
76 { m_widget->unblockSignals(); }
86 #define YGWIDGET_IMPL_COMMON(ParentClass) \
87 virtual bool setKeyboardFocus() { \
88 return doSetKeyboardFocus(); } \
89 virtual void setEnabled (bool enabled) { \
90 ParentClass::setEnabled (enabled); \
91 doSetEnabled (enabled); \
93 virtual int preferredWidth() { return doPreferredSize (YD_HORIZ); } \
94 virtual int preferredHeight() { return doPreferredSize (YD_VERT); } \
95 virtual void setSize (int width, int height) { doSetSize (width, height); }
97 #define YGWIDGET_IMPL_USE_BOLD(ParentClass) \
98 virtual void setUseBoldFont (bool useBold) { \
99 ParentClass::setUseBoldFont (useBold); \
100 doSetUseBoldFont (useBold); \
103 #define YGWIDGET_IMPL_CONTAINER(ParentClass) \
104 YGWIDGET_IMPL_COMMON (ParentClass) \
105 virtual void addChild (YWidget *ychild) { \
106 ParentClass::addChild (ychild); \
107 doAddChild (ychild, getContainer()); \
109 virtual void removeChild (YWidget *ychild) { \
110 ParentClass::removeChild (ychild); \
111 doRemoveChild (ychild, getContainer()); \
121 const std::string &label_text, YUIDimension label_ori,
122 GType type,
const char *property_name, ...);
125 virtual inline GtkWidget* getWidget() {
return m_field; }
127 void setLabelVisible (
bool show);
128 void setBuddy (GtkWidget *widget);
129 virtual void doSetLabel (
const std::string &label);
131 YUIDimension orientation() {
return m_orientation; }
132 GtkWidget *getLabelWidget() {
return m_label; }
135 GtkWidget *m_label, *m_field;
136 YUIDimension m_orientation;
139 #define YGLABEL_WIDGET_IMPL(ParentClass) \
140 YGWIDGET_IMPL_COMMON (ParentClass) \
141 virtual void setLabel (const std::string &label) { \
142 ParentClass::setLabel (label); \
143 doSetLabel (label); \
151 GType type,
const char *property_name, ...);
154 const std::string &label_text, YUIDimension label_ori,
155 GType type,
const char *property_name, ...);
158 virtual inline GtkWidget *getWidget() {
return m_widget; }
161 void setPolicy (GtkPolicyType hpolicy, GtkPolicyType vpolicy);
164 void construct(GType type,
const char *property_name, va_list args);