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
bcd752f4
Commit
bcd752f4
authored
Nov 06, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge graph view added
parent
b7e824c3
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
618 additions
and
2 deletions
+618
-2
xtt/lib/ge/gtk/ge_gtk.cpp
xtt/lib/ge/gtk/ge_gtk.cpp
+34
-1
xtt/lib/ge/gtk/ge_gtk.h
xtt/lib/ge/gtk/ge_gtk.h
+3
-0
xtt/lib/ge/gtk/ge_item_view_gtk.cpp
xtt/lib/ge/gtk/ge_item_view_gtk.cpp
+498
-0
xtt/lib/ge/gtk/ge_item_view_gtk.h
xtt/lib/ge/gtk/ge_item_view_gtk.h
+72
-0
xtt/lib/ge/src/ge.cpp
xtt/lib/ge/src/ge.cpp
+8
-1
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+1
-0
xtt/lib/ge/src/ge_graph.h
xtt/lib/ge/src/ge_graph.h
+2
-0
No files found.
xtt/lib/ge/gtk/ge_gtk.cpp
View file @
bcd752f4
...
...
@@ -77,6 +77,7 @@
#include "ge_subgraphs_gtk.h"
#include "ge_util.h"
#include "ge_msg.h"
#include "ge_item_view_gtk.h"
#include "wb_wnav_selformat.h"
#include "cow_wow_gtk.h"
#include "cow_logw_gtk.h"
...
...
@@ -1270,6 +1271,25 @@ void GeGtk::activate_view_plant(GtkWidget *w, gpointer data)
#endif
}
void
GeGtk
::
activate_view_graphlist
(
GtkWidget
*
w
,
gpointer
data
)
{
Ge
*
ge
=
(
Ge
*
)
data
;
int
set
=
(
int
)
gtk_check_menu_item_get_active
(
GTK_CHECK_MENU_ITEM
(
((
GeGtk
*
)
ge
)
->
view_graphlist_w
));
if
(
w
!=
((
GeGtk
*
)
ge
)
->
view_graphlist_w
)
{
set
=
!
set
;
gtk_check_menu_item_set_active
(
GTK_CHECK_MENU_ITEM
(
((
GeGtk
*
)
ge
)
->
view_graphlist_w
),
set
?
TRUE
:
FALSE
);
}
if
(
set
)
{
g_object_set
(
((
GeGtk
*
)
ge
)
->
graph_list
,
"visible"
,
TRUE
,
NULL
);
}
else
{
g_object_set
(
((
GeGtk
*
)
ge
)
->
graph_list
,
"visible"
,
FALSE
,
NULL
);
}
ge
->
set_focus
(
0
);
}
void
GeGtk
::
activate_concorner_right
(
GtkWidget
*
w
,
gpointer
gectx
)
{
...
...
@@ -2209,6 +2229,10 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_widget_add_accelerator
(
view_plant_w
,
"activate"
,
accel_g
,
'p'
,
GDK_CONTROL_MASK
,
GTK_ACCEL_VISIBLE
);
view_graphlist_w
=
gtk_check_menu_item_new_with_mnemonic
(
"Vie_w graph list"
);
g_signal_connect
(
view_graphlist_w
,
"activate"
,
G_CALLBACK
(
activate_view_graphlist
),
this
);
GtkMenu
*
view_menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_preview_start
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_preview_stop
);
...
...
@@ -2216,6 +2240,7 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_zoom_out
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_zoom_reset
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_plant_w
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
view_menu
),
view_graphlist_w
);
GtkWidget
*
view
=
gtk_menu_item_new_with_mnemonic
(
"_View"
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu_bar
),
view
);
...
...
@@ -3003,12 +3028,19 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_paned_pack2
(
GTK_PANED
(
hpaned
),
vpaned2
,
FALSE
,
TRUE
);
gtk_widget_show
(
vpaned1
);
GeItemViewGtk
*
item_view
=
new
GeItemViewGtk
(
this
);
GtkWidget
*
hpaned2
=
gtk_hpaned_new
();
graph_list
=
item_view
->
widget
();
gtk_paned_pack1
(
GTK_PANED
(
hpaned2
),
graph_list
,
FALSE
,
FALSE
);
gtk_paned_pack2
(
GTK_PANED
(
hpaned2
),
hpaned
,
TRUE
,
TRUE
);
gtk_widget_show
(
hpaned2
);
GtkWidget
*
vbox
=
gtk_vbox_new
(
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
menu_bar
),
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
tools3
),
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
tools2
),
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
tools
),
FALSE
,
FALSE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
hpaned
),
TRUE
,
TRUE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
hpaned
2
),
TRUE
,
TRUE
,
0
);
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
GTK_WIDGET
(
statusbar
),
FALSE
,
FALSE
,
0
);
gtk_container_add
(
GTK_CONTAINER
(
toplevel
),
vbox
);
...
...
@@ -3025,6 +3057,7 @@ GeGtk::GeGtk( void *x_parent_ctx,
#endif
g_object_set
(
cmd_prompt
,
"visible"
,
FALSE
,
NULL
);
g_object_set
(
cmd_input
,
"visible"
,
FALSE
,
NULL
);
g_object_set
(
graph_list
,
"visible"
,
FALSE
,
NULL
);
subpalette
->
get_path
(
&
path_cnt
,
&
path
);
graph
->
set_subgraph_path
(
path_cnt
,
path
);
...
...
xtt/lib/ge/gtk/ge_gtk.h
View file @
bcd752f4
...
...
@@ -79,6 +79,8 @@ class GeGtk : public Ge {
GtkWidget
*
grid_size_01_w
;
GtkWidget
*
show_grid_w
;
GtkWidget
*
view_plant_w
;
GtkWidget
*
view_graphlist_w
;
GtkWidget
*
graph_list
;
GdkAtom
graph_atom
;
CoWowRecall
*
text_recall
;
CoWowRecall
*
name_recall
;
...
...
@@ -274,6 +276,7 @@ class GeGtk : public Ge {
static
void
activate_zoom_out
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_zoom_reset
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_view_plant
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_view_graphlist
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_concorner_right
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_concorner_rounded
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_round_amount_1
(
GtkWidget
*
w
,
gpointer
gectx
);
...
...
xtt/lib/ge/gtk/ge_item_view_gtk.cpp
0 → 100644
View file @
bcd752f4
This diff is collapsed.
Click to expand it.
xtt/lib/ge/gtk/ge_item_view_gtk.h
0 → 100644
View file @
bcd752f4
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef ge_item_view_gtk_h
#define ge_item_view_gtk_h
#ifndef ge_h
#include "ge.h"
#endif
#include "cow_wow.h"
class
GeItemViewGtk
{
private:
gpointer
ge_ctx
;
GtkWidget
*
toplevel_widget
;
GtkWidget
*
tree_widget
;
GtkWidget
*
autosave_button
;
public:
GeItemViewGtk
(
gpointer
gectx
);
~
GeItemViewGtk
();
GtkWidget
*
widget
()
const
;
void
update
();
void
update
(
char
*
,
int
);
char
*
selected_text
()
const
;
static
char
*
selected_text
(
GtkWidget
*
);
static
void
activate_menu_open
(
GtkWidget
*
,
gpointer
);
static
void
activate_menu_delete
(
GtkWidget
*
,
gpointer
);
static
void
activate_tree_widget
(
GtkTreeView
*
,
GtkTreePath
*
,
GtkTreeViewColumn
*
,
gpointer
);
static
gboolean
focus_out_tree_widget
(
GtkWidget
*
,
GdkEvent
*
,
gpointer
);
};
#endif
xtt/lib/ge/src/ge.cpp
View file @
bcd752f4
...
...
@@ -302,6 +302,7 @@ void Ge::clear_all()
graph
->
set_gridsize
(
1
);
graph
->
set_grid
(
0
);
graph
->
clear_all
();
graph
->
set_modified
(
0
);
subpalette
->
get_path
(
&
path_cnt
,
&
path
);
graph
->
set_subgraph_path
(
path_cnt
,
path
);
update
();
...
...
@@ -1068,6 +1069,12 @@ void Ge::activate_print()
void
Ge
::
activate_new
()
{
if
(
graph
->
is_modified
())
{
int
rv
=
create_modal_dialog
(
"New"
,
"Graph is not saved.
\n
Do you want to continue?"
,
"Yes"
,
"Cancel"
,
NULL
,
NULL
);
if
(
rv
==
wow_eModalDialogReturn_Button1
)
clear_all
();
}
else
clear_all
();
}
...
...
xtt/lib/ge/src/ge_graph.cpp
View file @
bcd752f4
...
...
@@ -2560,6 +2560,7 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
}
else
if
(
strcmp
(
type
,
".gif"
)
==
0
||
strcmp
(
type
,
".jpg"
)
==
0
||
strcmp
(
type
,
".svg"
)
==
0
||
strcmp
(
type
,
".png"
)
==
0
)
{
grow_tObject
i1
;
char
name
[
80
];
...
...
xtt/lib/ge/src/ge_graph.h
View file @
bcd752f4
...
...
@@ -993,6 +993,8 @@ class Graph {
/*! \return 1 if modified, 0 if not modified. */
int
is_modified
();
void
set_modified
(
int
mod
)
{
grow_SetModified
(
grow
->
ctx
,
mod
);}
//! Set scantime for slow cycle.
/*! \param time Scantime in seconds. */
void
set_scantime
(
double
time
)
{
scan_time
=
time
;};
...
...
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