.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Padre::Wx::Main 3pm" .TH Padre::Wx::Main 3pm "2014-09-11" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Padre::Wx::Main \- The main window for the Padre IDE .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Padre::Wx::Main\*(C'\fR implements Padre's main window. It is the window containing the menus, the notebook with all opened tabs, the various sub-windows (outline, subs, output, errors, etc). .PP It inherits from \f(CW\*(C`Wx::Frame\*(C'\fR, so check Wx documentation to see all the available methods that can be applied to it besides the added ones (see below). .SH "PUBLIC API" .IX Header "PUBLIC API" .SS "Constructor" .IX Subsection "Constructor" There's only one constructor for this class. .PP \fI\f(CI\*(C`new\*(C'\fI\fR .IX Subsection "new" .PP .Vb 1 \& my $main = Padre::Wx::Main\->new($ide); .Ve .PP Create and return a new Padre main window. One should pass a \f(CW\*(C`Padre\*(C'\fR object as argument, to get a reference to the Padre application. .SS "Accessors" .IX Subsection "Accessors" The following methods access the object attributes. They are both getters and setters, depending on whether you provide them with an argument. Use them wisely. .PP Accessors to \s-1GUI\s0 elements: .IP "\(bu" 4 \&\f(CW\*(C`title\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`config\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`aui\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`menu\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`notebook\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`left\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`right\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`functions\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`tasks\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`outline\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`directory\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`bottom\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`output\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`syntax\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`vcs\*(C'\fR .PP Accessors to operating data: .IP "\(bu" 4 \&\f(CW\*(C`cwd\*(C'\fR .PP Accessors that may not belong to this class: .PP \fI\f(CI\*(C`left\*(C'\fI\fR .IX Subsection "left" .PP .Vb 1 \& my $panel = $main\->left; .Ve .PP Returns the left toolbar container panel, creating it if needed. .PP \fI\f(CI\*(C`right\*(C'\fI\fR .IX Subsection "right" .PP .Vb 1 \& my $panel = $main\->right; .Ve .PP Returns the right toolbar container panel, creating it if needed. .PP \fI\f(CI\*(C`bottom\*(C'\fI\fR .IX Subsection "bottom" .PP .Vb 1 \& my $panel = $main\->bottom; .Ve .PP Returns the bottom toolbar container panel, creating it if needed. .PP \fI\f(CI\*(C`find\*(C'\fI\fR .IX Subsection "find" .PP .Vb 1 \& my $dialog = $main\->find; .Ve .PP Returns the Find dialog, creating it if needed. .PP \fI\f(CI\*(C`findfast\*(C'\fI\fR .IX Subsection "findfast" .PP .Vb 1 \& my $find = $main\->findfast; .Ve .PP Returns the Fast Find panel, creating it if needed. .ie n .SS """findinfiles""" .el .SS "\f(CWfindinfiles\fP" .IX Subsection "findinfiles" .Vb 1 \& my $dialog = $main\->findinfiles; .Ve .PP Returns the Find in Files dialog, creating it if needed. .ie n .SS """foundinfiles""" .el .SS "\f(CWfoundinfiles\fP" .IX Subsection "foundinfiles" .Vb 1 \& my $panel = $main\->foundinfiles; .Ve .PP Returns the Find in Files results panel, creating it if needed. .PP \fI\f(CI\*(C`replace\*(C'\fI\fR .IX Subsection "replace" .PP .Vb 1 \& my $dialog = $main\->replace; .Ve .PP Return current Find and Replace dialog. Create a new one if needed. .PP \fI\f(CI\*(C`goto\*(C'\fI\fR .IX Subsection "goto" .PP .Vb 1 \& my $dialog = $main\->goto; .Ve .PP Return the Goto dialog. Create a new one if needed. .SS "Public Methods" .IX Subsection "Public Methods" \fI\f(CI\*(C`load_files\*(C'\fI\fR .IX Subsection "load_files" .PP .Vb 1 \& $main\->load_files; .Ve .PP Load any default files: session from command-line, explicit list on command\- line, or last session if user has this setup, a new file, or nothing. .PP \fI\f(CI\*(C`lock\*(C'\fI\fR .IX Subsection "lock" .PP .Vb 1 \& my $lock = $main\->lock(\*(AqUPDATE\*(Aq, \*(AqBUSY\*(Aq, \*(Aqrefresh_toolbar\*(Aq); .Ve .PP Create and return a guard object that holds resource locks of various types. .PP The method takes a parameter list of the locks you wish to exist for the current scope. Special types of locks are provided in capitals, refresh/method locks are provided in lowercase. .PP The \f(CW\*(C`UPDATE\*(C'\fR lock creates a Wx repaint lock using the built in Wx::WindowUpdateLocker class. .PP You should use an update lock during \s-1GUI\s0 construction/modification to prevent screen flicker. As a side effect of not updating, the \s-1GUI\s0 changes happen \fBsignificantly\fR faster as well. Update locks should only be held for short periods of time, as the operating system will begin to treat your application as \*(L"hung\*(R" if an update lock persists for more than a few seconds. In this situation, you may begin to see \s-1GUI\s0 corruption. .PP The \f(CW\*(C`BUSY\*(C'\fR lock creates a Wx \*(L"busy\*(R" lock using the built in Wx::WindowDisabler class. .PP You should use a busy lock during times when Padre has to do a long and/or complex operation in the foreground, or when you wish to disable use of any user interface elements until a background thread is finished. .PP Busy locks can be held for long periods of time, however your users may start to suspect trouble if you do not provide any periodic feedback to them. .PP Lowercase lock names are used to delay the firing of methods that will themselves generate \s-1GUI\s0 events you may want to delay until you are sure you want to rebuild the \s-1GUI.\s0 .PP For example, opening a file will require a Padre::Wx::Main refresh call, which will itself generate more refresh calls on the directory browser, the function list, output window, menus, and so on. .PP But if you open more than one file at a time, you don't want to refresh the menu for the first file, only to do it again on the second, third and fourth files. .PP By creating refresh locks in the top level operation, you allow the lower level operation to make requests for parts of the \s-1GUI\s0 to be refreshed, but have the actual refresh actions delayed until the lock expires. .PP This should make operations with a high \s-1GUI\s0 intensity both simpler and faster. .PP The name of the lowercase \s-1MUST\s0 be the name of a Padre::Wx::Main method, which will be fired (with no parameters) when the method lock expires. .PP \fI\f(CI\*(C`locked\*(C'\fI\fR .IX Subsection "locked" .PP This method provides the ability to check if a resource is currently locked. .SS "Single Instance Server" .IX Subsection "Single Instance Server" Padre embeds a small network server to handle single instance. Here are the methods that allow to control this embedded server. .PP \fI\f(CI\*(C`single_instance_address\*(C'\fI\fR .IX Subsection "single_instance_address" .PP .Vb 1 \& $main\->single_instance_address; .Ve .PP Determines the location of the single instance server for this instance of Padre. .PP \fI\f(CI\*(C`single_instance_start\*(C'\fI\fR .IX Subsection "single_instance_start" .PP .Vb 1 \& $main\->single_instance_start; .Ve .PP Start the embedded server. Create it if it doesn't exist. Return true on success, die otherwise. .PP \fI\f(CI\*(C`single_instance_stop\*(C'\fI\fR .IX Subsection "single_instance_stop" .PP .Vb 1 \& $main\->single_instance_stop; .Ve .PP Stop & destroy the embedded server if it was running. Return true on success. .PP \fI\f(CI\*(C`single_instance_running\*(C'\fI\fR .IX Subsection "single_instance_running" .PP .Vb 1 \& my $is_running = $main\->single_instance_running; .Ve .PP Return true if the embedded server is currently running. .PP \fI\f(CI\*(C`single_instance_connect\*(C'\fI\fR .IX Subsection "single_instance_connect" .PP .Vb 1 \& $main\->single_instance_connect; .Ve .PP Callback called when a client is connecting to embedded server. This is the case when user starts a new Padre, and preference \*(L"open all documents in single Padre instance\*(R" is checked. .PP \fI\f(CI\*(C`single_instance_command\*(C'\fI\fR .IX Subsection "single_instance_command" .PP .Vb 1 \& $main\->single_instance_command( $line ); .Ve .PP Callback called when a client has issued a command \f(CW$line\fR while connected on embedded server. Current supported commands are \f(CW\*(C`open $file\*(C'\fR and \f(CW\*(C`focus\*(C'\fR. .SS "Window Geometry" .IX Subsection "Window Geometry" Query properties about the state and shape of the main window .PP \fI\f(CI\*(C`window_width\*(C'\fI\fR .IX Subsection "window_width" .PP .Vb 1 \& my $width = $main\->window_width; .Ve .PP Return the main window width. .PP \fI\f(CI\*(C`window_height\*(C'\fI\fR .IX Subsection "window_height" .PP .Vb 1 \& my $width = $main\->window_height; .Ve .PP Return the main window height. .PP \fI\f(CI\*(C`window_left\*(C'\fI\fR .IX Subsection "window_left" .PP .Vb 1 \& my $left = $main\->window_left; .Ve .PP Return the main window position from the left of the screen. .PP \fI\f(CI\*(C`window_top\*(C'\fI\fR .IX Subsection "window_top" .PP .Vb 1 \& my $top = $main\->window_top; .Ve .PP Return the main window position from the top of the screen. .PP \fI\f(CI\*(C`window_save\*(C'\fI\fR .IX Subsection "window_save" .PP .Vb 1 \& $main\->window_save; .Ve .PP Saves the current main window geometry (left, top, width, height, maximized). .PP Called during Maximize, Iconize, ShowFullScreen and Padre shutdown so we can restart the next Padre instance at the last good non\-Maximize/Iconize location. .PP Saves and returns true if and only the window is regular or maximized. .PP Skips and returns false if the window is currently hidden, iconised, or full screen. .SS "Refresh Methods" .IX Subsection "Refresh Methods" Those methods refresh parts of Padre main window. The term \f(CW\*(C`refresh\*(C'\fR and the following methods are reserved for fast, blocking, real-time updates to the \s-1GUI,\s0 implying rapid changes. .PP \fI\f(CI\*(C`refresh\*(C'\fI\fR .IX Subsection "refresh" .PP .Vb 1 \& $main\->refresh; .Ve .PP Force refresh of all elements of Padre main window. (see below for individual refresh methods) .PP \fI\f(CI\*(C`add_refresh_listener\*(C'\fI\fR .IX Subsection "add_refresh_listener" .PP Adds an object which will have its \f(CW\*(C`\->refresh\*(C'\fR method called whenever the main refresh event is triggered. The refresh listener is stored as a weak reference so make sure that you keep the listener alive elsewhere. .PP If your object does not have a \f(CW\*(C`\->refresh\*(C'\fR method, pass in a code reference \- it will be called instead. .PP Note that this method must return really quick. If you plan to do work that takes longer, launch it via the Action::Queue mechanism and perform it in the background. .PP \fI\f(CI\*(C`refresh_title\*(C'\fI\fR .IX Subsection "refresh_title" .PP Sets or updates the Window title. .PP \fI\f(CI\*(C`refresh_syntax\*(C'\fI\fR .IX Subsection "refresh_syntax" .PP .Vb 1 \& $main\->refresh_syntax; .Ve .PP Do a refresh of document syntax checking. This is a \*(L"rapid\*(R" change, since actual syntax check is happening in the background. .PP \fI\f(CI\*(C`refresh_vcs\*(C'\fI\fR .IX Subsection "refresh_vcs" .PP .Vb 1 \& $main\->refresh_vcs; .Ve .PP Do a refresh of version control checking. This is a \*(L"rapid\*(R" change, since actual version control check is happening in the background. .PP \fI\f(CI\*(C`refresh_outline\*(C'\fI\fR .IX Subsection "refresh_outline" .PP .Vb 1 \& $main\->refresh_outline; .Ve .PP Force a refresh of the outline panel. .PP \fI\f(CI\*(C`refresh_menu\*(C'\fI\fR .IX Subsection "refresh_menu" .PP .Vb 1 \& $main\->refresh_menu; .Ve .PP Force a refresh of all menus. It can enable / disable menu entries depending on current document or Padre internal state. .PP \fI\f(CI\*(C`refresh_menu_plugins\*(C'\fI\fR .IX Subsection "refresh_menu_plugins" .PP .Vb 1 \& $main\->refresh_menu_plugins; .Ve .PP Force a refresh of just the plug-in menus. .ie n .SS """refresh_notebook""" .el .SS "\f(CWrefresh_notebook\fP" .IX Subsection "refresh_notebook" .Vb 1 \& $main\->refresh_notebook .Ve .PP Force a refresh of the notebook panel titles .PP \fI\f(CI\*(C`refresh_windowlist\*(C'\fI\fR .IX Subsection "refresh_windowlist" .PP .Vb 1 \& $main\->refresh_windowlist .Ve .PP Force a refresh of the list of windows in the window menu .PP \fI\f(CI\*(C`refresh_recent\*(C'\fI\fR .IX Subsection "refresh_recent" .PP Specifically refresh the Recent Files entries in the File dialog .PP \fI\f(CI\*(C`refresh_toolbar\*(C'\fI\fR .IX Subsection "refresh_toolbar" .PP .Vb 1 \& $main\->refresh_toolbar; .Ve .PP Force a refresh of Padre's toolbar. .PP \fI\f(CI\*(C`refresh_status\*(C'\fI\fR .IX Subsection "refresh_status" .PP .Vb 1 \& $main\->refresh_status; .Ve .PP Force a refresh of Padre's status bar. .PP \fI\f(CI\*(C`refresh_status_template\*(C'\fI\fR .IX Subsection "refresh_status_template" .PP .Vb 1 \& $main\->refresh_status_templat; .Ve .PP Force a refresh of Padre's status bar. The part that is driven by a template. .PP \fI\f(CI\*(C`refresh_cursorpos\*(C'\fI\fR .IX Subsection "refresh_cursorpos" .PP .Vb 1 \& $main\->refresh_cursorpos; .Ve .PP Force a refresh of the position of the cursor on Padre's status bar. .PP \fI\f(CI\*(C`refresh_functions\*(C'\fI\fR .IX Subsection "refresh_functions" .PP .Vb 1 \& $main\->refresh_functions; .Ve .PP Force a refresh of the function list on the right. .PP \fI\f(CI\*(C`refresh_tasks\*(C'\fI\fR .IX Subsection "refresh_tasks" .PP .Vb 1 \& $main\->refresh_tasks; .Ve .PP Force a refresh of the \s-1TODO\s0 list on the right. .PP \fI\f(CI\*(C`refresh_directory\*(C'\fI\fR .IX Subsection "refresh_directory" .PP Force a refresh of the directory tree .PP \fI\f(CI\*(C`refresh_aui\*(C'\fI\fR .IX Subsection "refresh_aui" .PP This is a refresh method wrapper around the \f(CW\*(C`AUI\*(C'\fR \f(CW\*(C`Update\*(C'\fR method so that it can be lock-managed by the existing locking system. .PP \fI\f(CI\*(C`refresh_diff\*(C'\fI\fR .IX Subsection "refresh_diff" .PP .Vb 1 \& $main\->refresh_diff; .Ve .PP Do a refresh of saved and current document differences. This is a \*(L"rapid\*(R" change, since actual calculating differences is happening in the background. .PP \fI\f(CI\*(C`refresh_breakpoint_panel\*(C'\fI\fR .IX Subsection "refresh_breakpoint_panel" .PP .Vb 1 \& $main\->refresh_breakpoint_panel; .Ve .PP Refresh of the Breakpoints panel if open, required as we load and switch tabs. .SS "Interface Rebuilding Methods" .IX Subsection "Interface Rebuilding Methods" Those methods reconfigure Padre's main window in case of drastic changes (locale, etc.) .PP \fI\f(CI\*(C`change_locale\*(C'\fI\fR .IX Subsection "change_locale" .PP .Vb 1 \& $main\->change_locale( $locale ); .Ve .PP Change Padre's locale to \f(CW$locale\fR. This will update the \s-1GUI\s0 to reflect the new locale. .PP \fI\f(CI\*(C`relocale\*(C'\fI\fR .IX Subsection "relocale" .PP .Vb 1 \& $main\->relocale; .Ve .PP The term and method \f(CW\*(C`relocale\*(C'\fR is reserved for functionality intended to run when the application wishes to change locale (and wishes to do so without restarting). .PP Note at this point, that the new locale has already been fixed, and this method is usually called by \f(CW\*(C`change_locale()\*(C'\fR. .PP \fI\f(CI\*(C`restyle\*(C'\fI\fR .IX Subsection "restyle" .PP .Vb 1 \& $main\->restyle; .Ve .PP The term and method \f(CW\*(C`restyle\*(C'\fR is reserved for code that needs to be run when the Padre::Wx::Theme of the editor has changed and the colouring of the application needs to be changed without restarting. .PP Note that the new style must be applied to configuration before this method is called, and this method is usually called by the \f(CW\*(C`apply\*(C'\fR handler for the \&\f(CW\*(C`editor_style\*(C'\fR configuration setting. .PP \fI\f(CI\*(C`rebuild_toolbar\*(C'\fI\fR .IX Subsection "rebuild_toolbar" .PP .Vb 1 \& $main\->rebuild_toolbar; .Ve .PP Destroy and rebuild the toolbar. This method is useful because the toolbar is not really flexible, and most of the time it's better to recreate it from scratch. .SS "Tools and Dialogs" .IX Subsection "Tools and Dialogs" Those methods deal with the various panels that Padre provides, and allow to show or hide them. .PP \fI\f(CI\*(C`find_view\*(C'\fI\fR .IX Subsection "find_view" .PP .Vb 1 \& my $name = $main\->find_view(\*(AqPadre::Wx::FunctionList\*(Aq); .Ve .PP The \f(CW\*(C`find_view\*(C'\fR method locates the name of the panel in which a tool is currently being shown. We assume each tool is only being shown once. .PP Returns the name of the panel in string form (such as 'left') or false if the view is not currently being shown. .PP \fI\f(CI\*(C`show_view\*(C'\fI\fR .IX Subsection "show_view" .PP .Vb 1 \& $main\->show_view( functions => 1 ); .Ve .PP The \f(CW\*(C`show_view\*(C'\fR methods displays or hides a named view of the main window. .PP \fI\f(CI\*(C`show_functions\*(C'\fI\fR .IX Subsection "show_functions" .PP .Vb 1 \& $main\->show_functions( $visible ); .Ve .PP Show the functions panel on the right if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_tasks\*(C'\fI\fR .IX Subsection "show_tasks" .PP .Vb 1 \& $main\->show_tasks( $visible ); .Ve .PP Show the \fIto do\fR panel on the right if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_outline\*(C'\fI\fR .IX Subsection "show_outline" .PP .Vb 1 \& $main\->show_outline( $visible ); .Ve .PP Show the outline panel on the right if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_debug\*(C'\fI\fR .IX Subsection "show_debug" .PP .Vb 1 \& $main\->show_debug($visible); .Ve .PP \fI\f(CI\*(C`show_directory\*(C'\fI\fR .IX Subsection "show_directory" .PP .Vb 1 \& $main\->show_directory( $visible ); .Ve .PP Show the directory panel on the right if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_output\*(C'\fI\fR .IX Subsection "show_output" .PP .Vb 1 \& $main\->show_output( $visible ); .Ve .PP Show the output panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_findfast\*(C'\fI\fR .IX Subsection "show_findfast" .PP .Vb 1 \& $main\->show_findfast( $visible ); .Ve .PP Show the Fast Find panel at the bottom of the editor area if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_foundinfiles\*(C'\fI\fR .IX Subsection "show_foundinfiles" .PP .Vb 1 \& $main\->show_foundinfiles( $visible ); .Ve .PP Show the Find in Files panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_replaceinfiles\*(C'\fI\fR .IX Subsection "show_replaceinfiles" .PP .Vb 1 \& $main\->show_replaceinfiles( $visible ); .Ve .PP Show the Replace in Files panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_command\*(C'\fI\fR .IX Subsection "show_command" .PP .Vb 1 \& $main\->show_command( $visible ); .Ve .PP Show the command panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_syntax\*(C'\fI\fR .IX Subsection "show_syntax" .PP .Vb 1 \& $main\->show_syntax( $visible ); .Ve .PP Show the syntax panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_vcs\*(C'\fI\fR .IX Subsection "show_vcs" .PP .Vb 1 \& $main\->show_vcs( $visible ); .Ve .PP Show the version control panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_cpan\*(C'\fI\fR .IX Subsection "show_cpan" .PP .Vb 1 \& $main\->show_cpan( $visible ); .Ve .PP Show the \s-1CPAN\s0 explorer panel at the bottom if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_breakpoints\*(C'\fI\fR .IX Subsection "show_breakpoints" .PP .Vb 1 \& $main\->show_breakpoints( $visible ); .Ve .PP Show the version control panel at the left if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_debugoutput\*(C'\fI\fR .IX Subsection "show_debugoutput" .PP .Vb 1 \& $main\->show_debugoutput( $visible ); .Ve .PP Show the version control panel at the left if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .PP \fI\f(CI\*(C`show_debugger\*(C'\fI\fR .IX Subsection "show_debugger" .PP .Vb 1 \& $main\->show_debugger( $visible ); .Ve .PP Show the version control panel at the left if \f(CW$visible\fR is true. Hide it otherwise. If \f(CW$visible\fR is not provided, the method defaults to show the panel. .SS "Introspection" .IX Subsection "Introspection" The following methods allow to poke into Padre's internals. .PP \fI\f(CI\*(C`current\*(C'\fI\fR .IX Subsection "current" .PP .Vb 1 \& my $current = $main\->current; .Ve .PP Creates a Padre::Current object for the main window, giving you quick and caching access to the current various object members. .PP See Padre::Current for more information. .PP \fI\f(CI\*(C`pageids\*(C'\fI\fR .IX Subsection "pageids" .PP .Vb 1 \& my @ids = $main\->pageids; .Ve .PP Return a list of all current tab ids (integers) within the notebook. .PP \fI\f(CI\*(C`editors\*(C'\fI\fR .IX Subsection "editors" .PP .Vb 1 \& my @editors = $main\->editors; .Ve .PP Return a list of all current editors. Those are the real objects, not the ids (see \f(CW\*(C`pageids()\*(C'\fR above). .PP Note: for now, this has the same meaning as \f(CW\*(C`pages()\*(C'\fR (see above), but this will change once we get project tabs or something else. .PP \fI\f(CI\*(C`documents\*(C'\fI\fR .IX Subsection "documents" .PP .Vb 1 \& my @document = $main\->documents; .Ve .PP Return a list of all current documents, in the specific order they are open in the notebook. .PP \fI\f(CI\*(C`documents_modified\*(C'\fI\fR .IX Subsection "documents_modified" .PP Returns a list of all modified documents, in the specific order they are open in the notebook. .SS "Process Execution" .IX Subsection "Process Execution" The following methods run an external command, for example to evaluate current document. .PP \fI\f(CI\*(C`on_run_command\*(C'\fI\fR .IX Subsection "on_run_command" .PP .Vb 1 \& $main\->on_run_command; .Ve .PP Prompt the user for a command to run, then run it with \f(CW\*(C`run_command()\*(C'\fR (see below). .PP Note: it probably needs to be combined with \f(CW\*(C`run_command()\*(C'\fR itself. .PP \fI\f(CI\*(C`on_run_tdd_tests\*(C'\fI\fR .IX Subsection "on_run_tdd_tests" .PP .Vb 1 \& $main\->on_run_tdd_tests; .Ve .PP Callback method, to build and then call on_run_tests .PP \fI\f(CI\*(C`on_run_tests\*(C'\fI\fR .IX Subsection "on_run_tests" .PP .Vb 1 \& $main\->on_run_tests; .Ve .PP Callback method, to run the project tests and harness them. .PP \fI\f(CI\*(C`on_run_this_test\*(C'\fI\fR .IX Subsection "on_run_this_test" .PP .Vb 1 \& $main\->on_run_this_test; .Ve .PP Callback method, to run the currently open test through prove. .PP \fI\f(CI\*(C`on_open_in_file_browser\*(C'\fI\fR .IX Subsection "on_open_in_file_browser" .PP .Vb 1 \& $main\->on_open_in_file_browser( $filename ); .Ve .PP Opens the current \f(CW$filename\fR using the operating system's file browser .PP \fI\f(CI\*(C`run_command\*(C'\fI\fR .IX Subsection "run_command" .PP .Vb 1 \& $main\->run_command( $command ); .Ve .PP Run \f(CW$command\fR and display the result in the output panel. .PP \fI\f(CI\*(C`run_document\*(C'\fI\fR .IX Subsection "run_document" .PP .Vb 1 \& $main\->run_document( $debug ) .Ve .PP Run current document. If \f(CW$debug\fR is true, document will be run with diagnostics and various debug options. .PP Note: this should really be somewhere else, but can stay here for now. .SS "Session Support" .IX Subsection "Session Support" Those methods deal with Padre sessions. A session is a set of files / tabs opened, with the position within the files saved, as well as the document that has the focus. .PP \fI\f(CI\*(C`capture_session\*(C'\fI\fR .IX Subsection "capture_session" .PP .Vb 1 \& my @session = $main\->capture_session; .Ve .PP Capture list of opened files, with information. Return a list of \&\f(CW\*(C`Padre::DB::SessionFile\*(C'\fR objects. .PP \fI\f(CI\*(C`open_session\*(C'\fI\fR .IX Subsection "open_session" .PP .Vb 1 \& $main\->open_session( $session ); .Ve .PP Try to close all files, then open all files referenced in the given \&\f(CW$session\fR (a \f(CW\*(C`Padre::DB::Session\*(C'\fR object). No return value. .PP \fI\f(CI\*(C`save_session\*(C'\fI\fR .IX Subsection "save_session" .PP .Vb 1 \& $main\->save_session( $session, @session ); .Ve .PP Try to save \f(CW@session\fR files (\f(CW\*(C`Padre::DB::SessionFile\*(C'\fR objects, such as what is returned by \f(CW\*(C`capture_session()\*(C'\fR \- see above) to database, associated to \f(CW$session\fR. Note that \f(CW$session\fR should already exist. .SS "User Interaction" .IX Subsection "User Interaction" Various methods to help send information to user. .PP Some methods are inherited from Padre::Wx::Role::Dialog. .PP \fI\f(CI\*(C`status\*(C'\fI\fR .IX Subsection "status" .PP .Vb 1 \& $main\->status($msg); .Ve .PP Temporarily change the status bar leftmost block only to some message. .PP This is a super-quick method intended for transient messages as short as a few tens of milliseconds (for example printing all directories read during a recursive file scan). .PP \fI\f(CI\*(C`info\*(C'\fI\fR .IX Subsection "info" .PP .Vb 1 \& $main\->info($msg); .Ve .PP Print a message on the status bar or within a dialog box depending on the users preferences setting. .PP The dialog has only a \s-1OK\s0 button and there is no return value. .PP \fI\f(CI\*(C`prompt\*(C'\fI\fR .IX Subsection "prompt" .PP .Vb 1 \& my $value = $main\->prompt( $title, $subtitle, $key ); .Ve .PP Prompt user with a dialog box about the value that \f(CW$key\fR should have. Return this value, or \f(CW\*(C`undef\*(C'\fR if user clicked \f(CW\*(C`cancel\*(C'\fR. .PP \fI\f(CI\*(C`simple_prompt\*(C'\fI\fR .IX Subsection "simple_prompt" .PP .Vb 1 \& my $value = $main\->simple_prompt( $title, $subtitle, $default_text ); .Ve .PP Prompt user with a dialog box about the value that \f(CW$key\fR should have. Return this value, or \f(CW\*(C`undef\*(C'\fR if user clicked \f(CW\*(C`cancel\*(C'\fR. .SS "Search and Replace" .IX Subsection "Search and Replace" These methods provide the highest level abstraction for entry into the various search and replace functions and dialogs. .PP However, they still represent abstract logic and should \s-1NOT\s0 be tied directly to keystroke or menu events. .PP \fI\f(CI\*(C`find_dialog\*(C'\fI\fR .IX Subsection "find_dialog" .PP .Vb 1 \& $main\->find_dialog; .Ve .PP Show the find dialog, escalating from the fast find if needed .PP \fI\f(CI\*(C`search_next\*(C'\fI\fR .IX Subsection "search_next" .PP .Vb 2 \& # Next match for a new explicit search \& $main\->search_next( $search ); \& \& # Next match on current search \& $main\->search_next; .Ve .PP Find the next match for the current search. .PP If no files are open, silently do nothing (don't even remember the new search) .PP \fI\f(CI\*(C`search_previous\*(C'\fI\fR .IX Subsection "search_previous" .PP .Vb 2 \& # Previous match for a new search \& $main\->search_previous( $search ); \& \& # Previous match on current search (or show Find dialog if none) \& $main\->search_previous; .Ve .PP Find the previous match for the current search, or spawn the Find dialog. .PP If no files are open, do nothing. .PP \fI\f(CI\*(C`replace_next\*(C'\fI\fR .IX Subsection "replace_next" .PP .Vb 2 \& # Next replace for a new search \& $main\->replace_next( $search ); \& \& # Next replace on current search (or show Find dialog if none) \& $main\->replace_next; .Ve .PP Replace the next match for the current search, or spawn the Replace dialog. .PP If no files are open, do nothing. .PP \fI\f(CI\*(C`replace_all\*(C'\fI\fR .IX Subsection "replace_all" .PP .Vb 2 \& # Replace all for a new search \& $main\->replace_all( $search ); \& \& # Replace all for the current search (or show Replace dialog if none) \& $main\->replace_all; .Ve .PP Replace all matches for the current search, or spawn the Replace dialog. .PP If no files are open, do nothing. .SS "General Events" .IX Subsection "General Events" Those methods are the various callbacks registered in the menus or whatever widgets Padre has. .PP \fI\f(CI\*(C`on_brace_matching\*(C'\fI\fR .IX Subsection "on_brace_matching" .PP .Vb 1 \& $main\->on_brace_matching; .Ve .PP Jump to brace matching current the one at current position. .PP \fI\f(CI\*(C`on_autocompletion\*(C'\fI\fR .IX Subsection "on_autocompletion" .PP .Vb 1 \& $main\->on_autocompletion; .Ve .PP Try to auto complete current word being typed, depending on document type. .PP \fI\f(CI\*(C`on_activate\*(C'\fI\fR .IX Subsection "on_activate" .PP The \f(CW\*(C`on_activate\*(C'\fR method is called when Padre has been in the background for some period of time, and has just returned to the foreground. .PP It calls a subset of refresh methods where something may have been changed by the user while they were using some other program that wasn't Padre. .PP \fI\f(CI\*(C`on_deactivate\*(C'\fI\fR .IX Subsection "on_deactivate" .PP The \f(CW\*(C`on_deactivate\*(C'\fR method is called when the user has switched away from Padre to some other application. .PP Currently all this does is hide away from short-lived tools like Fast Find if they are open, so that when the user returns it is not to a stale \&\s-1UI\s0 context. .PP \fI\f(CI\*(C`on_close_window\*(C'\fI\fR .IX Subsection "on_close_window" .PP Callback when window is about to be closed. This is our last chance to veto the \f(CW$event\fR close, e.g. when some files are not yet saved. .PP If close is confirmed, save configuration to disk. Also, capture current session to be able to restore it next time if user set Padre to open last session on start-up. Clean up all Task Manager's tasks. .PP \fI\f(CI\*(C`setup_editors\*(C'\fI\fR .IX Subsection "setup_editors" .PP .Vb 1 \& $main\->setup_editors( @files ); .Ve .PP Setup (new) tabs for \f(CW@files\fR, and update the \s-1GUI.\s0 If \f(CW@files\fR is \f(CW\*(C`undef\*(C'\fR, open an empty document. .PP \fI\f(CI\*(C`on_new\*(C'\fI\fR .IX Subsection "on_new" .PP .Vb 1 \& $main\->on_new; .Ve .PP Create a new empty tab. No return value. .PP \fI\f(CI\*(C`setup_editor\*(C'\fI\fR .IX Subsection "setup_editor" .PP .Vb 1 \& $main\->setup_editor( $file ); .Ve .PP Setup a new tab / buffer and open \f(CW$file\fR, then update the \s-1GUI.\s0 Recycle current buffer if there's only one empty tab currently opened. If \f(CW$file\fR is already opened, focus on the tab displaying it. Finally, if \f(CW$file\fR does not exist, create an empty file before opening it. .PP \fI\f(CI\*(C`create_tab\*(C'\fI\fR .IX Subsection "create_tab" .PP .Vb 1 \& my $tab = $main\->create_tab; .Ve .PP Create a new tab in the notebook, and return its id (an integer). .PP \fI\f(CI\*(C`on_deparse\*(C'\fI\fR .IX Subsection "on_deparse" .PP Show what perl thinks about your code using B::Deparse .PP \fI\f(CI\*(C`on_open_selection\*(C'\fI\fR .IX Subsection "on_open_selection" .PP .Vb 1 \& $main\->on_open_selection; .Ve .PP Try to open current selection in a new tab. Different combinations are tried in order: as full path, as path relative to \f(CW\*(C`cwd\*(C'\fR (where the editor was started), as path to relative to where the current file is, if we are in a Perl file or Perl environment also try if the thing might be a name of a module and try to open it locally or from \f(CW@INC\fR. .PP No return value. .PP \fI\f(CI\*(C`on_open_all_recent_files\*(C'\fI\fR .IX Subsection "on_open_all_recent_files" .PP .Vb 1 \& $main\->on_open_all_recent_files; .Ve .PP Try to open all recent files within Padre. No return value. .PP \fI\f(CI\*(C`on_filter_tool\*(C'\fI\fR .IX Subsection "on_filter_tool" .PP .Vb 1 \& $main\->on_filter_tool; .Ve .PP Prompt user for a command to filter the selection/document. .PP \fI\f(CI\*(C`on_open_url\*(C'\fI\fR .IX Subsection "on_open_url" .PP .Vb 1 \& $main\->on_open_url; .Ve .PP Prompt user for \s-1URL\s0 to open and open it as a new tab. .PP Should be merged with \->on_open or at least a browsing function should be added. .PP \fI\f(CI\*(C`on_open\*(C'\fI\fR .IX Subsection "on_open" .PP .Vb 1 \& $main\->on_open; .Ve .PP Prompt user for file(s) to open, and open them as new tabs. No return value. .PP \fI\f(CI\*(C`on_open_with_default_system_editor\*(C'\fI\fR .IX Subsection "on_open_with_default_system_editor" .PP .Vb 1 \& $main\->on_open_with_default_system_editor($filename); .Ve .PP Opens \f(CW$filename\fR in the default system editor .PP \fI\f(CI\*(C`on_open_in_command_line\*(C'\fI\fR .IX Subsection "on_open_in_command_line" .PP .Vb 1 \& $main\->on_open_in_command_line($filename); .Ve .PP Opens a command line/shell using the working directory of \f(CW$filename\fR .PP \fI\f(CI\*(C`on_open_example\*(C'\fI\fR .IX Subsection "on_open_example" .PP .Vb 1 \& $main\->on_open_example; .Ve .PP Opens the examples file dialog .PP \fI\f(CI\*(C`on_open_last_closed_file\*(C'\fI\fR .IX Subsection "on_open_last_closed_file" .PP .Vb 1 \& $main\->on_open_last_closed_file; .Ve .PP Opens the last closed file in similar fashion to Chrome and Firefox. .PP \fI\f(CI\*(C`reload_editor\*(C'\fI\fR .IX Subsection "reload_editor" .PP .Vb 1 \& $main\->reload_editor; .Ve .PP Try to reload a file from disk. Display an error if something went wrong. .PP Returns 1 on success and 0 in case of and error. .PP \fI\f(CI\*(C`reload_editors\*(C'\fI\fR .IX Subsection "reload_editors" .PP .Vb 1 \& my $success = $main\->reload_editors(@editors); .Ve .PP Reloads a series of editors. .PP Returns true upon success, false otherwise. .PP \fI\f(CI\*(C`reload_all\*(C'\fI\fR .IX Subsection "reload_all" .PP .Vb 1 \& my $success = $main\->reload_all; .Ve .PP Reload all open files from disk. .ie n .SS """reload_dialog""" .el .SS "\f(CWreload_dialog\fP" .IX Subsection "reload_dialog" .Vb 1 \& $main\->reload_dialog; .Ve .PP Displays the \*(L"Reload Files\*(R" dialog, asking the user which files should be reloaded and reloading them as specified. .PP \fI\f(CI\*(C`on_save\*(C'\fI\fR .IX Subsection "on_save" .PP .Vb 1 \& my $success = $main\->on_save; .Ve .PP Try to save current document. Prompt user for a file name if document was new (see \f(CW\*(C`on_save_as()\*(C'\fR above). Return true if document has been saved, false otherwise. .PP \fI\f(CI\*(C`on_save_as\*(C'\fI\fR .IX Subsection "on_save_as" .PP .Vb 1 \& my $was_saved = $main\->on_save_as; .Ve .PP Prompt user for a new file name to save current document, and save it. Returns true if saved, false if cancelled. .PP \fI\f(CI\*(C`on_save_intuition\*(C'\fI\fR .IX Subsection "on_save_intuition" .PP .Vb 1 \& my $success = $main\->on_save_intuition; .Ve .PP Try to automatically determine an appropriate file name and save it, based entirely on the content of the file. .PP Only do this for new documents, otherwise behave like a regular save. .PP \fI\f(CI\*(C`on_save_all\*(C'\fI\fR .IX Subsection "on_save_all" .PP .Vb 1 \& my $success = $main\->on_save_all; .Ve .PP Try to save all opened documents. Return true if all documents were saved, false otherwise. .PP \fI\f(CI\*(C`_save_buffer\*(C'\fI\fR .IX Subsection "_save_buffer" .PP .Vb 1 \& my $success = $main\->_save_buffer($id); .Ve .PP Try to save buffer in tab \f(CW$id\fR. This is the method used underneath by all \f(CW\*(C`on_save_*()\*(C'\fR methods. It will check if document has been updated out of Padre before saving, and report an error if something went wrong. Return true if buffer was saved, false otherwise. .PP \fI\f(CI\*(C`on_close\*(C'\fI\fR .IX Subsection "on_close" .PP .Vb 1 \& $main\->on_close( $event ); .Ve .PP Handler when there is a close \f(CW$event\fR. Veto it if it's from the \f(CW\*(C`AUI\*(C'\fR notebook, since Wx will try to close the tab no matter what. Otherwise, close current tab. No return value. .PP \fI\f(CI\*(C`close\*(C'\fI\fR .IX Subsection "close" .PP .Vb 1 \& my $success = $main\->close( $id ); .Ve .PP Request to close document in tab \f(CW$id\fR, or current one if no \f(CW$id\fR provided. Return true if closed, false otherwise. .PP \fI\f(CI\*(C`close_all\*(C'\fI\fR .IX Subsection "close_all" .PP .Vb 1 \& my $success = $main\->close_all( $skip ); .Ve .PP Try to close all documents. If \f(CW$skip\fR is specified (an integer), don't close the tab with this id. Return true upon success, false otherwise. .PP \fI\f(CI\*(C`close_some\*(C'\fI\fR .IX Subsection "close_some" .PP .Vb 1 \& my $success = $main\->close_some(@pages_to_close); .Ve .PP Try to close all documents. Return true upon success, false otherwise. .PP \fI\f(CI\*(C`close_where\*(C'\fI\fR .IX Subsection "close_where" .PP .Vb 5 \& # Close all files in current project \& my $project = Padre::Current\->document\->project_dir; \& my $success = $main\->close_where( sub { \& $_[0]\->project_dir eq $project \& } ); .Ve .PP The \f(CW\*(C`close_where\*(C'\fR method is for closing multiple document windows. It takes a subroutine as a parameter and calls that subroutine for each currently open document, passing the document as the first parameter. .PP Any documents that return true will be closed. .PP \fI\f(CI\*(C`on_delete\*(C'\fI\fR .IX Subsection "on_delete" .PP .Vb 1 \& $main\->on_delete; .Ve .PP Close the current tab and remove the associated file from disk. No return value. .PP \fI\f(CI\*(C`delete\*(C'\fI\fR .IX Subsection "delete" .PP .Vb 1 \& my $success = $main\->delete( $id ); .Ve .PP Request to close document in tab \f(CW$id\fR, or current one if no \f(CW$id\fR provided and \s-1DELETE THE FILE FROM DISK.\s0 Return true if closed, false otherwise. .PP \fI\f(CI\*(C`on_nth_path\*(C'\fI\fR .IX Subsection "on_nth_path" .PP .Vb 1 \& $main\->on_nth_pane( $id ); .Ve .PP Put focus on tab \f(CW$id\fR in the notebook. Return true upon success, false otherwise. .PP \fI\f(CI\*(C`on_next_pane\*(C'\fI\fR .IX Subsection "on_next_pane" .PP .Vb 1 \& $main\->on_next_pane; .Ve .PP Put focus on tab next to current document. Currently, only left to right order is supported, but later on it can be extended to follow a last seen order. .PP No return value. .PP \fI\f(CI\*(C`on_prev_pane\*(C'\fI\fR .IX Subsection "on_prev_pane" .PP .Vb 1 \& $main\->on_prev_pane; .Ve .PP Put focus on tab previous to current document. Currently, only right to left order is supported, but later on it can be extended to follow a reverse last seen order. .PP No return value. .PP \fI\f(CI\*(C`on_join_lines\*(C'\fI\fR .IX Subsection "on_join_lines" .PP .Vb 1 \& $main\->on_join_lines; .Ve .PP Join current line with next one (X la \fBvi\fR with \f(CW\*(C`Ctrl+J\*(C'\fR). No return value. .SS "Preferences and toggle methods" .IX Subsection "Preferences and toggle methods" Those methods allow to change Padre's preferences. .PP \fI\f(CI\*(C`zoom\*(C'\fI\fR .IX Subsection "zoom" .PP .Vb 1 \& $main\->zoom( $factor ); .Ve .PP Apply zoom \f(CW$factor\fR to Padre's documents. Factor can be either positive or negative. .PP \fI\f(CI\*(C`show_regex_editor\*(C'\fI\fR .IX Subsection "show_regex_editor" .PP .Vb 1 \& $main\->show_regex_editor; .Ve .PP Open Padre's regular expression editor. No return value. .PP \fI\f(CI\*(C`show_perl_filter\*(C'\fI\fR .IX Subsection "show_perl_filter" .PP .Vb 1 \& $main\->show_perl_filter; .Ve .PP Open Padre's filter-through-perl. No return value. .PP \fI\f(CI\*(C`editor_linenumbers\*(C'\fI\fR .IX Subsection "editor_linenumbers" .PP .Vb 1 \& $main\->editor_linenumbers(1); .Ve .PP Set visibility of line numbers on the left of the document. .PP No return value. .PP \fI\f(CI\*(C`editor_folding\*(C'\fI\fR .IX Subsection "editor_folding" .PP .Vb 1 \& $main\->editor_folding(1); .Ve .PP Enabled or disables code folding. .PP No return value. .PP \fI\f(CI\*(C`editor_currentline\*(C'\fI\fR .IX Subsection "editor_currentline" .PP .Vb 1 \& $main\->editor_currentline(1); .Ve .PP Enable or disable background highlighting of the current line. .PP No return value. .PP \fI\f(CI\*(C`editor_rightmargin\*(C'\fI\fR .IX Subsection "editor_rightmargin" .PP .Vb 1 \& $main\->editor_rightmargin(1); .Ve .PP Enable or disable display of the right margin. .PP No return value. .PP \fI\f(CI\*(C`editor_indentationguides\*(C'\fI\fR .IX Subsection "editor_indentationguides" .PP .Vb 1 \& $main\->editor_indentationguides(1); .Ve .PP Enable or disable visibility of the indentation guides. .PP No return value. .PP \fI\f(CI\*(C`editor_eol\*(C'\fI\fR .IX Subsection "editor_eol" .PP .Vb 1 \& $main\->editor_eol(1); .Ve .PP Show or hide end of line carriage return characters. .PP No return value. .PP \fI\f(CI\*(C`editor_whitespace\*(C'\fI\fR .IX Subsection "editor_whitespace" .PP .Vb 1 \& $main\->editor_whitespace; .Ve .PP Show/hide spaces and tabs (with dots and arrows respectively). No return value. .ie n .SS """editor_focus""" .el .SS "\f(CWeditor_focus\fP" .IX Subsection "editor_focus" .Vb 1 \& $main\->editor_focus; .Ve .PP Return focus to the current editor, if one exists. This method is provided as a convenience for dialog writers who wish to return focus. .PP \fI\f(CI\*(C`on_word_wrap\*(C'\fI\fR .IX Subsection "on_word_wrap" .PP .Vb 1 \& $main\->on_word_wrap; .Ve .PP Toggle word wrapping for current document. No return value. .PP \fI\f(CI\*(C`show_toolbar\*(C'\fI\fR .IX Subsection "show_toolbar" .PP .Vb 1 \& $main\->show_toolbar; .Ve .PP Toggle toolbar visibility. No return value. .PP \fI\f(CI\*(C`show_statusbar\*(C'\fI\fR .IX Subsection "show_statusbar" .PP .Vb 1 \& $main\->show_statusbar; .Ve .PP Toggle status bar visibility. No return value. .PP \fI\f(CI\*(C`on_toggle_lockinterface\*(C'\fI\fR .IX Subsection "on_toggle_lockinterface" .PP .Vb 1 \& $main\->on_toggle_lockinterface; .Ve .PP Toggle possibility for user to change Padre's external aspect. No return value. .PP \fI\f(CI\*(C`on_insert_from_file\*(C'\fI\fR .IX Subsection "on_insert_from_file" .PP .Vb 1 \& $main\->on_insert_from_file; .Ve .PP Prompt user for a file to be inserted at current position in current document. No return value. .PP \fI\f(CI\*(C`convert_to\*(C'\fI\fR .IX Subsection "convert_to" .PP .Vb 1 \& $main\->convert_to( $eol_style ); .Ve .PP Convert document to \f(CW$eol_style\fR line endings (can be one of \f(CW\*(C`WIN\*(C'\fR, \&\f(CW\*(C`UNIX\*(C'\fR, or \f(CW\*(C`MAC\*(C'\fR). No return value. .PP \fI\f(CI\*(C`editor_of_file\*(C'\fI\fR .IX Subsection "editor_of_file" .PP .Vb 1 \& my $editor = $main\->editor_of_file( $file ); .Ve .PP Return the editor (a \f(CW\*(C`Padre::Wx::Editor\*(C'\fR object) containing the wanted \&\f(CW$file\fR, or \f(CW\*(C`undef\*(C'\fR if file is not opened currently. .PP \fI\f(CI\*(C`editor_id\*(C'\fI\fR .IX Subsection "editor_id" .PP .Vb 1 \& my $id = $main\->editor_id( $editor ); .Ve .PP Given \f(CW$editor\fR, return the tab id holding it, or \f(CW\*(C`undef\*(C'\fR if it was not found. .PP Note: can this really work? What happens when we split a window? .PP \fI\f(CI\*(C`run_in_padre\*(C'\fI\fR .IX Subsection "run_in_padre" .PP .Vb 1 \& $main\->run_in_padre; .Ve .PP Evaluate current document within Padre. It means it can access all of Padre's internals, and wreak havoc. Display an error message if the evaluation went wrong, dump the result in the output panel otherwise. .PP No return value. .ie n .SS """STC"" related methods" .el .SS "\f(CWSTC\fP related methods" .IX Subsection "STC related methods" Those methods are needed to have a smooth \f(CW\*(C`STC\*(C'\fR experience. .PP \fI\f(CI\*(C`on_stc_style_needed\*(C'\fI\fR .IX Subsection "on_stc_style_needed" .PP .Vb 1 \& $main\->on_stc_style_needed( $event ); .Ve .PP Handler of \f(CW\*(C`EVT_STC_STYLENEEDED\*(C'\fR \f(CW$event\fR. Used to work around some edge cases in scintilla. No return value. .PP \fI\f(CI\*(C`on_stc_updateui\*(C'\fI\fR .IX Subsection "on_stc_updateui" .PP .Vb 1 \& $main\->on_stc_updateui; .Ve .PP Handler called on every movement of the cursor. No return value. .PP \fI\f(CI\*(C`on_stc_change\*(C'\fI\fR .IX Subsection "on_stc_change" .PP .Vb 1 \& $main\->on_stc_change; .Ve .PP Handler of the \f(CW\*(C`EVT_STC_CHANGE\*(C'\fR event. Doesn't do anything. No return value. .PP \fI\f(CI\*(C`on_stc_char_needed\*(C'\fI\fR .IX Subsection "on_stc_char_needed" .PP .Vb 1 \& $main\->on_stc_char_added; .Ve .PP This handler is called when a character is added. No return value. See .PP \&\s-1TO DO:\s0 maybe we need to check this more carefully. .PP \fI\f(CI\*(C`on_aui_pane_close\*(C'\fI\fR .IX Subsection "on_aui_pane_close" .PP .Vb 1 \& $main\->on_aui_pane_close( $event ); .Ve .PP Handler called upon \f(CW\*(C`EVT_AUI_PANE_CLOSE\*(C'\fR \f(CW$event\fR. Doesn't do anything by now. .PP \fI\f(CI\*(C`on_tab_and_space\*(C'\fI\fR .IX Subsection "on_tab_and_space" .PP .Vb 1 \& $main\->on_tab_and_space( $style ); .Ve .PP Convert current document from spaces to tabs (or vice-versa) depending on \f(CW$style\fR (can be either of \f(CW\*(C`Space_to_Tab\*(C'\fR or \f(CW\*(C`Tab_to_Space\*(C'\fR). Prompts the user for how many spaces are to be used to replace tabs (whatever the replacement direction). No return value. .PP \fI\f(CI\*(C`on_delete_trailing_spaces\*(C'\fI\fR .IX Subsection "on_delete_trailing_spaces" .PP .Vb 1 \& $main\->on_delete_trailing_spaces; .Ve .PP Trim all ending spaces in current selection, or document if no text is selected. No return value. .PP \fI\f(CI\*(C`on_delete_leading_spaces\*(C'\fI\fR .IX Subsection "on_delete_leading_spaces" .PP .Vb 1 \& $main\->on_delete_leading_spaces; .Ve .PP Trim all leading spaces in current selection. No return value. .PP \fI\f(CI\*(C`timer_check_overwrite\*(C'\fI\fR .IX Subsection "timer_check_overwrite" .PP .Vb 1 \& $main\->timer_check_overwrite; .Ve .PP Called every n seconds to check if file has been overwritten outside of Padre. If that's the case, prompts the user whether s/he wants to reload the document. No return value. .PP \fI\f(CI\*(C`on_duplicate\*(C'\fI\fR .IX Subsection "on_duplicate" .PP .Vb 1 \& $main\->on_duplicate; .Ve .PP Create a new document and copy the contents of the current file. No return value. .SS "Code Starter Methods" .IX Subsection "Code Starter Methods" These methods provide skeleton generators for a variety of file types, with the preferences of the user applied already. .PP \fI\f(CI\*(C`start_perl6_script\*(C'\fI\fR .IX Subsection "start_perl6_script" .PP .Vb 1 \& $main\->start_perl6_script; .Ve .PP Create a new blank Perl 6 script, applying the user's style preferences if possible. .SS "Auxiliary Methods" .IX Subsection "Auxiliary Methods" Various methods that did not fit exactly in above categories... .PP \fI\f(CI\*(C`action\*(C'\fI\fR .IX Subsection "action" .PP .Vb 1 \& Padre::Current\->main\->action(\*(Aqhelp.about\*(Aq); .Ve .PP Single execution of a named action. .PP \fI\f(CI\*(C`setup_bindings\*(C'\fI\fR .IX Subsection "setup_bindings" .PP .Vb 1 \& $main\->setup_bindings; .Ve .PP Setup the various bindings needed to handle output pane correctly. .PP Note: I'm not sure those are really needed... .PP \fI\f(CI\*(C`key_up\*(C'\fI\fR .IX Subsection "key_up" .PP .Vb 1 \& $main\->key_up( $event ); .Ve .PP Callback for when a key up \f(CW$event\fR happens in Padre. This handles the various \f(CW\*(C`Ctrl\*(C'\fR+key combinations used within Padre. .PP \fI\f(CI\*(C`new_document_from_string\*(C'\fI\fR .IX Subsection "new_document_from_string" .PP .Vb 1 \& $main\->new_document_from_string( $string, $mimetype, $encoding ); .Ve .PP Create a new document in Padre with the string value. .PP Pass in an optional mime type to have Padre colorize the text correctly. .PP Pass in an optional encoding name that will be used when saving the file. .PP Note: this method may not belong here... .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008\-2013 The Padre development team as listed in Padre.pm. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \&\s-1LICENSE\s0 file included with this module.