gwenhywfar
4.7.0beta
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
gui
cocoa
w_vline.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 "
CocoaVLineView.h
"
11
12
13
static
GWENHYWFAR_CB
14
int
CocoaGui_WVLine_SetIntProperty
(
GWEN_WIDGET
*w,
15
GWEN_DIALOG_PROPERTY
prop,
16
int
index,
17
int
value,
18
int
doSignal) {
19
CocoaVLineView
*vLineView;
20
21
vLineView=(
CocoaVLineView
*)(
GWEN_Widget_GetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
));
22
assert(vLineView);
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
47
static
GWENHYWFAR_CB
48
int
CocoaGui_WVLine_GetIntProperty
(
GWEN_WIDGET
*w,
49
GWEN_DIALOG_PROPERTY
prop,
50
int
index,
51
int
defaultValue) {
52
CocoaVLineView
*vLineView;
53
54
vLineView=(
CocoaVLineView
*)(
GWEN_Widget_GetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
));
55
assert(vLineView);
56
57
58
switch
(prop) {
59
case
GWEN_DialogProperty_Enabled
:
60
//return (gtk_widget_get_sensitive(GTK_WIDGET(g))==TRUE)?1:0;
61
return
0;
62
63
case
GWEN_DialogProperty_Focus
:
64
//return (gtk_widget_has_focus(GTK_WIDGET(g))==TRUE)?1:0;
65
return
0;
66
67
default
:
68
break
;
69
}
70
71
72
DBG_WARN
(
GWEN_LOGDOMAIN
,
73
"Function is not appropriate for this type of widget (%s)"
,
74
GWEN_Widget_Type_toString
(
GWEN_Widget_GetType
(w)));
75
return
defaultValue;
76
}
77
78
79
80
int
CocoaGui_WVLine_Setup
(
GWEN_WIDGET
*w) {
81
CocoaVLineView
*vLineView;
82
uint32_t flags;
83
GWEN_WIDGET
*wParent;
84
85
flags=
GWEN_Widget_GetFlags
(w);
86
wParent=GWEN_Widget_Tree_GetParent(w);
87
88
vLineView = [[[
CocoaVLineView
alloc] initWithFrame:NSMakeRect(0.0, 0.0, 100.0, 5.0)] autorelease];
89
if
(flags &
GWEN_WIDGET_FLAGS_FILLX
) vLineView.
fillX
= YES;
90
if
(flags &
GWEN_WIDGET_FLAGS_FILLY
) vLineView.
fillY
= YES;
91
92
93
GWEN_Widget_SetImplData
(w,
COCOA_DIALOG_WIDGET_REAL
, (
void
*) vLineView);
94
GWEN_Widget_SetImplData
(w,
COCOA_DIALOG_WIDGET_CONTENT
, (
void
*) vLineView);
95
96
GWEN_Widget_SetSetIntPropertyFn
(w,
CocoaGui_WHLine_SetIntProperty
);
97
GWEN_Widget_SetGetIntPropertyFn
(w,
CocoaGui_WHLine_GetIntProperty
);
98
99
if
(wParent)
100
GWEN_Widget_AddChildGuiWidget
(wParent, w);
101
102
return
0;
103
}
104
105
Generated on Wed Aug 21 2013 18:32:11 for gwenhywfar by
1.8.4