#!/usr/bin/perl -w -- 
#
# generated by wxGlade acbfabfba67b+ on Fri Oct 17 23:42:56 2014
#
# To get wxPerl visit http://wxPerl.sourceforge.net/
#

use Wx 0.15 qw[:allclasses];
use strict;

package MyDialog;

use Wx qw[:everything];
use base qw(Wx::Dialog);
use strict;

use Wx::Locale gettext => '_T';
sub new {
    my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_;
    $parent = undef              unless defined $parent;
    $id     = -1                 unless defined $id;
    $title  = ""                 unless defined $title;
    $pos    = wxDefaultPosition  unless defined $pos;
    $size   = wxDefaultSize      unless defined $size;
    $name   = ""                 unless defined $name;

    $style = wxDEFAULT_DIALOG_STYLE 
        unless defined $style;

    $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $style, $name );
    $self->{button_1} = Wx::Button->new($self, wxID_ANY, _T("Font"));


    Wx::Event::EVT_BUTTON($self, $self->{button_1}, \&on_click_font);
        
    $self->SetTitle(_T("dialog_1"));
    $self->{sizer_1} = Wx::BoxSizer->new(wxHORIZONTAL);
    $self->{sizer_1}->Add($self->{button_1}, 0, 0, 0);
    $self->SetSizer($self->{sizer_1});
    $self->{sizer_1}->Fit($self);
    $self->Layout();
    
    return $self;
}


sub on_click_font{
    my ($i_frame, $event) = @_;
    
    my $dlg_format = Wx::RichTextFormattingDialog -> newFull (wxRICHTEXT_FORMAT_FONT,$i_frame,"Format Paragraph",wxID_ANY, wxDefaultPosition, wxDefaultSize,wxNO_BORDER); # , -1, (("Paragraph details"))
    $dlg_format->ShowModal();
    return;
}

1;

package main;

use Wx qw(wxLANGUAGE_DEFAULT wxLOCALE_LOAD_DEFAULT);

unless(caller){
    my $local = Wx::Locale->new(wxLOCALE_LOAD_DEFAULT, wxLOCALE_LOAD_DEFAULT );

    local *Wx::App::OnInit = sub{1};
    my $app = Wx::App->new();
    Wx::InitAllImageHandlers();

    my $dialog_1 = MyDialog->new();

    $app->SetTopWindow($dialog_1);
    $dialog_1->Show(1);
    $app->MainLoop();
}

