App-Codit

 view release on metacpan or  search on metacpan

lib/App/Codit/Ext/CoditMDI.pm  view on Meta::CPAN

		[ 'menu_check',     'View::',          'Show ~spaces and tabs','show-spaces',   '-doc_show_spaces', undef, 0, 1],

		[ 'menu',           undef,             '~Tools'],
		[ 'menu_normal',    'Tools::',         '~Find',              'doc_find',          'edit-find',      '*CTRL+F',],
		[ 'menu_normal',    'Tools::',         '~Replace',	          'doc_replace',       'edit-find-replace','*CTRL+R',],
		[ 'menu_separator', 'Tools::',          't1' ],
		[ 'menu_check',     'Tools::',          'A~uto indent',        undef,   '-doc_autoindent', undef, 0, 1],
		[ 'menu_check',     'Tools::',          'A~uto brackets',        undef,   '-doc_autobrackets', undef, 0, 1],
		[ 'menu_check',     'Tools::',          'A~uto complete',        undef,   '-doc_autocomplete', undef, 0, 1],
		[ 'menu_radio_s',   'Tools::',          '~Wrap',  [qw/char word none/],  undef, '-doc_wrap'],
		[ 'menu_separator', 'Tools::',          't1' ],
		[ 'menu_normal',    'Tools::',          'R~emove trailing spaces',   'doc_remove_trailing',],
		[ 'menu_normal',    'Tools::',          'F~ix indentation',   'doc_fix_indent',],
	);
}

sub navCollapse {
	my $self = shift;
	my $tree = $self->Subwidget('NAVTREE');
	$tree->collapseAll;
}

sub navContextMenu {
	my $self = shift;
	my $nav = $self->Subwidget('NAVTREE');
	my @items = @navcontextmenu;

	#checking if Git is loaded;
	my $git = $self->extGet('Plugins')->plugGet('Git');
	push @items, [ 'menu_normal', 'c1', '~Add to project', 'git_add', 'git-icon',] if defined $git;

	my $stack = $self->extGet('MenuBar')->menuStack(@items);
	$nav->configure('-contextmenu', $stack);
}

sub navExpand {
	my $self = shift;
	my $tree = $self->Subwidget('NAVTREE');
	$tree->expandAll;
}

sub SettingsPage {
	my $self = shift;
	my ($first) = $self->docList;
	my $doc = $self->docGet($first);
	return () unless defined $doc;
	my $themefile = $doc->cget('-highlight_themefile');
	my $historyfile = $self->extGet('ConfigFolder')->ConfigFolder . '/color_history';
	my @opt = (
		-applycall => sub {
			my $themefile = shift;
			my @list = $self->docList;
			for (@list) {
				my $d = $self->docGet($_);
				$d->configure(-highlight_themefile => $themefile);
				$d->configureTags;
			}
		},
		-defaultbackground => $doc->cget('-contentbackground'),
		-defaultforeground => $doc->cget('-contentforeground'),
		-defaultfont => $doc->CWidg->Subwidget('XText')->cget('-font'),
		-historyfile => $historyfile,
		-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'],
	);
}

=back

=head1 LICENSE

Same as Perl.

=head1 AUTHOR

Hans Jeuken (hanje at cpan dot org)

=head1 BUGS

Unknown. If you find any, please report them here L<https://github.com/haje61/App-Codit/issues>.

=head1 SEE ALSO

=over 4

=item L<App::Codit::Macro>

=item L<Tk::AppWindow::Ext::MDI>

=back

=cut

1;



( run in 1.066 second using v1.01-cache-2.11-cpan-5735350b133 )