Changeset 487
- Timestamp:
- 10/26/08 06:32:53 (3 years ago)
- Location:
- trunk/lib/Padre/Wx
- Files:
-
- 2 edited
-
Editor.pm (modified) (1 diff)
-
MainWindow.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Padre/Wx/Editor.pm
r486 r487 183 183 # actually I added some improvement allowing a 50% growth in the file 184 184 # 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);185 sub show_line_numbers { 186 my ($self, $on) = @_; 187 188 $self->SetMarginWidth(1, 0); 189 $self->SetMarginWidth(2, 0); 190 190 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 character193 $ 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); 195 195 } 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); 198 198 } 199 199 -
trunk/lib/Padre/Wx/MainWindow.pm
r486 r487 745 745 my $title = $editor->{Document}->get_title; 746 746 747 $editor-> _toggle_numbers($config->{editor_linenumbers});747 $editor->show_line_numbers($config->{editor_linenumbers}); 748 748 $editor->SetViewEOL($config->{editor_eol}); 749 749 $self->set_preferences($editor, $config); … … 1100 1100 1101 1101 foreach my $page ( $self->pages ) { 1102 $page-> _toggle_numbers( $config->{editor_linenumbers} );1102 $page->show_line_numbers( $config->{editor_linenumbers} ); 1103 1103 } 1104 1104
Note: See TracChangeset
for help on using the changeset viewer.
