Commit 207d59b7 authored by Rémi BERTHO's avatar Rémi BERTHO

Merge statistics and charts windows

parent ea22e6d8
......@@ -44,5 +44,7 @@ Codelite/.build-debug_windows
Codelite/.build-release_windows
Codelite/.codelite
build
.kdev4
*.kdev4
.vs
.vscode
......@@ -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 />
......
......@@ -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>
......
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
}
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"
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
}
/*!
* \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
//
ChartDialog::ChartDialog(BaseObjectType* cobject, const RefPtr<Builder>& refGlade) : CsuWidget(), Dialog(cobject)
ChartGrid::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_);*/
}
ChartDialog::~ChartDialog()
ChartGrid::~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 ChartDialog::launch(const bool total_points)
void ChartGrid::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, &ChartDialog::changePlayers));
players_grid->attach(*tmp_button, i % 5, i / 5, 1, 1);
tmp_button->signal_toggled().connect(mem_fun(*this, &ChartGrid::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 ChartDialog::changePlayers()
void ChartGrid::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 ChartDialog::changeZoom()
void ChartGrid::changeZoom()
{
changeScrollbar();
}
void ChartDialog::changeScrollbar()
void ChartGrid::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 ChartDialog::drawChart(const Cairo::RefPtr<Cairo::Context>& cr)
bool ChartGrid::drawChart(const Cairo::RefPtr<Cairo::Context>& cr)
{
// Draw
double chart_width, chart_height;
......
/*!
* \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 ChartDialog
* \brief This class represent the chart dialog
/*! \class ChartWidget
* \brief This class represent the chart widget
*/
class ChartDialog : public CsuWidget, public Gtk::Dialog
class ChartGrid : 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
/*!
* \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"
using namespace Gtk;
using namespace Glib;
using namespace csuper;
using namespace std;
//
// Constructor and destructor
//
ChartPointsGrid::ChartPointsGrid(BaseObjectType* cobject, const RefPtr<Builder>& refGlade) : ChartGrid(cobject, refGlade)
{
refGlade->get_widget("display_dialog_points_chart_grid", chart_grid_);
refGlade->get_widget("display_dialog_points_chart_x_scrollbar", x_scrollbar_);
refGlade->get_widget("display_dialog_points_chart_y_scrollbar", y_scrollbar_);
refGlade->get_widget("display_dialog_points_chart_x_scale", x_scale_);
refGlade->get_widget("display_dialog_points_chart_y_scale", y_scale_);
refGlade->get_widget("display_dialog_points_chart_drawingarea", chart_);
init();
}
ChartPointsGrid::~ChartPointsGrid()
{
}
void ChartPointsGrid::update()
{
ChartGrid::update(false);
}
/*!
* \file chart_points_widget.h
* \author Remi BERTHO
* \date 04/12/15
* \version 4.3.0
*/
/*
* chart_points_widget.h
*
* 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.
*
*
*/
#ifndef CHART_POINTS_GRID_H_INCLUDED
#define CHART_POINTS_GRID_H_INCLUDED
#include <gtkmm.h>
#include <slope/slope.h>
#include "chart_grid.h"
/*! \class ChartPointsGrid
* \brief This class represent the chart widget
*/
class ChartPointsGrid : public ChartGrid
{
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Constructor ///////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
public:
/*!
* \brief Constructor with builder
* \param cobject the C object
* \param refGlade the builder
*/
ChartPointsGrid(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refGlade);
~ChartPointsGrid();
///////////////////////////////////////////////////////////////////////////////////