my $dlg = ManaTools::Shared::GUI::Dialog->new(
dialogType => ManaTools::Shared::GUI::Dialog->mainDialog, ## or popupDialog
title => ``New Title'',
icon => $icon,
optFields => [
ManaTools::Shared::GUI::Dialog->TimeField,
ManaTools::Shared::GUI::Dialog->DateField,
ManaTools::Shared::GUI::Dialog->TabField,
],
buttons => [
ManaTools::Shared::GUI::Dialog->cancelButton,
ManaTools::Shared::GUI::Dialog->okButton,
],
event_timeout => 0, # event timeout in msec during the waitForEvent()
layout => sub { my $self = shift; my $layoutstart = shift; my $dlg = $self->dialog(); my $info = $self->info(); ... $self->addWidget('button1', $button, sub{...}, $backendItem1); },
restoreValues => sub { my $self = shift; $info = {}; ...; return $info },
result => sub { my $self = shift; ... },
);
my $result = $dlg->call();
## you should call this from the Module, and not directly from here...
perldoc ManaTools::Shared::GUI::Dialog
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
hash ref containing module: the parent ManaTools::Module dialogType: ManaTools::Shared::GUI::Dialog->mainDialog, or popupDialog title: a title icon: an icon layout: a callback that builds the layout of the dialog restoreValues: an optional callback that restore the values to an $info HashRef event_timeout: an optional and rw timeout in msec during the waitForEvent() needs a ManaTools::Shared::GUI::Event to manage the $yui::YEvent::TimeoutEvent buttons: an optional hashref containing ManaTools::Shared::GUI::Dialog->cancelButton and/or ManaTools::Shared::GUI::Dialog->okButton result: an optional callback for returning a result (mostly for popupDialogs)
DESCRIPTION
new is inherited from Moose, to create a Dialog object
$self: this object
OUTPUT
returns true or false depending on success
DESCRIPTION
helper function to check if the optional factory has the optFields
$self: this object $buttonType: a buttonType
OUTPUT
returns the CodeRef associated with the buttonType, or undef
DESCRIPTION
gets the CodeRef associated with a buttontype
$self: this object $ylayout: a layout widget to base the buttons on
DESCRIPTION
add buttons to the layout according to $self->buttons()
$self: this object
DESCRIPTION
Start multiple changes (if required)
$self: this object $force: bool
DESCRIPTION
Recalculates the layout and ends multiple changes (if required or if forced)
$self: this object
OUTPUT
the result from the dialog
DESCRIPTION
Creates a dialog (either popup or main) and handles it's events and resturns the proper result.