Changeset 468


Ignore:
Timestamp:
10/26/08 01:06:48 (3 years ago)
Author:
szabgab
Message:

stop importing Wx directly in the Padre::Wx:: modules

Location:
trunk/lib/Padre/Wx
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Padre/Wx/Editor.pm

    r467 r468  
    55use warnings; 
    66 
    7 our $VERSION = '0.12'; 
     7use Wx::STC; 
     8use Padre::Wx; 
    89 
    9 use Wx::STC; 
    1010use base 'Wx::StyledTextCtrl'; 
    1111 
    12 use Padre::Wx; 
     12our $VERSION = '0.12'; 
    1313 
    1414sub new { 
  • trunk/lib/Padre/Wx/GoToLine.pm

    r433 r468  
    77# GoTo Line widget of Padre 
    88 
    9 use Wx             qw(wxID_CANCEL); 
     9use Padre::Wx  (); 
    1010 
    1111our $VERSION = '0.12'; 
     
    1616 
    1717    my $dialog = Wx::TextEntryDialog->new( $self, "Line number:", "", '' ); 
    18     if ($dialog->ShowModal == wxID_CANCEL) { 
     18    if ($dialog->ShowModal == Wx::wxID_CANCEL) { 
    1919        return; 
    2020    }    
  • trunk/lib/Padre/Wx/History/TextDialog.pm

    r433 r468  
    44use strict; 
    55use warnings; 
     6 
    67use Padre::DB (); 
    7 use Wx        (); 
     8use Padre::Wx (); 
     9 
    810use Class::Adapter::Builder 
    911    ISA      => 'Wx::TextEntryDialog', 
  • trunk/lib/Padre/Wx/MainWindow.pm

    r463 r468  
    1313use List::Util     (); 
    1414use Params::Util   (); 
    15 use Wx             qw( 
    16                    WXK_TAB wxDEFAULT_FRAME_STYLE wxMAXIMIZE wxNO_FULL_REPAINT_ON_RESIZE wxCLIP_CHILDREN  
    17                    wxLC_SINGLE_SEL wxLC_NO_HEADER wxLC_REPORT wxLIST_AUTOSIZE wxTE_READONLY wxTE_MULTILINE  
    18                    wxOK wxCENTRE wxFD_OPEN wxID_CANCEL wxFD_SAVE wxYES_NO wxYES wxCANCEL wxNO 
    19                    wxSTC_STYLE_LINENUMBER wxSTC_MARGIN_NUMBER 
    20                    ); 
    21 use Wx::Event      qw( 
    22                    EVT_LIST_ITEM_ACTIVATED EVT_NOTEBOOK_PAGE_CHANGED EVT_KEY_UP EVT_CLOSE 
    23                    EVT_STC_UPDATEUI EVT_STC_CHANGE EVT_STC_STYLENEEDED 
    24                    ); 
    25  
    26 use base qw{Wx::Frame}; 
    2715 
    2816use Padre::Util        (); 
     
    3119use Padre::Wx::ToolBar (); 
    3220use Padre::Wx::Output  (); 
     21 
     22use base qw{Wx::Frame}; 
    3323 
    3424our $VERSION = '0.12'; 
     
    124114    $self->{rightbar}->InsertColumn(0, 'Methods'); 
    125115    $self->{rightbar}->SetColumnWidth(0, Wx::wxLIST_AUTOSIZE); 
    126     EVT_LIST_ITEM_ACTIVATED( 
     116    Wx::Event::EVT_LIST_ITEM_ACTIVATED( 
    127117        $self, 
    128118        $self->{rightbar}, 
     
    138128        Wx::wxNO_FULL_REPAINT_ON_RESIZE | Wx::wxCLIP_CHILDREN, 
    139129    ); 
    140     EVT_NOTEBOOK_PAGE_CHANGED( 
     130    Wx::Event::EVT_NOTEBOOK_PAGE_CHANGED( 
    141131        $self, 
    142132        $self->{notebook}, 
     
    160150 
    161151    # Special Key Handling 
    162     EVT_KEY_UP( $self, sub { 
     152    Wx::Event::EVT_KEY_UP( $self, sub { 
    163153        my ($self, $event) = @_; 
    164154        $self->refresh_status; 
     
    168158        if ( $mod == 2 ) { # Ctrl 
    169159            # Ctrl-TAB  #TODO it is already in the menu 
    170             $self->on_next_pane if $code == WXK_TAB; 
     160            $self->on_next_pane if $code == Wx::WXK_TAB; 
    171161        } elsif ( $mod == 6 ) { # Ctrl-Shift 
    172162            # Ctrl-Shift-TAB #TODO it is already in the menu 
    173             $self->on_prev_pane if $code == WXK_TAB; 
     163            $self->on_prev_pane if $code == Wx::WXK_TAB; 
    174164        } 
    175165        return; 
     
    177167 
    178168    # Deal with someone closing the window 
    179     EVT_CLOSE( $self, \&on_close_window); 
    180  
    181     EVT_STC_UPDATEUI(    $self, -1, \&Padre::Wx::Editor::on_stc_update_ui    ); 
    182     EVT_STC_CHANGE(      $self, -1, \&Padre::Wx::Editor::on_stc_change       ); 
    183     EVT_STC_STYLENEEDED( $self, -1, \&Padre::Wx::Editor::on_stc_style_needed ); 
     169    Wx::Event::EVT_CLOSE( $self, \&on_close_window); 
     170 
     171    Wx::Event::EVT_STC_UPDATEUI(    $self, -1, \&Padre::Wx::Editor::on_stc_update_ui    ); 
     172    Wx::Event::EVT_STC_CHANGE(      $self, -1, \&Padre::Wx::Editor::on_stc_change       ); 
     173    Wx::Event::EVT_STC_STYLENEEDED( $self, -1, \&Padre::Wx::Editor::on_stc_style_needed ); 
    184174 
    185175    # As ugly as the WxPerl icon is, the new file toolbar image is uglier 
     
    564554    my $pos1  = $page->GetCurrentPos; 
    565555    my $pos2  = $page->BraceMatch($pos1); 
    566     if ($pos2 != -1 ) {   #wxSTC_INVALID_POSITION 
     556    if ($pos2 != -1 ) {   #Wx::wxSTC_INVALID_POSITION 
    567557        #print "$pos1 $pos2\n"; 
    568558        #$page->BraceHighlight($pos1, $pos2); 
     
    626616    my ( $length, @words ) = $doc->autocomplete; 
    627617    if ( $length =~ /\D/ ) { 
    628         Wx::MessageBox($length, "Autocompletions error", wxOK); 
     618        Wx::MessageBox($length, "Autocompletions error", Wx::wxOK); 
    629619    } 
    630620    if ( @words ) { 
     
    772762    my $selection = $self->selected_text(); 
    773763    if (not $selection) { 
    774         Wx::MessageBox("Need to have something selected", "Open Selection", wxOK, $self); 
     764        Wx::MessageBox("Need to have something selected", "Open Selection", Wx::wxOK, $self); 
    775765        return; 
    776766    } 
     
    809799 
    810800    if (not $file) { 
    811         Wx::MessageBox("Could not find file '$selection'", "Open Selection", wxOK, $self); 
     801        Wx::MessageBox("Could not find file '$selection'", "Open Selection", Wx::wxOK, $self); 
    812802        return; 
    813803    } 
     
    831821        "", 
    832822        "*.*", 
    833         wxFD_OPEN, 
     823        Wx::wxFD_OPEN, 
    834824    ); 
    835825    unless ( Padre::Util::WIN32 ) { 
    836826        $dialog->SetWildcard("*"); 
    837827    } 
    838     if ( $dialog->ShowModal == wxID_CANCEL ) { 
     828    if ( $dialog->ShowModal == Wx::wxID_CANCEL ) { 
    839829        return; 
    840830    } 
     
    874864            "", 
    875865            "*.*", 
    876             wxFD_SAVE, 
     866            Wx::wxFD_SAVE, 
    877867        ); 
    878         if ( $dialog->ShowModal == wxID_CANCEL ) { 
     868        if ( $dialog->ShowModal == Wx::wxID_CANCEL ) { 
    879869            return 0; 
    880870        } 
     
    886876                "File already exists. Overwrite it?", 
    887877                "Exist", 
    888                 wxYES_NO, 
     878                Wx::wxYES_NO, 
    889879                $self, 
    890880            ); 
    891             if ( $res == wxYES ) { 
     881            if ( $res == Wx::wxYES ) { 
    892882                $doc->_set_filename($path); 
    893883                $doc->set_newline_type(Padre::Util::NEWLINE); 
     
    952942    }; 
    953943    if ($@) { 
    954         Wx::MessageBox("Could not save: $!", "Error", wxOK, $self); 
     944        Wx::MessageBox("Could not save: $!", "Error", Wx::wxOK, $self); 
    955945        return; 
    956946    } 
     
    980970            "File changed. Do you want to save it?", 
    981971            $doc->filename || "Unsaved File", 
    982             wxYES_NO|wxCANCEL|wxCENTRE, 
     972            Wx::wxYES_NO|Wx::wxCANCEL|Wx::wxCENTRE, 
    983973            $self, 
    984974        ); 
    985         if ( $ret == wxYES ) { 
     975        if ( $ret == Wx::wxYES ) { 
    986976            $self->on_save( $doc ); 
    987         } elsif ( $ret == wxNO ) { 
     977        } elsif ( $ret == Wx::wxNO ) { 
    988978            # just close it 
    989979        } else { 
    990             # wxCANCEL, or when clicking on [x] 
     980            # Wx::wxCANCEL, or when clicking on [x] 
    991981            return 0; 
    992982        } 
     
    11761166    if ($on) { 
    11771167        my $n = 1 + List::Util::max (2, length ($editor->GetLineCount * 2)); 
    1178         my $width = $n * $editor->TextWidth(wxSTC_STYLE_LINENUMBER, "9"); # width of a single character 
     1168        my $width = $n * $editor->TextWidth(Wx::wxSTC_STYLE_LINENUMBER, "9"); # width of a single character 
    11791169        $editor->SetMarginWidth(0, $width); 
    1180         $editor->SetMarginType(0, wxSTC_MARGIN_NUMBER); 
     1170        $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
    11811171    } else { 
    11821172        $editor->SetMarginWidth(0, 0); 
    1183         $editor->SetMarginType(0, wxSTC_MARGIN_NUMBER); 
     1173        $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
    11841174    } 
    11851175 
     
    12221212    eval $code; 
    12231213    if ( $@ ) { 
    1224         Wx::MessageBox("Error: $@", "Self error", wxOK, $self); 
     1214        Wx::MessageBox("Error: $@", "Self error", Wx::wxOK, $self); 
    12251215        return; 
    12261216    } 
  • trunk/lib/Padre/Wx/Menu.pm

    r457 r468  
    44use strict; 
    55use warnings; 
     6use Params::Util qw{_INSTANCE}; 
     7 
     8use Padre::Wx    (); 
    69use Padre::Util  (); 
    7 use Params::Util qw{_INSTANCE}; 
    8 use Wx           qw( wxID_NEW wxID_CLOSE wxID_SAVEAS wxID_EXIT wxID_UNDO wxID_REDO  
    9                      wxID_FIND wxID_HELP wxID_ABOUT wxOK wxID_CANCEL wxID_OPEN wxID_SAVE); 
    10 use Wx::Event    qw(EVT_MENU); 
    1110 
    1211our $VERSION = '0.12'; 
     
    3433 
    3534    # Opening and closing files 
    36     EVT_MENU( $win, 
     35    Wx::Event::EVT_MENU( $win, 
    3736        $menu->{file}->Append( Wx::wxID_NEW, '' ), 
    3837        sub { 
     
    4140        }, 
    4241    ); 
    43     EVT_MENU( $win, 
     42    Wx::Event::EVT_MENU( $win, 
    4443        $menu->{file}->Append( Wx::wxID_OPEN, '' ), 
    4544        sub { $_[0]->on_open }, 
    4645    ); 
    47     EVT_MENU( $win, 
     46    Wx::Event::EVT_MENU( $win, 
    4847        $menu->{file}->Append( -1, "Open Selection\tCtrl-Shift-O" ), 
    4948        sub { $_[0]->on_open_selection }, 
    5049    ); 
    51     EVT_MENU( $win, 
     50    Wx::Event::EVT_MENU( $win, 
    5251        $menu->{file}->Append( Wx::wxID_CLOSE,  '' ), 
    5352        sub { $_[0]->close }, 
    5453    ); 
    55     EVT_MENU( $win, 
     54    Wx::Event::EVT_MENU( $win, 
    5655        $menu->{file}->Append( -1, 'Close All' ), 
    5756        sub { $_[0]->on_close_all }, 
     
    6059 
    6160    # Saving 
    62     EVT_MENU( $win, 
     61    Wx::Event::EVT_MENU( $win, 
    6362        $menu->{file}->Append( Wx::wxID_SAVE, '' ), 
    6463        sub { $_[0]->on_save }, 
    6564    ); 
    66     EVT_MENU( $win, 
     65    Wx::Event::EVT_MENU( $win, 
    6766        $menu->{file}->Append( Wx::wxID_SAVEAS, '' ), 
    6867        sub { $_[0]->on_save_as }, 
    6968    ); 
    70     EVT_MENU( $win, 
     69    Wx::Event::EVT_MENU( $win, 
    7170        $menu->{file}->Append( -1, 'Save All' ), 
    7271        sub { $_[0]->on_save_all }, 
     
    7776    $menu->{file_convert} = Wx::Menu->new; 
    7877    $menu->{file}->Append( -1, "Convert...", $menu->{file_convert} ); 
    79     EVT_MENU( $win, 
     78    Wx::Event::EVT_MENU( $win, 
    8079        $menu->{file_convert}->Append(-1, "EOL to Windows"), 
    8180        sub { $_[0]->convert_to("WIN") }, 
    8281    ); 
    83     EVT_MENU( $win, 
     82    Wx::Event::EVT_MENU( $win, 
    8483        $menu->{file_convert}->Append(-1, "EOL to Unix"), 
    8584        sub { $_[0]->convert_to("UNIX") }, 
    8685    ); 
    87     EVT_MENU( $win, 
     86    Wx::Event::EVT_MENU( $win, 
    8887        $menu->{file_convert}->Append(-1, "EOL to Mac"), 
    8988        sub { $_[0]->convert_to("MAC") }, 
     
    9695    foreach my $f ( Padre::DB->get_recent_files ) { 
    9796        next unless -f $f; 
    98         EVT_MENU( $win, 
     97        Wx::Event::EVT_MENU( $win, 
    9998            $menu->{file_recentfiles}->Append(-1, $f),  
    10099            sub {  
     
    115114 
    116115    # Module::Start 
    117     EVT_MENU( $win, 
     116    Wx::Event::EVT_MENU( $win, 
    118117        $menu->{file}->Append( -1, 'Start Module' ), 
    119118        \&Padre::Wx::ModuleStartDialog::on_start, 
     
    123122 
    124123    # Exiting 
    125     EVT_MENU( $win, 
     124    Wx::Event::EVT_MENU( $win, 
    126125        $menu->{file}->Append( Wx::wxID_EXIT, '' ), 
    127126        sub { $_[0]->Close }, 
     
    136135 
    137136    # Undo/Redo 
    138     EVT_MENU( $win, # Ctrl-Z 
     137    Wx::Event::EVT_MENU( $win, # Ctrl-Z 
    139138        $menu->{edit}->Append( Wx::wxID_UNDO, '' ), 
    140139        sub { 
     
    146145        }, 
    147146    ); 
    148     EVT_MENU( $win, # Ctrl-Y 
     147    Wx::Event::EVT_MENU( $win, # Ctrl-Y 
    149148        $menu->{edit}->Append( Wx::wxID_REDO, '' ), 
    150149        sub { 
     
    159158 
    160159    # Random shit that doesn't fit anywhere better yet 
    161     EVT_MENU( $win, 
     160    Wx::Event::EVT_MENU( $win, 
    162161        $menu->{edit}->Append( Wx::wxID_FIND, '' ), 
    163162        \&Padre::Wx::FindDialog::on_find, 
    164163    ); 
    165     EVT_MENU( $win, 
     164    Wx::Event::EVT_MENU( $win, 
    166165        $menu->{edit}->Append( -1, "&Find Next\tF3" ), 
    167166        \&Padre::Wx::FindDialog::on_find_next, 
    168167    ); 
    169     EVT_MENU( $win, 
     168    Wx::Event::EVT_MENU( $win, 
    170169        $menu->{edit}->Append( -1, "Find Previous\tShift-F3" ), 
    171170        \&Padre::Wx::FindDialog::on_find_previous, 
    172171    ); 
    173     EVT_MENU( $win, 
     172    Wx::Event::EVT_MENU( $win, 
    174173        $menu->{edit}->Append( -1, "Ac&k" ), 
    175174        \&Padre::Wx::Ack::on_ack, 
    176175    ); 
    177     EVT_MENU( $win, 
     176    Wx::Event::EVT_MENU( $win, 
    178177        $menu->{edit}->Append( -1, "&Goto\tCtrl-G" ), 
    179178        \&Padre::Wx::GoToLine::on_goto, 
    180179    ); 
    181     EVT_MENU( $win, 
     180    Wx::Event::EVT_MENU( $win, 
    182181        $menu->{edit}->Append( -1, "&AutoComp\tCtrl-P" ), 
    183182        \&Padre::Wx::MainWindow::on_autocompletition, 
    184183    ); 
    185     EVT_MENU( $win, 
     184    Wx::Event::EVT_MENU( $win, 
    186185        $menu->{edit}->Append( -1, "Subs\tAlt-S" ), 
    187186        sub { $_[0]->{rightbar}->SetFocus }, 
    188187    );  
    189     EVT_MENU( $win, 
     188    Wx::Event::EVT_MENU( $win, 
    190189        $menu->{edit}->Append( -1, "&Brace matching\tCtrl-1" ), 
    191190        \&Padre::Wx::MainWindow::on_brace_matching, 
     
    194193 
    195194    # User Preferences 
    196     EVT_MENU( $win, 
     195    Wx::Event::EVT_MENU( $win, 
    197196        $menu->{edit}->Append( -1, "&Preferences" ), 
    198197        \&Padre::Wx::MainWindow::on_preferences, 
     
    206205    $menu->{view}       = Wx::Menu->new; 
    207206    $menu->{view_lines} = $menu->{view}->AppendCheckItem( -1, "Show Line numbers" ); 
    208     EVT_MENU( $win, 
     207    Wx::Event::EVT_MENU( $win, 
    209208        $menu->{view_lines}, 
    210209        \&Padre::Wx::MainWindow::on_toggle_line_numbers, 
    211210    ); 
    212211    $menu->{view_eol} = $menu->{view}->AppendCheckItem( -1, "Show Newlines" ); 
    213     EVT_MENU( $win, 
     212    Wx::Event::EVT_MENU( $win, 
    214213        $menu->{view_eol}, 
    215214        \&Padre::Wx::MainWindow::on_toggle_eol, 
    216215    ); 
    217216    $menu->{view_output} = $menu->{view}->AppendCheckItem( -1, "Show Output" ); 
    218     EVT_MENU( $win, 
     217    Wx::Event::EVT_MENU( $win, 
    219218        $menu->{view_output}, 
    220219        sub { 
     
    227226        # On Windows disabling the status bar is broken, so don't allow it 
    228227        $menu->{view_statusbar} = $menu->{view}->AppendCheckItem( -1, "Show StatusBar" ); 
    229         EVT_MENU( $win, 
     228        Wx::Event::EVT_MENU( $win, 
    230229            $menu->{view_statusbar}, 
    231230            \&Padre::Wx::MainWindow::on_toggle_status_bar, 
     
    233232    } 
    234233    $menu->{view_indentation_guide} = $menu->{view}->AppendCheckItem( -1, "Show Indentation Guide" ); 
    235     EVT_MENU( $win, 
     234    Wx::Event::EVT_MENU( $win, 
    236235        $menu->{view_indentation_guide}, 
    237236        \&Padre::Wx::MainWindow::on_toggle_indentation_guide, 
    238237    ); 
    239238    $menu->{view_show_calltips} = $menu->{view}->AppendCheckItem( -1, "Show Call Tips" ); 
    240     EVT_MENU( $win, 
     239    Wx::Event::EVT_MENU( $win, 
    241240        $menu->{view_show_calltips}, 
    242241        sub { $config->{editor_calltips} = $menu->{view_show_calltips}->IsChecked }, 
     
    244243    $menu->{view}->AppendSeparator; 
    245244 
    246     EVT_MENU( $win, 
     245    Wx::Event::EVT_MENU( $win, 
    247246        $menu->{view}->Append( -1, "Increase Font Size\tCtrl--" ), 
    248247        sub { $_[0]->zoom(+1) }, 
    249248    ); 
    250     EVT_MENU( $win, 
     249    Wx::Event::EVT_MENU( $win, 
    251250        $menu->{view}->Append( -1, "Decrease Font Size\tCtrl-+" ), 
    252251        sub { $_[0]->zoom(-1) }, 
    253252    ); 
    254     EVT_MENU( $win, 
     253    Wx::Event::EVT_MENU( $win, 
    255254        $menu->{view}->Append( -1, "Reset Font Size\tCtrl-/" ), 
    256255        sub { $_[0]->zoom( -1 * $_[0]->selected_editor->GetZoom ) }, 
     
    258257 
    259258    $menu->{view}->AppendSeparator; 
    260     EVT_MENU( $win, 
     259    Wx::Event::EVT_MENU( $win, 
    261260        $menu->{view}->Append( -1, "Set Bookmark\tCtrl-B" ), 
    262261        sub { Padre::Wx::Bookmarks::on_set_bookmark($_[0]) }, 
    263262    ); 
    264     EVT_MENU( $win, 
     263    Wx::Event::EVT_MENU( $win, 
    265264        $menu->{view}->Append( -1, "Goto Bookmark\tCtrl-Shift-B" ), 
    266265        sub { Padre::Wx::Bookmarks::on_goto_bookmark($_[0]) }, 
     
    275274    # Perl-Specific Searches 
    276275    $menu->{perl_find_unmatched} = $menu->{perl}->Append( -1, "Find Unmatched Brace" ); 
    277     EVT_MENU( $win, 
     276    Wx::Event::EVT_MENU( $win, 
    278277        $menu->{perl_find_unmatched}, 
    279278        sub { 
     
    303302    # Script Execution 
    304303    $menu->{perl_run_script} = $menu->{perl}->Append( -1, "Run Script\tF5" ); 
    305     EVT_MENU( $win, 
     304    Wx::Event::EVT_MENU( $win, 
    306305        $menu->{perl_run_script}, 
    307306        sub { $_[0]->run_perl }, 
    308307    ); 
    309308    $menu->{perl_run_command} = $menu->{perl}->Append( -1, "Run Command\tCtrl-F5" ); 
    310     EVT_MENU( $win, 
     309    Wx::Event::EVT_MENU( $win, 
    311310        $menu->{perl_run_command}, 
    312311        sub { 
     
    333332    ); 
    334333    $menu->{perl_stop} = $menu->{perl}->Append( -1, "&Stop" ); 
    335     EVT_MENU( $win, 
     334    Wx::Event::EVT_MENU( $win, 
    336335        $menu->{perl_stop}, 
    337336        sub { 
     
    346345 
    347346    # Commenting 
    348     EVT_MENU( $win, 
     347    Wx::Event::EVT_MENU( $win, 
    349348        $menu->{perl}->Append( -1, "&Comment Selected Lines\tCtrl-M" ), 
    350349        \&Padre::Wx::MainWindow::on_comment_out_block, 
    351350    ); 
    352     EVT_MENU( $win, 
     351    Wx::Event::EVT_MENU( $win, 
    353352        $menu->{perl}->Append( -1, "&Uncomment Selected Lines\tCtrl-Shift-M" ), 
    354353        \&Padre::Wx::MainWindow::on_uncomment_block, 
     
    379378    $menu->{window} = Wx::Menu->new; 
    380379    if ( $experimental ) { 
    381         EVT_MENU( $win, 
     380        Wx::Event::EVT_MENU( $win, 
    382381            $menu->{window}->Append( -1, "&Split window" ), 
    383382            \&Padre::Wx::MainWindow::on_split_window, 
     
    385384        $menu->{window}->AppendSeparator; 
    386385    } 
    387     EVT_MENU( $win, 
     386    Wx::Event::EVT_MENU( $win, 
    388387        $menu->{window}->Append(-1, "Next File\tCtrl-TAB"), 
    389388        \&Padre::Wx::MainWindow::on_next_pane, 
    390389    ); 
    391     EVT_MENU( $win, 
     390    Wx::Event::EVT_MENU( $win, 
    392391        $menu->{window}->Append(-1, "Previous File\tCtrl-Shift-TAB"), 
    393392        \&Padre::Wx::MainWindow::on_prev_pane, 
     
    403402    my $help = Padre::Wx::Menu::Help->new; 
    404403 
    405     EVT_MENU( $win, 
     404    Wx::Event::EVT_MENU( $win, 
    406405        $menu->{help}->Append( Wx::wxID_HELP, '' ), 
    407406        sub { $help->help($win) }, 
    408407    ); 
    409     EVT_MENU( $win, 
     408    Wx::Event::EVT_MENU( $win, 
    410409        $menu->{help}->Append( -1, "Context Help\tCtrl-Shift-H" ), 
    411410        sub { 
     
    420419    ); 
    421420    $menu->{help}->AppendSeparator; 
    422     EVT_MENU( $win, 
     421    Wx::Event::EVT_MENU( $win, 
    423422        $menu->{help}->Append( Wx::wxID_ABOUT, '' ), 
    424423        sub { $help->about }, 
     
    434433    if ( $experimental ) { 
    435434        $menu->{experimental} = Wx::Menu->new; 
    436         EVT_MENU( $win, 
     435        Wx::Event::EVT_MENU( $win, 
    437436            $menu->{experimental}->Append( -1, 'Reflow Menu/Toolbar' ), 
    438437            sub { 
     
    445444            }, 
    446445        ); 
    447         EVT_MENU( 
     446        Wx::Event::EVT_MENU( 
    448447            $win, 
    449448            $menu->{experimental}->Append( -1, 'Run in &Padre' ), 
     
    498497            $menu->Append(-1, $m->[0], $submenu); 
    499498        } else { 
    500             EVT_MENU( $self->win, $menu->Append(-1, $m->[0]), $m->[1] ); 
     499            Wx::Event::EVT_MENU( $self->win, $menu->Append(-1, $m->[0]), $m->[1] ); 
    501500        } 
    502501    } 
     
    510509 
    511510    $self->{alt}->[$n] = $self->{window}->Append(-1, ""); 
    512     EVT_MENU( $self->win, $self->{alt}->[$n], sub { $_[0]->on_nth_pane($n) } ); 
     511    Wx::Event::EVT_MENU( $self->win, $self->{alt}->[$n], sub { $_[0]->on_nth_pane($n) } ); 
    513512    $self->update_alt_n_menu($file, $n); 
    514513 
  • trunk/lib/Padre/Wx/Menu/Help.pm

    r455 r468  
    44use strict; 
    55use warnings; 
    6 use Wx (); 
    76 
     7use Padre::Wx (); 
    88use Padre::Util; 
    99 
  • trunk/lib/Padre/Wx/ModuleStartDialog.pm

    r454 r468  
    44use strict; 
    55use warnings; 
    6  
    7 # Module::Start widget of Padre 
    8  
    9 use Wx           qw( wxOK wxID_OK wxID_CANCEL wxVERTICAL wxHORIZONTAL wxEXPAND ); 
    10 use Wx::Event    qw( EVT_BUTTON EVT_CHECKBOX ); 
    116use Data::Dumper qw(Dumper); 
    127use Cwd          (); 
     8 
     9# Module::Start widget of Padre 
     10 
     11use Padre::Wx  (); 
    1312 
    1413our $VERSION = '0.12'; 
     
    2928 
    3029    $dialog->{_ok_}->SetDefault; 
    31     EVT_BUTTON( $dialog, $dialog->{_ok_},      \&ok_clicked      ); 
    32     EVT_BUTTON( $dialog, $dialog->{_cancel_},  \&cancel_clicked  ); 
     30    Wx::Event::EVT_BUTTON( $dialog, $dialog->{_ok_},      \&ok_clicked      ); 
     31    Wx::Event::EVT_BUTTON( $dialog, $dialog->{_cancel_},  \&cancel_clicked  ); 
    3332 
    3433    $dialog->{_module_name_}->SetFocus; 
  • trunk/lib/Padre/Wx/Output.pm

    r462 r468  
    88use strict; 
    99use warnings; 
     10 
    1011use Padre::Wx (); 
    1112 
  • trunk/lib/Padre/Wx/Popup.pm

    r456 r468  
    66#use base 'Wx::PopupTransientWindow'; 
    77#use base 'Wx::PopupWindow'; 
    8 use Wx        qw(:everything); 
    9 use Wx::Event qw(:everything); 
     8use Padre::Wx   (); 
     9 
    1010use base qw(Wx::PlPopupTransientWindow); 
    1111 
     
    1616    my( $self, $event ) = @_; 
    1717#    my $dc = Wx::PaintDC->new( $self ); 
    18 #    $dc->SetBrush( Wx::Brush->new( Wx::Colour->new( 0, 192, 0 ), wxSOLID ) ); 
    19 #    $dc->SetPen( Wx::Pen->new( Wx::Colour->new( 0, 0, 0 ), 1, wxSOLID ) ); 
     18#    $dc->SetBrush( Wx::Brush->new( Wx::Colour->new( 0, 192, 0 ), Wx::wxSOLID ) ); 
     19#    $dc->SetPen( Wx::Pen->new( Wx::Colour->new( 0, 0, 0 ), 1, Wx::wxSOLID ) ); 
    2020#    $dc->DrawRectangle( 0, 0, $self->GetSize->x, $self->GetSize->y ); 
    2121 
     
    2525    my $class = shift; 
    2626    my $self = $class->SUPER::new(@_); 
    27 EVT_PAINT( $self, \&on_paint); 
     27Wx::Event::EVT_PAINT( $self, \&on_paint); 
    2828 
    2929print "xxx $self\n"; 
  • trunk/lib/Padre/Wx/Preferences.pm

    r433 r468  
    44use strict; 
    55use warnings; 
    6 use Wx        qw(wxID_OK wxID_CANCEL wxDEFAULT_FRAME_STYLE); 
    7 use Wx::Event qw(EVT_BUTTON); 
     6 
     7use Padre::Wx  (); 
    88 
    99our $VERSION = '0.12'; 
     
    1212    my ( $class, $win, $config ) = @_; 
    1313 
    14     my $dialog = Wx::Dialog->new( $win, -1, "Preferences", [-1, -1], [550, 200], wxDEFAULT_FRAME_STYLE); 
     14    my $dialog = Wx::Dialog->new( $win, -1, "Preferences", [-1, -1], [550, 200], Wx::wxDEFAULT_FRAME_STYLE); 
    1515 
    1616    my $y = 10; 
     
    4444 
    4545    $y += $HEIGHT; 
    46     my $ok     = Wx::Button->new( $dialog, wxID_OK,     '', [10,  $y] ); 
    47     my $cancel = Wx::Button->new( $dialog, wxID_CANCEL, '', [120, $y], $ok->GetSize ); 
    48     EVT_BUTTON( $dialog, $ok,     sub { $dialog->EndModal(wxID_OK) } ); 
    49     EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(wxID_CANCEL) } ); 
     46    my $ok     = Wx::Button->new( $dialog, Wx::wxID_OK,     '', [10,  $y] ); 
     47    my $cancel = Wx::Button->new( $dialog, Wx::wxID_CANCEL, '', [120, $y], $ok->GetSize ); 
     48    Wx::Event::EVT_BUTTON( $dialog, $ok,     sub { $dialog->EndModal(Wx::wxID_OK) } ); 
     49    Wx::Event::EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 
    5050    $ok->SetDefault; 
    51     if ($dialog->ShowModal == wxID_CANCEL) { 
     51    if ($dialog->ShowModal == Wx::wxID_CANCEL) { 
    5252        return; 
    5353    } 
  • trunk/lib/Padre/Wx/Project.pm

    r453 r468  
    99# Project related widgets of Padre 
    1010 
    11 use Wx             qw(wxOK wxID_OK wxID_CANCEL wxVERTICAL wxHORIZONTAL wxALL); 
     11use Padre::Wx  (); 
    1212 
    1313our $VERSION = '0.12'; 
     
    2121    # set current project 
    2222    # run 
    23     Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self); 
     23    Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 
    2424 
    2525    return; 
     
    2929    my ($self) = @_; 
    3030 
    31     #Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self); 
     31    #Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 
    3232    #return; 
    3333    # popup a window with a list of projects previously selected, 
     
    4040    my $dialog = Wx::Dialog->new( $self, -1, "Select Project", [-1, -1], [-1, -1]); 
    4141 
    42     my $box  = Wx::BoxSizer->new(  wxVERTICAL   ); 
    43     my $row1 = Wx::BoxSizer->new(  wxHORIZONTAL ); 
    44     my $row2 = Wx::BoxSizer->new(  wxHORIZONTAL ); 
    45     my $row3 = Wx::BoxSizer->new(  wxHORIZONTAL ); 
    46     my $row4 = Wx::BoxSizer->new(  wxHORIZONTAL ); 
     42    my $box  = Wx::BoxSizer->new(  Wx::wxVERTICAL   ); 
     43    my $row1 = Wx::BoxSizer->new(  Wx::wxHORIZONTAL ); 
     44    my $row2 = Wx::BoxSizer->new(  Wx::wxHORIZONTAL ); 
     45    my $row3 = Wx::BoxSizer->new(  Wx::wxHORIZONTAL ); 
     46    my $row4 = Wx::BoxSizer->new(  Wx::wxHORIZONTAL ); 
    4747 
    4848    $box->Add($row1); 
     
    5151    $box->Add($row4); 
    5252 
    53     $row1->Add( Wx::StaticText->new( $dialog, -1, 'Select Project Name or type in new one'), 1, wxALL, 3 ); 
     53    $row1->Add( Wx::StaticText->new( $dialog, -1, 'Select Project Name or type in new one'), 1, Wx::wxALL, 3 ); 
    5454 
    5555    my @projects = keys %{ $config->{projects} }; 
    5656    my $choice = Wx::ComboBox->new( $dialog, -1, '', [-1, -1], [-1, -1], \@projects); 
    57     $row2->Add( $choice, 1, wxALL, 3); 
     57    $row2->Add( $choice, 1, Wx::wxALL, 3); 
    5858 
    5959    my $dir_selector = Wx::Button->new( $dialog, -1, 'Select Directory'); 
    60     $row2->Add($dir_selector, 1, wxALL, 3); 
     60    $row2->Add($dir_selector, 1, Wx::wxALL, 3); 
    6161 
    6262    my $path = Wx::StaticText->new( $dialog, -1, ''); 
    63     $row3->Add( $path, 1, wxALL, 3 ); 
     63    $row3->Add( $path, 1, Wx::wxALL, 3 ); 
    6464 
    6565    EVT_BUTTON( $dialog, $dir_selector, sub {on_pick_project_dir($path, @_) } ); 
     
    7272    # be local in the development directory and checked in to version control. 
    7373 
    74     my $ok     = Wx::Button->new( $dialog, wxID_OK,     ''); 
    75     my $cancel = Wx::Button->new( $dialog, wxID_CANCEL, ''); 
    76     EVT_BUTTON( $dialog, $ok,     sub { $dialog->EndModal(wxID_OK)     } ); 
    77     EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(wxID_CANCEL) } ); 
    78     $row4->Add($cancel, 1, wxALL, 3); 
    79     $row4->Add($ok,     1, wxALL, 3); 
     74    my $ok     = Wx::Button->new( $dialog, Wx::wxID_OK,     ''); 
     75    my $cancel = Wx::Button->new( $dialog, Wx::wxID_CANCEL, ''); 
     76    EVT_BUTTON( $dialog, $ok,     sub { $dialog->EndModal(Wx::wxID_OK)     } ); 
     77    EVT_BUTTON( $dialog, $cancel, sub { $dialog->EndModal(Wx::wxID_CANCEL) } ); 
     78    $row4->Add($cancel, 1, Wx::wxALL, 3); 
     79    $row4->Add($ok,     1, Wx::wxALL, 3); 
    8080 
    8181    $dialog->SetSizer($box); 
    8282    #$box->SetSizeHints( $self ); 
    8383 
    84     if ($dialog->ShowModal == wxID_CANCEL) { 
     84    if ($dialog->ShowModal == Wx::wxID_CANCEL) { 
    8585        return; 
    8686    } 
     
    109109#    my ($choice, $self, $event) = @_; 
    110110#    my $dialog = Wx::TextEntryDialog->new( $self, "Project Name", "", '' ); 
    111 #    if ($dialog->ShowModal == wxID_CANCEL) { 
     111#    if ($dialog->ShowModal == Wx::wxID_CANCEL) { 
    112112#        return; 
    113113#    }    
     
    122122 
    123123    my $dialog = Wx::DirDialog->new( $self, "Select Project Directory", $default_dir); 
    124     if ($dialog->ShowModal == wxID_CANCEL) { 
     124    if ($dialog->ShowModal == Wx::wxID_CANCEL) { 
    125125#print "Cancel\n"; 
    126126        return; 
     
    137137sub on_test_project { 
    138138    my ($self) = @_; 
    139     Wx::MessageBox("Not implemented yet", "Not Yes", wxOK, $self); 
     139    Wx::MessageBox("Not implemented yet", "Not Yes", Wx::wxOK, $self); 
    140140} 
    141141 
  • trunk/lib/Padre/Wx/RightClick.pm

    r433 r468  
    77# Find and Replace widget of Padre 
    88 
    9 use Wx             qw(:everything); 
    10 use Wx::Event      qw(:everything); 
     9use Padre::Wx  (); 
    1110 
    1211our $VERSION = '0.12'; 
     
    1716    my @options = qw(abc def); 
    1817    my $HEIGHT = 30; 
    19     my $dialog = Wx::Dialog->new( $self, -1, "", [-1, -1], [100, 50 + $HEIGHT * $#options], wxBORDER_SIMPLE); 
     18    my $dialog = Wx::Dialog->new( $self, -1, "", [-1, -1], [100, 50 + $HEIGHT * $#options], Wx::wxBORDER_SIMPLE); 
    2019    #$dialog->; 
    2120    foreach my $i (0..@options-1) { 
    22         EVT_BUTTON( $dialog, Wx::Button->new( $dialog, -1, $options[$i], [10, 10+$HEIGHT*$i] ), sub {on_right(@_, $i)} ); 
     21        Wx::Event::EVT_BUTTON( $dialog, Wx::Button->new( $dialog, -1, $options[$i], [10, 10+$HEIGHT*$i] ), sub {on_right(@_, $i)} ); 
    2322    } 
    2423    my $ret = $dialog->Show; 
    2524#print "ret\n"; 
    26     #my $pop = Padre::Wx::Popup->new($self); #, wxSIMPLE_BORDER); 
     25    #my $pop = Padre::Wx::Popup->new($self); #, Wx::wxSIMPLE_BORDER); 
    2726    #$pop->Move($event->GetPosition()); 
    2827    #$pop->SetSize(300, 200); 
  • trunk/lib/Padre/Wx/ToolBar.pm

    r459 r468  
    44use strict; 
    55use warnings; 
    6 use Wx           qw( wxNO_BORDER wxTB_HORIZONTAL wxTB_FLAT wxTB_DOCKABLE wxID_NEW wxID_OPEN wxID_SAVE); 
     6 
    77use Padre::Wx    (); 
    88 
Note: See TracChangeset for help on using the changeset viewer.