CEL

Public API Reference

iUIInventory Struct Reference

The inventory itself. More...

#include <tools/uitools/inventory.h>

Inheritance diagram for iUIInventory:

List of all members.

Public Member Functions

virtual void AddSelectionListener (iUIInventorySelectionCallback *cb)=0
 Add a new selection listener.
virtual bool Bind (const char *eventname, const char *command, const char *args)=0
 Bind an event to some command.
virtual void Close ()=0
 Close the inventory.
virtual iUIInventoryInfoGetInfo () const =0
 Get the current info.
virtual iPcInventoryGetInventory () const =0
 While the inventory is open you can query the inventory.
virtual void Open (const char *title, iPcInventory *inventory)=0
 Open the inventory.
virtual void SetInfo (iUIInventoryInfo *info)=0
 Setup a class which will be used to get information about the entities to show in the inventory.
virtual bool SetStyleOption (const char *name, const char *value)=0
 Set a style option.

Detailed Description

The inventory itself.

Definition at line 90 of file inventory.h.


Member Function Documentation

virtual void iUIInventory::AddSelectionListener ( iUIInventorySelectionCallback cb  )  [pure virtual]

Add a new selection listener.

virtual bool iUIInventory::Bind ( const char *  eventname,
const char *  command,
const char *  args 
) [pure virtual]

Bind an event to some command.

Returns false if this inventory doesn't support bindings or if the binding event or command is invalid.

Parameters:
eventname is the name for a keyboard or mouse event
command is a inventory implementation specific command
args is an optional argument string for the command

In order to make sure that different inventory implementations can co-exist there are a few conventions for common operations:

  • 'select': select an item and close inventory
  • 'select_keepopen': select an item but keep inventory open
  • 'cancel': close the inventory
  • 'scroll_left': scroll inventory to the left or up (depending on orientation)
  • 'scroll_right': scroll inventory to the right or down (depending on orientation)
virtual void iUIInventory::Close (  )  [pure virtual]

Close the inventory.

virtual iUIInventoryInfo* iUIInventory::GetInfo (  )  const [pure virtual]

Get the current info.

If you want to implement your own info class that only overrides one particular function you can delegate back to this class provided you hold a reference to it.

virtual iPcInventory* iUIInventory::GetInventory (  )  const [pure virtual]

While the inventory is open you can query the inventory.

virtual void iUIInventory::Open ( const char *  title,
iPcInventory inventory 
) [pure virtual]

Open the inventory.

virtual void iUIInventory::SetInfo ( iUIInventoryInfo info  )  [pure virtual]

Setup a class which will be used to get information about the entities to show in the inventory.

If this function is not called then there will be a default implementation that just gets the name from the entities.

virtual bool iUIInventory::SetStyleOption ( const char *  name,
const char *  value 
) [pure virtual]

Set a style option.

Different inventory implementations can support different style options. This function returns false if a certain style option is not supported or if the value is invalid for this style.


The documentation for this struct was generated from the following file:

Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1