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
be1c37a7
Commit
be1c37a7
authored
Jul 13, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Object editor removed when object removed
parent
85ed8252
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
11 deletions
+48
-11
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+37
-7
xtt/lib/ge/src/ge_graph.h
xtt/lib/ge/src/ge_graph.h
+11
-4
No files found.
xtt/lib/ge/src/ge_graph.cpp
View file @
be1c37a7
...
...
@@ -142,7 +142,7 @@ Graph::Graph(
char
*
xn_object_name
,
int
xn_use_default_access
,
unsigned
int
xn_default_access
)
:
attr_list
(
1
,
NULL
),
attr_list
(
0
,
NULL
),
parent_ctx
(
xn_parent_ctx
),
parent_wid
(
xn_parent_wid
),
grow_cnt
(
0
),
ldhses
(
0
),
message_cb
(
NULL
),
get_current_subgraph_cb
(
NULL
),
close_cb
(
NULL
),
...
...
@@ -416,6 +416,16 @@ int Graph::is_javaapplet()
//
void
Graph
::
clear_all
()
{
Attr
*
attrctx
;
int
sts
;
sts
=
attr_list
.
get_first
(
(
void
**
)
&
attrctx
);
while
(
sts
)
{
delete
attrctx
;
attr_list
.
remove
(
(
void
*
)
attrctx
);
sts
=
attr_list
.
get_first
(
(
void
**
)
&
attrctx
);
}
grow_New
(
grow
->
ctx
);
}
...
...
@@ -1506,7 +1516,7 @@ int Graph::edit_attributes( grow_tObject object)
attr
->
set_data_cb
=
&
graph_attr_set_data_cb
;
attr
->
get_plant_select_cb
=
&
graph_get_plant_select_cb
;
attr
->
get_current_colors_cb
=
&
graph_get_current_colors_cb
;
attr_list
.
insert
(
(
void
*
)
attr
);
attr_list
.
insert
(
(
void
*
)
object
,
(
void
*
)
attr
);
grow_SetModified
(
grow
->
ctx
,
1
);
return
1
;
}
...
...
@@ -1771,7 +1781,7 @@ int Graph::edit_subgraph_attributes()
attr
->
close_cb
=
graph_graphattr_close_cb
;
attr
->
redraw_cb
=
graph_graphattr_redraw_cb
;
attr
->
reconfigure_attr_cb
=
&
graph_reconfigure_attr_cb
;
attr_list
.
insert
(
(
void
*
)
attr
);
attr_list
.
insert
(
0
,
(
void
*
)
attr
);
grow_SetModified
(
grow
->
ctx
,
1
);
was_subgraph
=
is_subgraph
();
return
1
;
...
...
@@ -1826,7 +1836,7 @@ int Graph::edit_graph_attributes()
attr
->
close_cb
=
graph_graphattr_close_cb
;
attr
->
redraw_cb
=
graph_graphattr_redraw_cb
;
attr
->
reconfigure_attr_cb
=
&
graph_reconfigure_attr_cb
;
attr_list
.
insert
(
(
void
*
)
attr
);
attr_list
.
insert
(
0
,
(
void
*
)
attr
);
grow_SetModified
(
grow
->
ctx
,
1
);
was_subgraph
=
is_subgraph
();
return
1
;
...
...
@@ -2010,7 +2020,7 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
case
glow_eEvent_SelectClear
:
grow_ResetSelectHighlight
(
graph
->
grow
->
ctx
);
break
;
case
glow_eEvent_ObjectDeleted
:
case
glow_eEvent_ObjectDeleted
:
{
if
(
graph
->
current_polyline
&&
event
->
object
.
object
==
graph
->
current_polyline
)
{
...
...
@@ -2031,7 +2041,14 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
grow_GetUserData
(
event
->
object
.
object
,
(
void
**
)
&
dyn
);
delete
dyn
;
}
Attr
*
attrctx
;
if
(
graph
->
attr_list
.
find
(
event
->
object
.
object
,
(
void
**
)
&
attrctx
))
{
delete
attrctx
;
graph
->
attr_list
.
remove
(
(
void
*
)
attrctx
);
}
break
;
}
case
glow_eEvent_MB3Click
:
if
(
grow_Mode
(
graph
->
grow
->
ctx
)
==
grow_eMode_PolyLine
&&
graph
->
current_polyline
)
{
if
(
graph
->
fill
)
...
...
@@ -3983,9 +4000,9 @@ void Graph::swap( int mode)
}
}
void
GraphApplList
::
insert
(
void
*
ctx
)
void
GraphApplList
::
insert
(
void
*
key
,
void
*
ctx
)
{
GraphApplList
*
appl_p
=
new
GraphApplList
(
0
,
ctx
);
GraphApplList
*
appl_p
=
new
GraphApplList
(
key
,
ctx
);
if
(
next
)
next
->
prev
=
appl_p
;
appl_p
->
next
=
next
;
...
...
@@ -4018,6 +4035,19 @@ void GraphApplList::remove( void *ctx)
}
}
int
GraphApplList
::
find
(
void
*
key
,
void
**
ctx
)
{
GraphApplList
*
appl_p
;
for
(
appl_p
=
next
;
appl_p
;
appl_p
=
appl_p
->
next
)
{
if
(
appl_p
->
key
==
key
)
{
*
ctx
=
appl_p
->
ctx
;
return
1
;
}
}
return
0
;
}
int
GraphApplList
::
get_first
(
void
**
ctx
)
{
if
(
next
)
...
...
xtt/lib/ge/src/ge_graph.h
View file @
be1c37a7
...
...
@@ -253,22 +253,29 @@ class GraphApplList {
\param root The root of the list.
\param appl_ctx Application object.
*/
GraphApplList
(
int
root
,
void
*
appl_ctx
)
:
is_root
(
root
),
ctx
(
appl_ctx
),
prev
(
NULL
),
next
(
NULL
)
{};
GraphApplList
(
void
*
appl_key
,
void
*
appl_ctx
)
:
key
(
appl_key
),
ctx
(
appl_ctx
),
prev
(
NULL
),
next
(
NULL
)
{};
int
is_root
;
//!< This elements is the root of the list
.
void
*
key
;
//!< Key
.
void
*
ctx
;
//!< Application object.
GraphApplList
*
prev
;
//!< Previous element in list.
GraphApplList
*
next
;
//!< Next element in list.
//! Insert an application in list.
/*! \param key Key for application. */
/*! \param ctx Application object to insert. */
void
insert
(
void
*
ctx
);
void
insert
(
void
*
key
,
void
*
ctx
);
//! Remove an application from list.
/*! \param ctx Application object to remove. */
void
remove
(
void
*
ctx
);
//! Find an applications with specified key.
/*! \param key Key to search for. */
/*! \param ctx Ctx for found key. */
/*! \return Returns 1 if key is found, else 0. */
int
find
(
void
*
key
,
void
**
ctx
);
//! Get the first element (after the root element)
/*!
\param ctx The object of the first element.
...
...
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