gwenhywfar 5.10.1
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
15static 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
48static 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
78static 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
97static 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
115static 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)
174
175 return 0;
176}
177
178
#define COCOA_DIALOG_WIDGET_REAL
#define COCOA_DIALOG_WIDGET_CONTENT
#define DBG_WARN(dbg_logger, format, args...)
Definition: debug.h:125
#define GWEN_WIDGET_FLAGS_FILLY
Definition: dialog.h:62
#define GWEN_WIDGET_FLAGS_FILLX
Definition: dialog.h:61
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
@ GWEN_DialogProperty_Enabled
Definition: dialog.h:267
@ GWEN_DialogProperty_Focus
Definition: dialog.h:276
#define GWEN_ERROR_INVALID
Definition: error.h:67
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
#define GWEN_LOGDOMAIN
Definition: logger.h:35
static GWENHYWFAR_CB int CocoaGui_WHLayout_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
Definition: w_hlayout.mm:79
static GWENHYWFAR_CB int CocoaGui_WHLayout_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
Definition: w_hlayout.mm:16
int CocoaGui_WHLayout_Setup(GWEN_WIDGET *w)
Definition: w_hlayout.mm:141
static GWENHYWFAR_CB int CocoaGui_WHLayout_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: w_hlayout.mm:116
static GWENHYWFAR_CB const char * CocoaGui_WHLayout_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
Definition: w_hlayout.mm:98
static GWENHYWFAR_CB int CocoaGui_WHLayout_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
Definition: w_hlayout.mm:49
GWEN_WIDGET_GETCHARPROPERTY_FN GWEN_Widget_SetGetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETCHARPROPERTY_FN fn)
Definition: widget.c:732
GWEN_WIDGET_GETINTPROPERTY_FN GWEN_Widget_SetGetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETINTPROPERTY_FN fn)
Definition: widget.c:702
GWEN_WIDGET_ADDCHILDGUIWIDGET_FN GWEN_Widget_SetAddChildGuiWidgetFn(GWEN_WIDGET *w, GWEN_WIDGET_ADDCHILDGUIWIDGET_FN fn)
Definition: widget.c:747
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget.c:828
void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.
Definition: widget.c:136
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition: widget.c:122
GWEN_WIDGET_SETINTPROPERTY_FN GWEN_Widget_SetSetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETINTPROPERTY_FN fn)
Definition: widget.c:687
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition: widget.c:149
const char * GWEN_Widget_Type_toString(GWEN_WIDGET_TYPE t)
Definition: widget.c:452
GWEN_WIDGET_TYPE GWEN_Widget_GetType(const GWEN_WIDGET *w)
Definition: widget.c:185
GWEN_WIDGET_SETCHARPROPERTY_FN GWEN_Widget_SetSetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETCHARPROPERTY_FN fn)
Definition: widget.c:717
struct GWEN_WIDGET GWEN_WIDGET
Definition: widget_be.h:34