gwenhywfar
4.8.0beta
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
gui
cocoa
w_hspacer.mm
Go to the documentation of this file.
1
/***************************************************************************
2
begin : Aug 17 2010
3
copyright : (C) 2010 by Samuel Strupp
4
5
***************************************************************************
6
* Please see toplevel file COPYING for license details *
7
***************************************************************************/
8
9
10
#import "
CocoaSpacer.h
"
11
12
13
static
GWENHYWFAR_CB
14
int
CocoaGui_WHSpacer_SetIntProperty
(
GWEN_WIDGET
*w,
15
GWEN_DIALOG_PROPERTY
prop,
16
int
index,
17
int
value,
18
int
doSignal) {
19
CocoaSpacer
*hSpacer;
20
21
hSpacer=(
CocoaSpacer
*)(
GWEN_Widget_GetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
));
22
assert(hSpacer);
23
24
switch
(prop) {
25
case
GWEN_DialogProperty_Enabled
:
26
return
0;
27
28
case
GWEN_DialogProperty_Focus
:
29
return
0;
30
31
default
:
32
break
;
33
}
34
35
DBG_WARN
(
GWEN_LOGDOMAIN
,
36
"Function is not appropriate for this type of widget (%s)"
,
37
GWEN_Widget_Type_toString
(
GWEN_Widget_GetType
(w)));
38
return
GWEN_ERROR_INVALID
;
39
}
40
41
42
43
44
static
GWENHYWFAR_CB
45
int
CocoaGui_WHSpacer_GetIntProperty
(
GWEN_WIDGET
*w,
46
GWEN_DIALOG_PROPERTY
prop,
47
int
index,
48
int
defaultValue) {
49
CocoaSpacer
*hSpacer;
50
51
hSpacer=(
CocoaSpacer
*)(
GWEN_Widget_GetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
));
52
assert(hSpacer);
53
54
switch
(prop) {
55
case
GWEN_DialogProperty_Enabled
:
56
return
1;
57
58
case
GWEN_DialogProperty_Focus
:
59
return
0;
60
61
default
:
62
break
;
63
}
64
65
DBG_WARN
(
GWEN_LOGDOMAIN
,
66
"Function is not appropriate for this type of widget (%s)"
,
67
GWEN_Widget_Type_toString
(
GWEN_Widget_GetType
(w)));
68
return
defaultValue;
69
}
70
71
72
73
int
CocoaGui_WHSpacer_Setup
(
GWEN_WIDGET
*w) {
74
CocoaSpacer
*hSpacer;
75
uint32_t flags;
76
GWEN_WIDGET
*wParent;
77
78
flags=
GWEN_Widget_GetFlags
(w);
79
wParent=GWEN_Widget_Tree_GetParent(w);
80
81
hSpacer = [[[
CocoaSpacer
alloc] initWithFrame:NSMakeRect(0.0, 0.0, 10.0, 10.0)] autorelease];
82
GWEN_Widget_AddFlags
(w,
GWEN_WIDGET_FLAGS_FILLX
);
83
hSpacer.
fillX
= YES;
84
if
(flags &
GWEN_WIDGET_FLAGS_FILLY
) hSpacer.
fillY
= YES;
85
86
GWEN_Widget_SetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
, (
void
*) hSpacer);
87
GWEN_Widget_SetImplData
(w,
COCOA_DIALOG_WIDGET_CONTENT
, (
void
*) hSpacer);
88
89
GWEN_Widget_SetSetIntPropertyFn
(w,
CocoaGui_WHSpacer_SetIntProperty
);
90
GWEN_Widget_SetGetIntPropertyFn
(w,
CocoaGui_WHSpacer_GetIntProperty
);
91
92
if
(wParent)
93
GWEN_Widget_AddChildGuiWidget
(wParent, w);
94
95
return
0;
96
}
97
98
Generated on Sun Oct 27 2013 09:43:38 for gwenhywfar by
1.8.4