#include <gump.h>
Public Member Functions | |
Gump (int x, int y, int width, int height, uint16 owner=0, uint32 flags=0, int32 layer=LAYER_NORMAL) | |
virtual void | CreateNotifier () |
void | SetNotifyProcess (GumpNotifyProcess *proc) |
GumpNotifyProcess * | GetNotifyProcess () |
uint32 | GetResult () |
void | SetResult (uint32 res) |
void | SetShape (const Shape *shape, uint32 frameNum) |
Set the Gump's shape/frame. | |
void | SetShape (FrameID frame, bool adjustsize=false) |
void | UpdateDimsFromShape () |
Update the width/height to match the gump's current shape frame. | |
void | Set_frameNum (uint32 frameNum) |
Set the Gump's frame. | |
virtual void | InitGump (Gump *newparent, bool take_focus=true) |
virtual Gump * | FindGump (FindGumpPredicate predicate, bool recursive=true) |
template<class T > | |
Gump * | FindGump (bool recursive=true) |
virtual Gump * | FindGump (int mx, int my) |
virtual bool | GetMouseCursor (int32 mx, int32 my, Shape &shape, int32 &frame) |
virtual void | RenderSurfaceChanged () |
virtual void | run () |
Run the gump. | |
virtual void | CloseItemDependents () |
virtual void | Paint (RenderSurface *surf, int32 lerp_factor, bool scaled) |
virtual void | PaintCompositing (RenderSurface *surf, int32 lerp_factor, int32 scalex, int32 scaley) |
virtual void | Close (bool no_del=false) |
bool | IsClosing () const |
Check to see if a Gump is Closing. | |
virtual void | Move (int32 x, int32 y) |
Move this gump. | |
virtual void | MoveRelative (int x, int y) |
Move this gump relative to its current position. | |
void | getLocation (int32 &x, int32 &y) const |
virtual void | setRelativePosition (Position pos, int xoffset=0, int yoffset=0) |
Moves this gump to a relative location on the parent gump. | |
virtual void | GetDims (Rect &d) const |
Get the _dims. | |
virtual void | SetDims (const Rect &d) |
Set the _dims. | |
virtual bool | PointOnGump (int mx, int my) |
Detect if a point is on the gump. | |
virtual void | ScreenSpaceToGump (int32 &sx, int32 &sy, PointRoundDir r=ROUND_TOPLEFT) |
Convert a screen space point to a gump point. | |
virtual void | GumpToScreenSpace (int32 &gx, int32 &gy, PointRoundDir r=ROUND_TOPLEFT) |
Convert a gump point to a screen space point. | |
virtual void | ParentToGump (int32 &px, int32 &py, PointRoundDir r=ROUND_TOPLEFT) |
Convert a parent relative point to a gump point. | |
virtual void | GumpToParent (int32 &gx, int32 &gy, PointRoundDir r=ROUND_TOPLEFT) |
Convert a gump point to parent relative point. | |
virtual void | GumpRectToScreenSpace (Rect &gr, RectRoundDir r=ROUND_OUTSIDE) |
Transform a rectangle to screenspace from gumpspace. | |
virtual void | ScreenSpaceToGumpRect (Rect &sr, RectRoundDir r=ROUND_OUTSIDE) |
Transform a rectangle to gumpspace from screenspace. | |
virtual uint16 | TraceObjId (int32 mx, int32 my) |
Trace a click, and return ObjId. | |
virtual bool | GetLocationOfItem (uint16 itemid, int32 &gx, int32 &gy, int32 lerp_factor=256) |
virtual Gump * | onMouseDown (int button, int32 mx, int32 my) |
virtual void | onMouseUp (int button, int32 mx, int32 my) |
virtual void | onMouseClick (int button, int32 mx, int32 my) |
virtual void | onMouseDouble (int button, int32 mx, int32 my) |
virtual Gump * | onMouseMotion (int32 mx, int32 my) |
virtual void | onMouseOver () |
virtual void | onMouseLeft () |
virtual bool | OnKeyDown (int key, int mod) |
virtual bool | OnKeyUp (int key) |
virtual bool | OnTextInput (int unicode) |
virtual void | OnFocus (bool) |
virtual void | MakeFocus () |
bool | IsFocus () |
Gump * | GetFocusChild () |
void | FindNewFocusChild () |
virtual void | AddChild (Gump *, bool take_focus=true) |
Add a gump to the child list. | |
virtual void | RemoveChild (Gump *) |
Remove a gump from the child list. | |
virtual void | MoveChildToFront (Gump *) |
Move child to front (within its layer) | |
Gump * | GetParent () |
Get the parent. | |
Gump * | GetRootGump () |
Get the root gump (or self) | |
virtual void | ChildNotify (Gump *child, uint32 message) |
void | SetIndex (int32 i) |
int32 | GetIndex () const |
virtual bool | onDragStart (int32 mx, int32 my) |
virtual void | onDragStop (int32 mx, int32 my) |
virtual void | onDrag (int32 mx, int32 my) |
virtual bool | StartDraggingItem (Item *item, int mx, int my) |
virtual bool | DraggingItem (Item *item, int mx, int my) |
virtual void | DraggingItemLeftGump (Item *item) |
Called when an item that was being dragged over the gump left the gump. | |
virtual void | StopDraggingItem (Item *item, bool moved) |
virtual void | DropItem (Item *item, int mx, int my) |
bool | hasFlags (uint flags) const |
Does this gump have any of the given flags mask set. | |
bool | IsHidden () const |
bool | IsDraggable () const |
virtual void | HideGump () |
virtual void | UnhideGump () |
void | SetVisibility (bool visible) |
bool | mustSave (bool toplevel) const |
bool | loadData (Common::ReadStream *rs, uint32 version) |
void | saveData (Common::WriteStream *ws) override |
Public Member Functions inherited from Ultima::Ultima8::Object | |
ObjId | getObjId () const |
get this Object's objID | |
virtual ObjId | assignObjId () |
virtual void | clearObjId () |
Clear objID of self and contents (if any) | |
virtual Common::String | dumpInfo () const |
dump some info about this object to a string | |
ProcId | callUsecode (uint16 classid, uint16 offset, const uint8 *args=0, int argsize=0) |
bool | loadData (Common::ReadStream *rs, uint32 version) |
Static Public Member Functions | |
template<int T> | |
static bool | FindByIndex (const Gump *g) |
A predicate to find a ui element by its index. | |
Protected Member Functions | |
virtual void | PaintThis (RenderSurface *surf, int32 lerp_factor, bool scaled) |
Overloadable method to Paint just this Gump (RenderSurface is relative to this) | |
virtual void | PaintChildren (RenderSurface *surf, int32 lerp_factor, bool scaled) |
Paint the Gumps Children (RenderSurface is relative to this) | |
virtual void | PaintComposited (RenderSurface *surf, int32 lerp_factor, int32 scalex, int32 scaley) |
Overloadable method to Paint just this gumps unscaled components that require compositing (RenderSurface is relative to parent). | |
Static Protected Member Functions | |
static int32 | ScaleCoord (int32 c, int32 factor) |
static int32 | UnscaleCoord (int32 c, int32 factor) |
Protected Attributes | |
uint16 | _owner |
Gump * | _parent |
int32 | _x |
int32 | _y |
Rect | _dims |
uint32 | _flags |
int32 | _layer |
int32 | _index |
const Shape * | _shape |
uint32 | _frameNum |
Std::list< Gump * > | _children |
Gump * | _focusChild |
uint16 | _notifier |
uint32 | _processResult |
Protected Attributes inherited from Ultima::Ultima8::Object | |
ObjId | _objId |
A Gump is a single GUI element within the game, like the backpack window, menu, conversation text, etc. Like most windowing systems, gumps nest.
|
virtual |
Init the gump and add it to parent; call after construction When newparent is 0, this will call Ultima8Engine::addGump().
newparent | The Gump's new parent or 0. |
takefocus | If true, set parent's _focusChild to this |
Reimplemented in Ultima::Ultima8::TextWidget, Ultima::Ultima8::ShapeViewerGump, Ultima::Ultima8::BarkGump, Ultima::Ultima8::WeaselGump, Ultima::Ultima8::BookGump, Ultima::Ultima8::ScrollGump, Ultima::Ultima8::ContainerGump, Ultima::Ultima8::MessageBoxGump, Ultima::Ultima8::ReadableGump, Ultima::Ultima8::ComputerGump, Ultima::Ultima8::CruStatusGump, Ultima::Ultima8::CruPickupAreaGump, Ultima::Ultima8::ModalGump, Ultima::Ultima8::EditWidget, Ultima::Ultima8::AskGump, Ultima::Ultima8::CreditsGump, Ultima::Ultima8::CruPickupGump, Ultima::Ultima8::MovieGump, Ultima::Ultima8::PaperdollGump, Ultima::Ultima8::CruCreditsGump, Ultima::Ultima8::SliderGump, Ultima::Ultima8::ButtonWidget, Ultima::Ultima8::CruAmmoGump, Ultima::Ultima8::CruInventoryGump, Ultima::Ultima8::ItemRelativeGump, Ultima::Ultima8::SlidingWidget, Ultima::Ultima8::CruDemoGump, Ultima::Ultima8::KeypadGump, Ultima::Ultima8::MenuGump, Ultima::Ultima8::MiniStatsGump, Ultima::Ultima8::TargetGump, Ultima::Ultima8::U8SaveGump, Ultima::Ultima8::CruEnergyGump, Ultima::Ultima8::CruHealthGump, Ultima::Ultima8::CruStatGump, Ultima::Ultima8::CruWeaponGump, Ultima::Ultima8::CruMenuGump, Ultima::Ultima8::PagedGump, Ultima::Ultima8::QuitGump, and Ultima::Ultima8::DifficultyGump.
|
virtual |
Find a gump of that matches a predicate function (this or child)
predicate | Function to check if a gump is a match |
recursive | Recursively search through children? |
|
inline |
Find a gump of the specified type (this or child)
T | Type of gump to look for |
recursive | Recursively search through children? |
|
virtual |
Find gump (this, child or NULL) at parent coordinates (mx,my)
Reimplemented in Ultima::Ultima8::ModalGump.
|
virtual |
Get the mouse cursor for position mx, my relative to parents position. If this gump doesn't want to set the cursor, the gump list will attempt to get the cursor shape from the next lower gump.
|
virtual |
Close item-dependent gumps (recursively). Called when there is a map change (so the gumps can self terminate among other things), or when backspace is pressed by the user.
|
virtual |
Paint the Gump (RenderSurface is relative to parent). Calls PaintThis and PaintChildren
Reimplemented in Ultima::Ultima8::ComputerGump, Ultima::Ultima8::ItemRelativeGump, and Ultima::Ultima8::InverterGump.
|
virtual |
Paint the unscaled compontents of the Gump with compositing (RenderSurface is relative to parent). Calls PaintComposited on self and PaintCompositing on children
|
virtual |
Close the gump
no_del | If true, do not delete after closing |
Reimplemented in Ultima::Ultima8::BarkGump, Ultima::Ultima8::WeaselGump, Ultima::Ultima8::CreditsGump, Ultima::Ultima8::MessageBoxGump, Ultima::Ultima8::ContainerGump, Ultima::Ultima8::ModalGump, Ultima::Ultima8::PaperdollGump, Ultima::Ultima8::MovieGump, Ultima::Ultima8::CruCreditsGump, Ultima::Ultima8::SliderGump, Ultima::Ultima8::CruDemoGump, Ultima::Ultima8::MenuGump, Ultima::Ultima8::TargetGump, Ultima::Ultima8::U8SaveGump, Ultima::Ultima8::CruMenuGump, Ultima::Ultima8::PagedGump, Ultima::Ultima8::KeypadGump, and Ultima::Ultima8::DifficultyGump.
|
virtual |
Get the location of an item in the gump (coords relative to this).
Reimplemented in Ultima::Ultima8::ContainerGump, Ultima::Ultima8::GameMapGump, and Ultima::Ultima8::PaperdollGump.
|
inlinevirtual |
This function is used by our children to notifty us of 'something' Think of it as a generic call back function
Reimplemented in Ultima::Ultima8::MessageBoxGump, Ultima::Ultima8::WeaselGump, Ultima::Ultima8::PaperdollGump, Ultima::Ultima8::MenuGump, Ultima::Ultima8::U8SaveGump, Ultima::Ultima8::CruMenuGump, Ultima::Ultima8::KeypadGump, Ultima::Ultima8::PagedGump, Ultima::Ultima8::AskGump, Ultima::Ultima8::SliderGump, and Ultima::Ultima8::QuitGump.
|
virtual |
Called when a gump starts to be dragged.
Reimplemented in Ultima::Ultima8::ResizableGump.
|
inlinevirtual |
This will be called when an item in this gump starts to be dragged.
Reimplemented in Ultima::Ultima8::ContainerGump, Ultima::Ultima8::GameMapGump, and Ultima::Ultima8::PaperdollGump.
|
inlinevirtual |
Called when an item is being dragged over the gump. Note: this may be called on a different gump than StartDraggingItem.
Reimplemented in Ultima::Ultima8::ContainerGump, Ultima::Ultima8::GameMapGump, and Ultima::Ultima8::PaperdollGump.
|
inlinevirtual |
Called when a drag operation finished. This is called on the same gump that received StartDraggingItem
moved | If true, the item was actually dragged somewhere else. If false, the drag was cancelled. |
Reimplemented in Ultima::Ultima8::ContainerGump, and Ultima::Ultima8::GameMapGump.
|
inlinevirtual |
Called when an item has been dropped on a gump. This is called after StopDraggingItem has been called, but possibly on a different gump. It's guaranteed that a gump will only receive a DropItem at a location if a DraggingItem there returned true.
Reimplemented in Ultima::Ultima8::ContainerGump, Ultima::Ultima8::GameMapGump, and Ultima::Ultima8::PaperdollGump.
The Gump list for this gump. This will contain all child gumps, as well as all gump widgets.