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
1075fb5b
Commit
1075fb5b
authored
Nov 02, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge, menu entry to create subgraphs added
parent
682dabc9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
5 deletions
+99
-5
xtt/lib/ge/gtk/ge_gtk.cpp
xtt/lib/ge/gtk/ge_gtk.cpp
+13
-1
xtt/lib/ge/gtk/ge_gtk.h
xtt/lib/ge/gtk/ge_gtk.h
+1
-0
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+66
-0
xtt/lib/ge/src/ge_graph.h
xtt/lib/ge/src/ge_graph.h
+2
-0
xtt/lib/glow/src/glow_ctx.cpp
xtt/lib/glow/src/glow_ctx.cpp
+4
-3
xtt/lib/glow/src/glow_ctx.h
xtt/lib/glow/src/glow_ctx.h
+1
-0
xtt/lib/glow/src/glow_growapi.cpp
xtt/lib/glow/src/glow_growapi.cpp
+11
-1
xtt/lib/glow/src/glow_growapi.h
xtt/lib/glow/src/glow_growapi.h
+1
-0
No files found.
xtt/lib/ge/gtk/ge_gtk.cpp
View file @
1075fb5b
...
...
@@ -384,6 +384,11 @@ void GeGtk::set_prompt( const char *prompt)
//
// Callbackfunctions from menu entries
//
void
GeGtk
::
activate_create_subgraph
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
graph
->
create_node_floating
(
0
,
0
);
}
void
GeGtk
::
activate_change_text
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
activate_change_text
();
...
...
@@ -1734,6 +1739,12 @@ GeGtk::GeGtk( void *x_parent_ctx,
g_signal_connect
(
edit_polyline
,
"activate"
,
G_CALLBACK
(
activate_edit_polyline
),
this
);
GtkWidget
*
edit_create_subgraph
=
gtk_menu_item_new_with_mnemonic
(
"_Create Subgraph"
);
g_signal_connect
(
edit_create_subgraph
,
"activate"
,
G_CALLBACK
(
activate_create_subgraph
),
this
);
gtk_widget_add_accelerator
(
edit_create_subgraph
,
"activate"
,
accel_g
,
'd'
,
GDK_CONTROL_MASK
,
GTK_ACCEL_VISIBLE
);
GtkWidget
*
edit_change_text
=
gtk_menu_item_new_with_mnemonic
(
"Change _Text"
);
g_signal_connect
(
edit_change_text
,
"activate"
,
G_CALLBACK
(
activate_change_text
),
this
);
...
...
@@ -1759,6 +1770,7 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_redo
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_rotate
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_polyline
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_create_subgraph
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_change_text
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_change_name
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
edit_menu
),
edit_command
);
...
...
@@ -2170,7 +2182,7 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
view
),
GTK_WIDGET
(
view_menu
));
// Menu Help
GtkWidget
*
help_help
=
gtk_image_menu_item_new_from_stock
(
GTK_STOCK_HELP
,
accel_g
);
GtkWidget
*
help_help
=
gtk_image_menu_item_new_from_stock
(
GTK_STOCK_HELP
,
0
);
g_signal_connect
(
help_help
,
"activate"
,
G_CALLBACK
(
activate_help
),
this
);
GtkWidget
*
help_help_subgraph
=
gtk_menu_item_new_with_mnemonic
(
"H_elp on Subgraphs"
);
...
...
xtt/lib/ge/gtk/ge_gtk.h
View file @
1075fb5b
...
...
@@ -109,6 +109,7 @@ class GeGtk : public Ge {
static
void
create_india_label
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
create_india_text
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_create_subgraph
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_change_text
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_change_name
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_preview_start
(
GtkWidget
*
w
,
gpointer
gectx
);
...
...
xtt/lib/ge/src/ge_graph.cpp
View file @
1075fb5b
...
...
@@ -294,6 +294,9 @@ void Graph::delete_select()
grow_tObject
*
sel_list
;
int
sel_count
;
if
(
grow_GetPasteActive
(
grow
->
ctx
))
return
;
journal_store
(
journal_eAction_DeleteSelect
,
0
);
grow_GetSelectList
(
grow
->
ctx
,
&
sel_list
,
&
sel_count
);
...
...
@@ -2279,6 +2282,9 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
}
break
;
case
glow_eEvent_MB2DoubleClick
:
if
(
grow_GetPasteActive
(
graph
->
grow
->
ctx
))
break
;
if
(
event
->
object
.
object_type
!=
glow_eObjectType_NoObject
)
{
graph
->
journal_store
(
journal_eAction_DeleteObject
,
event
->
object
.
object
);
...
...
@@ -4684,6 +4690,66 @@ void Graph::create_axis( grow_tObject *object, double x, double y)
grow_Redraw
(
grow
->
ctx
);
}
int
Graph
::
create_node_floating
(
double
x
,
double
y
)
{
char
sub_name
[
80
]
=
"graph"
;
pwr_tFileName
filename
;
char
name
[
80
];
grow_tNodeClass
nc
;
grow_tNode
n1
;
int
sts
;
char
dev
[
80
],
dir
[
80
],
file
[
80
],
type
[
32
];
int
version
;
GeDyn
*
dyn
;
// Create subgraph object
sts
=
(
get_current_subgraph_cb
)(
parent_ctx
,
sub_name
,
filename
);
if
(
EVEN
(
sts
))
{
message
(
'E'
,
"Select a SubGraph"
);
return
sts
;
}
dcli_parse_filename
(
filename
,
dev
,
dir
,
file
,
type
,
&
version
);
cdh_ToLower
(
sub_name
,
file
);
if
(
strcmp
(
type
,
".pwsg"
)
==
0
)
{
sts
=
grow_FindNodeClassByName
(
grow
->
ctx
,
sub_name
,
&
nc
);
if
(
EVEN
(
sts
))
{
// Load the subgraph
grow_OpenSubGraph
(
grow
->
ctx
,
filename
);
}
sts
=
grow_FindNodeClassByName
(
grow
->
ctx
,
sub_name
,
&
nc
);
if
(
EVEN
(
sts
))
{
message
(
'E'
,
"Unable to open subgraph"
);
return
sts
;
}
grow_GetUserData
(
nc
,
(
void
**
)
&
dyn
);
if
(
!
dyn
)
{
// Old version nodeclass without dyn, create dyn
GeDyn
*
dyn
=
new
GeDyn
(
this
);
grow_SetUserData
(
nc
,
(
void
*
)
dyn
);
}
sprintf
(
name
,
"O%d"
,
grow_IncrNextObjectNameNumber
(
grow
->
ctx
));
grow_PasteClear
(
grow
->
ctx
);
grow_CreatePasteNode
(
grow
->
ctx
,
name
,
nc
,
x
,
y
,
NULL
,
&
n1
);
if
(
shadow
)
grow_SetObjectShadow
(
n1
,
1
);
GeDyn
*
dyn
=
new
GeDyn
(
this
);
grow_SetUserData
(
n1
,
(
void
*
)
dyn
);
if
(
grow_IsSliderClass
(
nc
))
dyn
->
action_type
=
ge_mActionType
(
dyn
->
action_type
|
ge_mActionType_Slider
);
grow_Paste
(
grow
->
ctx
);
// grow_SetSelectHighlight( grow->ctx);
}
return
1
;
}
void
Graph
::
swap
(
int
mode
)
{
...
...
xtt/lib/ge/src/ge_graph.h
View file @
1075fb5b
...
...
@@ -1250,6 +1250,8 @@ class Graph {
*/
void
create_axis
(
grow_tObject
*
object
,
double
x
,
double
y
);
int
create_node_floating
(
double
x
,
double
y
);
//! Set displayed folder in a folder object.
/*!
\param name Object name of folder object.
...
...
xtt/lib/glow/src/glow_ctx.cpp
View file @
1075fb5b
...
...
@@ -724,10 +724,11 @@ void GlowCtx::paste_execute()
{
a
.
insert
(
a_move
[
i
]);
}
if
(
application_paste
)
// if ( application_paste)
a_sel
.
copy_from_common_objects
(
a_move
);
else
a_sel
.
copy_from
(
a_move
);
//
else
//
a_sel.copy_from(a_move);
ur_x
=
-
1e10
;
ll_x
=
1e10
;
...
...
xtt/lib/glow/src/glow_ctx.h
View file @
1075fb5b
...
...
@@ -290,6 +290,7 @@ class GlowCtx {
Copies all objects in paste list and inserts them into the context and into the move list.
*/
void
paste_execute
();
int
get_paste_active
()
{
return
node_movement_paste_active
;}
//! Cut selected objects.
/*! Clear paste list and move obejcts from select list to the pastelist. Remove them from the context. */
...
...
xtt/lib/glow/src/glow_growapi.cpp
View file @
1075fb5b
...
...
@@ -248,7 +248,11 @@ void grow_CreatePasteNode( grow_tCtx ctx, char *name, grow_tNodeClass nc,
double
x
,
double
y
,
void
*
user_data
,
grow_tNode
*
node
)
{
GlowNode
*
n1
;
n1
=
new
GlowNode
(
ctx
,
name
,
(
GlowNodeClass
*
)
nc
,
x
,
y
,
1
);
if
(((
GlowNodeClass
*
)
nc
)
->
is_slider
())
n1
=
new
GrowSlider
(
ctx
,
name
,
(
GlowNodeClass
*
)
nc
,
x
,
y
);
else
n1
=
new
GrowNode
(
ctx
,
name
,
(
GlowNodeClass
*
)
nc
,
x
,
y
,
1
);
n1
->
set_user_data
(
user_data
);
ctx
->
paste_insert
(
n1
);
*
node
=
(
grow_tNode
)
n1
;
...
...
@@ -357,6 +361,12 @@ void grow_PasteClear( grow_tCtx ctx)
ctx
->
paste_clear
();
}
int
grow_GetPasteActive
(
grow_tCtx
ctx
)
{
return
ctx
->
get_paste_active
();
}
void
grow_CreateRect
(
grow_tCtx
ctx
,
double
x
,
double
y
,
double
width
,
double
height
,
glow_eDrawType
draw_type
,
int
line_width
,
int
fix_line_width
,
...
...
xtt/lib/glow/src/glow_growapi.h
View file @
1075fb5b
...
...
@@ -459,6 +459,7 @@ extern "C" {
//! Clear the paste list.
/*! \param ctx Grow context. */
void
grow_PasteClear
(
grow_tCtx
ctx
);
int
grow_GetPasteActive
(
grow_tCtx
ctx
);
void
grow_CreateRect
(
grow_tCtx
ctx
,
double
x
,
double
y
,
double
width
,
double
height
,
...
...
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