App-Chart

 view release on metacpan or  search on metacpan

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

# Copyright 2008, 2009, 2010, 2011, 2012 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/>.


# gravity up,down,centre
# stick to start/end if already there
# which of upper/lower to grow
# set_page_range wait until first size_allocate to decide vpp,ppv
# choice keep vpp same and expand page, or keep page and adjust vpp
# integer ppv



package App::Chart::Gtk2::AdjScale;
use 5.008;
use strict;
use warnings;
use Glib::Ex::FreezeNotify;
use Glib::Ex::SignalIds;
use Gtk2;
use Gtk2::Ex::AdjustmentBits 47; # v.47 for set_empty()
use POSIX ();
use Scalar::Util;

use App::Chart;
use App::Chart::Glib::Ex::MoreUtils;
use App::Chart::Glib::Ex::TieWeakNotify;

use constant DEBUG => 0;

BEGIN {
  Glib::Type->register_enum ('App::Chart::Gtk2::AdjScale::Gravity',
                             'lower',
                             'upper',
                             'centre');
}

use constant {
  DEFAULT_GRAVITY     => 'centre',
  DEFAULT_ORIENTATION => 'horizontal',
};

use Glib::Object::Subclass
  'Gtk2::Adjustment',
  signals => { },
  properties => [Glib::ParamSpec->double
                 ('pixel-per-value',
                  'pixel-per-value',
                  'Blurb',
                  0, POSIX::DBL_MAX(), 0,
                  Glib::G_PARAM_READWRITE),

                 Glib::ParamSpec->double
                 ('value-per-pixel',
                  'value-per-pixel',
                  'Blurb',
                  0, POSIX::DBL_MAX(), 0,
                  Glib::G_PARAM_READWRITE),

                 Glib::ParamSpec->double
                 ('page-increment-fraction',
                  'page-increment-fraction',
                  'Blurb',
                  0, POSIX::DBL_MAX(), 0.85,
                  Glib::G_PARAM_READWRITE),
                 Glib::ParamSpec->double
                 ('step-increment-fraction',
                  'step-increment-fraction',



( run in 0.797 second using v1.01-cache-2.11-cpan-39bf76dae61 )