ManaTools::Shared::GUI::EventHandlerRole

NAME
SYNOPSIS package Foo;
DESCRIPTION
SUPPORT
AUTHOR
COPYRIGHT and LICENSE
METHODS


NAME

ManaTools::Shared::GUI::EventHandlerRole − a Properties Moose::Role

SYNOPSIS package Foo;

with ‘ManaTools::Shared::GUI::EventHandlerRole’;
1;

my $f = Foo−>new(…);
$f−>addEvent($event);

while(1) {

last if (!$f−>processEvents($yevent));
}

$f−>clearEvents();

DESCRIPTION

This Role is to specify an EventHandler Role, specifically, to handle multiple sub−Events

SUPPORT

You can find documentation for this Role with the perldoc command:
perldoc ManaTools::Shared::GUI::EventHandlerRole

AUTHOR

Maarten Vanraes

COPYRIGHT and LICENSE

Copyright (c) 2015−2017 Maarten Vanraes

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.

METHODS

addEventHandler
INPUT

$self: this object
$eventHandler: an EventHandlerRole to be added

DESCRIPTION

add an EventHandler to the events list

delEventHandler
INPUT

$self: this object
$eventHandler: an EventHandlerRole to be removed

DESCRIPTION

del an eventHandler from the events list

addEvent
INPUT

$self: this object
$name: a name to identify the event
$event: an EventRole to be added
@args: extra optional arguments

DESCRIPTION

add an Event to the events list

delEvent
INPUT

$self: this object
$name: a name to identify the event

DESCRIPTION

del an event from the events list

hasEvent
INPUT

$self: this object
$name: the event identified by $name

DESCRIPTION

1 if the event exists, 0 otherwise

getEvent
INPUT

$self: this object
$name: the event identified by $name

OUTPUT

an ManaTools::Shared::GUI::EventRole

DESCRIPTION

returns an event, depending on the name

clearEvents
INPUT

$self: this object

DESCRIPTION

clears all events

findEvent
INPUT

$self: this object
$callback: CodeRef to be executed for each event
@args: extra arguments for the callback

OUTPUT

an event if it’s found, or undef otherwise

DESCRIPTION

returns an Event from the list, according to a callback function, or undef

addWidget
INPUT

$self: this object
$name: a name to identify the widget
$widget: a yui widget
$event: an optional CodeRef that will be executed when an Event triggers
$backend: an optional backend object that will be present in the event handler

DESCRIPTION

add a widget event handler to the events list

delWidget
INPUT

$self: this object
$widget: a yui widget

DESCRIPTION

del a widget event handler from the events list

widget
INPUT

$self: this object
$name: the widget identified by $name

DESCRIPTION

returns a yui::YWidget

findWidget
INPUT

$self: this object
$widget: the yui::YWidget to be found

DESCRIPTION

returns a ManaTools::Shared::GUI::Dialog::Event that has the widget

addItem
INPUT

$self: this object
$name: a name to identify the item
$item: a yui item
$event: an optional CodeRef that will be executed when an Event triggers
$backend: an optional backend object that will be present in the event handler

DESCRIPTION

add a item event handler to the events list

delItem
INPUT

$self: this object
$item: a yui item

DESCRIPTION

del a item event handler from the events list

item
INPUT

$self: this object
$name: the item identified by $name

DESCRIPTION

returns a yui::YItem

findItem
INPUT

$self: this object
$item: the yui::YItem to be found

DESCRIPTION

returns a ManaTools::Shared::GUI::Dialog::Event that has the item

processEvents
INPUT

$self: this object
$yevent: the yui::YEvent

OUTPUT

0 if the loop should end, positive if handled, negative otherwise

DESCRIPTION

returns an Event from the list, according to a callback function, or undef

parentDialog
INPUT

$self: this object

DESCRIPTION

finds the parent Dialog