Changeset 487


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

rename function to show_line_numbers and rename the internal variable to $self

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

Legend:

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

    r486 r487  
    183183# actually I added some improvement allowing a 50% growth in the file 
    184184# and requireing a min of 2 width 
    185 sub _toggle_numbers { 
    186     my ($editor, $on) = @_; 
    187  
    188     $editor->SetMarginWidth(1, 0); 
    189     $editor->SetMarginWidth(2, 0); 
     185sub show_line_numbers { 
     186    my ($self, $on) = @_; 
     187 
     188    $self->SetMarginWidth(1, 0); 
     189    $self->SetMarginWidth(2, 0); 
    190190    if ($on) { 
    191         my $n = 1 + List::Util::max (2, length ($editor->GetLineCount * 2)); 
    192         my $width = $n * $editor->TextWidth(Wx::wxSTC_STYLE_LINENUMBER, "9"); # width of a single character 
    193         $editor->SetMarginWidth(0, $width); 
    194         $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
     191        my $n = 1 + List::Util::max (2, length ($self->GetLineCount * 2)); 
     192        my $width = $n * $self->TextWidth(Wx::wxSTC_STYLE_LINENUMBER, "9"); # width of a single character 
     193        $self->SetMarginWidth(0, $width); 
     194        $self->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
    195195    } else { 
    196         $editor->SetMarginWidth(0, 0); 
    197         $editor->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
     196        $self->SetMarginWidth(0, 0); 
     197        $self->SetMarginType(0, Wx::wxSTC_MARGIN_NUMBER); 
    198198    } 
    199199 
  • trunk/lib/Padre/Wx/MainWindow.pm

    r486 r487  
    745745    my $title = $editor->{Document}->get_title; 
    746746 
    747     $editor->_toggle_numbers($config->{editor_linenumbers}); 
     747    $editor->show_line_numbers($config->{editor_linenumbers}); 
    748748    $editor->SetViewEOL($config->{editor_eol}); 
    749749    $self->set_preferences($editor, $config); 
     
    11001100 
    11011101    foreach my $page ( $self->pages ) { 
    1102         $page->_toggle_numbers( $config->{editor_linenumbers} ); 
     1102        $page->show_line_numbers( $config->{editor_linenumbers} ); 
    11031103    } 
    11041104 
Note: See TracChangeset for help on using the changeset viewer.