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