1Padre::Wx::Main(3)    User Contributed Perl Documentation   Padre::Wx::Main(3)
2
3
4

NAME

6       Padre::Wx::Main - The main window for the Padre IDE
7

DESCRIPTION

9       "Padre::Wx::Main" implements Padre's main window. It is the window
10       containing the menus, the notebook with all opened tabs, the various
11       sub-windows (outline, subs, output, errors, etc).
12
13       It inherits from "Wx::Frame", so check Wx documentation to see all the
14       available methods that can be applied to it besides the added ones (see
15       below).
16

PUBLIC API

18   Constructor
19       There's only one constructor for this class.
20
21       "new"
22
23           my $main = Padre::Wx::Main->new($ide);
24
25       Create and return a new Padre main window. One should pass a "Padre"
26       object as argument, to get a reference to the Padre application.
27
28   Accessors
29       The following methods access the object attributes. They are both
30       getters and setters, depending on whether you provide them with an
31       argument. Use them wisely.
32
33       Accessors to GUI elements:
34
35       ·   "title"
36
37       ·   "config"
38
39       ·   "aui"
40
41       ·   "menu"
42
43       ·   "notebook"
44
45       ·   "left"
46
47       ·   "right"
48
49       ·   "functions"
50
51       ·   "todo"
52
53       ·   "outline"
54
55       ·   "directory"
56
57       ·   "bottom"
58
59       ·   "output"
60
61       ·   "syntax"
62
63       Accessors to operating data:
64
65       ·   "cwd"
66
67       Accessors that may not belong to this class:
68
69       "about"
70
71           my $dialog = $main->about;
72
73       Returns the About Padre dialog, creating it if needed.
74
75       "left"
76
77           my $panel = $main->left;
78
79       Returns the left toolbar container panel, creating it if needed.
80
81       "right"
82
83           my $panel = $main->right;
84
85       Returns the right toolbar container panel, creating it if needed.
86
87       "bottom"
88
89           my $panel = $main->bottom;
90
91       Returns the bottom toolbar container panel, creating it if needed.
92
93       "find"
94
95           my $find = $main->find;
96
97       Returns the find dialog, creating a new one if needed.
98
99       "findfast"
100
101           my $find = $main->findfast;
102
103       Return current quick find dialog. Create a new one if needed.
104
105       "replace"
106
107           my $replace = $main->replace;
108
109       Return current replace dialog. Create a new one if needed.
110
111   Public Methods
112       "load_files"
113
114           $main->load_files;
115
116       Load any default files: session from command-line, explicit list on
117       command- line, or last session if user has this setup, a new file, or
118       nothing.
119
120   "lock"
121         my $lock = $main->lock('UPDATE', 'BUSY', 'refresh_toolbar');
122
123       Create and return a guard object that holds resource locks of various
124       types.
125
126       The method takes a parameter list of the locks you wish to exist for
127       the current scope. Special types of locks are provided in capitals,
128       refresh/method locks are provided in lowercase.
129
130       The "UPDATE" lock creates a Wx repaint lock using the built in
131       Wx::WindowUpdateLocker class.
132
133       You should use an update lock during GUI construction/modification to
134       prevent screen flicker. As a side effect of not updating, the GUI
135       changes happen significantly faster as well. Update locks should only
136       be held for short periods of time, as the operating system will begin
137       to treat your\ application as "hung" if an update lock persists for
138       more than a few seconds. In this situation, you may begin to see GUI
139       corruption.
140
141       The "BUSY" lock creates a Wx "busy" lock using the built in
142       Wx::WindowDisabler class.
143
144       You should use a busy lock during times when Padre has to do a long
145       and/or complex operation in the foreground, or when you wish to disable
146       use of any user interface elements until a background thread is
147       finished.
148
149       Busy locks can be held for long periods of time, however your users may
150       start to suspect trouble if you do not provide any periodic feedback to
151       them.
152
153       Lowercase lock names are used to delay the firing of methods that will
154       themselves generate GUI events you may want to delay until you are sure
155       you want to rebuild the GUI.
156
157       For example, opening a file will require a Padre::Wx::Main refresh
158       call, which will itself generate more refresh calls on the directory
159       browser, the function list, output window, menus, and so on.
160
161       But if you open more than one file at a time, you don't want to refresh
162       the menu for the first file, only to do it again on the second, third
163       and fourth files.
164
165       By creating refresh locks in the top level operation, you allow the
166       lower level operation to make requests for parts of the GUI to be
167       refreshed, but have the actual refresh actions delayed until the lock
168       expires.
169
170       This should make operations with a high GUI intensity both simpler and
171       faster.
172
173       The name of the lowercase MUST be the name of a Padre::Wx::Main method,
174       which will be fired (with no parameters) when the method lock expires.
175
176   locked
177       This method provides the ability to check if a resource is currently
178       locked.
179
180   Single Instance Server
181       Padre embeds a small network server to handle single instance. Here are
182       the methods that allow to control this embedded server.
183
184       "single_instance_address"
185
186           $main->single_instance_address;
187
188       Determines the location of the single instance server for this instance
189       of Padre.
190
191       my $single_instance_port = 4444;
192
193       "single_instance_start"
194
195           $main->single_instance_start;
196
197       Start the embedded server. Create it if it doesn't exist. Return true
198       on success, die otherwise.
199
200       "single_instance_stop"
201
202           $main->single_instance_stop;
203
204       Stop & destroy the embedded server if it was running. Return true on
205       success.
206
207       "single_instance_running"
208
209           my $is_running = $main->single_instance_running;
210
211       Return true if the embedded server is currently running.
212
213       "single_instance_connect"
214
215           $main->single_instance_connect;
216
217       Callback called when a client is connecting to embedded server. This is
218       the case when user starts a new Padre, and preference "open all
219       documents in single Padre instance" is checked.
220
221       "single_instance_command"
222
223           $main->single_instance_command( $line );
224
225       Callback called when a client has issued a command $line while
226       connected on embedded server. Current supported commands are "open
227       $file" and "focus".
228
229   Window Geometry
230       Query properties about the state and shape of the main window
231
232       "window_width"
233
234           my $width = $main->window_width;
235
236       Return the main window width.
237
238       "window_height"
239
240           my $width = $main->window_height;
241
242       Return the main window height.
243
244       "window_left"
245
246           my $left = $main->window_left;
247
248       Return the main window position from the left of the screen.
249
250       "window_top"
251
252           my $top = $main->window_top;
253
254       Return the main window position from the top of the screen.
255
256   "window_save"
257           $main->window_save;
258
259       Saves the current main window geometry (left, top, width, height,
260       maximized).
261
262       Called during Maximize, Iconize, ShowFullScreen and Padre shutdown so
263       we can restart the next Padre instance at the last good
264       non-Maximize/Iconize location.
265
266       Saves and returns true if and only the window is regular or maximized.
267
268       Skips and returns false if the window is currently hidden, iconised, or
269       full screen.
270
271   Refresh Methods
272       Those methods refresh parts of Padre main window. The term "refresh"
273       and the following methods are reserved for fast, blocking, real-time
274       updates to the GUI, implying rapid changes.
275
276       "refresh"
277
278           $main->refresh;
279
280       Force refresh of all elements of Padre main window. (see below for
281       individual refresh methods)
282
283       "add_refresh_listener"
284
285       Adds an object which will have its "->refresh" method called whenever
286       the main refresh event is triggered. The refresh listener is stored as
287       a weak reference so make sure that you keep the listener alive
288       elsewhere.
289
290       If your object does not have a "->refresh" method, pass in a code
291       reference - it will be called instead.
292
293       Note that this method must return really quick. If you plan to do work
294       that takes longer, launch it via the Action::Queue mechanism and
295       perform it in the background.
296
297       "refresh_title"
298
299       Sets or updates the Window title.
300
301       "refresh_syntaxcheck"
302
303           $main->refresh_syntaxcheck;
304
305       Do a refresh of document syntax checking. This is a "rapid" change,
306       since actual syntax check is happening in the background.
307
308   "refresh_outline"
309           $main->refresh_outline;
310
311       Force a refresh of the outline panel.
312
313       "refresh_menu"
314
315           $main->refresh_menu;
316
317       Force a refresh of all menus. It can enable / disable menu entries
318       depending on current document or Padre internal state.
319
320       "refresh_menu_plugins"
321
322           $main->refresh_menu_plugins;
323
324       Force a refresh of just the plug-in menus.
325
326       "refresh_windowlist"
327
328           $main->refresh_windowlist
329
330       Force a refresh of the list of windows in the window menu
331
332       "refresh_recent"
333
334       Specifically refresh the Recent Files entries in the File dialog
335
336       "refresh_toolbar"
337
338           $main->refresh_toolbar;
339
340       Force a refresh of Padre's toolbar.
341
342       "refresh_status"
343
344           $main->refresh_status;
345
346       Force a refresh of Padre's status bar.
347
348       "refresh_status_template"
349
350           $main->refresh_status_templat;
351
352       Force a refresh of Padre's status bar.  The part that is driven by a
353       template.
354
355       "refresh_cursorpos"
356
357           $main->refresh_cursorpos;
358
359       Force a refresh of the position of the cursor on Padre's status bar.
360
361       "refresh_functions"
362
363           $main->refresh_functions;
364
365       Force a refresh of the function list on the right.
366
367       "refresh_todo"
368
369           $main->refresh_todo;
370
371       Force a refresh of the TODO list on the right.
372
373       "refresh_directory"
374
375       Force a refresh of the directory tree
376
377   "refresh_aui"
378       This is a refresh method wrapper around the "AUI" "Update" method so
379       that it can be lock-managed by the existing locking system.
380
381   Interface Rebuilding Methods
382       Those methods reconfigure Padre's main window in case of drastic
383       changes (locale, etc.)
384
385       "change_style"
386
387           $main->change_style( $style, $private );
388
389       Apply $style to Padre main window. $private is a Boolean true if the
390       style is located in user's private Padre directory.
391
392       "change_locale"
393
394           $main->change_locale( $locale );
395
396       Change Padre's locale to $locale. This will update the GUI to reflect
397       the new locale.
398
399       "relocale"
400
401           $main->relocale;
402
403       The term and method "relocale" is reserved for functionality intended
404       to run when the application wishes to change locale (and wishes to do
405       so without restarting).
406
407       Note at this point, that the new locale has already been fixed, and
408       this method is usually called by "change_locale()".
409
410       "rebuild_toolbar"
411
412           $main->rebuild_toolbar;
413
414       Destroy and rebuild the toolbar. This method is useful because the
415       toolbar is not really flexible, and most of the time it's better to
416       recreate it from scratch.
417
418   Tools and Dialogs
419       Those methods deal with the various panels that Padre provides, and
420       allow to show or hide them.
421
422       "show_functions"
423
424           $main->show_functions( $visible );
425
426       Show the functions panel on the right if $visible is true. Hide it
427       otherwise. If $visible is not provided, the method defaults to show the
428       panel.
429
430       "show_todo"
431
432           $main->show_todo( $visible );
433
434       Show the to do panel on the right if $visible is true. Hide it
435       otherwise. If $visible is not provided, the method defaults to show the
436       panel.
437
438       "show_outline"
439
440           $main->show_outline( $visible );
441
442       Show the outline panel on the right if $visible is true. Hide it
443       otherwise. If $visible is not provided, the method defaults to show the
444       panel.
445
446       "show_debug"
447
448           $main->show_debug($visible);
449
450       "show_directory"
451
452           $main->show_directory( $visible );
453
454       Show the directory panel on the right if $visible is true. Hide it
455       otherwise. If $visible is not provided, the method defaults to show the
456       panel.
457
458       "show_output"
459
460           $main->show_output( $visible );
461
462       Show the output panel at the bottom if $visible is true. Hide it
463       otherwise. If $visible is not provided, the method defaults to show the
464       panel.
465
466   "show_findfast"
467           $main->show_findfast( $visible );
468
469       Show the Fast Find panel at the bottom of the editor area if $visible
470       is true. Hide it otherwise. If $visible is not provided, the method
471       defaults to show the panel.
472
473       "show_findinfiles"
474
475           $main->show_findinfiles( $visible );
476
477       Show the Find in Files panel at the bottom if $visible is true.  Hide
478       it otherwise. If $visible is not provided, the method defaults to show
479       the panel.
480
481       "show_replaceinfiles"
482
483           $main->show_replaceinfiles( $visible );
484
485       Show the Replace in Files panel at the bottom if $visible is true.
486       Hide it otherwise. If $visible is not provided, the method defaults to
487       show the panel.
488
489       "show_command_line"
490
491           $main->show_command_line( $visible );
492
493       Show the command panel at the bottom if $visible is true. Hide it
494       otherwise. If $visible is not provided, the method defaults to show the
495       panel.
496
497       "show_syntaxcheck"
498
499           $main->show_syntaxcheck( $visible );
500
501       Show the syntax panel at the bottom if $visible is true. Hide it
502       otherwise. If $visible is not provided, the method defaults to show the
503       panel.
504
505   Search and Replace
506   find_dialog
507           $main->find_dialog;
508
509       Show the find dialog, escalating from the fast find if needed
510
511   Introspection
512       The following methods allow to poke into Padre's internals.
513
514       "current"
515
516           my $current = $main->current;
517
518       Creates a Padre::Current object for the main window, giving you quick
519       and caching access to the current various object members.
520
521       See Padre::Current for more information.
522
523       "pageids"
524
525           my @ids = $main->pageids;
526
527       Return a list of all current tab ids (integers) within the notebook.
528
529       "pages"
530
531           my @pages = $main->pages;
532
533       Return a list of all notebook tabs. Those are the real objects, not the
534       ids (see "pageids()" above).
535
536       "editors"
537
538           my @editors = $main->editors;
539
540       Return a list of all current editors. Those are the real objects, not
541       the ids (see "pageids()" above).
542
543       Note: for now, this has the same meaning as "pages()" (see above), but
544       this will change once we get project tabs or something else.
545
546       "documents"
547
548           my @document = $main->documents;
549
550       Return a list of all current documents, in the specific order they are
551       open in the notepad.
552
553   Process Execution
554       The following methods run an external command, for example to evaluate
555       current document.
556
557       "on_run_command"
558
559           $main->on_run_command;
560
561       Prompt the user for a command to run, then run it with "run_command()"
562       (see below).
563
564       Note: it probably needs to be combined with "run_command()" itself.
565
566       "on_run_tdd_tests"
567
568          $main->on_run_tdd_tests;
569
570       Callback method, to build and then call on_run_tests
571
572       "on_run_tests"
573
574           $main->on_run_tests;
575
576       Callback method, to run the project tests and harness them.
577
578       "on_run_this_test"
579
580           $main->on_run_this_test;
581
582       Callback method, to run the currently open test through prove.
583
584       "on_open_in_file_browser"
585
586           $main->on_open_in_file_browser( $filename );
587
588       Opens the current $filename using the operating system's file browser
589
590       "run_command"
591
592           $main->run_command( $command );
593
594       Run $command and display the result in the output panel.
595
596       "run_document"
597
598           $main->run_document( $debug )
599
600       Run current document. If $debug is true, document will be run with
601       diagnostics and various debug options.
602
603       Note: this should really be somewhere else, but can stay here for now.
604
605   Session Support
606       Those methods deal with Padre sessions. A session is a set of files /
607       tabs opened, with the position within the files saved, as well as the
608       document that has the focus.
609
610       "capture_session"
611
612           my @session = $main->capture_session;
613
614       Capture list of opened files, with information. Return a list of
615       "Padre::DB::SessionFile" objects.
616
617       "open_session"
618
619           $main->open_session( $session );
620
621       Try to close all files, then open all files referenced in the given
622       $session (a "Padre::DB::Session" object). No return value.
623
624       "save_session"
625
626           $main->save_session( $session, @session );
627
628       Try to save @session files ("Padre::DB::SessionFile" objects, such as
629       what is returned by "capture_session()" - see above) to database,
630       associated to $session. Note that $session should already exist.
631
632   User Interaction
633       Various methods to help send information to user.
634
635       Some methods are inherited from Padre::Wx::Role::Dialog.
636
637   "status"
638           $main->status( $msg );
639
640       Temporarily change the status bar leftmost block only to some message.
641
642       This is a super-quick method intended for transient messages as short
643       as a few tens of milliseconds (for example printing all directories
644       read during a recursive file scan).
645
646       "info"
647
648           $main->info( $msg );
649
650       Print a message on the status bar or within a dialog box depending on
651       the users preferences setting.  The dialog has only a OK button and
652       there is no return value.
653
654       "prompt"
655
656           my $value = $main->prompt( $title, $subtitle, $key );
657
658       Prompt user with a dialog box about the value that $key should have.
659       Return this value, or "undef" if user clicked "cancel".
660
661       "simple_prompt"
662
663           my $value = $main->simple_prompt( $title, $subtitle, $default_text );
664
665       Prompt user with a dialog box about the value that $key should have.
666       Return this value, or "undef" if user clicked "cancel".
667
668   Search and Replace
669       These methods provide the highest level abstraction for entry into the
670       various search and replace functions and dialogs.
671
672       However, they still represent abstract logic and should NOT be tied
673       directly to keystroke or menu events.
674
675   "search_next"
676         # Next match for a new explicit search
677         $main->search_next( $search );
678
679         # Next match on current search
680         $main->search_next;
681
682       Find the next match for the current search.
683
684       If no files are open, silently do nothing (don't even remember the new
685       search)
686
687   "search_previous"
688         # Previous match for a new search
689         $main->search_previous( $search );
690
691         # Previous match on current search (or show Find dialog if none)
692         $main->search_previous;
693
694       Find the previous match for the current search, or spawn the Find
695       dialog.
696
697       If no files are open, do nothing.
698
699   "replace_next"
700         # Next replace for a new search
701         $main->replace_next( $search );
702
703         # Next replace on current search (or show Find dialog if none)
704         $main->replace_next;
705
706       Replace the next match for the current search, or spawn the Replace
707       dialog.
708
709       If no files are open, do nothing.
710
711   "replace_all"
712         # Replace all for a new search
713         $main->replace_all( $search );
714
715         # Replace all for the current search (or show Replace dialog if none)
716         $main->replace_all;
717
718       Replace all matches for the current search, or spawn the Replace
719       dialog.
720
721       If no files are open, do nothing.
722
723   General Events
724       Those methods are the various callbacks registered in the menus or
725       whatever widgets Padre has.
726
727       "on_brace_matching"
728
729           $main->on_brace_matching;
730
731       Jump to brace matching current the one at current position.
732
733       "on_comment_block"
734
735           $main->on_comment_block;
736
737       Performs one of the following depending the given operation
738
739       ·   Uncomment or comment selected lines, depending on their current
740           state.
741
742       ·   Comment out selected lines unilaterally.
743
744       ·   Uncomment selected lines unilaterally.
745
746       "on_autocompletion"
747
748           $main->on_autocompletion;
749
750       Try to auto complete current word being typed, depending on document
751       type.
752
753       "on_goto"
754
755           $main->on_goto;
756
757       Prompt user for a line or character position, and jump to this line or
758       character position in current document.
759
760       "on_close_window"
761
762           $main->on_close_window( $event );
763
764       Callback when window is about to be closed. This is our last chance to
765       veto the $event close, e.g. when some files are not yet saved.
766
767       If close is confirmed, save configuration to disk. Also, capture
768       current session to be able to restore it next time if user set Padre to
769       open last session on start-up. Clean up all Task Manager's tasks.
770
771       "setup_editors"
772
773           $main->setup_editors( @files );
774
775       Setup (new) tabs for @files, and update the GUI. If @files is "undef",
776       open an empty document.
777
778       "on_new"
779
780           $main->on_new;
781
782       Create a new empty tab. No return value.
783
784       "setup_editor"
785
786           $main->setup_editor( $file );
787
788       Setup a new tab / buffer and open $file, then update the GUI. Recycle
789       current buffer if there's only one empty tab currently opened. If $file
790       is already opened, focus on the tab displaying it. Finally, if $file
791       does not exist, create an empty file before opening it.
792
793       "create_tab"
794
795           my $tab = $main->create_tab;
796
797       Create a new tab in the notebook, and return its id (an integer).
798
799       "on_deparse"
800
801       Show what perl thinks about your code using B::Deparse
802
803       "on_open_selection"
804
805           $main->on_open_selection;
806
807       Try to open current selection in a new tab. Different combinations are
808       tried in order: as full path, as path relative to "cwd" (where the
809       editor was started), as path to relative to where the current file is,
810       if we are in a Perl file or Perl environment also try if the thing
811       might be a name of a module and try to open it locally or from @INC.
812
813       No return value.
814
815       "on_open_all_recent_files"
816
817           $main->on_open_all_recent_files;
818
819       Try to open all recent files within Padre. No return value.
820
821       "on_filter_tool"
822
823           $main->on_filter_tool;
824
825       Prompt user for a command to filter the selection/document.
826
827       "on_open_url"
828
829           $main->on_open_url;
830
831       Prompt user for URL to open and open it as a new tab.
832
833       Should be merged with ->on_open or at least a browsing function should
834       be added.
835
836       "on_open"
837
838           $main->on_open;
839
840       Prompt user for file(s) to open, and open them as new tabs. No return
841       value.
842
843       "on_open_with_default_system_editor"
844
845           $main->on_open_with_default_system_editor($filename);
846
847       Opens $filename in the default system editor
848
849       "on_open_in_command_line"
850
851           $main->on_open_in_command_line($filename);
852
853       Opens a command line/shell using the working directory of $filename
854
855       "on_open_example"
856
857           $main->on_open_example;
858
859       Opens the examples file dialog
860
861       "on_open_last_closed_file"
862
863           $main->on_open_last_closed_file;
864
865       Opens the last closed file in similar fashion to Chrome and Firefox.
866
867       "reload_all"
868
869           my $success = $main->reload_all;
870
871       Reload all open files from disk.
872
873       "reload_some"
874
875           my $success = $main->reload_some(@pages_to_reload);
876
877       Reloads the given documents. Return true upon success, false otherwise.
878
879       "reload_file"
880
881           $main->reload_file;
882
883       Try to reload a file from disk. Display an error if something went
884       wrong.
885
886       Returns 1 on success and 0 in case of and error.
887
888       "on_reload_file"
889
890           $main->on_reload_file;
891
892       Try to reload current file from disk. Display an error if something
893       went wrong.  No return value.
894
895       "on_reload_all"
896
897           $main->on_reload_all;
898
899       Reload all currently opened files from disk.  No return value.
900
901       "on_save"
902
903           my $success = $main->on_save;
904
905       Try to save current document. Prompt user for a file name if document
906       was new (see "on_save_as()" above). Return true if document has been
907       saved, false otherwise.
908
909       "on_save_as"
910
911           my $was_saved = $main->on_save_as;
912
913       Prompt user for a new file name to save current document, and save it.
914       Returns true if saved, false if cancelled.
915
916       "on_save_intuition"
917
918           my $success = $main->on_save_intuition;
919
920       Try to automatically determine an appropriate file name and save it,
921       based entirely on the content of the file.
922
923       Only do this for new documents, otherwise behave like a regular save.
924
925       "on_save_all"
926
927           my $success = $main->on_save_all;
928
929       Try to save all opened documents. Return true if all documents were
930       saved, false otherwise.
931
932       "_save_buffer"
933
934           my $success = $main->_save_buffer( $id );
935
936       Try to save buffer in tab $id. This is the method used underneath by
937       all "on_save_*()" methods. It will check if document has been updated
938       out of Padre before saving, and report an error if something went
939       wrong.  Return true if buffer was saved, false otherwise.
940
941       "on_close"
942
943           $main->on_close( $event );
944
945       Handler when there is a close $event. Veto it if it's from the "AUI"
946       notebook, since Wx will try to close the tab no matter what. Otherwise,
947       close current tab. No return value.
948
949       "close"
950
951           my $success = $main->close( $id );
952
953       Request to close document in tab $id, or current one if no $id
954       provided. Return true if closed, false otherwise.
955
956       "close_all"
957
958           my $success = $main->close_all( $skip );
959
960       Try to close all documents. If $skip is specified (an integer), don't
961       close the tab with this id. Return true upon success, false otherwise.
962
963       "close_some"
964
965           my $success = $main->close_some(@pages_to_close);
966
967       Try to close all documents. Return true upon success, false otherwise.
968
969       "close_where"
970
971           # Close all files in current project
972           my $project = Padre::Current->document->project_dir;
973           my $success = $main->close_where( sub {
974               $_[0]->project_dir eq $project
975           } );
976
977       The "close_where" method is for closing multiple document windows.  It
978       takes a subroutine as a parameter and calls that subroutine for each
979       currently open document, passing the document as the first parameter.
980
981       Any documents that return true will be closed.
982
983       "on_delete"
984
985           $main->on_delete;
986
987       Close the current tab and remove the associated file from disk.  No
988       return value.
989
990       "delete"
991
992           my $success = $main->delete( $id );
993
994       Request to close document in tab $id, or current one if no $id provided
995       and DELETE THE FILE FROM DISK. Return true if closed, false otherwise.
996
997       "on_nth_path"
998
999           $main->on_nth_pane( $id );
1000
1001       Put focus on tab $id in the notebook. Return true upon success, false
1002       otherwise.
1003
1004       "on_next_pane"
1005
1006           $main->on_next_pane;
1007
1008       Put focus on tab next to current document. Currently, only left to
1009       right order is supported, but later on it can be extended to follow a
1010       last seen order.
1011
1012       No return value.
1013
1014       "on_prev_pane"
1015
1016           $main->on_prev_pane;
1017
1018       Put focus on tab previous to current document. Currently, only right to
1019       left order is supported, but later on it can be extended to follow a
1020       reverse last seen order.
1021
1022       No return value.
1023
1024       "on_diff"
1025
1026           $main->on_diff;
1027
1028       Run "Text::Diff" between current document and its last saved content on
1029       disk. This allow to see what has changed before saving. Display the
1030       differences in the output pane.
1031
1032       "on_join_lines"
1033
1034           $main->on_join_lines;
1035
1036       Join current line with next one (à la vi with "Ctrl+J"). No return
1037       value.
1038
1039   Preferences and toggle methods
1040       Those methods allow to change Padre's preferences.
1041
1042       "zoom"
1043
1044           $main->zoom( $factor );
1045
1046       Apply zoom $factor to Padre's documents. Factor can be either positive
1047       or negative.
1048
1049       "open_regex_editor"
1050
1051           $main->open_regex_editor;
1052
1053       Open Padre's regular expression editor. No return value.
1054
1055       "open_perl_filter"
1056
1057           $main->open_perl_filter;
1058
1059       Open Padre's filter-through-perl. No return value.
1060
1061       "on_key_bindings"
1062
1063           $main->on_key_bindings;
1064
1065       Opens the key bindings dialog
1066
1067       "editor_linenumbers"
1068
1069           $main->editor_linenumbers(1);
1070
1071       Set visibility of line numbers on the left of the document.
1072
1073       No return value.
1074
1075       "editor_folding"
1076
1077           $main->editor_folding(1);
1078
1079       Enabled or disables code folding.
1080
1081       No return value.
1082
1083       "editor_currentline"
1084
1085           $main->editor_currentline(1);
1086
1087       Enable or disable background highlighting of the current line.
1088
1089       No return value.
1090
1091       "editor_rightmargin"
1092
1093           $main->editor_rightmargin(1);
1094
1095       Enable or disable display of the right margin.
1096
1097       No return value.
1098
1099       "editor_indentationguides"
1100
1101           $main->editor_indentationguides(1);
1102
1103       Enable or disable visibility of the indentation guides.
1104
1105       No return value.
1106
1107       "editor_eol"
1108
1109           $main->editor_eol(1);
1110
1111       Show or hide end of line carriage return characters.
1112
1113       No return value.
1114
1115       "editor_whitespace"
1116
1117           $main->editor_whitespace;
1118
1119       Show/hide spaces and tabs (with dots and arrows respectively). No
1120       return value.
1121
1122       "on_word_wrap"
1123
1124           $main->on_word_wrap;
1125
1126       Toggle word wrapping for current document. No return value.
1127
1128       "show_toolbar"
1129
1130           $main->show_toolbar;
1131
1132       Toggle toolbar visibility. No return value.
1133
1134       "show_statusbar"
1135
1136           $main->show_statusbar;
1137
1138       Toggle status bar visibility. No return value.
1139
1140       "on_toggle_lockinterface"
1141
1142           $main->on_toggle_lockinterface;
1143
1144       Toggle possibility for user to change Padre's external aspect. No
1145       return value.
1146
1147       "on_insert_from_file"
1148
1149           $main->on_insert_from_file;
1150
1151       Prompt user for a file to be inserted at current position in current
1152       document. No return value.
1153
1154       "convert_to"
1155
1156           $main->convert_to( $eol_style );
1157
1158       Convert document to $eol_style line endings (can be one of "WIN",
1159       "UNIX", or "MAC"). No return value.
1160
1161       "editor_of_file"
1162
1163           my $editor = $main->editor_of_file( $file );
1164
1165       Return the editor (a "Padre::Wx::Editor" object) containing the wanted
1166       $file, or "undef" if file is not opened currently.
1167
1168       "editor_id"
1169
1170           my $id = $main->editor_id( $editor );
1171
1172       Given $editor, return the tab id holding it, or "undef" if it was not
1173       found.
1174
1175       Note: can this really work? What happens when we split a window?
1176
1177       "run_in_padre"
1178
1179           $main->run_in_padre;
1180
1181       Evaluate current document within Padre. It means it can access all of
1182       Padre's internals, and wreak havoc. Display an error message if the
1183       evaluation went wrong, dump the result in the output panel otherwise.
1184
1185       No return value.
1186
1187   "STC" related methods
1188       Those methods are needed to have a smooth "STC" experience.
1189
1190       "on_stc_style_needed"
1191
1192           $main->on_stc_style_needed( $event );
1193
1194       Handler of "EVT_STC_STYLENEEDED" $event. Used to work around some edge
1195       cases in scintilla. No return value.
1196
1197       "on_stc_update_ui"
1198
1199           $main->on_stc_update_ui;
1200
1201       Handler called on every movement of the cursor. No return value.
1202
1203       "on_stc_change"
1204
1205           $main->on_stc_change;
1206
1207       Handler of the "EVT_STC_CHANGE" event. Doesn't do anything. No return
1208       value.
1209
1210       "on_stc_char_needed"
1211
1212           $main->on_stc_char_added;
1213
1214       This handler is called when a character is added. No return value. See
1215       <http://www.yellowbrain.com/stc/events.html#EVT_STC_CHARADDED>
1216
1217       TO DO: maybe we need to check this more carefully.
1218
1219       "on_stc_dwell_start"
1220
1221           $main->on_stc_dwell_start( $event );
1222
1223       Handler of the "DWELLSTART" $event. This event is sent when the mouse
1224       has not moved in a given amount of time. Doesn't do anything by now. No
1225       return value.
1226
1227       "on_aui_pane_close"
1228
1229           $main->on_aui_pane_close( $event );
1230
1231       Handler called upon "EVT_AUI_PANE_CLOSE" $event. Doesn't do anything by
1232       now.
1233
1234       "on_doc_stats"
1235
1236           $main->on_doc_stats;
1237
1238       Compute various stats about current document, and display them in a
1239       message. No return value.
1240
1241       "on_tab_and_space"
1242
1243           $main->on_tab_and_space( $style );
1244
1245       Convert current document from spaces to tabs (or vice-versa) depending
1246       on $style (can be either of "Space_to_Tab" or "Tab_to_Space").  Prompts
1247       the user for how many spaces are to be used to replace tabs (whatever
1248       the replacement direction). No return value.
1249
1250       "on_delete_ending_space"
1251
1252           $main->on_delete_ending_space;
1253
1254       Trim all ending spaces in current selection, or document if no text is
1255       selected. No return value.
1256
1257       "on_delete_leading_space"
1258
1259           $main->on_delete_leading_space;
1260
1261       Trim all leading spaces in current selection. No return value.
1262
1263       "timer_check_overwrite"
1264
1265           $main->timer_check_overwrite;
1266
1267       Called every n seconds to check if file has been overwritten outside of
1268       Padre. If that's the case, prompts the user whether s/he wants to
1269       reload the document. No return value.
1270
1271       "on_last_visited_pane"
1272
1273           $main->on_last_visited_pane;
1274
1275       Put focus on tab visited before the current one. No return value.
1276
1277       "on_oldest_visited_pane"
1278
1279           $main->on_oldest_visited_pane;
1280
1281       Put focus on tab visited the longest time ago. No return value.
1282
1283       "on_duplicate"
1284
1285           $main->on_duplicate;
1286
1287       Create a new document and copy the contents of the current file.  No
1288       return value.
1289
1290       "on_new_from_template"
1291
1292           $main->on_new_from_template( $extension );
1293
1294       Create a new document according to template for $extension type of
1295       file. No return value.
1296
1297   Auxiliary Methods
1298       Various methods that did not fit exactly in above categories...
1299
1300   "action"
1301         Padre::Current->main->action('help.about');
1302
1303       Single execution of a named action.
1304
1305       "install_cpan"
1306
1307           $main->install_cpan( $module );
1308
1309       Install $module from "CPAN".
1310
1311       Note: this method may not belong here...
1312
1313       "setup_bindings"
1314
1315           $main->setup_bindings;
1316
1317       Setup the various bindings needed to handle output pane correctly.
1318
1319       Note: I'm not sure those are really needed...
1320
1321       "key_up"
1322
1323           $main->key_up( $event );
1324
1325       Callback for when a key up $event happens in Padre. This handles the
1326       various "Ctrl"+key combinations used within Padre.
1327
1328       "new_document_from_string"
1329
1330           $main->new_document_from_string( $string, $mimetype );
1331
1332       Create a new document in Padre with the string value.
1333
1334       Pass in an optional mime type to have Padre colorize the text
1335       correctly.
1336
1337       Note: this method may not belong here...
1338
1340       Copyright 2008-2011 The Padre development team as listed in Padre.pm.
1341
1342       This program is free software; you can redistribute it and/or modify it
1343       under the same terms as Perl itself.
1344
1345       The full text of the license can be found in the LICENSE file included
1346       with this module.
1347
1348
1349
1350perl v5.28.1                      2019-02-02                Padre::Wx::Main(3)
Impressum