1
package Padre::Wx::Choice::Theme;
3
# Theme selection choice box
10
use Padre::Wx::Role::Main ();
11
use Padre::Wx::Theme ();
13
our $VERSION = '0.92';
19
# Provide a custom config_load hook so that Padre::Wx::Role::Config will let
20
# let us load our own data instead of doing it for us.
27
# Instead of using the vanilla options provided by configuration,
28
# use the elevated ones provided by the theme engine.
29
my $locale = Padre::Locale::rfc4646();
30
my $options = Padre::Wx::Theme->labels($locale);
34
# NOTE: This assumes that the list will not be
35
# sorted in Wx via a style flag and that the
36
# order of the fields should be that of the key
37
# and not of the translated label.
38
# Doing sort in Wx will probably break this.
39
foreach my $option ( sort keys %$options ) {
40
# Don't localise the label as Padre::Wx::Theme will do
41
# the localisation for us in this special case.
42
my $label = $options->{$option};
43
$self->Append( $label => $option );
44
next unless $option eq $value;
45
$self->SetSelection( $self->GetCount - 1 );
54
# Copyright 2008-2011 The Padre development team as listed in Padre.pm.
56
# This program is free software; you can redistribute it and/or
57
# modify it under the same terms as Perl 5 itself.