App-Chart

 view release on metacpan or  search on metacpan

lib/App/Chart/Gtk2/RawDialog.pm  view on Meta::CPAN

# Copyright 2007, 2008, 2009, 2010, 2011, 2013, 2014 Kevin Ryde

# This file is part of Chart.
#
# Chart 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, or (at your option) any later version.
#
# Chart 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 Chart.  If not, see <http://www.gnu.org/licenses/>.

package App::Chart::Gtk2::RawDialog;
use 5.010;
use strict;
use warnings;
use Gtk2 1.220;
use Locale::TextDomain 1.18;
use Locale::TextDomain 'App-Chart';
use List::Util qw(min max);

use Gtk2::Ex::Datasheet::DBI;
use Gtk2::Ex::WidgetCursor;

use Gtk2::Ex::Units;

# hack for Gtk2::Ex::Datasheet::DBI 2.1
{ package Gtk2::Ex::Datasheet::DBI::CellRendererText;
  sub GET_SIZE {
    my ($self, $widget, $cell_area) = @_;
    return $self->SUPER::GET_SIZE ($widget, $cell_area);
  }
}

use App::Chart::Gtk2::Ex::NotebookLazyPages;
use App::Chart::Gtk2::GUI;
use App::Chart::Intraday;
use App::Chart::Gtk2::SeriesTreeView;
use App::Chart::Gtk2::RawLatest;
use App::Chart::Gtk2::RawInfo;

# uncomment this to run the ### lines
#use Smart::Comments;


use Glib::Object::Subclass
  'Gtk2::Dialog',
  properties => [Glib::ParamSpec->string
                 ('symbol',
                   __('Symbol'),
                  'The symbol to display.',
                  '', # default
                  Glib::G_PARAM_READWRITE),];


use constant { RESPONSE_INSERT  => 0,
               RESPONSE_DELETE  => 1,
               RESPONSE_APPLY   => 2,
               RESPONSE_UNDO    => 3,
               RESPONSE_REFRESH => 4,
             };

# sub _do_edited {
#   my ($cell, $pathstr, $newstr, $self) = @_;
#   my $path = Gtk2::TreePath->new_from_string ($pathstr);
#   my $model = $self->{'model'};
#   my $treeview = $self->{'treeview'};
#   my $iter = $model->get_iter ($path);
#   my ($treepath, $treeviewcolumn) = $treeview->get_cursor;
#   my $col = $treeviewcolumn->{'model_col'};
#   $model->set_value ($iter, $col, $newstr);
# }

# sub _do_data_changed {
#   my ($self, $symbol_hash) = @_;
#   my $symbol = $self->{'symbol'};
#   if (List::Util::first {$_ eq $symbol} @symbol_list) {
#     $self->refresh;
#   }
# }

sub INIT_INSTANCE {
  my ($self) = @_;
  $self->set_title (__('Chart: RawDialog'));
  $self->{'symbol'} = ''; # default

  #   App::Chart::chart_dirbroadcast()->connect_for_object ('data-changed',
  #                                          \&_do_data_changed, $self);

  $self->add_buttons ('gtk-add'     => RESPONSE_INSERT,
                      'gtk-delete'  => RESPONSE_DELETE,



( run in 0.517 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )