view release on metacpan or search on metacpan
lib/App/Codit.pm view on Meta::CPAN
-contenttabs => '8m',
-contentwrap => 'none',
-showfolds => 1,
-shownumbers => 1,
-showstatus => 1,
);
for (keys %opts) {
$args->{$_} = $opts{$_}
}
$self->SUPER::Populate($args);
$self->geometry('800x600+150+150');
$self->{UNIQUE} = 0;
$self->extGet('Panels')->panelHide('TOOL');
$self->extGet('Panels')->panelHide('RIGHT');
$self->cmdConfig(
report_issue => ['ReportIssue', $self],
lib/App/Codit.pm view on Meta::CPAN
$self->ConfigSpecs(
-uniqueinstance => ['METHOD', undef, undef, 0],
DEFAULT => ['SELF'],
);
}
sub CanQuit {
my $self = shift;
my $file = $self->lockfile;
unlink $file if defined $file;
return $self->SUPER::CanQuit
}
sub DoPostConfig {
my $self = shift;
$self->SetThemeFile;
$self->cmdExecute('doc_new');
}
sub GetThemeFile {
return $_[0]->extGet('ConfigFolder')->ConfigFolder .'/highlight_theme.ctt';
lib/App/Codit.pm view on Meta::CPAN
Returns a reference to the CoditMDI extension.
=cut
sub mdi {
return $_[0]->extGet('CoditMDI');
}
sub MenuItems {
my $self = shift;
return ($self->SUPER::MenuItems,
[ 'menu_normal', 'appname::h1', '~Report a problem', 'report_issue' ],
)
}
=item B<panels>
Returns a reference to the Panels extension.
=cut
lib/App/Codit/BaseClasses/TextModPlugin.pm view on Meta::CPAN
use base qw( Tk::AppWindow::BaseClasses::Plugin );
require Tk::HList;
=head1 DESCRIPTION
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->{ACTIVEDELAY} = 600;
$self->cmdHookBefore('quit', 'selectBlock', $self);
$self->cmdHookBefore('deferred_open', 'selectBlock', $self);
$self->cmdHookAfter('modified', 'activate', $self);
$self->cmdHookAfter('doc_select', 'docSelect', $self);
# $self->after(1000, sub {
# my $sel = $self->extGet('CoditMDI')->docSelected;
lib/App/Codit/BaseClasses/TextModPlugin.pm view on Meta::CPAN
sub Unload {
my $self = shift;
my $id = $self->{'active_id'};
$self->afterCancel($id) if defined $id;
$self->cmdUnhookBefore('quit', 'selectBlock', $self);
$self->cmdUnhookBefore('deferred_open', 'selectBlock', $self);
$self->cmdUnhookAfter('modified', 'activate', $self);
$self->cmdUnhookAfter('doc_select', 'docSelect', $self);
# $self->cmdUnhookAfter('doc_close', 'docAfterClose', $self);
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/CodeTextManager.pm view on Meta::CPAN
$VERSION = '0.19';
use Tk;
require Tk::CodeText;
use base qw(Tk::Derived Tk::AppWindow::BaseClasses::ContentManager);
Construct Tk::Widget 'CodeTextManager';
sub Populate {
my ($self,$args) = @_;
$self->SUPER::Populate($args);
my $ext = $self->Extension;
my $text = $self->CodeText(
-contextmenu => $ext->ContextMenu,
-height => 8,
-keyreleasecall => ['KeyReleased', $self],
-logcall => ['log', $self],
-modifiedcall => ['Modified', $self],
-saveimage => $ext->getArt('document-save', 16),
-scrollbars => 'osoe',
lib/App/Codit/CoditTagsEditor.pm view on Meta::CPAN
die 'You must specify the -defaultforeground option' unless defined $dforeground;
my $dfont = delete $args->{'-defaultfont'};
die 'You must specify the -defaultfont option' unless defined $dfont;
my $ext = delete $args->{'-extension'};
die 'You must specify the -extension option' unless defined $ext;
my $hist = delete $args->{'-historyfile'};
die 'You must specify the -historyfile option' unless defined $hist;
my $themefile = delete $args->{'-themefile'};
die 'You must specify the -themefile option' unless defined $themefile;
$self->SUPER::Populate($args);
my $te = $self->TagsEditor(
-defaultbackground => $dbackground,
-defaultforeground => $dforeground,
-defaultfont => $dfont,
-historyfile => $hist,
)->pack(-expand => 1, -fill => 'both');
$self->Advertise(TE => $te);
my $toolframe = $self->Frame(
)->pack(-fill => 'x');
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
=back
=head1 METHODS
=over 4
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
# $self->Require('Navigator');
$self->{MACROS} = {};
$self->{SHOWSPACES} = 0;
$self->{FIXINDENTSPACES} = 3;
my $nav = $self->Subwidget('NAVTREE');
$self->configInit(
-doc_autoindent => ['docAutoIndent', $self],
-doc_autobrackets => ['docAutoBrackets', $self],
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
if (defined $doc) {
my $w = $self->docGet($doc)->CWidg;
$w->bookmarkRemove
}
}
sub CmdDocClose {
my ($self, $name) = @_;
$name = $self->docSelected unless defined $name;
$self->macroRemoveAll($name);
my $result = $self->SUPER::CmdDocClose($name);
if ($result) {
$self->after(100, sub {
my @list = $self->docFullList;
$self->cmdExecute('doc_new') unless @list;
});
}
return $result
}
sub CmdDocNew {
my $self = shift;
my $result = $self->SUPER::CmdDocNew(@_);
$self->disposeUntitled if $result;
return $result
}
#sub CmdDocOpen {
# my $self = shift;
# my $result = $self->SUPER::CmdDocOpen(@_);
# $self->disposeUntitled if $result;
# return $result
#}
sub contentModified {
my $self = shift;
my ($doc, $index) = @_;
if ($self->docShowSpaces) {
my $macro = $self->macroGet($doc, 'space');
if (defined $macro) {
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
[ 'menu_normal', undef, '~Indent', '<Control-j>', 'format-indent-more','*CTRL+J'],
[ 'menu_normal', undef, 'Unin~dent', '<Control-J>', 'format-indent-less','*CTRL+SHIFT+J'],
[ 'menu_separator', undef, 'c4' ],
[ 'menu_check', undef, 'A~uto indent', undef, '-doc_autoindent', undef, 0, 1],
[ 'menu_radio_s', undef, '~Wrap', [qw/char word none/], 'text-wrap', '-doc_wrap'],
)
}
sub CreateContentHandler {
my ($self, $name, $parent) = @_;
my $h = $self->SUPER::CreateContentHandler($name, $parent);
$h->Name($name);
return $h;
}
sub CreateInterface {
my $self = shift;
my $w = $self->WorkSpace;
$w->gridColumnconfigure(0, -weight => 1);
$w->gridRowconfigure(0, -weight => 1);
$self->{INTERFACE} = $w->YANoteBook(
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
-selecttabcall => ['cmdExecute', $self, 'doc_select'],
-closetabcall => ['cmdExecute', $self, 'doc_close'],
)->grid(-row => 0, -column => 0, -sticky => 'nsew');
}
sub deferredOpen {
my ($self, $name) = @_;
croak 'Name not defined' unless defined $name;
my $options = $self->deferredOptions($name);
my $bookmarks = delete $options->{'bookmarks'};
$self->SUPER::deferredOpen($name);
$self->after(100, sub {
if (defined $bookmarks) {
my $w = $self->docGet($name)->CWidg;
while ($bookmarks =~ s/^(\d+)\s//) {
$w->bookmarkNew($1);
}
}
});
}
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
sub docRemoveTrailing {
my ($self, $name) = @_;
$name = $self->docSelected unless defined $name;
my $widg = $self->docGet($name)->CWidg;
$widg->removeTrailingSpaces;
}
sub docSelect {
my ($self, $name) = @_;
return if $self->selectDisabled;
$self->SUPER::docSelect($name);
}
sub docShowSpaces {
my $self = shift;
return $self->docOption('-contentshowspaces', @_);
}
sub docSelectFirst {
my $self = shift;
my $sel = $self->docSelected;
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
$self->macroRemove($doc, $_->name);
}
}
sub MenuItems {
my $self = shift;
#creating the context menu for the navigator tree
$self->after(1000, ['navContextMenu', $self]);
my @items = $self->SUPER::MenuItems;
return (@items,
[ 'menu', undef, '~Edit'],
[ 'menu_normal', 'Edit::', '~Copy', '<Control-c>', 'edit-copy', '*CTRL+C'],
[ 'menu_normal', 'Edit::', 'C~ut', '<Control-x>', 'edit-cut', '*CTRL+X'],
[ 'menu_normal', 'Edit::', '~Paste', '<Control-v>', 'edit-paste', '*CTRL+V'],
[ 'menu_separator', 'Edit::', 'e1' ],
[ 'menu_normal', 'Edit::', 'U~ndo', '<Control-z>', 'edit-undo', '*CTRL+Z'],
[ 'menu_normal', 'Edit::', '"~Redo', '<Control-Z>', 'edit-redo', '*CTRL+SHIFT+Z'],
[ 'menu_separator', 'Edit::', 'e2'],
[ 'menu_normal', 'Edit::', 'Co~mment', '<Control-g>', undef, '*CTRL+G'],
lib/App/Codit/Ext/CoditMDI.pm view on Meta::CPAN
-extension => $self,
-themefile => $themefile,
);
return (
'Highlighting' => ['CoditTagsEditor', @opt]
)
}
sub ToolItems {
my $self = shift;
my @items = $self->SUPER::ToolItems;
return (@items,
# type label cmd icon help
[ 'tool_separator' ],
[ 'tool_button', 'Copy', '<Control-c>', 'edit-copy', 'Copy selected text to clipboard'],
[ 'tool_button', 'Cut', '<Control-x>', 'edit-cut', 'Move selected text to clipboard'],
[ 'tool_button', 'Paste', '<Control-v>', 'edit-paste', 'Paste clipboard content into document'],
[ 'tool_separator' ],
[ 'tool_button', 'Undo', '<Control-z>', 'edit-undo', 'Undo last action'],
[ 'tool_button', 'Redo', '<Control-Z>', 'edit-redo', 'Cancel undo'],
);
lib/App/Codit/Plugins/Backups.pm view on Meta::CPAN
It keeps backups of all open and unsaved files. Whenever a file is saved or closed
the backup is removed.
It keeps the backups in the configuration folder, it does not pollute your working folders.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->interval(1000);
$self->{MODIFIED} = {};
$self->{ACTIVE} = {};
$self->cmdHookBefore('deferred_open', 'openDocBefore', $self);
$self->cmdHookAfter('doc_close', 'closeDocAfter', $self);
$self->cmdHookBefore('doc_rename', 'docRenameBefore', $self);
$self->cmdHookAfter('doc_save', 'saveDocAfter', $self);
lib/App/Codit/Plugins/Backups.pm view on Meta::CPAN
my $self = shift;
for ($self->jobList) { $self->jobEnd($_) }
}
sub Unload {
my $self = shift;
$self->cmdUnhookBefore('deferred_open', 'openDocBefore', $self);
$self->cmdUnhookAfter('doc_close', 'closeDocAfter', $self);
$self->cmdUnhookBefore('doc_rename', 'docRenameBefore', $self);
$self->cmdUnhookAfter('doc_save', 'saveDocAfter', $self);
return $self->SUPER::Unload;
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Bookmarks.pm view on Meta::CPAN
=item B<bm_plug_previous>
Jumps to the previous selected bookmark.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
my $page = $self->ToolLeftPageAdd('Bookmarks', 'bookmarks', undef, 'Manage your bookmarks', 250);
$self->cmdConfig(
bm_plug_next => ['bmNext', $self],
bm_plug_previous => ['bmPrevious', $self],
);
$self->cmdHookAfter('bookmark_add', 'RefreshSelected', $self);
$self->cmdHookAfter('bookmark_remove', 'RefreshSelected', $self);
lib/App/Codit/Plugins/Bookmarks.pm view on Meta::CPAN
$t->deleteAll;
my $mdi = $self->mdi;
for ($mdi->deferredList, $mdi->docList) {
my @marks = $self->Collect($_);
$self->bmAdd($_, @marks) if @marks;
}
}
sub Refresh {
my $self = shift;
$self->SUPER::Refresh;
$self->RefreshSelected;
}
sub RefreshAll {
my $self = shift;
my $t = $self->tree;
my @list = $t->infoChildren('');
for (@list) {
$self->docRefresh($_);
}
lib/App/Codit/Plugins/Bookmarks.pm view on Meta::CPAN
#jump to bookmark
$self->{CURRENT} = $mark;
$self->bmGo($mark);
}
sub tree { return $_[0]->{TREE} }
sub ToolItems {
my $self = shift;
my @items = $self->SUPER::ToolItems;
return (@items,
# type label cmd icon help
[ 'tool_separator' ],
[ 'tool_button', 'Previous', 'bm_plug_previous', 'bookmark_previous', 'Jump to previous bookmark'],
[ 'tool_button', 'Next', 'bm_plug_next', 'bookmark_next', 'Jump to next bookmark'],
);
}
sub Unload {
my $self = shift;
for (qw/
bm_plug_next
bm_plug_previous
/) {
$self->cmdRemove($_);
}
$self->cmdUnhookAfter('bookmark_add', 'RefreshSelected', $self);
$self->cmdUnhookAfter('bookmark_remove', 'RefreshSelected', $self);
$self->ToolLeftPageRemove('Bookmarks');
return $self->SUPER::Unload;
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Colors.pm view on Meta::CPAN
You can select a color in RGB, CMY and HSV space. Whenever you select a color it is added to the Recent tab.
It allows you to specify color depths 4, 8, 12 and 16 bits per color.
You can pick a color from any place on the screen with the pick button. This does not work on Windows.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
my $page = $self->ToolRightPageAdd('Colors', 'fill-color', undef, 'Select and insert colors', 350);
my @padding = (-padx => 3, -pady => 3);
my $eframe = $page->Frame->pack(-fill => 'x');
my $fframe = $eframe->Frame->pack(-side => 'left');
lib/App/Codit/Plugins/Colors.pm view on Meta::CPAN
$self->_ent($pick->notationCurrent);
$self->updateEntry;
}
}
}
sub Unload {
my $self = shift;
# $self->extGet('ToolPanel')->deletePage('Colors');
$self->ToolRightPageRemove('Colors');
return $self->SUPER::Unload
}
sub updateEntry {
my ($self, $value) = @_;
$value = $self->_ent->get unless defined $value;
my $pick = $self->_pick;
if ($self->_pick->validate($value)) {
$self->_ind($pick->getHEX);
$self->_ent->configure(-foreground => $self->configGet('-foreground'));
$self->_pick($value);
lib/App/Codit/Plugins/Console.pm view on Meta::CPAN
Kill the currently running process.
=back
This plugin does not work and cannot load on Windows.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
return undef if $mswin; #will not load on windows.
my $page = $self->ToolBottomPageAdd('Console', 'utilities-terminal', undef, 'Execute system commands', 250);
my @pad = (-padx => 2, -pady => 2);
my $workdir = '';
$self->{WORKDIR} = \$workdir;
$self->{UPDATEBLOCK} = 0;
lib/App/Codit/Plugins/Console.pm view on Meta::CPAN
$menu->unpost;
$menu->destroy;
});
$menu->post($x - 2, $y - 2);
}
}
sub Unload {
my $self = shift;
$self->ToolBottomPageRemove('Console');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Exporter.pm view on Meta::CPAN
=back
Beware! Exporting to PNG is painstakingly slow.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->{BACKGROUND} = undef;
$self->{IMAGE} = undef;
$self->{IHEIGHT} = 0;
$self->{IWIDTH} = 0;
$self->{MAXWIDTH} = 0;
$self->{XPOS} = 0;
$self->{TABSTRING} = '';
$self->{YPOS} = 0;
lib/App/Codit/Plugins/Exporter.pm view on Meta::CPAN
sub tabstring {
my $self = shift;
$self->{TABSTRING} = shift if @_;
return $self->{TABSTRING}
}
sub Unload {
my $self = shift;
$self->cmdRemove('export_html');
$self->cmdRemove('export_png');
return $self->SUPER::Unload;
}
sub xpos {
my $self = shift;
$self->{XPOS} = shift if @_;
return $self->{XPOS}
}
sub ypos {
my $self = shift;
lib/App/Codit/Plugins/FileBrowser.pm view on Meta::CPAN
[ 'menu_normal', undef, 'Cut', 'fb_cut', 'edit-cut', '*CTRL+X'],
[ 'menu_normal', undef, 'Paste', 'fb_paste', 'edit-paste', '*CTRL+V'],
[ 'menu_separator', undef, 'f2'],
[ 'menu_normal', undef, 'Delete', 'fb_delete', 'edit-delete', '*SHIFT+DELETE'],
[ 'menu_separator', undef, 'f3'],
[ 'menu_normal', undef, 'Properties', 'fb_properties', 'document-properties', '*CTRL+P'],
);
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
my $page = $self->ToolLeftPageAdd('FileBrowser', 'folder', undef, 'Browse your file system', 400);
my @images = (
['-msgimage', 'dialog-information', 32],
['-newfolderimage', 'folder-new', 16],
['-reloadimage', 'appointment-recurring', 16],
['-warnimage', 'dialog-warning', 32],
);
lib/App/Codit/Plugins/FileBrowser.pm view on Meta::CPAN
sub Unload {
my $self = shift;
$self->cmdRemove('fb_copy');
$self->cmdRemove('fb_cut');
$self->cmdRemove('fb_delete');
$self->cmdRemove('fb_open');
$self->cmdRemove('fb_paste');
$self->cmdRemove('fb_properties');
$self->ToolLeftPageRemove('FileBrowser');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Git.pm view on Meta::CPAN
=item B<git_remove_dialog>
Same as git_remove but first asks nicely if you really want to do this.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
#load only if git command line is installed
my $git = `git -v`;
return undef unless $git =~/^git\sversion/;
$self->cmdHookAfter('doc_open', 'openDocAfter', $self);
$self->cmdHookAfter('doc_close', 'closeDocAfter', $self);
$self->cmdHookBefore('doc_select', 'selectDocBefore', $self);
$self->cmdConfig(
lib/App/Codit/Plugins/Git.pm view on Meta::CPAN
'git_expand',
'git_open_all',
'git_remove',
'git_remove_dialog',
) {
$self->cmdRemove($_);
}
$self->cmdUnhookAfter('doc_close', 'closeDocAfter', $self);
$self->cmdUnhookAfter('doc_open', 'openDocAfter', $self);
$self->cmdUnhookBefore('doc_select', 'selectDocBefore', $self);
my $flag = $self->SUPER::Unload;
my $mdi = $self->mdi;
$self->after(100, ['navContextMenu', $mdi]);
return $flag;
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
lib/App/Codit/Plugins/Icons.pm view on Meta::CPAN
The Icons plugin lets you choose an icon from the iconlibrary and insert it's name
into your document.
If a selection exists and it's content matches the name of an icon, the icon will
be selected.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
my $page = $self->ToolRightPageAdd('Icons', 'preferences-desktop-icons', undef, 'Select and insert icons', 350);
my @padding = (-padx => 3, -pady => 3);
my $list;
#setting up the buttons
my $eframe = $page->Frame(
-relief => 'groove',
lib/App/Codit/Plugins/Icons.pm view on Meta::CPAN
$l->selectionSet($text);
$l->anchorSet($text);
$l->see($text);
}
}
}
sub Unload {
my $self = shift;
$self->ToolRightPageRemove('Icons');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/PerlSubs.pm view on Meta::CPAN
When you click on and item in the list, the insert cursor is moved to that
line and it is scrolled into visibility.
Both colums are sizable and sortable.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
my $page = $self->ToolLeftPageAdd('PerlSubs', 'code-context', undef, 'Find your Perl subs', 250);
$self->{CURRENT} = [];
$self->{SORTON} = 'Line';
$self->{SORTORDER} = 'ascending';
my $hlist = $page->Scrolled('HList',
-browsecmd => ['Select', $self],
lib/App/Codit/Plugins/PerlSubs.pm view on Meta::CPAN
#find and set selection
if ($select) {
$hlist->selectionSet($cursel) if (defined $cursel) and $hlist->infoExists($cursel);
$hlist->see($lastvisible) if (defined $lastvisible) and $hlist->infoExists($lastvisible);
}
$self->Current($new);
}
sub Refresh {
my ($self, $select) = @_;
$self->SUPER::Refresh;
$select = 1 unless defined $select;
my $current = $self->Current;
my @new = ();
my $mdi = $self->extGet('CoditMDI');
my $doc = $self->mdi->docWidget;
return unless defined $doc;
my $end = $doc->index('end - 1c');
my $numlines = $end;
$numlines =~ s/\.\d+$//;
lib/App/Codit/Plugins/PerlSubs.pm view on Meta::CPAN
sub SortOrder {
my $self = shift;
$self->{SORTORDER} = shift if @_;
return $self->{SORTORDER}
}
sub Unload {
my $self = shift;
$self->ToolLeftPageRemove('PerlSubs');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/PodViewer.pm view on Meta::CPAN
When you click it the frame of the current selected document
will split and the bottom half will show the pod documentation
in your document.
The viewer is refreshed after you make an edit.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->{ADJUSTER} = undef;
$self->{DOCS} = {};
$self->{MODIFIEDSAVE} = {};
$self->{VIEWER} = undef;
$self->{VISIBLE} = 0;
my $page = $self->ToolBottomPageAdd('Pod', 'documentation', undef, 'Show the documentation in your file');
$self->sidebars->pageSelectCall('Pod', sub {
lib/App/Codit/Plugins/PodViewer.pm view on Meta::CPAN
sub ReConfigure {
my $self = shift;
my $pod = $self->{PODWIDGET};
$pod->configure(-linkcolor => $self->configGet('-linkcolor'));
$pod->configureTags;
return 1
}
sub Refresh {
my $self = shift;
$self->SUPER::Refresh;
return unless $self->_visible;
my $widg = $self->mdi->docWidget;
return unless defined $widg;
my $text = $widg->get('1.0', 'end -1c');
my $pod = $self->{PODWIDGET};
my $podtxt = $pod->Subwidget('txt');
my ($v) = $podtxt->yview;
$pod->load(\$text);
$podtxt->yviewMoveto($v);
}
sub Unload {
my $self = shift;
$self->ToolBottomPageRemove('Pod');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/SearchReplace.pm view on Meta::CPAN
When searching with a regular expression you can include the captures you make with () in
the replace string with â$1â, â$2â, etcetera.
Clear removes all search results.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
# my $tp = $self->extGet('ToolPanel');
# my $page = $tp->addPage('SearchReplace', 'edit-find-replace', undef, 'Search and replace');
my $page = $self->ToolRightPageAdd('SearchReplace', 'edit-find-replace', undef, 'Search and replace', 350);
my $searchterm = '';
my $replaceterm = '';
my $casesensitive = '-case';
my $useregex = '-exact';
lib/App/Codit/Plugins/SearchReplace.pm view on Meta::CPAN
sub skipped {
my $self = shift;
$self->{SKIPPED} = shift if @_;
return $self->{SKIPPED}
}
sub Unload {
my $self = shift;
$self->ToolRightPageRemove('SearchReplace');
$self->cmdUnhookAfter('doc_select', 'ShowResults', $self);
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Sessions.pm view on Meta::CPAN
=item B<session_save_as>
Save current session under a new name.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_, 'ConfigFolder', 'MenuBar');
return undef unless defined $self;
$self->sessionFolder;
$self->{CURRENT} = '';
$self->{DATA} = {};
$self->cmdConfig(
session_dialog => ['sessionDialog', $self],
session_fill_menu => ['sessionFillMenu', $self],
lib/App/Codit/Plugins/Sessions.pm view on Meta::CPAN
session_new
session_open
session_save
session_save_as
/) {
$self->cmdRemove($_);
}
$self->sessionCurrent('');
$self->cmdUnhookAfter('set_title', 'AdjustTitle', $self);
$self->AdjustTitle;
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/Snippets.pm view on Meta::CPAN
The top side of the panel allows you to manage your collection of snippets.
The bottom side allows you to insert a selected snippet into your document,
copy the snippet to the clipboard or create a new document based on the snippet.
A file dialog is launched and the snippet is saved to the selected file name.
Then it is opened in a new tab.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->{CURRENT} = undef;
# my $tp = $self->extGet('ToolPanel');
# my $page = $tp->addPage('Snippets', 'insert-text', undef, 'Snippets');
my $page = $self->ToolRightPageAdd('Snippets', 'insert-text', undef, 'Snippets', 350);
my @padding = (-padx => 2, -pady => 2);
my $lf = $page->Frame(
lib/App/Codit/Plugins/Snippets.pm view on Meta::CPAN
my $config = $self->extGet('ConfigFolder')->ConfigFolder . '/Snippets';
make_path($config) unless -e $config;
return $config
}
sub Unload {
my $self = shift;
$self->snippetSave;
$self->ToolRightPageRemove('Snippets');
# $self->extGet('ToolPanel')->deletePage('Snippets');
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/Plugins/SplitView.pm view on Meta::CPAN
=item B<split_vertical>
Creates a vertical split.
=back
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return undef unless defined $self;
$self->{ADJUSTER} = undef;
$self->{DOCS} = {};
$self->{SPLIT} = undef;
$self->{STATE} = 'none';
my $w = $self->WorkSpace;
$self->cmdHookAfter('doc_close', 'splitClose', $self);
$self->cmdHookAfter('doc_open', 'splitOpen', $self);
lib/App/Codit/Plugins/SplitView.pm view on Meta::CPAN
$self->cmdUnhookAfter('doc_open', 'splitOpen', $self);
#unload commands
for (qw/
split_horizontal
split_vertical
split_cancel
/) {
$self->cmdRemove($_);
}
return $self->SUPER::Unload
}
=head1 LICENSE
Same as Perl.
=head1 AUTHOR
Hans Jeuken (hanje at cpan dot org)
lib/App/Codit/SessionManager.pm view on Meta::CPAN
use base qw(Tk::Derived Tk::YADialog);
Construct Tk::Widget 'SessionManager';
sub Populate {
my ($self,$args) = @_;
my $plug = delete $args->{'-plugin'};
carp 'You must specify the -plugin option' unless defined $plug;
$self->SUPER::Populate($args);
my @padding = (-padx => 4, -pady => 4);
my $art = $plug->extGet('Art');
my @sessions = ();
$self->{SESSIONS} = \@sessions;
$self->{PLUGIN} = $plug;
my $lb = $self->Scrolled('Listbox',
-scrollbars => 'osoe',