~ubuntu-branches/ubuntu/precise/padre/precise

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/Dialog/Warning.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-05-08 09:17:22 UTC
  • mfrom: (1.2.1 upstream) (10.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100508091722-y6008jtk0ap6znyn
Tags: 0.60.ds1-3
rules: run tests with HOME=$fake_home to avoud failing when $HOME points
to a non-existent location. Closes: #579289

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Padre::Wx::Dialog::Warning;
 
2
 
 
3
use 5.008;
 
4
use strict;
 
5
use warnings;
 
6
use Padre::Wx                  ();
 
7
use Padre::Wx::Role::MainChild ();
 
8
use Padre::Locale              ();
 
9
 
 
10
our $VERSION = '0.60';
 
11
our @ISA     = qw{
 
12
        Padre::Wx::Role::MainChild
 
13
        Wx::Dialog
 
14
};
 
15
 
 
16
=pod
 
17
 
 
18
=head1 NAME
 
19
 
 
20
Padre::Wx::Dialog::Warning - A Dialog
 
21
 
 
22
=cut
 
23
 
 
24
sub new {
 
25
        my $class = shift;
 
26
        my $main  = shift;
 
27
 
 
28
        # Create the Wx dialog
 
29
        my $self = $class->SUPER::new(
 
30
                $main,
 
31
                -1,
 
32
                Wx::gettext('A Dialog'),
 
33
                Wx::wxDefaultPosition,
 
34
                Wx::wxDefaultSize,
 
35
                Wx::wxCAPTION | Wx::wxCLOSE_BOX | Wx::wxSYSTEM_MENU
 
36
        );
 
37
 
 
38
        $self->{warning_label} = Wx::StaticText->new(
 
39
                $self,
 
40
                -1,
 
41
                Wx::gettext("See http://padre.perlide.org/ for update information"),
 
42
                Wx::wxDefaultPosition,
 
43
                Wx::wxDefaultSize,
 
44
                Wx::wxALIGN_CENTRE,
 
45
        );
 
46
        $self->{warning_checkbox} = Wx::CheckBox->new(
 
47
                $self,
 
48
                -1,
 
49
                Wx::gettext("Do not show this again"),
 
50
                Wx::wxDefaultPosition,
 
51
                Wx::wxDefaultSize,
 
52
        );
 
53
        my $line_1 = Wx::StaticLine->new(
 
54
                $self,
 
55
                -1,
 
56
                Wx::wxDefaultPosition,
 
57
                Wx::wxDefaultSize,
 
58
        );
 
59
        $self->{ok_button} = Wx::Button->new(
 
60
                $self,
 
61
                Wx::wxID_OK,
 
62
                "",
 
63
        );
 
64
        $self->SetTitle( Wx::gettext("Warning") );
 
65
        my $sizer_4 = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
 
66
        my $sizer_5 = Wx::BoxSizer->new(Wx::wxVERTICAL);
 
67
        my $sizer_6 = Wx::BoxSizer->new(Wx::wxHORIZONTAL);
 
68
        $sizer_5->Add( $self->{warning_label},    0, 0,                                       0 );
 
69
        $sizer_5->Add( $self->{warning_checkbox}, 0, Wx::wxTOP | Wx::wxEXPAND,                5 );
 
70
        $sizer_5->Add( $line_1,                   0, Wx::wxTOP | Wx::wxBOTTOM | Wx::wxEXPAND, 5 );
 
71
        $sizer_6->Add( $self->{ok_button},        0, 0,                                       0 );
 
72
        $sizer_5->Add( $sizer_6,                  1, Wx::wxALIGN_CENTER_HORIZONTAL,           5 );
 
73
        $sizer_4->Add( $sizer_5,                  1, Wx::wxALL | Wx::wxEXPAND,                5 );
 
74
        $self->SetSizer($sizer_4);
 
75
        $sizer_4->Fit($self);
 
76
 
 
77
        return $self;
 
78
}
 
79
 
 
80
1;
 
81
 
 
82
=pod
 
83
 
 
84
=head1 COPYRIGHT & LICENSE
 
85
 
 
86
Copyright 2008-2010 The Padre development team as listed in Padre.pm.
 
87
 
 
88
This program is free software; you can redistribute
 
89
it and/or modify it under the same terms as Perl itself.
 
90
 
 
91
The full text of the license can be found in the
 
92
LICENSE file included with this module.
 
93
 
 
94
=cut
 
95
 
 
96
# Copyright 2008-2010 The Padre development team as listed in Padre.pm.
 
97
# LICENSE
 
98
# This program is free software; you can redistribute it and/or
 
99
# modify it under the same terms as Perl 5 itself.