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