App-PLab

 view release on metacpan or  search on metacpan

bin/ManCen  view on Meta::CPAN

      $mc-> line( 0, $c2y, $c2x - 2, $c2y);
      $mc-> line( $c2x + 2, $c2y, $cx - 1, $c2y);
      $mc-> line( $c2x, 0, $c2x, $c2y - 2);
      $mc-> line( $c2x, $c2y + 2, $c2x, $cy - 1);
   }
   $mc-> end_paint;
   my $icx = Prima::Icon-> create;
   $icx-> combine( $ic, $mc);
   $w-> IV-> set(
      pointerIcon    => $icx,
      pointerHotSpot => [$c2x, $c2y],
      pointerType    => cr::User,
   );
}

# WIN_END
# OPT

sub opt_colormount
{
   my $w = $_[0];
   $w-> win_pointerchanged;
   $w-> ToolBar-> PointRef-> color( $w-> {ini}-> {Color_Label});
   $w-> ToolBar-> Lookup-> color( $w-> {ini}-> {Color_Label});
}

sub opt_colors
{
    return {
       'Points'      => [ cl::LightGreen, 'Points'],
       'ExtraPoints' => [ cl::LightRed,   'Crosses'],
       'Pointer'     => [ cl::Black,      'Cursor and selection'],
       'Label'       => [ cl::Black,      'Label'],
    }
}

sub opt_keys
{
   return {
      %{$_[0]-> SUPER::opt_keys()},
      EditClearPoints  => [ kb::NoKey,      'Remove all points'],
      EditToggleLookup => [ kb::Space,      'Turn on or off neighbour points lookup'],
      HelpAbout        => [ kb::NoKey,      'Standard about box'],
      HelpPlabApps     => [ kb::NoKey,      'Online PlabApps overview'],
      HelpContents     => [ kb::NoKey,      'Online ManCen overview'],
   }   
}

sub opt_propcreate
{
   my ( $w, $dlg, $nb, $nbpages) = @_;
   $w-> SUPER::opt_propcreate( $dlg, $nb, $nbpages);
   my $mh = 0;
   for ( $nbpages-> widgets_from_page(1)) {
      my $y = $_-> top;
      $mh = $y if $mh < $y;
   }
   $nb-> insert_to_page( 1, CheckBox =>
       origin => [ 10,  $mh + 10],
       size   => [ 300, 36],
       text   => 'Default ~cursor shape',
       name   => 'CursorShape',
       hint   => 'Uses system default cursor instead of crosshair',
   );
   $nb-> insert_to_page( 0, [ CheckBox =>
       origin => [ 10, 170],
       size   => [ 300, 36],
       text   => 'Look .cen ~forward',
       name   => 'ForwardLookup',
       hint   => "Looks one step back or forward.\n See also at the arrow indicator into right upper corner",
   ] , [ CheckBox =>
       origin => [ 10, 130],
       size   => [ 300, 36],
       text   => '~Display neighbour .cen',
       name   => 'LookupEnabled',
       hint   => 'Draws next or previous data points with crosses',
   ]);
}

sub opt_proppush
{
   my ( $w, $dlg, $nb, $nbpages) = @_;
   $w-> SUPER::opt_proppush( $dlg, $nb, $nbpages);
   $nbpages-> CursorShape-> checked( $w->{ini}->{StdPointerShape});
   $nbpages-> ForwardLookup-> checked( $w->{ini}->{forwardLookup});
   $nbpages-> LookupEnabled-> checked( $w->{ini}->{lookupEnabled});
}

sub opt_proppop
{
   my ( $w, $dlg, $nb, $nbpages, $mr) = @_;
   $w-> SUPER::opt_proppop( $dlg, $nb, $nbpages, $mr);
   if ( $mr) {
      $w->{ini}->{StdPointerShape} = $nbpages-> CursorShape-> checked;
      $w-> win_pointerchanged;
      my $newlookup = $nbpages-> ForwardLookup-> checked;
      if ( $newlookup != $w->{ini}->{forwardLookup}) {
         $w->{ini}->{forwardLookup} = $newlookup;
         $w-> ToolBar-> Lookup-> repaint;
         if ( $w->{file}) {
            $w-> win_closeextras;
            $w-> win_newextras;
            $w-> win_extraschanged;
         }
      }
      $w->{ini}->{lookupEnabled} = $nbpages-> LookupEnabled-> checked;
      $w-> IV-> repaint;
   }
}

# OPT_END
# RPT

sub rpt_read
{
   my ( $w, $fh) = @_;
   my @pts = ();
   while ( <$fh>) {
      chomp;
      next if /^\s*\#/;
      next if /^\s*$/;
      my @p = split( ' ', $_);
      next if @p < 4 || $p[0] !~ /^\d+$/ || $p[1] !~ /^\d+$/;



( run in 1.225 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )