gwenhywfar  4.3.3
w_groupbox.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Sun May 16 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 
12 
13 
14 static GWENHYWFAR_CB
17  int index,
18  int value,
19  int doSignal) {
20  GtkWidget *g;
21 
23  assert(g);
24 
25  switch(prop) {
27  gtk_widget_set_sensitive(GTK_WIDGET(g), (value==0)?FALSE:TRUE);
28  return 0;
29 
31  gtk_widget_grab_focus(GTK_WIDGET(g));
32  return 0;
33 
36  /* just ignore these for now */
37  return 0;
38 
39  default:
40  break;
41  }
42 
44  "Function is not appropriate for this type of widget (%s)",
46  return GWEN_ERROR_INVALID;
47 }
48 
49 
50 
51 
52 static GWENHYWFAR_CB
55  int index,
56  int defaultValue) {
57  GtkWidget *g;
58 
60  assert(g);
61 
62  switch(prop) {
64  return (gtk_widget_get_sensitive(GTK_WIDGET(g))==TRUE)?1:0;
65 
67  return (gtk_widget_has_focus(GTK_WIDGET(g))==TRUE)?1:0;
68  return 0;
69 
72  /* just ignore these for now */
73  return 0;
74 
75  default:
76  break;
77  }
78 
80  "Function is not appropriate for this type of widget (%s)",
82  return defaultValue;
83 }
84 
85 
86 
87 static GWENHYWFAR_CB
90  int index,
91  const char *value,
92  int doSignal) {
93  GtkWidget *g;
94 
96  assert(g);
97 
98  switch(prop) {
100  gtk_frame_set_label(GTK_FRAME(g), value);
101  return 0;
102  default:
103  break;
104  }
105 
107  "Function is not appropriate for this type of widget (%s)",
109  return GWEN_ERROR_INVALID;
110 }
111 
112 
113 
114 static GWENHYWFAR_CB
117  int index,
118  const char *defaultValue) {
119  GtkWidget *g;
120 
122  assert(g);
123 
124  switch(prop) {
126  return gtk_frame_get_label(GTK_FRAME(g));
127  default:
128  break;
129  }
130 
132  "Function is not appropriate for this type of widget (%s)",
134  return defaultValue;
135 }
136 
137 
138 
139 static GWENHYWFAR_CB
141  GtkWidget *g;
142  GtkWidget *gChild;
143  uint32_t cflags;
144 
146  assert(g);
147 
148  gChild=GTK_WIDGET(GWEN_Widget_GetImplData(wChild, GTK2_DIALOG_WIDGET_REAL));
149  assert(gChild);
150 
151  cflags=GWEN_Widget_GetFlags(wChild);
152 
153  gtk_box_pack_start(GTK_BOX(g), gChild,
154  (cflags & GWEN_WIDGET_FLAGS_FILLY)?TRUE:FALSE,
155  (cflags & GWEN_WIDGET_FLAGS_FILLY)?TRUE:FALSE,
156  0);
157 
158  return 0;
159 }
160 
161 
162 
164  GtkWidget *g;
165  GtkWidget *gContent;
166  const char *s;
167  uint32_t flags;
168  GWEN_WIDGET *wParent;
169 
170  flags=GWEN_Widget_GetFlags(w);
171  wParent=GWEN_Widget_Tree_GetParent(w);
172  s=GWEN_Widget_GetText(w, 0);
173 
174  g=gtk_frame_new(s);
175 
176  gContent=gtk_vbox_new(TRUE, GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
177  gtk_container_add(GTK_CONTAINER(g), gContent);
178 
181 
187 
188  if (wParent)
189  GWEN_Widget_AddChildGuiWidget(wParent, w);
190 
191  return 0;
192 }
193 
194