package Padre::Plugin::Git::FBP::Message;

## no critic

# This module was generated by Padre::Plugin::FormBuilder::Perl.
# To change this module edit the original .fbp file and regenerate.
# DO NOT MODIFY THIS FILE BY HAND!

use 5.008005;
use utf8;
use strict;
use warnings;
use Padre::Wx ();
use Padre::Wx::Role::Main ();

our $VERSION = '0.12';
our @ISA     = qw{
	Padre::Wx::Role::Main
	Wx::Dialog
};

sub new {
	my $class  = shift;
	my $parent = shift;

	my $self = $class->SUPER::new(
		$parent,
		-1,
		Wx::gettext("Git Commit Message"),
		Wx::DefaultPosition,
		Wx::DefaultSize,
		Wx::DEFAULT_DIALOG_STYLE | Wx::RESIZE_BORDER,
	);

	$self->{m_staticText2} = Wx::StaticText->new(
		$self,
		-1,
		Wx::gettext("Guidance:"),
	);

	$self->{m_staticText1} = Wx::StaticText->new(
		$self,
		-1,
		Wx::gettext("Please enter the commit message for your changes. Lines starting\nwith '#' will be ignored, and an empty message aborts the commit."),
	);

	$self->{type} = Wx::StaticText->new(
		$self,
		-1,
		Wx::gettext("File:"),
	);

	$self->{commit_file} = Wx::StaticText->new(
		$self,
		-1,
		Wx::gettext("commit file"),
	);

	$self->{message} = Wx::TextCtrl->new(
		$self,
		-1,
		"",
		Wx::DefaultPosition,
		Wx::DefaultSize,
		Wx::TE_MULTILINE,
	);
	$self->{message}->SetMinSize( [ 480, 60 ] );

	$self->{m_staticline1} = Wx::StaticLine->new(
		$self,
		-1,
		Wx::DefaultPosition,
		Wx::DefaultSize,
		Wx::LI_HORIZONTAL,
	);

	$self->{show_last_commit} = Wx::Button->new(
		$self,
		-1,
		Wx::gettext("Show Last Commit"),
		Wx::DefaultPosition,
		Wx::DefaultSize,
	);

	Wx::Event::EVT_BUTTON(
		$self,
		$self->{show_last_commit},
		sub {
			shift->on_show_last(@_);
		},
	);

	$self->{m_button_cancel} = Wx::Button->new(
		$self,
		Wx::ID_CANCEL,
		Wx::gettext("Cancel"),
		Wx::DefaultPosition,
		Wx::DefaultSize,
	);
	$self->{m_button_cancel}->SetDefault;

	$self->{button_commit} = Wx::Button->new(
		$self,
		-1,
		Wx::gettext("Commit"),
		Wx::DefaultPosition,
		Wx::DefaultSize,
	);
	$self->{button_commit}->SetDefault;

	Wx::Event::EVT_BUTTON(
		$self,
		$self->{button_commit},
		sub {
			shift->on_commit(@_);
		},
	);

	my $fgSizer1 = Wx::FlexGridSizer->new( 2, 2, 0, 0 );
	$fgSizer1->SetFlexibleDirection(Wx::BOTH);
	$fgSizer1->SetNonFlexibleGrowMode(Wx::FLEX_GROWMODE_SPECIFIED);
	$fgSizer1->Add( $self->{m_staticText2}, 0, Wx::ALL, 5 );
	$fgSizer1->Add( $self->{m_staticText1}, 0, Wx::ALL, 5 );
	$fgSizer1->Add( $self->{type}, 0, Wx::ALL, 5 );
	$fgSizer1->Add( $self->{commit_file}, 0, Wx::ALL, 5 );

	my $bSizer8 = Wx::BoxSizer->new(Wx::HORIZONTAL);
	$bSizer8->Add( $self->{show_last_commit}, 0, Wx::ALL, 5 );
	$bSizer8->Add( 0, 0, 1, Wx::EXPAND, 5 );
	$bSizer8->Add( $self->{m_button_cancel}, 0, Wx::ALL, 5 );
	$bSizer8->Add( $self->{button_commit}, 0, Wx::ALL, 5 );

	my $bSizer1 = Wx::BoxSizer->new(Wx::VERTICAL);
	$bSizer1->Add( $fgSizer1, 0, Wx::EXPAND, 5 );
	$bSizer1->Add( $self->{message}, 1, Wx::ALL | Wx::EXPAND, 5 );
	$bSizer1->Add( $self->{m_staticline1}, 0, Wx::EXPAND | Wx::ALL, 5 );
	$bSizer1->Add( $bSizer8, 0, Wx::ALL | Wx::EXPAND, 5 );

	$self->SetSizerAndFit($bSizer1);
	$self->Layout;

	return $self;
}

sub type {
	$_[0]->{type};
}

sub commit_file {
	$_[0]->{commit_file};
}

sub message {
	$_[0]->{message};
}

sub on_show_last {
	$_[0]->main->error('Handler method on_show_last for event show_last_commit.OnButtonClick not implemented');
}

sub on_commit {
	$_[0]->main->error('Handler method on_commit for event button_commit.OnButtonClick not implemented');
}

1;

# Copyright 2008-2012 The Padre development team as listed in Padre.pm.
# LICENSE
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl 5 itself.

