view release on metacpan or search on metacpan
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
return $string;
}
}
# Cannot add an underline to $string; all of its letters are already in use. Return the
# unmodified string
return $string
}
# Treeview header responses - profiles
sub allProfHeader {
# Called by ->treeViewChanged when the user clicks on the 'All profiles' header in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# Compile the data to display
$dataHashRef = $self->compileList_profPriority();
# (Nothing happens if the user double-clicks on a row)
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - dictionaries
sub allDictHeader {
# Called by ->treeViewChanged when the user clicks on the 'All dictionaries' header in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# equivalent to the edit button
$self->ivPoke('notebookSelectRef', sub {
$self->buttonEdit_dict();
});
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - tasks
sub availableTaskHeader {
# Called by ->treeViewChanged when the user clicks on the 'Available tasks' header in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# equivalent to the edit button
$self->ivPoke('notebookSelectRef', sub {
$self->buttonEdit_taskLabel();
});
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - cages
sub allCageHeader {
# Called by ->treeViewChanged when the user clicks on the 'All cages' header in the treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
# 'undef' on improper arguments
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# equivalent to the edit button
$self->ivPoke('notebookSelectRef', sub {
$self->buttonView_interfaceModel();
});
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - world model
sub modelHeader {
# Called by $self->allModelHeader, $self->regionModelHeader etc, after a call by
# ->treeViewChanged when the user clicks on one of the items under the 'world model'
# header in the treeview
#
# Expected arguments
# $tabName - What to display on the tab, e.g. 'Weapons'
# $tabShortCut - e.g. '_Weapons'
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# equivalent to the edit button
$self->ivPoke('notebookSelectRef', sub {
$self->buttonEdit_exitModel();
});
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - buffers
sub displayBufferHeader {
# Called by ->treeViewChanged when the user clicks on the 'Display buffer' header in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# Display all of this in the notebook
return $self->refreshNotebook(
$tabListRef,
$columnListRef,
$dataHashRef,
$buttonListRef,
TRUE, # Scroll to bottom
);
}
# Treeview header responses - other objects
sub chatContactHeader {
# Called by ->treeViewChanged when the user clicks on the 'Chat contacts' header in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
# equivalent to the edit button
$self->ivPoke('notebookSelectRef', sub {
$self->buttonEdit_zonemap();
});
# Display all of this in the notebook
return $self->refreshNotebook($tabListRef, $columnListRef, $dataHashRef, $buttonListRef);
}
# Treeview header responses - help
sub quickHelpHeader {
# Called by ->treeViewChanged when the user clicks on one of the quick help item in the
# treeview
#
# Expected arguments
# $item - The treeview item that was clicked (i.e. the text it contains)
#
# Return values
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
'Add', 'Add an object to the world model', 'buttonAdd_model',
'Edit', 'Edit the selected world model object', 'buttonEdit_model',
'Delete', 'Delete the selected world model object', 'buttonDelete_model',
'Dump', 'Displays a list of all world model objects in the \'main\' window',
'buttonDump_model',
);
return \@list;
}
# Treeview callbacks
sub treeViewRowActivated {
# Treeview's 'row_activated' callback - expands and collapses parts of the tree
# Defined in $self->enable
#
# Expected arguments
# $tree - The Gtk3::TreeView widget
# $path, $column - The clicked cell
# $self - This Perl object
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
} else {
$tree->expand_row($path, FALSE);
}
return 1;
}
sub treeViewChanged {
# Treeview's 'changed' callback - responds to clicks on the tree
# Defined in $self->winEnable
#
# Expected arguments
# $selection - Gtk3::Selection
# $self - This Perl object
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
1, # Left mouse button
Gtk3::get_current_event_time(),
);
$popupMenu->show_all();
# Operation complete. Now wait for the user's response
return 1;
}
# Treeview widget methods
sub enableTreeView {
# Called by $self->drawWidgets
# Sets up the Automapper window's treeview widget
#
# Expected arguments
# (none besides $self)
#
# Return values
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
}
# Call this function recursively, to expand the parent's parent (if it has one)
$self->expandTreeView($model, $parentObj->name);
return 1;
}
sub treeViewRowActivatedCallback {
# Treeview's 'row_activated' callback - called when the user double-clicks on one of the
# treeview's cells
# Called from an anonymous sub in $self->enableTreeView
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
}
# Sensitise/desensitise menu bar/toolbar items, depending on current conditions
$self->restrictWidgets();
return 1;
}
sub treeViewRowChangedCallback {
# Treeview's 'changed' callback - called when the user single-clicks on one of the
# treeview's cells
# Called from an anonymous sub in $self->enableTreeView
#
# Expected arguments
# $selection - A Gtk3::Selection
#
# Return values
# 'undef' on improper arguments or if the selection is not recognised
# 1 otherwise
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
$self->ivPoke('treeViewSelectedLine', $region);
# Sensitise/desensitise menu bar/toolbar items, depending on current conditions
$self->restrictWidgets();
return 1;
}
}
sub treeViewRowExpandedCallback {
# Treeview's 'row_expanded' callback - called when the user expands one of the treeview's
# rows to reveal a region's child regions
# Called from an anonymous sub in $self->enableTreeView
#
# Expected arguments
# $iter - A Gtk3::TreeIter
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/Win/Map.pm view on Meta::CPAN
$region = $self->treeViewModel->get($iter, 0);
# Mark the row as expanded
$self->ivAdd('treeViewRegionHash', $region, TRUE);
return 1;
}
sub treeViewRowCollapsedCallback {
# Treeview's 'row_collapsed' callback - called when the user collapses one of the treeview's
# rows to hide a region's child regions
# Called from an anonymous sub in $self->enableTreeView
#
# Expected arguments
# $iter - A Gtk3::TreeIter
#
# Return values
# 'undef' on improper arguments
# 1 otherwise