gwenhywfar  4.8.0beta
w_scrollarea.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; /* text view */
21  GtkWidget *gs; /* scrollable window */
22 
24  assert(g);
26  assert(gs);
27 
28  switch(prop) {
30  gtk_widget_set_sensitive(GTK_WIDGET(gs), (value==0)?FALSE:TRUE);
31  return 0;
32 
34  gtk_widget_grab_focus(GTK_WIDGET(gs));
35  return 0;
36 
39  /* just ignore these for now */
40  return 0;
41 
42  default:
43  break;
44  }
45 
47  "Function is not appropriate for this type of widget (%s)",
49  return GWEN_ERROR_INVALID;
50 }
51 
52 
53 
54 
55 static GWENHYWFAR_CB
58  int index,
59  int defaultValue) {
60  GtkWidget *g; /* text view */
61  GtkWidget *gs; /* scrollable window */
62 
64  assert(g);
66  assert(gs);
67 
69  assert(g);
70 
71  switch(prop) {
73  return (gtk_widget_get_sensitive(GTK_WIDGET(gs))==TRUE)?1:0;
74 
76  return (gtk_widget_has_focus(GTK_WIDGET(gs))==TRUE)?1:0;
77  return 0;
78 
81  /* just ignore these for now */
82  return 0;
83 
84  default:
85  break;
86  }
87 
89  "Function is not appropriate for this type of widget (%s)",
91  return defaultValue;
92 }
93 
94 
95 
96 static GWENHYWFAR_CB
99  int index,
100  const char *value,
101  int doSignal) {
102  GtkWidget *g; /* scrollable window */
103  GtkWidget *gContent; /* vbox */
104 
105  gContent=GTK_WIDGET(GWEN_Widget_GetImplData(w, GTK2_DIALOG_WIDGET_CONTENT));
106  assert(gContent);
108  assert(g);
109 
111  "Function is not appropriate for this type of widget (%s)",
113  return GWEN_ERROR_INVALID;
114 }
115 
116 
117 
118 static GWENHYWFAR_CB
121  int index,
122  const char *defaultValue) {
123  GtkWidget *gs; /* scrollable window */
124  GtkWidget *g; /* vbox */
125 
127  assert(g);
129  assert(gs);
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  uint32_t flags;
167  GWEN_WIDGET *wParent;
168 
169  flags=GWEN_Widget_GetFlags(w);
170  wParent=GWEN_Widget_Tree_GetParent(w);
171 
172  /* create widget */
173  g=gtk_scrolled_window_new(NULL, NULL);
174  gContent=gtk_vbox_new(TRUE, GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
175  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(g), gContent);
176 
179 
185 
186  if (wParent)
187  GWEN_Widget_AddChildGuiWidget(wParent, w);
188 
189  return 0;
190 }
191 
192