Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
5d8e4a55
Commit
5d8e4a55
authored
May 18, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More flexible layout of operator buttons. NoFastAvail not used any more.
parent
833116cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
21 deletions
+43
-21
xtt/lib/xtt/gtk/xtt_op_gtk.cpp
xtt/lib/xtt/gtk/xtt_op_gtk.cpp
+41
-19
xtt/lib/xtt/src/xtt_op.cpp
xtt/lib/xtt/src/xtt_op.cpp
+1
-1
xtt/lib/xtt/src/xtt_op.h
xtt/lib/xtt/src/xtt_op.h
+1
-1
No files found.
xtt/lib/xtt/gtk/xtt_op_gtk.cpp
View file @
5d8e4a55
...
...
@@ -562,12 +562,13 @@ void OpGtk::update_alarm_info()
int
OpGtk
::
configure
(
char
*
opplace_str
)
{
int
sts
;
int
i
;
unsigned
int
i
;
pwr_tObjid
opplace
;
pwr_tObjid
user
;
pwr_sClass_OpPlace
*
opplace_p
;
pwr_sClass_User
*
user_p
;
pwr_sAttrRef
attrref
;
pwr_tTid
tid
;
sts
=
gdh_NameToObjid
(
opplace_str
,
&
opplace
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
@@ -593,28 +594,43 @@ int OpGtk::configure( char *opplace_str)
if
(
EVEN
(
sts
))
return
sts
;
// Examine Graph objects
button_cnt
=
user_p
->
NoFastAvail
;
if
(
button_cnt
>
15
)
button_cnt
=
15
;
for
(
i
=
0
;
i
<
button_cnt
;
i
++
)
{
if
(
i
>=
15
)
break
;
memset
(
&
attrref
,
0
,
sizeof
(
attrref
));
for
(
i
=
0
;
i
<
sizeof
(
user_p
->
FastAvail
)
/
sizeof
(
user_p
->
FastAvail
[
0
]);
i
++
)
{
button_aref
[
i
].
Objid
=
pwr_cNOid
;
if
(
cdh_ObjidIsNull
(
user_p
->
FastAvail
[
i
].
Objid
))
continue
;
sts
=
gdh_GetAttrRefTid
(
&
user_p
->
FastAvail
[
i
],
&
tid
);
if
(
EVEN
(
sts
))
continue
;
if
(
tid
!=
pwr_cClass_XttGraph
)
continue
;
memset
(
&
attrref
,
0
,
sizeof
(
attrref
));
sts
=
gdh_ClassAttrToAttrref
(
pwr_cClass_XttGraph
,
".ButtonText"
,
&
attrref
);
if
(
EVEN
(
sts
))
return
sts
;
attrref
=
cdh_ArefAdd
(
&
user_p
->
FastAvail
[
i
],
&
attrref
);
sts
=
gdh_GetObjectInfoAttrref
(
&
attrref
,
(
void
*
)
button_title
[
i
],
sizeof
(
button_title
[
0
]));
if
(
EVEN
(
sts
))
strcpy
(
button_title
[
i
],
""
);
if
(
EVEN
(
sts
))
continue
;
button_objid
[
i
]
=
attrref
.
Objid
;
if
(
strcmp
(
button_title
[
i
],
""
)
==
0
)
{
// Take object name instead
sts
=
gdh_AttrrefToName
(
&
user_p
->
FastAvail
[
i
],
button_title
[
i
],
sizeof
(
button_title
[
0
]),
cdh_mName_object
);
if
(
EVEN
(
sts
))
continue
;
}
button_aref
[
i
]
=
user_p
->
FastAvail
[
i
];
}
// Create the application buttons
GtkWidget
*
b
[
15
];
for
(
i
=
0
;
i
<
button_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
sizeof
(
user_p
->
FastAvail
)
/
sizeof
(
user_p
->
FastAvail
[
0
]);
i
++
)
{
if
(
cdh_ObjidIsNull
(
button_aref
[
i
].
Objid
))
continue
;
char
*
textutf8
=
g_convert
(
button_title
[
i
],
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
b
[
i
]
=
gtk_button_new_with_label
(
textutf8
);
g_free
(
textutf8
);
...
...
@@ -670,7 +686,7 @@ int OpGtk::configure( char *opplace_str)
appl_form
=
gtk_vbox_new
(
FALSE
,
0
);
GtkWidget
*
bbox
[
3
];
for
(
i
=
0
;
i
<
button_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
sizeof
(
user_p
->
FastAvail
)
/
sizeof
(
user_p
->
FastAvail
[
0
])
;
i
++
)
{
if
(
i
==
0
)
{
bbox
[
0
]
=
gtk_hbox_new
(
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
appl_form
),
bbox
[
0
],
FALSE
,
FALSE
,
0
);
...
...
@@ -684,12 +700,18 @@ int OpGtk::configure( char *opplace_str)
gtk_box_pack_start
(
GTK_BOX
(
appl_form
),
bbox
[
2
],
FALSE
,
FALSE
,
0
);
}
if
(
i
<
5
)
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
0
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
else
if
(
i
<
10
)
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
1
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
else
if
(
i
<
15
)
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
2
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
if
(
i
<
5
)
{
if
(
cdh_ObjidIsNotNull
(
button_aref
[
i
].
Objid
))
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
0
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
}
else
if
(
i
<
10
)
{
if
(
cdh_ObjidIsNotNull
(
button_aref
[
i
].
Objid
))
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
1
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
}
else
if
(
i
<
15
)
{
if
(
cdh_ObjidIsNotNull
(
button_aref
[
i
].
Objid
))
gtk_box_pack_start
(
GTK_BOX
(
bbox
[
2
]),
b
[
i
],
TRUE
,
TRUE
,
0
);
}
}
return
XNAV__SUCCESS
;
...
...
xtt/lib/xtt/src/xtt_op.cpp
View file @
5d8e4a55
...
...
@@ -79,7 +79,7 @@ int Op::appl_action( int idx)
int
sts
;
if
(
command_cb
)
{
sts
=
gdh_
ObjidToName
(
button_objid
[
idx
],
name
,
sizeof
(
name
),
cdh_mNName
);
sts
=
gdh_
AttrrefToName
(
&
button_aref
[
idx
],
name
,
sizeof
(
name
),
cdh_mNName
);
strcpy
(
cmd
,
"ope gra/obj="
);
strcat
(
cmd
,
name
);
...
...
xtt/lib/xtt/src/xtt_op.h
View file @
5d8e4a55
...
...
@@ -46,7 +46,7 @@ class Op {
unsigned
long
balarm_prio
;
unsigned
long
balarm_type
;
char
button_title
[
20
][
80
];
pwr_t
Objid
button_objid
[
20
];
pwr_t
AttrRef
button_aref
[
20
];
int
button_cnt
;
int
start_jop
;
Jop
*
jop
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment