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
263cfc45
Commit
263cfc45
authored
Jul 26, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wb menu methods, subclass override of method implemented
parent
65e7eefd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
+41
-0
wb/lib/wb/gtk/wb_wtt_gtk.cpp
wb/lib/wb/gtk/wb_wtt_gtk.cpp
+3
-0
wb/lib/wb/motif/wb_wtt_motif.cpp
wb/lib/wb/motif/wb_wtt_motif.cpp
+3
-0
wb/lib/wb/src/wb_ldh.h
wb/lib/wb/src/wb_ldh.h
+1
-0
wb/lib/wb/src/wb_session.cpp
wb/lib/wb/src/wb_session.cpp
+34
-0
No files found.
wb/lib/wb/gtk/wb_wtt_gtk.cpp
View file @
263cfc45
...
...
@@ -3227,6 +3227,9 @@ GtkWidget *WttGtk::build_submenu( GtkWidget *Parent, int MenuType,
for
(;
Items
[
*
idx
].
Level
!=
0
&&
Items
[
*
idx
].
Level
>=
Level
;
(
*
idx
)
++
)
{
if
(
Items
[
*
idx
].
Disabled
)
continue
;
if
(
Items
[
*
idx
].
Item
==
ldh_eMenuItem_Cascade
)
{
if
(
MenuType
==
MENU_OPTION
)
{
printf
(
"You can't have submenus from option menu items."
);
...
...
wb/lib/wb/motif/wb_wtt_motif.cpp
View file @
263cfc45
...
...
@@ -2452,6 +2452,9 @@ Widget WttMotif::build_submenu( Widget Parent, int MenuType,
Level
=
Items
[
*
idx
].
Level
;
for
(;
Items
[
*
idx
].
Level
!=
0
&&
Items
[
*
idx
].
Level
>=
Level
;
(
*
idx
)
++
)
{
if
(
Items
[
*
idx
].
Disabled
)
continue
;
if
(
Items
[
*
idx
].
Item
==
ldh_eMenuItem_Cascade
)
{
if
(
MenuType
==
MENU_OPTION
)
{
XtWarning
(
"You can't have submenus from option menu items."
);
...
...
wb/lib/wb/src/wb_ldh.h
View file @
263cfc45
...
...
@@ -349,6 +349,7 @@ struct ldh_s_MenuItem {
ldh_mMenuFlags
Flags
;
pwr_tStatus
(
*
Method
)();
pwr_tObjid
MenuObject
;
int
Disabled
;
};
#ifdef __cplusplus
...
...
wb/lib/wb/src/wb_session.cpp
View file @
263cfc45
...
...
@@ -923,6 +923,23 @@ void wb_session::getAllMenuItems( ldh_sMenuCall *ip, ldh_sMenuItem **Item, wb_cd
}
else
if
(
o
->
cid
()
==
pwr_eClass_MenuButton
)
{
mbp
=
(
pwr_sMenuButton
*
)
o_body
;
if
(
Level
==
1
)
{
// Check if method is overridden, ie name already exist
for
(
int
i
=
0
;
i
<
*
nItems
;
i
++
)
{
if
(
ldh_lMenuItem
[
i
].
Level
==
Level
&&
strcmp
(
ldh_lMenuItem
[
i
].
Name
,
mbp
->
ButtonName
)
==
0
)
{
ldh_lMenuItem
[
i
].
Disabled
=
1
;
for
(
int
j
=
i
+
1
;
j
<
*
nItems
;
j
++
)
{
if
(
ldh_lMenuItem
[
j
].
Level
>
ldh_lMenuItem
[
i
].
Level
)
ldh_lMenuItem
[
j
].
Disabled
=
1
;
else
if
(
ldh_lMenuItem
[
j
].
Level
==
ldh_lMenuItem
[
i
].
Level
)
break
;
}
}
}
}
(
*
Item
)
->
Level
=
Level
;
(
*
Item
)
->
Item
=
ldh_eMenuItem_Button
;
(
*
Item
)
->
MenuObject
=
o
->
oid
();
...
...
@@ -952,6 +969,23 @@ void wb_session::getAllMenuItems( ldh_sMenuCall *ip, ldh_sMenuItem **Item, wb_cd
(
*
nItems
)
++
;
}
else
if
(
o
->
cid
()
==
pwr_eClass_MenuCascade
)
{
mcp
=
(
pwr_sMenuCascade
*
)
o_body
;
if
(
Level
==
1
)
{
// Check if method is overridden, ie name already exist
for
(
int
i
=
0
;
i
<
*
nItems
;
i
++
)
{
if
(
ldh_lMenuItem
[
i
].
Level
==
Level
&&
strcmp
(
ldh_lMenuItem
[
i
].
Name
,
mcp
->
ButtonName
)
==
0
)
{
ldh_lMenuItem
[
i
].
Disabled
=
1
;
for
(
int
j
=
i
+
1
;
j
<
*
nItems
;
j
++
)
{
if
(
ldh_lMenuItem
[
j
].
Level
>
ldh_lMenuItem
[
i
].
Level
)
ldh_lMenuItem
[
j
].
Disabled
=
1
;
else
if
(
ldh_lMenuItem
[
j
].
Level
==
ldh_lMenuItem
[
i
].
Level
)
break
;
}
}
}
}
(
*
Item
)
->
Level
=
Level
;
(
*
Item
)
->
Item
=
ldh_eMenuItem_Cascade
;
(
*
Item
)
->
Flags
.
f
.
Sensitive
=
1
;
...
...
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