Wx-Demo

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.22  Mon Mar 31 2014
    - compatibility with Wx 0.9923 and wxWidgets 3.0.0

0.21  Mon Apr 22 2013
    - Added wxCommandLinkButton demo
    - Fixes as per rt#84591

0.20  Wed Apr 03 2013
    - Added wxFontEnumerator demo
    - demostrate switching off Ubuntu scrollbar overlay

0.19  Tue Oct 02 2012
    - Updated for wxRibbonControl changes in Wx 0.9912
    - Demo for wxRearrangeCtrl and friends added

0.18  Fri Aug 24 2012
    - Added Wx::TreeEvent::GetKeyEvent example

0.17  Thu May 31 2012
    - Added Wx::PrintPaperDatabase

lib/Wx/DemoModules/wxOverlay.pm  view on Meta::CPAN

( $x_size, $y_size ) = ( 1200, 1000 );

sub new {
  my $class = shift;
  my $parent = shift;
  my $this = $class->SUPER::new( $parent, -1 );
  $this->SetVirtualSize(  $x_size, $y_size  );
  $this->SetScrollRate( 1, 1 );
  $this->SetBackgroundColour( wxWHITE );
  $this->SetCursor( Wx::Cursor->new( wxCURSOR_PENCIL ) );
  $this->{overlay} = Wx::Overlay->new;
  
  EVT_MOTION( $this, \&OnMouseMove );
  EVT_LEFT_DOWN( $this, \&OnButton );
  EVT_LEFT_UP( $this, \&OnButton );
  EVT_PAINT( $this, \&OnPaint );
  return $this;
}

my ($usegctx, $usegcdc);
if(defined(&Wx::GraphicsContext::Create)) {

lib/Wx/DemoModules/wxOverlay.pm  view on Meta::CPAN

  }
}

sub OnMouseMove {
  my( $this, $event ) = @_;

  return unless $event->Dragging;
  return unless($this->{START_POINT});
  
  my $dc = Wx::ClientDC->new( $this );
  my $overlaydc = Wx::DCOverlay->new($this->{overlay}, $dc);
  $overlaydc->Clear;
  
  $this->PrepareDC( $dc ); # as this is a ScrolledWindow
  
  my $pen   = Wx::Pen->new( wxBLACK, 1, wxSHORT_DASH );
  my $brush = wxTRANSPARENT_BRUSH;
  #my $font  = Wx::SystemSettings::GetFont( wxSYS_SYSTEM_FONT );
  
  $dc->SetPen( $pen );
  $dc->SetBrush ( $brush );
  #$dc->SetFont( $font );

lib/Wx/DemoModules/wxOverlay.pm  view on Meta::CPAN

      my ($clipx, $clipy) = $this->CalcScrolledPosition($rec->x - $penwidth, $rec->y - $penwidth);
    
      my $clip = Wx::Rect->new(
        $clipx, $clipy, $rec->width + $penwidth + 1, $rec->height + $penwidth + 1
      );
    
      $this->Refresh(1, $clip ); # rewdraws the necessary part of underlying window
    }
    
    $this->ReleaseMouse();
    $this->{overlay}->Reset; # drops internally held pointers/refs
    
  } elsif( $event->LeftDown) {
    $this->{START_POINT} = [ $x, $y ];
    $this->CaptureMouse();
  }

}

eval { my $olay = Wx::Overlay->new; };
( $@ ) ? 0 : 1;



( run in 0.880 second using v1.01-cache-2.11-cpan-3b35f9de6a3 )