Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Csuper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Dalan94
Csuper
Commits
207d59b7
Verified
Commit
207d59b7
authored
Aug 22, 2017
by
Rémi BERTHO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge statistics and charts windows
parent
ea22e6d8
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1441 additions
and
1066 deletions
+1441
-1066
.gitignore
.gitignore
+2
-0
CodeBlocks/csuper-gtk.cbp
CodeBlocks/csuper-gtk.cbp
+10
-4
Codelite/csuper-gtk.project
Codelite/csuper-gtk.project
+10
-4
QtCreator/csuper-cli.pro
QtCreator/csuper-cli.pro
+0
-34
QtCreator/csuper-gtk.pro
QtCreator/csuper-gtk.pro
+0
-80
QtCreator/csuper.pro
QtCreator/csuper.pro
+0
-71
Sources/csuper-gtk/chart_grid.cpp
Sources/csuper-gtk/chart_grid.cpp
+46
-59
Sources/csuper-gtk/chart_grid.h
Sources/csuper-gtk/chart_grid.h
+43
-37
Sources/csuper-gtk/chart_points_grid.cpp
Sources/csuper-gtk/chart_points_grid.cpp
+68
-0
Sources/csuper-gtk/chart_points_grid.h
Sources/csuper-gtk/chart_points_grid.h
+71
-0
Sources/csuper-gtk/chart_total_points_grid.cpp
Sources/csuper-gtk/chart_total_points_grid.cpp
+66
-0
Sources/csuper-gtk/chart_total_points_grid.h
Sources/csuper-gtk/chart_total_points_grid.h
+70
-0
Sources/csuper-gtk/csu_application.cpp
Sources/csuper-gtk/csu_application.cpp
+17
-12
Sources/csuper-gtk/csu_application.h
Sources/csuper-gtk/csu_application.h
+33
-11
Sources/csuper-gtk/display_dialog.cpp
Sources/csuper-gtk/display_dialog.cpp
+73
-0
Sources/csuper-gtk/display_dialog.h
Sources/csuper-gtk/display_dialog.h
+90
-0
Sources/csuper-gtk/menu_display.cpp
Sources/csuper-gtk/menu_display.cpp
+8
-16
Sources/csuper-gtk/menu_display.h
Sources/csuper-gtk/menu_display.h
+0
-10
Sources/csuper-gtk/statistics_grid.cpp
Sources/csuper-gtk/statistics_grid.cpp
+39
-45
Sources/csuper-gtk/statistics_grid.h
Sources/csuper-gtk/statistics_grid.h
+15
-16
TODO.md
TODO.md
+1
-1
Translations/csuper-cli/messages.pot
Translations/csuper-cli/messages.pot
+1
-1
Translations/csuper-gtk/fr.po
Translations/csuper-gtk/fr.po
+217
-201
Translations/csuper-gtk/messages.pot
Translations/csuper-gtk/messages.pot
+214
-198
Translations/libcsuper/messages.pot
Translations/libcsuper/messages.pot
+1
-1
UI/csuper-gtk.glade
UI/csuper-gtk.glade
+346
-265
No files found.
.gitignore
View file @
207d59b7
...
...
@@ -44,5 +44,7 @@ Codelite/.build-debug_windows
Codelite/.build-release_windows
Codelite/.codelite
build
.kdev4
*.kdev4
.vs
.vscode
CodeBlocks/csuper-gtk.cbp
View file @
207d59b7
...
...
@@ -186,8 +186,12 @@
<Unit
filename=
"../Sources/csuper-gtk/about.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/change_distributor_dialog.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/change_distributor_dialog.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_dialog.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_dialog.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_grid.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_grid.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_points_grid.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_points_grid.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_total_points_grid.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/chart_total_points_grid.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/config.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/csu_application.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/csu_application.h"
/>
...
...
@@ -195,6 +199,8 @@
<Unit
filename=
"../Sources/csuper-gtk/csu_widget.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/delete_turn_dialog.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/delete_turn_dialog.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/display_dialog.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/display_dialog.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/display_preferences.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/display_preferences.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/edit_turn_dialog.cpp"
/>
...
...
@@ -251,8 +257,8 @@
</Unit>
<Unit
filename=
"../Sources/csuper-gtk/save_dialog.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/save_dialog.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/statistics_
dialog
.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/statistics_
dialog
.h"
/>
<Unit
filename=
"../Sources/csuper-gtk/statistics_
grid
.cpp"
/>
<Unit
filename=
"../Sources/csuper-gtk/statistics_
grid
.h"
/>
<Extensions>
<code_completion
/>
<debugger
/>
...
...
Codelite/csuper-gtk.project
View file @
207d59b7
...
...
@@ -49,7 +49,6 @@
<VirtualDirectory
Name=
"src"
>
<File
Name=
"../Sources/csuper-gtk/about.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/change_distributor_dialog.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/chart_dialog.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/csu_application.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/csu_widget.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/delete_turn_dialog.cpp"
/>
...
...
@@ -77,8 +76,12 @@
<File
Name=
"../Sources/csuper-gtk/preferences_window.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/ranking_view.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/save_dialog.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/statistics_dialog.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/html_preferences.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/display_dialog.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/statistics_grid.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/chart_grid.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/chart_total_points_grid.cpp"
/>
<File
Name=
"../Sources/csuper-gtk/chart_points_grid.cpp"
/>
</VirtualDirectory>
<VirtualDirectory
Name=
"include"
>
<File
Name=
"../Sources/csuper-gtk/change_distributor_dialog.h"
/>
...
...
@@ -88,7 +91,6 @@
<File
Name=
"../Sources/csuper-gtk/game_configuration_window.h"
/>
<File
Name=
"../Sources/csuper-gtk/new_file_assistant_page_2.h"
/>
<File
Name=
"../Sources/csuper-gtk/new_file_assistant_page_3.h"
/>
<File
Name=
"../Sources/csuper-gtk/statistics_dialog.h"
/>
<File
Name=
"../Sources/csuper-gtk/game_information_view.h"
/>
<File
Name=
"../Sources/csuper-gtk/game_over_dialog.h"
/>
<File
Name=
"../Sources/csuper-gtk/ranking_view.h"
/>
...
...
@@ -110,9 +112,13 @@
<File
Name=
"../Sources/csuper-gtk/exportation_preferences.h"
/>
<File
Name=
"../Sources/csuper-gtk/menu_edit.h"
/>
<File
Name=
"../Sources/csuper-gtk/display_preferences.h"
/>
<File
Name=
"../Sources/csuper-gtk/chart_dialog.h"
/>
<File
Name=
"../Sources/csuper-gtk/config.h"
/>
<File
Name=
"../Sources/csuper-gtk/html_preferences.h"
/>
<File
Name=
"../Sources/csuper-gtk/display_dialog.h"
/>
<File
Name=
"../Sources/csuper-gtk/statistics_grid.h"
/>
<File
Name=
"../Sources/csuper-gtk/chart_grid.h"
/>
<File
Name=
"../Sources/csuper-gtk/chart_total_points_grid.h"
/>
<File
Name=
"../Sources/csuper-gtk/chart_points_grid.h"
/>
</VirtualDirectory>
<Settings
Type=
"Executable"
>
<GlobalSettings>
...
...
QtCreator/csuper-cli.pro
deleted
100644 → 0
View file @
ea22e6d8
TEMPLATE
=
app
CONFIG
+=
console
c
++
14
CONFIG
-=
app_bundle
CONFIG
-=
qt
SOURCES
+=
\
..
/
Sources
/
csuper
-
cli
/
cin
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
command_line_option
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
game_cli
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
main
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
menu
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
play_game
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
share
.
cpp
\
..
/
Sources
/
csuper
-
cli
/
text_style
.
cpp
HEADERS
+=
\
..
/
Sources
/
csuper
-
cli
/
cin
.
h
\
..
/
Sources
/
csuper
-
cli
/
command_line_option
.
h
\
..
/
Sources
/
csuper
-
cli
/
game_cli
.
h
\
..
/
Sources
/
csuper
-
cli
/
menu
.
h
\
..
/
Sources
/
csuper
-
cli
/
play_game
.
h
\
..
/
Sources
/
csuper
-
cli
/
share
.
h
\
..
/
Sources
/
csuper
-
cli
/
text_style
.
h
LIBS
+=
-
lcsuper
-
lpodofo
-
lslope
-
L
"../.."
CONFIG
+=
link_pkgconfig
PKGCONFIG
+=
glibmm
-
2.4
cairo
giomm
-
2.4
libxml
++-
3.0
INCLUDEPATH
+=
"../../Sources"
"../../Externals_libraries/AsynchronousExecution/include"
linux
{
LIBS
+=
-
lncurses
}
QtCreator/csuper-gtk.pro
deleted
100644 → 0
View file @
ea22e6d8
TEMPLATE
=
app
CONFIG
+=
c
++
14
CONFIG
-=
app_bundle
CONFIG
-=
qt
SOURCES
+=
\
..
/
Sources
/
csuper
-
gtk
/
about
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
change_distributor_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
csu_application
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
csu_widget
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
display_preferences
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
exportation_preferences
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
file_properties_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
game_configuration_window
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
game_information_view
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
game_over_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
import_export_game_configuration_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
main
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
main_window
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
menu_display
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
menu_edit
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
menu_file
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_1
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_2
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_3
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
new_game_configuration_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
points_view
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
preferences_window
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
ranking_view
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
statistics_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
delete_turn_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
edit_turn_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
players_names_view
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
chart_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
save_dialog
.
cpp
\
..
/
Sources
/
csuper
-
gtk
/
open_dialog
.
cpp
HEADERS
+=
\
..
/
Sources
/
csuper
-
gtk
/
about
.
h
\
..
/
Sources
/
csuper
-
gtk
/
change_distributor_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
csu_application
.
h
\
..
/
Sources
/
csuper
-
gtk
/
csu_widget
.
h
\
..
/
Sources
/
csuper
-
gtk
/
display_preferences
.
h
\
..
/
Sources
/
csuper
-
gtk
/
exportation_preferences
.
h
\
..
/
Sources
/
csuper
-
gtk
/
file_properties_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
game_configuration_window
.
h
\
..
/
Sources
/
csuper
-
gtk
/
game_information_view
.
h
\
..
/
Sources
/
csuper
-
gtk
/
game_over_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
import_export_game_configuration_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
main_window
.
h
\
..
/
Sources
/
csuper
-
gtk
/
menu_display
.
h
\
..
/
Sources
/
csuper
-
gtk
/
menu_edit
.
h
\
..
/
Sources
/
csuper
-
gtk
/
menu_file
.
h
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant
.
h
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_1
.
h
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_2
.
h
\
..
/
Sources
/
csuper
-
gtk
/
new_file_assistant_page_3
.
h
\
..
/
Sources
/
csuper
-
gtk
/
new_game_configuration_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
points_view
.
h
\
..
/
Sources
/
csuper
-
gtk
/
preferences_window
.
h
\
..
/
Sources
/
csuper
-
gtk
/
ranking_view
.
h
\
..
/
Sources
/
csuper
-
gtk
/
statistics_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
delete_turn_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
edit_turn_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
players_names_view
.
h
\
..
/
Sources
/
csuper
-
gtk
/
chart_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
save_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
open_dialog
.
h
\
..
/
Sources
/
csuper
-
gtk
/
config
.
h
LIBS
+=
-
lcsuper
-
lpodofo
-
lslope
-
lmuparser
-
L
"../.."
CONFIG
+=
link_pkgconfig
PKGCONFIG
+=
glibmm
-
2.4
cairo
giomm
-
2.4
libxml
++-
3.0
gtkmm
-
3.0
INCLUDEPATH
+=
"../../Sources"
"../../Externals_libraries/AsynchronousExecution/include"
"../../Externals_libraries/Slope/src"
QtCreator/csuper.pro
deleted
100644 → 0
View file @
ea22e6d8
TEMPLATE
=
lib
CONFIG
+=
c
++
14
CONFIG
-=
app_bundle
CONFIG
-=
qt
VERSION
=
CONFIG
+=
plugin
SOURCES
+=
\
..
/
Sources
/
libcsuper
/
calculator
.
cpp
\
..
/
Sources
/
libcsuper
/
exceptions
.
cpp
\
..
/
Sources
/
libcsuper
/
game
.
cpp
\
..
/
Sources
/
libcsuper
/
game_configuration
.
cpp
\
..
/
Sources
/
libcsuper
/
list_game_configuration
.
cpp
\
..
/
Sources
/
libcsuper
/
pdf_exportation
.
cpp
\
..
/
Sources
/
libcsuper
/
player
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_chart_exportation
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_difference_between_player
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_directory
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_export_pdf
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_main_window_display
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_main_window_size
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_main_window_title_bar
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_score_display
.
cpp
\
..
/
Sources
/
libcsuper
/
preferences_version
.
cpp
\
..
/
Sources
/
libcsuper
/
share
.
cpp
\
..
/
Sources
/
libcsuper
/
undo_redo_manager
.
cpp
\
..
/
Sources
/
libcsuper
/
version
.
cpp
\
..
/
Sources
/
libcsuper
/
abstract_preference
.
cpp
\
..
/
Sources
/
libcsuper
/
exception_list
.
cpp
HEADERS
+=
\
..
/
Sources
/
libcsuper
/
calculator
.
h
\
..
/
Sources
/
libcsuper
/
config
.
h
\
..
/
Sources
/
libcsuper
/
exceptions
.
h
\
..
/
Sources
/
libcsuper
/
game
.
h
\
..
/
Sources
/
libcsuper
/
game_configuration
.
h
\
..
/
Sources
/
libcsuper
/
libcsuper
.
h
\
..
/
Sources
/
libcsuper
/
list_game_configuration
.
h
\
..
/
Sources
/
libcsuper
/
pdf_exportation
.
h
\
..
/
Sources
/
libcsuper
/
player
.
h
\
..
/
Sources
/
libcsuper
/
preferences
.
h
\
..
/
Sources
/
libcsuper
/
preferences_chart_exportation
.
h
\
..
/
Sources
/
libcsuper
/
preferences_difference_between_player
.
h
\
..
/
Sources
/
libcsuper
/
preferences_directory
.
h
\
..
/
Sources
/
libcsuper
/
preferences_export_pdf
.
h
\
..
/
Sources
/
libcsuper
/
preferences_main_window_display
.
h
\
..
/
Sources
/
libcsuper
/
preferences_main_window_size
.
h
\
..
/
Sources
/
libcsuper
/
preferences_main_window_title_bar
.
h
\
..
/
Sources
/
libcsuper
/
preferences_score_display
.
h
\
..
/
Sources
/
libcsuper
/
preferences_version
.
h
\
..
/
Sources
/
libcsuper
/
share
.
h
\
..
/
Sources
/
libcsuper
/
undo_redo_manager
.
h
\
..
/
Sources
/
libcsuper
/
version
.
h
\
..
/
Sources
/
libcsuper
/
abstract_preference
.
h
\
..
/
Sources
/
libcsuper
/
exception_list
.
h
LIBS
+=
-
lmuparser
-
lpodofo
-
lslope
-
lasynchronous_execution
-
L
"../.."
-
L
"../../Externals_libraries/AsynchronousExecution"
CONFIG
+=
link_pkgconfig
PKGCONFIG
+=
glibmm
-
2.4
libxml
++-
3.0
cairo
giomm
-
2.4
INCLUDEPATH
+=
"../../Externals_libraries/Slope/src"
"../../Externals_libraries/AsynchronousExecution/include"
linux
{
CONFIG
+=
unversioned_libname
}
windows
{
CONFIG
+=
skip_target_version_ext
}
Sources/csuper-gtk/chart_
dialog
.cpp
→
Sources/csuper-gtk/chart_
grid
.cpp
View file @
207d59b7
/*!
* \file chart_
dialog
.cpp
* \file chart_
widget
.cpp
* \author Remi BERTHO
* \date 04/12/15
* \version 4.3.0
*/
/*
* chart_
dialog
.cpp
* chart_
widget
.cpp
*
* Copyright 2014-2017 Remi BERTHO <remi.bertho@dalan.fr>
*
...
...
@@ -31,7 +31,7 @@
*/
#include "config.h"
#include "chart_
dialog
.h"
#include "chart_
grid
.h"
#include <glibmm/i18n.h>
#include "csu_application.h"
...
...
@@ -44,33 +44,17 @@ using namespace std;
//
// Constructor and destructor
//
Chart
Dialog
::
ChartDialog
(
BaseObjectType
*
cobject
,
const
RefPtr
<
Builder
>&
refGlade
)
:
CsuWidget
(),
Dialog
(
cobject
)
Chart
Grid
::
ChartGrid
(
BaseObjectType
*
cobject
,
const
RefPtr
<
Builder
>&
refGlade
)
:
CsuWidget
(),
Grid
(
cobject
)
{
refGlade
->
get_widget
(
"chart_dialog_validate_button"
,
ok_button_
);
refGlade
->
get_widget
(
"chart_dialog_main_grid"
,
main_grid_
);
refGlade
->
get_widget
(
"chart_dialog_grid"
,
chart_grid_
);
refGlade
->
get_widget
(
"chart_dialog_x_scrollbar"
,
x_scrollbar_
);
refGlade
->
get_widget
(
"chart_dialog_y_scrollbar"
,
y_scrollbar_
);
refGlade
->
get_widget
(
"chart_dialog_x_scale"
,
x_scale_
);
refGlade
->
get_widget
(
"dialog_chart_scale_y"
,
y_scale_
);
refGlade
->
get_widget
(
"chart_dialog_drawingarea"
,
chart_
);
// Signals
x_scrollbar_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartDialog
::
changeScrollbar
));
y_scrollbar_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartDialog
::
changeScrollbar
));
x_scale_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartDialog
::
changeZoom
));
y_scale_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartDialog
::
changeZoom
));
chart_
->
signal_draw
().
connect
(
mem_fun
(
*
this
,
&
ChartDialog
::
drawChart
));
ok_button_
->
set_image_from_icon_name
(
"gtk-ok"
,
ICON_SIZE_BUTTON
);
/*refGlade->get_widget("chart_widget_grid", chart_grid_);
refGlade->get_widget("chart_widget_x_scrollbar", x_scrollbar_);
refGlade->get_widget("chart_widget_y_scrollbar", y_scrollbar_);
refGlade->get_widget("chart_widget_x_scale", x_scale_);
refGlade->get_widget("widget_chart_scale_y", y_scale_);
refGlade->get_widget("chart_widget_drawingarea", chart_);*/
}
Chart
Dialog
::~
ChartDialog
()
Chart
Grid
::~
ChartGrid
()
{
freeSlope
();
}
...
...
@@ -78,7 +62,19 @@ ChartDialog::~ChartDialog()
//
// Function
//
void
ChartDialog
::
freeSlope
()
void
ChartGrid
::
init
()
{
// Signals
x_scrollbar_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartGrid
::
changeScrollbar
));
y_scrollbar_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartGrid
::
changeScrollbar
));
x_scale_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartGrid
::
changeZoom
));
y_scale_
->
signal_value_changed
().
connect
(
mem_fun
(
*
this
,
&
ChartGrid
::
changeZoom
));
chart_
->
signal_draw
().
connect
(
mem_fun
(
*
this
,
&
ChartGrid
::
drawChart
));
}
void
ChartGrid
::
freeSlope
()
{
if
(
slope_turn
!=
nullptr
)
{
...
...
@@ -112,15 +108,16 @@ void ChartDialog::freeSlope()
check_buttons_
.
clear
();
}
void
Chart
Dialog
::
launch
(
const
bool
total_points
)
void
Chart
Grid
::
update
(
const
bool
total_points
)
{
total_points_
=
total_points
;
// Dialog title
if
(
total_points
)
set_title
(
_
(
"Total points chart"
));
else
set_title
(
_
(
"Points chart"
));
if
(
players_grid_
!=
nullptr
)
{
freeSlope
();
delete
players_grid_
;
}
players_grid_
=
manage
(
new
Grid
());
// Chart name
ustring
title
=
path_get_basename
(
app
()
->
filename
());
...
...
@@ -218,13 +215,12 @@ void ChartDialog::launch(const bool total_points)
// Players grid
Grid
*
players_grid
=
manage
(
new
Grid
());
players_grid
->
set_column_spacing
(
5
);
players_grid
->
set_row_spacing
(
5
);
players_grid
->
set_margin_end
(
10
);
players_grid
->
set_margin_start
(
10
);
players_grid
->
set_margin_top
(
10
);
players_grid
->
set_margin_bottom
(
10
);
players_grid_
->
set_column_spacing
(
5
);
players_grid_
->
set_row_spacing
(
5
);
players_grid_
->
set_margin_end
(
10
);
players_grid_
->
set_margin_start
(
10
);
players_grid_
->
set_margin_top
(
10
);
players_grid_
->
set_margin_bottom
(
10
);
for
(
i
=
0
;
i
<
app
()
->
game
()
->
nbPlayer
();
i
++
)
{
...
...
@@ -232,29 +228,19 @@ void ChartDialog::launch(const bool total_points)
tmp_button
->
set_active
(
true
);
tmp_button
->
set_hexpand
(
true
);
tmp_button
->
set_halign
(
ALIGN_CENTER
);
tmp_button
->
signal_toggled
().
connect
(
mem_fun
(
*
this
,
&
Chart
Dialog
::
changePlayers
));
players_grid
->
attach
(
*
tmp_button
,
i
%
5
,
i
/
5
,
1
,
1
);
tmp_button
->
signal_toggled
().
connect
(
mem_fun
(
*
this
,
&
Chart
Grid
::
changePlayers
));
players_grid
_
->
attach
(
*
tmp_button
,
i
%
5
,
i
/
5
,
1
,
1
);
check_buttons_
.
push_back
(
tmp_button
);
}
main_grid_
->
attach
(
*
players_grid
,
0
,
1
,
1
,
1
);
players_grid
->
show_all
();
attach
(
*
players_grid_
,
0
,
1
,
1
,
1
);
players_grid
_
->
show_all
();
x_scale_
->
hide
();
y_scale_
->
hide
();
run
();
hide
();
delete
players_grid
;
freeSlope
();
// Reset the scrollbar and zoom
x_scale_
->
set_value
(
1
);
y_scale_
->
set_value
(
1
);
x_scrollbar_
->
set_value
(
0
);
y_scrollbar_
->
set_value
(
0
);
}
void
Chart
Dialog
::
changePlayers
()
void
Chart
Grid
::
changePlayers
()
{
for
(
unsigned
int
i
=
0
;
i
<
app
()
->
game
()
->
nbPlayer
();
i
++
)
slope_item_set_visible
(
slope_items
[
i
],
check_buttons_
[
i
]
->
get_active
());
...
...
@@ -262,12 +248,12 @@ void ChartDialog::changePlayers()
chart_
->
queue_draw
();
}
void
Chart
Dialog
::
changeZoom
()
void
Chart
Grid
::
changeZoom
()
{
changeScrollbar
();
}
void
Chart
Dialog
::
changeScrollbar
()
void
Chart
Grid
::
changeScrollbar
()
{
// Set the scrollbar
/*double zoom_x = x_scale_->get_value();
...
...
@@ -307,10 +293,11 @@ void ChartDialog::changeScrollbar()
slope_figure_update(slope_chart);
slope_figure_track_region(slope_chart,x1,y1,x2,y2);*/
chart_
->
queue_draw
();
}
bool
Chart
Dialog
::
drawChart
(
const
Cairo
::
RefPtr
<
Cairo
::
Context
>&
cr
)
bool
Chart
Grid
::
drawChart
(
const
Cairo
::
RefPtr
<
Cairo
::
Context
>&
cr
)
{
// Draw
double
chart_width
,
chart_height
;
...
...
Sources/csuper-gtk/chart_
dialog
.h
→
Sources/csuper-gtk/chart_
grid
.h
View file @
207d59b7
/*!
* \file chart_
dialog
.h
* \file chart_
widget
.h
* \author Remi BERTHO
* \date 04/12/15
* \version 4.3.0
*/
/*
* chart_
dialog
.h
* chart_
widget
.h
*
* Copyright 2014-2017 Remi BERTHO <remi.bertho@dalan.fr>
*
...
...
@@ -30,29 +30,30 @@
*
*/
#ifndef CHART_
DIALOG
_H_INCLUDED
#define CHART_
DIALOG
_H_INCLUDED
#ifndef CHART_
GRID
_H_INCLUDED
#define CHART_
GRID
_H_INCLUDED
#include <gtkmm.h>
#include <slope/slope.h>
#include "csu_widget.h"
/*! \class Chart
Dialog
* \brief This class represent the chart
dialog
/*! \class Chart
Widget
* \brief This class represent the chart
widget
*/
class
Chart
Dialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
class
Chart
Grid
:
public
CsuWidget
,
public
Gtk
::
Grid
{
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Attributes ////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
protected:
Gtk
::
Button
*
ok_button_
;
/*!< The OK button */
Gtk
::
Grid
*
main_grid_
;
/*!< The main grid */
Gtk
::
Grid
*
chart_grid_
;
/*!< The chart grid */
Gtk
::
Scrollbar
*
x_scrollbar_
;
/*!< The x scrollbar */
Gtk
::
Scrollbar
*
y_scrollbar_
;
/*!< The y scrollbar */
Gtk
::
Scale
*
x_scale_
;
/*!< The x scale */
Gtk
::
Scale
*
y_scale_
;
/*!< The y scale */
Gtk
::
DrawingArea
*
chart_
;
/*!< The chart */
Gtk
::
Grid
*
chart_grid_
;
/*!< The chart grid */
Gtk
::
Scrollbar
*
x_scrollbar_
;
/*!< The x scrollbar */
Gtk
::
Scrollbar
*
y_scrollbar_
;
/*!< The y scrollbar */
Gtk
::
Scale
*
x_scale_
;
/*!< The x scale */
Gtk
::
Scale
*
y_scale_
;
/*!< The y scale */
Gtk
::
DrawingArea
*
chart_
;
/*!< The chart */
Gtk
::
Grid
*
players_grid_
=
nullptr
;
/*!< The player grid */
bool
total_points_
;
/*!< True if we draw total points, false otherwise */
slope_figure_t
*
slope_chart
=
nullptr
;
/*!< The slope figure */
...
...
@@ -63,9 +64,29 @@ protected:
std
::
vector
<
Gtk
::
CheckButton
*>
check_buttons_
;
/*!< The check buttons */
//
// Functions
//
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Constructor ///////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
protected:
/*!
* \brief Constructor with builder
* \param cobject the C object
* \param refGlade the builder
*/
ChartGrid
(
BaseObjectType
*
cobject
,
const
Glib
::
RefPtr
<
Gtk
::
Builder
>&
refGlade
);
virtual
~
ChartGrid
();
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Function //////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
protected:
/*!
* \brief Init the objects
*/
void
init
();
/*!
* \brief Called when the zoom change
*/
...
...
@@ -91,26 +112,11 @@ protected:
*/
void
freeSlope
();
public:
//
// Constructor and Destructor
//
/*!
* \brief Constructor with builder
* \param cobject the C object
* \param refGlade the builder
*/
ChartDialog
(
BaseObjectType
*
cobject
,
const
Glib
::
RefPtr
<
Gtk
::
Builder
>&
refGlade
);
~
ChartDialog
();
/*!
* \brief Show the
dialog
properties
* \brief Show the
widget
properties
* \param total_points set to true if we draw total points, false otherwise
*/
void
launch
(
const
bool
total_points
);
void
update
(
const
bool
total_points
);
};
#endif // CHART_
DIALOG
_H_INCLUDED
#endif // CHART_
GRID
_H_INCLUDED
Sources/csuper-gtk/chart_points_grid.cpp
0 → 100644
View file @
207d59b7
/*!
* \file chart_points_widget.cpp
* \author Remi BERTHO
* \date 04/12/15
* \version 4.3.0
*/
/*
* chart_points_widget.cpp
*
* Copyright 2014-2017 Remi BERTHO <remi.bertho@dalan.fr>
*
* This file is part of Csuper-gtk.
*
* Csuper-gtk 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 3 of the License, or
* (at your option) any later version.
*
* Csuper-gtk 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#include "config.h"
#include "chart_points_grid.h"
#include <glibmm/i18n.h>
#include "csu_application.h"