Win32-GUI-Scintilla

 view release on metacpan or  search on metacpan

Samples/Editor.pl  view on Meta::CPAN

# Perl Editor
#-----------------------------------------------------------------------
# perl -v
use strict;
use Cwd;
use Win32::GUI;
use Win32::GUI::Scintilla;

my $VERSION = "1.0alpha1";
my $CurrentFile = "";
my $Directory = cwd;

my %faces = ( 'times'  => 'Times New Roman',
              'mono'   => 'Courier New',
              'helv'   => 'Lucida Console',
              'lucida' => 'Lucida Console',
              'other'  => 'Comic Sans MS',
              'size'   => '10',
              'size2'  => '9',
              'backcol'=> '#FFFFFF',
            );

my $PERL_KEYWORD = q{
NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD
BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept
alarm and atan2 bind binmode bless caller chdir chmod chomp chop
chown chr chroot close closedir cmp connect continue cos crypt
dbmclose dbmopen defined delete die do dump each else elsif endgrent
endhostent endnetent endprotoent endpwent endservent eof eq eval
exec exists exit exp fcntl fileno flock for foreach fork format
formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname
gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername
getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent
getpwent getpwnam getpwuid getservbyname getservbyport getservent
getsockname getsockopt glob gmtime goto grep gt hex if index
int ioctl join keys kill last lc lcfirst le length link listen
local localtime lock log lstat lt m map mkdir msgctl msgget msgrcv
msgsnd my ne next no not oct open opendir or ord our pack package
pipe pop pos print printf prototype push q qq qr quotemeta qu
qw qx rand read readdir readline readlink readpipe recv redo
ref rename require reset return reverse rewinddir rindex rmdir
s scalar seek seekdir select semctl semget semop send setgrent
sethostent setnetent setpgrp setpriority setprotoent setpwent
setservent setsockopt shift shmctl shmget shmread shmwrite shutdown
sin sleep socket socketpair sort splice split sprintf sqrt srand
stat study sub substr symlink syscall sysopen sysread sysseek
system syswrite tell telldir tie tied time times tr truncate
uc ucfirst umask undef unless unlink unpack unshift untie until
use utime values vec wait waitpid wantarray warn while write
x xor y
};


my $Menu =  Win32::GUI::MakeMenu(
    "&File"                   => "File",
    "   > &New"               => "FileNew",
    "   > &Open..."           => "FileOpen",
    "   > -"                  => 0,
    "   > &Save"              => "FileSave",
    "   > &Save As..."        => "FileSaveAs",
    "   > -"                  => 0,
    "   > &Directory..."      => "FileDirectory",
    "   > -"                  => 0,
    "   > E&xit"              => "FileExit",
    "&Edit"                   => "Edit",
    "   > &Undo"              => "EditUndo",
    "   > &Redo"              => "EditRedo",
    "   > -"                  => 0,
    "   > Cu&t"               => "EditCut",
    "   > &Copy"              => "EditCopy",
    "   > &Paste"             => "EditPaste",
    "   > &Delete"            => "EditClear",
    "   > -"                  => 0,
    "   > Select A&ll"        => "EditSelectAll",
    "   > -"                  => 0,
    "   > &Find..."           => "EditFind",
    "&Help"                   => "Help",
    "   > &About..."          => "HelpAbout",
    );

# main Window
my $Window = new Win32::GUI::Window (
                   -name     => "Window",
                   -title    => "Perl Editor",
                   -pos      => [100, 100],
                   -size     => [400, 400],
                   -menu     => $Menu,
                   ) or die "new Window";

# Create Scintilla Edit Window
# $Edit = new Win32::GUI::Scintilla  (
#               -parent  => $Window,
my $Editor = $Window->AddScintilla  (
                        -name    => "Editor",



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