Changeset 5378
- Timestamp:
- 06/19/09 13:55:04 (3 years ago)
- Location:
- trunk/Padre-Plugin-Perl6/lib/Padre/Plugin
- Files:
-
- 2 edited
-
Perl6.pm (modified) (2 diffs)
-
Perl6/Preferences.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6.pm
r5367 r5378 17 17 my $SNIPPET_HTML = 'snippet_html'; 18 18 19 use Class::XSAccessor accessors => { 20 config => 'config', # plugin configuration object 21 }; 22 19 23 # static field to contain reference to current plugin configuration 20 24 my $config; … … 76 80 $self->config_write($config); 77 81 82 # update configuration attribute 83 $self->config( $config ); 84 78 85 # let us parse some S29-functions.pod documentation (safely) 79 86 eval { -
trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Preferences.pm
r5350 r5378 5 5 6 6 use Class::XSAccessor accessors => { 7 _plugin => '_plugin', # plugin to be configured 8 _sizer => '_sizer', # window sizer 7 _plugin => '_plugin', # plugin to be configured 8 _sizer => '_sizer', # window sizer 9 _colorizer_list => '_colorizer_list' # colorizer list box 9 10 }; 10 11 … … 49 50 # 50 51 sub _on_ok_button_clicked { 51 my ($self) = @_; 52 my $self = shift; 53 52 54 my $plugin = $self->_plugin; 53 55 54 56 # read plugin preferences 55 #my $prefs = $plugin->config;57 my $prefs = $plugin->config; 56 58 57 # overwrite dictionary preference58 #my $dic = $self->_dict_combo->GetValue;59 #$prefs->{dictionary} = $dic;59 # update configuration 60 my $selection = $self->_colorizer_list->GetSelection(); 61 $prefs->{colorizer} = ($selection == 0) ? 'STD' : 'PGE'; 60 62 61 63 # store plugin preferences 62 #$plugin->config_write($prefs);64 $plugin->config_write($prefs); 63 65 64 66 $self->Destroy; … … 69 71 70 72 # 71 # $self->_create;72 #73 73 # create the dialog itself. 74 74 # 75 # no params, no return values.76 #77 75 sub _create { 78 my ($self) = @_;76 my $self = shift; 79 77 80 78 # create sizer that will host all controls … … 92 90 93 91 # 94 # $dialog->_create_buttons;95 #96 92 # create the buttons pane. 97 93 # 98 # no params. no return values.99 #100 94 sub _create_buttons { 101 my ($self) = @_;95 my $self = shift; 102 96 my $sizer = $self->_sizer; 103 97 … … 108 102 109 103 # 110 # $dialog->_create_controls;111 #112 104 # create the pane to choose the various configuration parameters. 113 105 # 114 # no params. no return values.115 #116 106 sub _create_controls { 117 my ($self) = @_;107 my $self = shift; 118 108 119 my @choices = ['S:H:P6/STD','Rakudo/PGE']; 109 my @choices = [ 110 'S:H:P6/STD', 111 'Rakudo/PGE' 112 ]; 120 113 # syntax highligher selection 121 114 my $selector_label = Wx::StaticText->new( $self, -1, Wx::gettext('Syntax Highlighter:') ); 122 my $selector_list = Wx::ListBox->new( 123 $self, 124 -1, 125 Wx::wxDefaultPosition, 126 Wx::wxDefaultSize, 127 @choices, 115 $self->_colorizer_list( 116 Wx::ListBox->new( 117 $self, 118 -1, 119 Wx::wxDefaultPosition, 120 Wx::wxDefaultSize, 121 @choices, 122 ) 128 123 ); 129 124 130 # XXX -Select based on configuration variable131 $sel ector_list->Select(0);125 # Select based on configuration variable 126 $self->_colorizer_list->Select( ($self->_plugin->config->{colorizer} eq 'STD') ? 0 : 1); 132 127 133 128 # pack the controls in a box … … 135 130 $box = Wx::BoxSizer->new(Wx::wxHORIZONTAL); 136 131 $box->Add( $selector_label, 0, Wx::wxALL|Wx::wxEXPAND|Wx::wxALIGN_CENTER, 5 ); 137 $box->Add( $sel ector_list, 1, Wx::wxALL|Wx::wxEXPAND|Wx::wxALIGN_CENTER, 5 );132 $box->Add( $self->_colorizer_list, 1, Wx::wxALL|Wx::wxEXPAND|Wx::wxALIGN_CENTER, 5 ); 138 133 $self->_sizer->Add( $box, 0, Wx::wxALL|Wx::wxEXPAND|Wx::wxALIGN_CENTER, 5 ); 139 134
Note: See TracChangeset
for help on using the changeset viewer.
