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
409ef9f1
Commit
409ef9f1
authored
Mar 10, 2015
by
Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plc editor, possibility to remove serveral objects with subwindows
parent
9e9c70c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
14 deletions
+82
-14
wb/lib/wb/src/wb_foe.cpp
wb/lib/wb/src/wb_foe.cpp
+81
-14
wb/lib/wb/src/wb_foe.h
wb/lib/wb/src/wb_foe.h
+1
-0
No files found.
wb/lib/wb/src/wb_foe.cpp
View file @
409ef9f1
...
...
@@ -651,12 +651,75 @@ void WFoe::delete_subwindow_ok_cb( void *ctx, void *data)
foe
->
gre
->
delete_selected
();
}
void
WFoe
::
delete_subwindows_ok_cb
(
void
*
ctx
,
void
*
data
)
{
WFoe
*
foe
=
(
WFoe
*
)
ctx
;
vldh_t_node
*
nodelist
;
unsigned
long
node_count
;
pwr_tStatus
sts
,
rsts
;
pwr_tOid
child
,
nextchild
;
vldh_t_wind
wind
=
foe
->
gre
->
wind
;
unsigned
long
wind_count
;
vldh_t_wind
*
windlist
;
vldh_t_wind
*
wind_ptr
;
int
i
;
foe
->
gre
->
get_selnodes
(
&
node_count
,
&
nodelist
);
for
(
unsigned
int
j
=
0
;
j
<
node_count
;
j
++
)
{
vldh_t_node
node
=
nodelist
[
j
];
if
(
node
->
ln
.
subwindow
!=
0
)
{
/* Check that subwindow is not open */
sts
=
vldh_get_wind_subwindows
(
foe
->
gre
->
wind
,
&
wind_count
,
&
windlist
);
if
(
EVEN
(
sts
))
{
foe
->
error_msg
(
sts
);
return
;}
for
(
sts
=
ldh_GetChild
(
wind
->
hw
.
ldhses
,
node
->
ln
.
oid
,
&
child
);
ODD
(
sts
);
sts
=
ldh_GetNextSibling
(
wind
->
hw
.
ldhses
,
child
,
&
child
))
{
wind_ptr
=
windlist
;
for
(
i
=
0
;
i
<
(
int
)
wind_count
;
i
++
)
{
if
(
cdh_ObjidIsEqual
(
(
*
wind_ptr
)
->
lw
.
oid
,
child
))
{
foe
->
wow
->
DisplayError
(
"Window open"
,
"Subwindow is open
\n
Close subwindow first"
);
free
((
char
*
)
windlist
);
free
(
(
char
*
)
nodelist
);
return
;
}
wind_ptr
++
;
}
}
if
(
wind_count
>
0
)
free
((
char
*
)
windlist
);
}
}
for
(
unsigned
int
j
=
0
;
j
<
node_count
;
j
++
)
{
vldh_t_node
node
=
nodelist
[
j
];
if
(
node
->
ln
.
subwindow
!=
0
)
{
for
(
sts
=
ldh_GetChild
(
wind
->
hw
.
ldhses
,
node
->
ln
.
oid
,
&
child
);
ODD
(
sts
);
child
=
nextchild
)
{
sts
=
ldh_GetNextSibling
(
wind
->
hw
.
ldhses
,
child
,
&
nextchild
);
rsts
=
ldh_DeleteObjectTree
(
wind
->
hw
.
ldhses
,
child
,
0
);
if
(
EVEN
(
rsts
))
{
foe
->
error_msg
(
rsts
);
return
;
}
}
node
->
ln
.
subwindow
=
0
;
}
}
foe
->
gre
->
delete_selected
();
free
(
(
char
*
)
nodelist
);
}
void
WFoe
::
activate_delete
()
{
unsigned
long
node_count
;
vldh_t_node
*
nodelist
;
vldh_t_node
*
node_ptr
;
int
i
,
subwind_found
;
int
i
;
if
(
msg_label_id
!=
0
)
message
(
""
);
...
...
@@ -678,25 +741,29 @@ void WFoe::activate_delete()
}
node_ptr
=
nodelist
;
subwind_found
=
FALSE
;
int
subwind_cnt
=
0
;
for
(
i
=
0
;
i
<
(
int
)
node_count
;
i
++
)
{
if
(
(
*
node_ptr
)
->
ln
.
subwindow
!=
0
)
{
subwind_found
=
TRUE
;
break
;
}
if
(
(
*
node_ptr
)
->
ln
.
subwindow
!=
0
)
subwind_cnt
++
;
node_ptr
++
;
}
if
(
node_count
>
0
)
free
((
char
*
)
nodelist
);
if
(
subwind_found
)
{
wow
->
DisplayError
(
"Subwindow found"
,
"Subwindow found
\n
Delete objects with subwindows separately"
);
BEEP
;
}
else
{
/* Delete selected nodes */
gre
->
delete_selected
();
if
(
subwind_cnt
)
{
char
msg
[
200
];
sprintf
(
msg
,
"%d objects have subwindows
\n
Do you want to delete the subwindows?"
,
subwind_cnt
);
wow
->
DisplayQuestion
(
this
,
"Delete subwindows"
,
msg
,
delete_subwindows_ok_cb
,
0
,
0
);
popupmenu_node
=
0
;
return
;
}
/* Delete selected nodes */
gre
->
delete_selected
();
popupmenu_node
=
0
;
}
void
WFoe
::
activate_createobject
(
float
x
,
float
y
)
...
...
wb/lib/wb/src/wb_foe.h
View file @
409ef9f1
...
...
@@ -331,6 +331,7 @@ class WFoe : public WUtility {
static
void
edit_exit_save
(
WFoe
*
foe
);
static
void
edit_exit_nosave
(
WFoe
*
foe
);
static
void
delete_subwindow_ok_cb
(
void
*
ctx
,
void
*
data
);
static
void
delete_subwindows_ok_cb
(
void
*
ctx
,
void
*
data
);
static
void
delete_ok_cb
(
void
*
ctx
,
void
*
data
);
static
void
exit_save
(
WFoe
*
foe
);
...
...
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