gwenhywfar  4.8.0beta
w_hlayout.mm
Go to the documentation of this file.
1 /***************************************************************************
2  begin : August 10 2010
3  copyright : (C) 2010 by Samuel Strupp
4 
5  ***************************************************************************
6  * Please see toplevel file COPYING for license details *
7  ***************************************************************************/
8 
9 
10 
11 #import "CocoaHLayout.h"
12 
13 
14 
15 static GWENHYWFAR_CB
18  int index,
19  int value,
20  int doSignal) {
21  CocoaHLayout *hlayout;
22 
24  assert(hlayout);
25 
26  switch(prop) {
28  //gtk_widget_set_sensitive(GTK_WIDGET(g), (value==0)?FALSE:TRUE);
29  return 0;
30 
32  //gtk_widget_grab_focus(GTK_WIDGET(g));
33  return 0;
34 
35  default:
36  break;
37  }
38 
40  "Function is not appropriate for this type of widget (%s)",
42  return GWEN_ERROR_INVALID;
43 }
44 
45 
46 
47 
48 static GWENHYWFAR_CB
51  int index,
52  int defaultValue) {
53  CocoaHLayout *hlayout;
54 
56  assert(hlayout);
57 
58  switch(prop) {
60  //return (gtk_widget_get_sensitive(GTK_WIDGET(g))==TRUE)?1:0;
61  return 1;
62 
64  //return (gtk_widget_has_focus(GTK_WIDGET(g))==TRUE)?1:0;
65  return 0;
66 
67  default:
68  break;
69  }
71  "Function is not appropriate for this type of widget (%s)",
73  return defaultValue;
74 }
75 
76 
77 
78 static GWENHYWFAR_CB
81  int index,
82  const char *value,
83  int doSignal) {
84  /*CocoaHLayout *hlayout;
85 
86  hlayout=(CocoaHLayout*)(GWEN_Widget_GetImplData(w, COCOA_DIALOG_WIDGET_REAL));
87  assert(hlayout);*/
88 
90  "Function is not appropriate for this type of widget (%s)",
92  return GWEN_ERROR_INVALID;
93 }
94 
95 
96 
97 static GWENHYWFAR_CB
100  int index,
101  const char *defaultValue) {
102  /*CocoaHLayout *hlayout;
103 
104  hlayout=(CocoaHLayout*)(GWEN_Widget_GetImplData(w, COCOA_DIALOG_WIDGET_REAL));
105  assert(hlayout);*/
106 
108  "Function is not appropriate for this type of widget (%s)",
110  return defaultValue;
111 }
112 
113 
114 
115 static GWENHYWFAR_CB
117  CocoaHLayout *hlayout;
118  NSView *childView;
119  uint32_t cflags;
120 
122  assert(hlayout);
123 
124  childView=(NSView*)(GWEN_Widget_GetImplData(wChild, COCOA_DIALOG_WIDGET_REAL));
125  assert(childView);
126 
127  cflags=GWEN_Widget_GetFlags(wChild);
128 
129  [hlayout addLayoutSubview:childView];
130 
131  /*gtk_box_pack_start(GTK_BOX(g), gChild,
132  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
133  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
134  0);*/
135 
136  return 0;
137 }
138 
139 
140 
142  CocoaHLayout *hlayout;
143  uint32_t flags;
144  GWEN_WIDGET *wParent;
145 
146  flags=GWEN_Widget_GetFlags(w);
147  wParent=GWEN_Widget_Tree_GetParent(w);
148 
149 
150  hlayout = [[[CocoaHLayout alloc] initWithFrame:NSMakeRect(10.0, 10.0, 200.0, 200.0)] autorelease];
151  if (flags & GWEN_WIDGET_FLAGS_FILLX) hlayout.fillX = YES;
152  if (flags & GWEN_WIDGET_FLAGS_FILLY) hlayout.fillY = YES;
153  /*#if 0
154  // using equal width here doesn't seem to be working as expected:
155  // I would expect al children be of equal width, but instead all children are
156  // equally distant to each other while still being of different width...
157  //
158  g=gtk_hbox_new((flags & GWEN_WIDGET_FLAGS_EQUAL_WIDTH)?TRUE:FALSE,
159  GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
160  #else
161  g=gtk_hbox_new(FALSE, GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
162  #endif*/
165 
171 
172  if (wParent)
173  GWEN_Widget_AddChildGuiWidget(wParent, w);
174 
175  return 0;
176 }
177 
178