Changeset 467
- Timestamp:
- 10/26/08 00:16:48 (3 years ago)
- Location:
- trunk/lib/Padre
- Files:
-
- 6 edited
-
Wx.pm (modified) (1 diff)
-
Wx/Ack.pm (modified) (7 diffs)
-
Wx/App.pm (modified) (1 diff)
-
Wx/Bookmarks.pm (modified) (5 diffs)
-
Wx/Editor.pm (modified) (4 diffs)
-
Wx/FindDialog.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Padre/Wx.pm
r461 r467 14 14 # use them without braces. 15 15 use Wx ':everything'; 16 16 # the same with events in the Wx::Event:: package 17 use Wx::Event ':everything'; 17 18 our $VERSION = '0.12'; 18 19 -
trunk/lib/Padre/Wx/Ack.pm
r451 r467 3 3 use strict; 4 4 use warnings; 5 use Wx qw(:everything); 6 use Wx::Event qw(:everything); 7 use Padre::Wx::Ack; 5 use Data::Dumper qw(Dumper); 6 8 7 use App::Ack; 9 use Data::Dumper qw(Dumper); 8 9 use Padre::Wx; 10 10 11 11 my $iter; … … 47 47 $self->show_output(1); 48 48 49 EVT_COMMAND( $self, -1, $DONE_EVENT, \&ack_done );49 Wx::Event::EVT_COMMAND( $self, -1, $DONE_EVENT, \&ack_done ); 50 50 51 51 my $worker = threads->create( \&on_ack_thread ); … … 59 59 my $id = -1; 60 60 my $title = "Ack"; 61 my $pos = wxDefaultPosition;62 my $size = wxDefaultSize;61 my $pos = Wx::wxDefaultPosition; 62 my $size = Wx::wxDefaultSize; 63 63 my $name = ""; 64 my $style = wxDEFAULT_FRAME_STYLE;64 my $style = Wx::wxDEFAULT_FRAME_STYLE; 65 65 66 66 my $dialog = Wx::Dialog->new( $win, $id, $title, $pos, $size, $style, $name ); 67 my $label_1 = Wx::StaticText->new($dialog, -1, "Term: ", wxDefaultPosition,wxDefaultSize, );68 my $term = Wx::ComboBox->new($dialog, -1, "", wxDefaultPosition, wxDefaultSize, [],wxCB_DROPDOWN);69 my $button_search = Wx::Button->new($dialog, wxID_FIND, '');70 my $label_2 = Wx::StaticText->new($dialog, -1, "Dir: ", wxDefaultPosition,wxDefaultSize, );71 my $dir = Wx::ComboBox->new($dialog, -1, "", wxDefaultPosition, wxDefaultSize, [],wxCB_DROPDOWN);72 my $button_cancel = Wx::Button->new($dialog, wxID_CANCEL, '');73 my $nothing_1 = Wx::StaticText->new($dialog, -1, "", wxDefaultPosition,wxDefaultSize, );74 my $nothing_2 = Wx::StaticText->new($dialog, -1, "", wxDefaultPosition,wxDefaultSize, );67 my $label_1 = Wx::StaticText->new($dialog, -1, "Term: ", Wx::wxDefaultPosition, Wx::wxDefaultSize, ); 68 my $term = Wx::ComboBox->new($dialog, -1, "", Wx::wxDefaultPosition, Wx::wxDefaultSize, [], Wx::wxCB_DROPDOWN); 69 my $button_search = Wx::Button->new($dialog, Wx::wxID_FIND, ''); 70 my $label_2 = Wx::StaticText->new($dialog, -1, "Dir: ", Wx::wxDefaultPosition, Wx::wxDefaultSize, ); 71 my $dir = Wx::ComboBox->new($dialog, -1, "", Wx::wxDefaultPosition, Wx::wxDefaultSize, [], Wx::wxCB_DROPDOWN); 72 my $button_cancel = Wx::Button->new($dialog, Wx::wxID_CANCEL, ''); 73 my $nothing_1 = Wx::StaticText->new($dialog, -1, "", Wx::wxDefaultPosition, Wx::wxDefaultSize, ); 74 my $nothing_2 = Wx::StaticText->new($dialog, -1, "", Wx::wxDefaultPosition, Wx::wxDefaultSize, ); 75 75 my $button_dir = Wx::Button->new($dialog, -1, "Pick &directory"); 76 76 77 EVT_BUTTON( $dialog, $button_search, sub { $dialog->EndModal(wxID_FIND) } );78 EVT_BUTTON( $dialog, $button_dir, sub { on_pick_dir($dir, @_) } );79 EVT_BUTTON( $dialog, $button_cancel, sub { $dialog->EndModal(wxID_CANCEL) } );77 Wx::Event::EVT_BUTTON( $dialog, $button_search, sub { $dialog->EndModal(Wx::wxID_FIND) } ); 78 Wx::Event::EVT_BUTTON( $dialog, $button_dir, sub { on_pick_dir($dir, @_) } ); 79 Wx::Event::EVT_BUTTON( $dialog, $button_cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 80 80 81 81 #$dialog->SetTitle("frame_1"); … … 85 85 86 86 # layout 87 my $sizer_1 = Wx::BoxSizer->new( wxVERTICAL);87 my $sizer_1 = Wx::BoxSizer->new(Wx::wxVERTICAL); 88 88 my $grid_sizer_1 = Wx::GridSizer->new(4, 3, 0, 0); 89 89 $grid_sizer_1->Add($label_1, 0, 0, 0); … … 97 97 $grid_sizer_1->Add($button_cancel, 0, 0, 0); 98 98 99 $sizer_1->Add($grid_sizer_1, 1, wxEXPAND, 0);99 $sizer_1->Add($grid_sizer_1, 1, Wx::wxEXPAND, 0); 100 100 101 101 $dialog->SetSizer($sizer_1); … … 106 106 my $ret = $dialog->ShowModal; 107 107 108 if ($ret == wxID_CANCEL) {108 if ($ret == Wx::wxID_CANCEL) { 109 109 $dialog->Destroy; 110 110 return; … … 123 123 124 124 my $dir_dialog = Wx::DirDialog->new( $self, "Select directory", ''); 125 if ($dir_dialog->ShowModal == wxID_CANCEL) {125 if ($dir_dialog->ShowModal == Wx::wxID_CANCEL) { 126 126 return; 127 127 } -
trunk/lib/Padre/Wx/App.pm
r433 r467 26 26 use strict; 27 27 use warnings; 28 28 29 use Wx::App (); 29 30 use Padre::Wx::MainWindow (); -
trunk/lib/Padre/Wx/Bookmarks.pm
r433 r467 3 3 use strict; 4 4 use warnings; 5 use Wx qw(wxID_OK wxID_CANCEL wxID_DELETE wxVERTICAL wxHORIZONTAL); 6 use Wx::Event qw(EVT_BUTTON); 5 7 6 use List::Util qw(max); 8 7 use Data::Dumper qw(Dumper); 8 9 use Padre::Wx; 9 10 10 11 our $VERSION = '0.12'; … … 15 16 my ($self, $text) = @_; 16 17 17 my $box = Wx::BoxSizer->new( wxVERTICAL );18 my $box = Wx::BoxSizer->new( Wx::wxVERTICAL ); 18 19 my @rows; 19 20 for my $i (0..3) { 20 $rows[$i] = Wx::BoxSizer->new( wxHORIZONTAL );21 $rows[$i] = Wx::BoxSizer->new( Wx::wxHORIZONTAL ); 21 22 $box->Add($rows[$i]); 22 23 } … … 26 27 27 28 28 my $ok = Wx::Button->new( $dialog, wxID_OK, '' );29 EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal(wxID_OK) } );29 my $ok = Wx::Button->new( $dialog, Wx::wxID_OK, '' ); 30 Wx::Event::EVT_BUTTON( $dialog, $ok, sub { $dialog->EndModal(Wx::wxID_OK) } ); 30 31 $ok->SetDefault; 31 32 32 my $cancel = Wx::Button->new( $dialog, wxID_CANCEL, '', [-1, -1], $ok->GetSize);33 EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(wxID_CANCEL) } );33 my $cancel = Wx::Button->new( $dialog, Wx::wxID_CANCEL, '', [-1, -1], $ok->GetSize); 34 Wx::Event::EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 34 35 35 36 … … 58 59 59 60 my $ret = $dialog->ShowModal; 60 if ( $ret eq wxID_CANCEL ) {61 if ( $ret eq Wx::wxID_CANCEL ) { 61 62 $dialog->Destroy; 62 63 return; … … 95 96 $rows->[2]->Add( $tb ); 96 97 97 my $delete = Wx::Button->new( $dialog, wxID_DELETE, '', [-1, -1], $button_size );98 EVT_BUTTON( $dialog, $delete, \&on_delete_bookmark );98 my $delete = Wx::Button->new( $dialog, Wx::wxID_DELETE, '', [-1, -1], $button_size ); 99 Wx::Event::EVT_BUTTON( $dialog, $delete, \&on_delete_bookmark ); 99 100 $rows->[3]->Add( $delete ); 100 101 } -
trunk/lib/Padre/Wx/Editor.pm
r433 r467 10 10 use base 'Wx::StyledTextCtrl'; 11 11 12 use Wx qw( wxTELETYPE wxNORMAL wxSTC_STYLE_DEFAULT wxSTC_H_TAG wxLayout_LeftToRight ); 12 use Padre::Wx; 13 13 14 sub new { 14 15 my( $class, $parent ) = @_; … … 46 47 my $self = shift; 47 48 48 my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL,wxNORMAL );49 my $font = Wx::Font->new( 10, Wx::wxTELETYPE, Wx::wxNORMAL, Wx::wxNORMAL ); 49 50 50 51 $self->SetFont( $font ); 51 52 52 $self->StyleSetFont( wxSTC_STYLE_DEFAULT, $font );53 $self->StyleSetFont( Wx::wxSTC_STYLE_DEFAULT, $font ); 53 54 54 55 $self->StyleClearAll(); … … 105 106 #define SCE_PL_FORMAT 42 106 107 ); 107 Wx->import(keys %colors);108 108 109 109 foreach my $k (keys %colors) { 110 110 my @c = map {hex($_)} $colors{$k} =~ /(..)(..)(..)/; 111 $self->StyleSetForeground( $k->(), Wx::Colour->new(@c)); 111 my $f = 'Wx::' . $k; 112 $self->StyleSetForeground( $f->(), Wx::Colour->new(@c)); 112 113 } 113 114 … … 116 117 117 118 # Apply tag style for selected lexer (blue) 118 $self->StyleSetSpec( wxSTC_H_TAG, "fore:#0000ff" );119 $self->StyleSetSpec( Wx::wxSTC_H_TAG, "fore:#0000ff" ); 119 120 120 121 if ( $self->can('SetLayoutDirection') ) { 121 $self->SetLayoutDirection( wxLayout_LeftToRight );122 $self->SetLayoutDirection( Wx::wxLayout_LeftToRight ); 122 123 } 123 124 -
trunk/lib/Padre/Wx/FindDialog.pm
r455 r467 7 7 # Find and Replace widget of Padre 8 8 9 use Wx qw( wxOK wxID_FIND wxID_CANCEL ); 10 use Wx::Event qw{ EVT_BUTTON EVT_CHECKBOX }; 9 use Padre::Wx; 11 10 12 11 our $VERSION = '0.12'; … … 37 36 38 37 foreach my $cb (@cbs) { 39 EVT_CHECKBOX( $dialog, $dialog->{$cb}, sub { $_[0]->{_find_choice_}->SetFocus; });38 Wx::Event::EVT_CHECKBOX( $dialog, $dialog->{$cb}, sub { $_[0]->{_find_choice_}->SetFocus; }); 40 39 } 41 40 $dialog->{_find_}->SetDefault; 42 EVT_BUTTON( $dialog, $dialog->{_find_}, \&find_clicked);43 EVT_BUTTON( $dialog, $dialog->{_replace_}, \&replace_clicked );44 EVT_BUTTON( $dialog, $dialog->{_replace_all_}, \&replace_all_clicked );45 EVT_BUTTON( $dialog, $dialog->{_cancel_}, \&cancel_clicked );41 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_find_}, \&find_clicked); 42 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_replace_}, \&replace_clicked ); 43 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_replace_all_}, \&replace_all_clicked ); 44 Wx::Event::EVT_BUTTON( $dialog, $dialog->{_cancel_}, \&cancel_clicked ); 46 45 47 46 $dialog->{_find_choice_}->SetFocus;
Note: See TracChangeset
for help on using the changeset viewer.
