Source

Kephra / lib / pb.pl

#!usr/bin/perl
use v5.12;
use warnings;

package PaintBar;
use base qw(Wx::App);
use Wx::STC;
use Wx::DND;
#use Wx::Scintilla;

sub OnInit {
	my $app   = shift;
	my $frame = Wx::Frame->new( undef, -1, __PACKAGE__);
	my $panel = Canvas->new($frame);

	$frame->Show(1);
	$app->SetTopWindow($frame);             # Fenster als oberstes bestimmen
	1;
}


package Canvas;
our @ISA = 'Wx::ScrolledWindow';

sub new {
	my $class = shift;
	my $parent = shift;
	my $this = $class->SUPER::new( $parent, -1 );
	return $this;
	1;
}

sub SIZE   { 1000 }

sub OnDraw {
	my( $this, $dc ) = @_;

	$dc->SetPen( &Wx::wxBLACK_PEN );
	for ( 0 .. 10 ) {
		$dc->DrawLine( 0, $_ * 100, SIZE, $_ * 100 );
		$dc->DrawLine( $_ * 100, 0, $_ * 100, SIZE );
	}

	$dc->SetPen( &Wx::wxTRANSPARENT_PEN );
	for my $x ( 0 .. 9 ) {
		for my $y ( 0 .. 9 ) {
			my $c = 255 - ( $x + $y ) * 255 / 18;
			$dc->SetBrush( Wx::Brush->new( Wx::Colour->new( $c, $c, $c ), &Wx::wxSOLID ) );
			$dc->DrawRectangle( $x * 100 + 1,  $y * 100 + 1, 99, 99 );
		}
	}
}

package main;
PaintBar->new->MainLoop;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.