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
f9b03929
Commit
f9b03929
authored
Dec 06, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge, fonts displayed in font menu, and reset button added
parent
bddb110e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
21 deletions
+65
-21
xtt/lib/ge/gtk/ge_gtk.cpp
xtt/lib/ge/gtk/ge_gtk.cpp
+24
-1
xtt/lib/ge/gtk/ge_gtk.h
xtt/lib/ge/gtk/ge_gtk.h
+1
-0
xtt/lib/ge/src/ge.cpp
xtt/lib/ge/src/ge.cpp
+6
-0
xtt/lib/ge/src/ge.h
xtt/lib/ge/src/ge.h
+1
-0
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+28
-20
xtt/lib/ge/src/ge_graph.h
xtt/lib/ge/src/ge_graph.h
+5
-0
No files found.
xtt/lib/ge/gtk/ge_gtk.cpp
View file @
f9b03929
...
...
@@ -773,7 +773,7 @@ void GeGtk::image_file_selected_cb( void *ctx, char *filename, wow_eFileSelType
char
*
s
;
dcli_translate_filename
(
str
,
"$pwrp_pop/"
);
sprintf
(
cmd
,
"cp
%s
%s"
,
filename
,
str
);
sprintf
(
cmd
,
"cp
\'
%s
\'
%s"
,
filename
,
str
);
system
(
cmd
);
sprintf
(
str
,
"Image imported, %s"
,
filename
);
...
...
@@ -1055,6 +1055,11 @@ void GeGtk::activate_gradient_radlowerright(GtkWidget *w, gpointer gectx)
((
Ge
*
)
gectx
)
->
activate_gradient
(
glow_eGradient_RadialLowerRight
);
}
void
GeGtk
::
activate_reset_mode
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
activate_reset_mode
();
}
void
GeGtk
::
activate_scale
(
GtkWidget
*
w
,
gpointer
gectx
)
{
((
Ge
*
)
gectx
)
->
activate_scale
();
...
...
@@ -1538,6 +1543,14 @@ static void destroy_event( GtkWidget *w, gpointer data)
{
}
static
void
set_widget_font
(
GtkWidget
*
w
,
const
char
*
font_name
)
{
PangoFontDescription
*
desc
;
desc
=
pango_font_description_from_string
(
font_name
);
gtk_widget_modify_font
(
w
,
desc
);
}
gboolean
GeGtk
::
ge_action_inputfocus
(
GtkWidget
*
w
,
GdkEvent
*
event
,
gpointer
data
)
{
GeGtk
*
gectx
=
(
GeGtk
*
)
data
;
...
...
@@ -2431,6 +2444,11 @@ GeGtk::GeGtk( void *x_parent_ctx,
g_signal_connect
(
tools_open_object
,
"clicked"
,
G_CALLBACK
(
activate_objectattributes
),
this
);
gtk_toolbar_append_widget
(
tools
,
tools_open_object
,
"Open selected object"
,
""
);
// Ordinary edit mode button
GtkWidget
*
tools_reset_mode
=
image_button
(
"$pwr_exe/ge_reset.png"
);
g_signal_connect
(
tools_reset_mode
,
"clicked"
,
G_CALLBACK
(
activate_reset_mode
),
this
);
gtk_toolbar_append_widget
(
tools2
,
tools_reset_mode
,
"Mode reset"
,
""
);
// Scale button
GtkWidget
*
tools_scale
=
image_button
(
"$pwr_exe/ge_scale.png"
);
g_signal_connect
(
tools_scale
,
"clicked"
,
G_CALLBACK
(
activate_scale
),
this
);
...
...
@@ -2648,18 +2666,23 @@ GeGtk::GeGtk( void *x_parent_ctx,
// Text font options menu
GtkWidget
*
tools_textfont_1
=
gtk_image_menu_item_new_with_label
(
"Helvetica"
);
set_widget_font
(
gtk_bin_get_child
(
GTK_BIN
(
tools_textfont_1
)),
"Helvetica"
);
g_signal_connect
(
tools_textfont_1
,
"activate"
,
G_CALLBACK
(
activate_textfont_1
),
this
);
GtkWidget
*
tools_textfont_2
=
gtk_image_menu_item_new_with_label
(
"Times"
);
set_widget_font
(
gtk_bin_get_child
(
GTK_BIN
(
tools_textfont_2
)),
"Times"
);
g_signal_connect
(
tools_textfont_2
,
"activate"
,
G_CALLBACK
(
activate_textfont_2
),
this
);
GtkWidget
*
tools_textfont_3
=
gtk_image_menu_item_new_with_label
(
"New Century Schoolbook"
);
set_widget_font
(
gtk_bin_get_child
(
GTK_BIN
(
tools_textfont_3
)),
"New Century Schoolbook"
);
g_signal_connect
(
tools_textfont_3
,
"activate"
,
G_CALLBACK
(
activate_textfont_3
),
this
);
GtkWidget
*
tools_textfont_4
=
gtk_image_menu_item_new_with_label
(
"Courier"
);
set_widget_font
(
gtk_bin_get_child
(
GTK_BIN
(
tools_textfont_4
)),
"Courier"
);
g_signal_connect
(
tools_textfont_4
,
"activate"
,
G_CALLBACK
(
activate_textfont_4
),
this
);
GtkWidget
*
tools_textfont_5
=
gtk_image_menu_item_new_with_label
(
"Lucida Sans"
);
set_widget_font
(
gtk_bin_get_child
(
GTK_BIN
(
tools_textfont_5
)),
"Lucida Sans"
);
g_signal_connect
(
tools_textfont_5
,
"activate"
,
G_CALLBACK
(
activate_textfont_5
),
this
);
GtkMenu
*
textfont_menu
=
(
GtkMenu
*
)
g_object_new
(
GTK_TYPE_MENU
,
NULL
);
...
...
xtt/lib/ge/gtk/ge_gtk.h
View file @
f9b03929
...
...
@@ -236,6 +236,7 @@ class GeGtk : public Ge {
static
void
activate_gradient_radlowerleft
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_gradient_radupperright
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_gradient_radlowerright
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_reset_mode
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_scale
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_scale_double
(
GtkWidget
*
w
,
gpointer
gectx
);
static
void
activate_scale_half
(
GtkWidget
*
w
,
gpointer
gectx
);
...
...
xtt/lib/ge/src/ge.cpp
View file @
f9b03929
...
...
@@ -1539,6 +1539,12 @@ void Ge::activate_subgraphs()
subgraphs_new
();
}
void
Ge
::
activate_reset_mode
()
{
graph
->
reset_mode
(
false
,
false
);
status_msg
(
this
,
0
,
0
);
}
void
Ge
::
activate_rect
(
bool
keep
)
{
graph
->
set_mode
(
grow_eMode_Rect
,
keep
);
...
...
xtt/lib/ge/src/ge.h
View file @
f9b03929
...
...
@@ -218,6 +218,7 @@ class Ge {
void
activate_graph_attr
();
void
activate_open
();
void
activate_subgraphs
();
void
activate_reset_mode
();
void
activate_rect
(
bool
keep
);
void
activate_rectrounded
(
bool
keep
);
void
activate_line
(
bool
keep
);
...
...
xtt/lib/ge/src/ge_graph.cpp
View file @
f9b03929
...
...
@@ -2238,6 +2238,33 @@ int Graph::edit_graph_attributes()
was_subgraph
=
is_subgraph
();
return
1
;
}
void
Graph
::
reset_mode
(
bool
select_clear
,
bool
keep
)
{
if
(
grow_Mode
(
grow
->
ctx
)
==
grow_eMode_PolyLine
&&
current_polyline
)
{
if
(
fill
)
grow_SetObjectFill
(
current_polyline
,
1
);
if
(
shadow
)
grow_SetObjectShadow
(
current_polyline
,
1
);
journal_store
(
journal_eAction_CreateObject
,
current_polyline
);
}
else
if
(
grow_Mode
(
grow
->
ctx
)
==
grow_eMode_EditPolyLine
||
grow_Mode
(
grow
->
ctx
)
==
grow_eMode_Scale
)
{
journal_store
(
journal_eAction_PostPropertiesSelect
,
0
);
}
grow_PolylineEnd
(
grow
->
ctx
);
current_polyline
=
0
;
grow_SetMode
(
grow
->
ctx
,
grow_eMode_Edit
);
grow_EnableHighlight
(
grow
->
ctx
);
// grow_SelectClear( grow->ctx);
grow_SetMoveRestrictions
(
grow
->
ctx
,
glow_eMoveRestriction_No
,
0
,
0
,
NULL
);
grow_SetScaleEqual
(
grow
->
ctx
,
0
);
keep_mode
=
keep
;
if
(
select_clear
)
grow_SelectClear
(
grow
->
ctx
);
}
//
// Callbacks from grow
//
...
...
@@ -2464,27 +2491,8 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
break
;
}
case
glow_eEvent_MB3Click
:
if
(
grow_Mode
(
graph
->
grow
->
ctx
)
==
grow_eMode_PolyLine
&&
graph
->
current_polyline
)
{
if
(
graph
->
fill
)
grow_SetObjectFill
(
graph
->
current_polyline
,
1
);
if
(
graph
->
shadow
)
grow_SetObjectShadow
(
graph
->
current_polyline
,
1
);
graph
->
journal_store
(
journal_eAction_CreateObject
,
graph
->
current_polyline
);
}
else
if
(
grow_Mode
(
graph
->
grow
->
ctx
)
==
grow_eMode_EditPolyLine
||
grow_Mode
(
graph
->
grow
->
ctx
)
==
grow_eMode_Scale
)
{
graph
->
journal_store
(
journal_eAction_PostPropertiesSelect
,
0
);
}
graph
->
reset_mode
(
true
,
false
);
grow_PolylineEnd
(
graph
->
grow
->
ctx
);
graph
->
current_polyline
=
0
;
grow_SetMode
(
graph
->
grow
->
ctx
,
grow_eMode_Edit
);
grow_EnableHighlight
(
graph
->
grow
->
ctx
);
grow_SelectClear
(
graph
->
grow
->
ctx
);
grow_SetMoveRestrictions
(
graph
->
grow
->
ctx
,
glow_eMoveRestriction_No
,
0
,
0
,
NULL
);
grow_SetScaleEqual
(
graph
->
grow
->
ctx
,
0
);
graph
->
keep_mode
=
false
;
if
(
graph
->
cursor_motion_cb
)
(
graph
->
cursor_motion_cb
)
(
graph
->
parent_ctx
,
event
->
any
.
x
,
event
->
any
.
y
);
...
...
xtt/lib/ge/src/ge_graph.h
View file @
f9b03929
...
...
@@ -833,6 +833,11 @@ class Graph {
/*! /return Always 1 */
int
edit_graph_attributes
();
//! Reset mode.
/*! \param reset_clear Clear selection. */
/*! \param keep Do not reset the edit mode when an object is created */
void
reset_mode
(
bool
reset_clear
,
bool
keep
);
//! Clear the graph.
/*! Remove all objects and reset the graph. */
void
clear_all
();
...
...
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