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
e4c14514
Commit
e4c14514
authored
Dec 11, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge menu, ColorTheme next added
parent
fb8d0072
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
57 deletions
+93
-57
xtt/lib/ge/gtk/ge_gtk.cpp
xtt/lib/ge/gtk/ge_gtk.cpp
+29
-8
xtt/lib/ge/gtk/ge_gtk.h
xtt/lib/ge/gtk/ge_gtk.h
+2
-1
xtt/lib/ge/src/ge.cpp
xtt/lib/ge/src/ge.cpp
+55
-45
xtt/lib/ge/src/ge.h
xtt/lib/ge/src/ge.h
+2
-1
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+5
-2
No files found.
xtt/lib/ge/gtk/ge_gtk.cpp
View file @
e4c14514
...
...
@@ -803,9 +803,14 @@ void GeGtk::image_file_selected_cb( void *ctx, char *filename, wow_eFileSelType
ge
->
subpalette
->
select_by_name
(
cmd
);
}
void
GeGtk
::
activate_
select_colortheme
(
GtkWidget
*
w
,
gpointer
gectx
)
void
GeGtk
::
activate_
colortheme_select
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
activate_select_colortheme
();
((
Ge
*
)
gectx
)
->
activate_colortheme_select
();
}
void
GeGtk
::
activate_colortheme_next
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
activate_colortheme_next
();
}
void
GeGtk
::
activate_customcolors_read
(
GtkWidget
*
w
,
gpointer
gectx
)
...
...
@@ -1690,15 +1695,31 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_widget_add_accelerator
(
file_graph_attr
,
"activate"
,
accel_g
,
'g'
,
GDK_MOD1_MASK
,
GTK_ACCEL_VISIBLE
);
GtkWidget
*
file_select_colortheme
=
gtk_menu_item_new_with_mnemonic
(
"_Select ColorTheme"
);
g_signal_connect
(
file_select_colortheme
,
"activate"
,
G_CALLBACK
(
activate_select_colortheme
),
this
);
gtk_widget_add_accelerator
(
file_select_colortheme
,
"activate"
,
accel_g
,
// Submenu colortheme
GtkWidget
*
file_colortheme_select
=
gtk_menu_item_new_with_mnemonic
(
"_Select"
);
g_signal_connect
(
file_colortheme_select
,
"activate"
,
G_CALLBACK
(
activate_colortheme_select
),
this
);
gtk_widget_add_accelerator
(
file_colortheme_select
,
"activate"
,
accel_g
,
't'
,
GdkModifierType
(
GDK_CONTROL_MASK
|
GDK_SHIFT_MASK
),
GTK_ACCEL_VISIBLE
);
GtkWidget
*
file_colortheme_next
=
gtk_menu_item_new_with_mnemonic
(
"_Next"
);
g_signal_connect
(
file_colortheme_next
,
"activate"
,
G_CALLBACK
(
activate_colortheme_next
),
this
);
gtk_widget_add_accelerator
(
file_colortheme_next
,
"activate"
,
accel_g
,
't'
,
GdkModifierType
(
GDK_CONTROL_MASK
|
GDK_MOD1_MASK
),
GTK_ACCEL_VISIBLE
);
GtkWidget
*
file_colortheme
=
gtk_menu_item_new_with_mnemonic
(
"ColorTheme"
);
GtkMenu
*
file_colortheme_menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_colortheme_menu
),
file_colortheme_select
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_colortheme_menu
),
file_colortheme_next
);
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
file_colortheme
),
GTK_WIDGET
(
file_colortheme_menu
));
// Submenu customcolors
GtkWidget
*
file_customcolors_read
=
gtk_menu_item_new_with_mnemonic
(
"_
Re
ad"
);
GtkWidget
*
file_customcolors_read
=
gtk_menu_item_new_with_mnemonic
(
"_
Lo
ad"
);
g_signal_connect
(
file_customcolors_read
,
"activate"
,
G_CALLBACK
(
activate_customcolors_read
),
this
);
...
...
@@ -1791,7 +1812,7 @@ GeGtk::GeGtk( void *x_parent_ctx,
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_save_as
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_build
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_graph_attr
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_
select_
colortheme
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_colortheme
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_customcolors
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_subgraphs
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
file_menu
),
file_export
);
...
...
xtt/lib/ge/gtk/ge_gtk.h
View file @
e4c14514
...
...
@@ -192,7 +192,8 @@ class GeGtk : public Ge {
static
void
activate_export_java_as
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_export_plcfo
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_export_plcfo_as
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_select_colortheme
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_colortheme_select
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_colortheme_next
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_customcolors_read
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_customcolors_write
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_import_graph
(
GtkWidget
*
w
,
gpointer
gectx
);
...
...
xtt/lib/ge/src/ge.cpp
View file @
e4c14514
...
...
@@ -1604,66 +1604,76 @@ void Ge::activate_open()
// Ge::open_graph);
}
typedef
struct
{
pwr_tString32
name
;
int
idx
;
}
tThemes
;
static
tThemes
themes
[]
=
{
{
"Standard"
,
0
},
{
"Sand"
,
1
},
{
"Maroon"
,
2
},
{
"Sienna"
,
3
},
{
"DarkBlue"
,
4
},
{
"Classic"
,
5
},
{
"Midnight"
,
6
},
{
"PlayRoom"
,
7
},
{
"NordicLight"
,
8
},
{
"Contrast"
,
9
},
{
"AzureContrast"
,
10
},
{
"OchreContrast"
,
11
},
{
"Chesterfield"
,
12
},
{
"TerraVerte"
,
13
},
{
"Custom"
,
100
}};
static
void
ge_colortheme_selector_ok_cb
(
void
*
ctx
,
char
*
text
)
{
Ge
*
gectx
=
(
Ge
*
)
ctx
;
int
idx
;
int
idx
=
-
1
;
if
(
strcmp
(
text
,
"Standard"
)
==
0
)
idx
=
0
;
else
if
(
strcmp
(
text
,
"Sand"
)
==
0
)
idx
=
1
;
else
if
(
strcmp
(
text
,
"Maroon"
)
==
0
)
idx
=
2
;
else
if
(
strcmp
(
text
,
"Sienna"
)
==
0
)
idx
=
3
;
else
if
(
strcmp
(
text
,
"DarkBlue"
)
==
0
)
idx
=
4
;
else
if
(
strcmp
(
text
,
"Classic"
)
==
0
)
idx
=
5
;
else
if
(
strcmp
(
text
,
"Midnight"
)
==
0
)
idx
=
6
;
else
if
(
strcmp
(
text
,
"PlayRoom"
)
==
0
)
idx
=
7
;
else
if
(
strcmp
(
text
,
"NordicLight"
)
==
0
)
idx
=
8
;
else
if
(
strcmp
(
text
,
"Contrast"
)
==
0
)
idx
=
9
;
else
if
(
strcmp
(
text
,
"AzureContrast"
)
==
0
)
idx
=
10
;
else
if
(
strcmp
(
text
,
"OchreContrast"
)
==
0
)
idx
=
11
;
else
return
;
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
themes
)
/
sizeof
(
themes
[
0
]);
i
++
)
{
if
(
strcmp
(
text
,
themes
[
i
].
name
)
==
0
)
{
idx
=
themes
[
i
].
idx
;
break
;
}
}
if
(
idx
>
0
)
gectx
->
graph
->
update_color_theme
(
idx
);
}
void
Ge
::
activate_select_colortheme
()
void
Ge
::
activate_colortheme_select
()
{
pwr_tString80
names
[
30
];
strcpy
(
names
[
0
],
"Standard"
);
strcpy
(
names
[
1
],
"Sand"
);
strcpy
(
names
[
2
],
"Maroon"
);
strcpy
(
names
[
3
],
"Sienna"
);
strcpy
(
names
[
4
],
"DarkBlue"
);
strcpy
(
names
[
5
],
"Classic"
);
strcpy
(
names
[
6
],
"Midnight"
);
strcpy
(
names
[
7
],
"PlayRoom"
);
strcpy
(
names
[
8
],
"NordicLight"
);
strcpy
(
names
[
9
],
"Contrast"
);
strcpy
(
names
[
10
],
"AzureContrast"
);
strcpy
(
names
[
11
],
"OchreContrast"
);
strcpy
(
names
[
11
],
"Chesterfield"
);
strcpy
(
names
[
11
],
"TerraVerte"
);
strcpy
(
names
[
11
],
"Custom"
);
strcpy
(
names
[
12
],
""
);
memset
(
names
,
0
,
sizeof
(
names
));
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
themes
)
/
sizeof
(
themes
[
0
]);
i
++
)
{
strcpy
(
names
[
i
],
themes
[
i
].
name
);
}
wow
->
CreateList
(
"ColorTheme Selector"
,
(
char
*
)
names
,
sizeof
(
names
[
0
]),
ge_colortheme_selector_ok_cb
,
0
,
this
);
}
void
Ge
::
activate_colortheme_next
()
{
int
next_idx
=
-
1
;
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
themes
)
/
sizeof
(
themes
[
0
]);
i
++
)
{
if
(
themes
[
i
].
idx
==
graph
->
color_theme
)
{
if
(
i
==
sizeof
(
themes
)
/
sizeof
(
themes
[
0
])
-
1
)
next_idx
=
themes
[
0
].
idx
;
else
next_idx
=
themes
[
i
+
1
].
idx
;
break
;
}
}
if
(
next_idx
<
0
)
next_idx
=
0
;
graph
->
update_color_theme
(
next_idx
);
}
void
Ge
::
activate_customcolors_read
()
{
wow
->
CreateFileSelDia
(
"CustomColors Selection"
,
(
void
*
)
this
,
...
...
xtt/lib/ge/src/ge.h
View file @
e4c14514
...
...
@@ -222,7 +222,8 @@ class Ge {
void
activate_prevpage
();
void
activate_graph_attr
();
void
activate_open
();
void
activate_select_colortheme
();
void
activate_colortheme_select
();
void
activate_colortheme_next
();
void
activate_customcolors_read
();
void
activate_customcolors_write
();
void
activate_subgraphs
();
...
...
xtt/lib/ge/src/ge_graph.cpp
View file @
e4c14514
...
...
@@ -679,13 +679,16 @@ void Graph::set_mode( grow_eMode mode, bool keep)
}
void
Graph
::
update_color_theme
(
int
c
olor_theme
)
void
Graph
::
update_color_theme
(
int
c
t
)
{
char
color_theme_file
[
80
];
int
sts
;
sprintf
(
color_theme_file
,
"pwr_colortheme%d"
,
c
olor_theme
);
sprintf
(
color_theme_file
,
"pwr_colortheme%d"
,
c
t
);
sts
=
grow_ReadCustomColorFile
(
grow
->
ctx
,
color_theme_file
);
if
(
EVEN
(
sts
))
return
;
color_theme
=
ct
;
if
(
update_colorpalette_cb
)
(
update_colorpalette_cb
)(
parent_ctx
);
...
...
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