NAME

Padre - Perl Application Development and Refactoring Environment

SYNOPSIS

Padre is a text editor aimed to be an IDE for Perl.

You should be able to just type in

padre

and get the editor working.

While I have been using this editor since version 0.01 myself there are still lots of missing features.

Not only it is missing several important feature, everything is in a constant flux. Menus, shortcuts and the way they work will change from version to version.

Having said that you can already use it for serious editing and you can even get involved and add the missing features.

You should also know that I am mostly working on Linux and I have been using vi for many years now. This means that I am not that familiar with the expectations of people using Windows.

FEATURES

Instead of duplicating all the text here, let me point you to the web site of Padre http://padre.perlide.org/ where we keep a list of existing and planned features.

DESCRIPTION

The application maintains its configuration information in a directory called .padre.

On Strawberry Perl you can associate .pl file extension with C:\strawberry\perl\bin\wxperl and then you can start double clicking on the application. It should work...

Run This (F5) - run the current buffer with the current perl
this currently only works with files with .pl  extensions.

Run Any (Ctr-F5) - run any external application
First time it will prompt you to a command line that you have to
type in such as

perl /full/path/to/my/script.pl

...then it will execute this every time you press Ctrl-F5 or the menu option. Currently Ctrl-F5 does not save any file. (This will be added later.)

You can edit the command line using the Run/Setup menu item.

Ctr-1          matching brace
Ctr-P          Autocompletition
Alt-N          Nth Pane
Ctr-TAB        Next Pane
Ctr-Shift-TAB  Previous Pane
Alt-S          Jump to list of subs window

Ctr-1 .. Ctrl-9 can set markers
Ctr-Shift-1 .. Ctrl-Shift-9 jump to marker

Ctr-M Ctr-Shift-M  comment/uncomment selected lines of code

Ctr-H opens a help window where you can see the documentation of 
any perl module. Just use open (in the help window) and type in the name
of a module.

Ctr-Shift-H Highlight the name of a module in the editor and then 
press Ctr-Shift-H. IT will open the help window for the module 
whose name was highlighted.

In the help window you can also start typing the name of a module. When the
list of the matching possible modules is small enough you'll be able
to open the drop-down list and select the name.
The "small enough" is controled by two configuration options in the 
Edit/Setup menu: 

Max Number of modules
Min Number of modules

This feature only works after you have indexed all the modules 
on your computer. Indexing is currently done by running the following command:

padre --index

Parrot integration

This is an experimentatl feature.

Download Parrot (or check it out from its version control)

Configure PARROT_PATH to point to the root of parrot

Configure LD_LIBRARY_PATH

export LD_LIBRARY_PATH=$PARROT_PATH/blib/lib/

Build Parrot

cd $PARROT_PATH
svn up
make realclean
perl Configure.pl
make
make test

Build Parrot::Embed

cd ext/Parrot-Embed/
./Build realclean
perl Build.PL
./Build
./Build test

Now if you run Padre it will come with an embedded Parrot interpreter.

You can get the interpreter by calling

Padre->ide->parrot

Rectangular Text Selection

Simple text editors usually only allow you to select contiguous lines of text with your mouse. Somtimes, however, it is handy to be able to select a rectangular area of text for more precise cutting/copying/pasting or performing search/replace on. You can select a rectangular area in Padre by holding down Ctr-Alt whilst selecting text with your mouse.

For example, imagine you have the following nicely formatted hash assignment in a perl source file:

 my %hash = (
	key1 => 'value1',
	key2 => 'value2',
	key3 => 'value3',
 );

With a rectangular text selection you can select only the keys, only the values, etc..

Command line options

--index   will go over the @INC and list all the available modules in the database

a list of filenames can be given to be opened

Plugins

There is a highly experimental but quit simple plugin system.

A plugin is a module in the Padre::Plugin::* namespace.

At startup time Padre looks for all such modules in @INC and loads them. Every plugin must have a menu method that returns its menu items which is a list of lists:

( 
  [ Name_1, \&callback_1 ],
  [ Name_2, \&callback_2 ],
)

Padre will add a menu entry for every plugin under the Plugins menu item. For each plugin menu item it will add all the Name_1, Name_2 subitems.

Search, Find and Replace

(planning)

Ctrl-F opens the search window, if something was selected then that is given as the search text. Otherwise the last search string should be displayed.

Provide option to search backwards

Limit action to current block, current subroutine, current file (should be the default) current project, current directory with some file filters.

When the user presses Find

  1. We find the first hit and the search window disappears. F3 jumps to next one.

  2. The first match is highlighted and focused but the window stays When the user clicks on the Find button again, we jump to the next hit In this case the user must be able to edit the document while the search window is on.

  3. All the matches are highlighted and we go to the first match, window disappears. F3 jumps to next one

  4. All the matches are highlighted and we go to the first one, window stays open user can edit text

Find and Replace

Find - find the next occurance

Replace all - do just that

Replace - if currently a match is selected then replace it find the next occurance and select it

TODO describe what to do if we have to deal with files that are not in the editor

if "Replace all" was pressed then do just that 1) without opening editors for the files. 2) opening an editor for each file and keep it in unsaved state (sounds carzy having 1000 editors open...) if Search or Replace is clicked then we might show the next location in the lower pane. If the user then presses Replace we open the file in an editor window and go on. If the user presses Search then we show the next occurance. Opened and edited files will be left in a not saved state.

BUGS

Please submit your bugs at http://padre.perlide.org/

Code layout

Padre is the main module that reads/writes the configuration files There is an SQLite database and a yml file to keep various pices of information The SQLite database holds the list of modules available on the system. It will also contain indexing of the documentation Looking at the entries of modules List of functions

The yml file contains individual configuration options

Padre::Wx::App is the Wx::App subclass

Padre::Wx::MainWindow is the main frame, most of the code is currently there.

Padre::Wx::Editor holds an editor text control instance (one for each buffer/file)

Padre::Pod::* are there to index and show documentation written in pod.

SUPPORT

I hope the http://www.perlmonks.org/ will be ready to take upon themself supporting this application.

See also http://padre.perlide.org/

COPYRIGHT

Copyright 2008 Gabor Szabo. http://www.szabgab.com/

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

The icons were taken from http://tango.freedesktop.org/Tango_Desktop_Project The Tango base icon theme is licensed under the Creative Commons Attribution Share-Alike license. Using tango-icon-theme-0.8.1.tar.gz

WARRANTY

There is no warranty whatsoever. If you lose data or your hair because of this program, that's your problem.

CREDITS and THANKS

To Mattia Barbon for providing WxPerl. Part of the code was copied from his Wx::Demo application.

To Adam Kennedy for lots of refactoring.

To Steffen Muller for PAR plugins.

To Patrick Donelan, Fayland Lam, Brian Cassidy

To Herbert Breunung for letting me work on Kephra.

To Octavian Rasnita for early testing and bug reports.