Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UEvent Class Reference

Ubit Event class. More...

#include <uevent.hpp>

List of all members.

Public Types

enum  ID {
  rawEvent = 0, mpress = 1<<0, mrelease = 1<<1, mmove = 1<<2,
  mdrag = 1<<3, kpress = 1<<4, krelease = 1<<5, enter = 1<<6,
  leave = 1<<7, change = 1<<8, select = 1<<9, unselect = 1<<10,
  action = 1<<11, add = 1<<15, remove = 1<<16, close = 1<<17,
  destruct = 1<<18, viewPaint = 1<<20, viewResize = 1<<21, viewMove = 1<<22,
  search = 1<<23, umessage = 1<<26, notifyEvent = 1<<27
}
 standard Event IDs (correspond to UOn conditions: see class UOn for details).

Public Member Functions

int getID () const
 returns the event id (see: UEvent::ID).
const class UCondgetCond () const
 returns the xxx condition of the: UOn::xxx / ucall( )
UViewgetView () const
 returns the source VIEW that received this event
UGroupgetSource () const
UBox * getBoxSource () const
 returns the object that produced this event
UGroupgetTarget () const
UBox * getBoxTarget () const
UBrickgetBrickTarget () const
 returns the object that was modified by this event (when available)
UAppligetAppli () const
 returns the Application Context.
UDispgetDisp () const
int getDispID () const
 returns the Display or Display ID where this event was produced
UFlowgetFlow () const
int getFlowID () const
 returns the Event Flow that produced this event
u_time getTime () const
 returns the time when this event was produced (when available).
u_pos getX () const
u_pos getY () const
 (mouse events) return the location of the mouse in the Source VIEW
u_pos getXscreen () const
u_pos getYscreen () const
 (mouse events) return the location of the mouse on the SCREEN.
u_pos getXwin () const
u_pos getYwin () const
 (mouse events) return the location of the mouse in the WINDOW that caught this event
int getClickCount () const
 (mouse events) returns the number of mouse clicks.
u_id getButtons () const
 (mouse events) returns the button(s) that are being pressed
u_id getMods () const
 (mouse & keyboard events) returns the key modifiers that are being pressed
int getKeyChar () const
 (key events) returns the typed character (in ASCII encoding).
void setKeyChar (int)
 (key events) changes the typed character (in ASCII encoding).
u_id getKeySym () const
 (key events) returns the X KeySym
UPropgetChangedProp () const
UElemgetChangedElem () const
UStrgetChangedStr () const
 (UOn::change, propChange, elemChange, strChange callbacks) returns the object whose value was changed.
bool getMessage (UStr &) const
 (UOn::umessage callbacks) returns the data sent through an Ubit message.
UElemgetElem ()
 returns the element that was under the mouse (null if none found).
UStrgetStr ()
 returns the UStr that was under the mouse (null if no str found)
UElemgetElem (class UElemProps &)
UStrgetStr (class UElemProps &)
 variants of getElem() and getStr() that return useful information
UElemsearchElem (class UElemProps &, const UElem *searched_elem, int strpos1=-1, int strpos2=-1)
 searches the element that is given as an argument
void goThrough (UBox *)
 events will go through this object.
void setMouse (u_pos x, u_pos y)
 changes mouse coordinates (x,y are in window coordinates).
void addFlagdef (const class UFlagdef *)
 adds a Flag to the Event (for transparent tools, etc); see: UFlag.
const class UFlagdefgetFlagdef (const class UFlag &) const
const class UPropdef * getPropdef (const class UFlag &) const
const class UFlagdef ** getFlagdefs () const
u_count getFlagdefCount () const
UWingetHardWin () const
UViewgetHardWinView () const
 [impl] returns the HARD Window that received this event.
USourcePropsgetSourceProps ()
 [impl] gets the source properties.
UX_Event getXEvent () const
 [impl] returns the X Event (NB: only valid at reception time).
 UEvent (int event_id, class UFlow *, class UView *hardwin_view, UX_Event)
 [impl] 'win_view' must be a valid UWin view or null.

Static Public Attributes

const u_id MButton1
const u_id MButton2
const u_id MButton3
const u_id MButton4
const u_id MButton5
 mouse button IDs for UEvent::getButtons()
const u_id MShift
const u_id MLock
const u_id MControl
const u_id MOption
const u_id UbitEventFlow = UMSprotocol::UBIT_EVENT_FLOW
 state mask raised for non standard event flows


Detailed Description

Ubit Event class.


Member Function Documentation

UBox * UEvent::getBoxSource  )  const
 

returns the object that produced this event

  • getBoxSource() returns null if the source is not a UBox.
  • getSource() returns null if the source is not a UGroup.

UBrick * UEvent::getBrickTarget  )  const
 

returns the object that was modified by this event (when available)

used for UOn::childSelect/childUnselect/add/remove/DND callbacks to indicate the object that was selected, unselected, added, removed, etc.

u_id UEvent::getButtons  )  const
 

(mouse events) returns the button(s) that are being pressed

details:

  • for press and release events: value is ONE of UEvent::MButton1, UEvent::MButton2, etc. exple: if (e.getButtons() == UEvent::MButton1)

  • for move or drag events: value is an ORed COMBINATION of these values (as several buttons can be pressed simultaneously). exple: if (e.getButtons() & (UEvent::MButton1 | Event::MButton3))

  • returns 0 if no button is pressed.

const class UCond* UEvent::getCond  )  const
 

returns the xxx condition of the: UOn::xxx / ucall( )

Note: as the same UEvent can be catched by several ucall() conditions this value should be checked immediately in the callback function as it can be changed at a later time

int UEvent::getDispID  )  const
 

returns the Display or Display ID where this event was produced

the ID of the default Display is 0.

int UEvent::getFlowID  )  const
 

returns the Event Flow that produced this event

the ID of the default event flow (= the standard X event flow) is 0.

u_id UEvent::getKeySym  )  const
 

(key events) returns the X KeySym

Note: key modifiers (Shift, Alt..) are not taken into into account.

u_id UEvent::getMods  )  const
 

(mouse & keyboard events) returns the key modifiers that are being pressed

returns an ORed combination of these modifiers exple: if (e.getMods() & (UEvent::KShift | UEvent::KControl))

UStr * UEvent::getStr class UElemProps  ) 
 

variants of getElem() and getStr() that return useful information

argument UElemProps (see this class) is filled with useful data such as the elem location, its graphical properties, etc.

Note on getStr() : the region returned in UElemProps does not contain the entire string but just the line that is beneath the mouse (in case of UFlowView rendering)

UStr * UEvent::getStr  ) 
 

returns the UStr that was under the mouse (null if no str found)

Note: same function as getElem() but discards elements that are not strings.

UView* UEvent::getView  )  const
 

returns the source VIEW that received this event

Note: a box can control several Views.

u_pos UEvent::getY  )  const
 

(mouse events) return the location of the mouse in the Source VIEW

returns -1 if source view wasn't found (= when getView() returns null)

u_pos UEvent::getYwin  )  const
 

(mouse events) return the location of the mouse in the WINDOW that caught this event

this location is relative to the window returned by getHardWin())

UElem * UEvent::searchElem class UElemProps ,
const UElem searched_elem,
int  strpos1 = -1,
int  strpos2 = -1
 

searches the element that is given as an argument

returns useful information about this element in UElemProps notes:

  • args. strpos1, strpos2 are used when searching for UStr(ings)
  • the region returned in UElemProps does not contain the entire string but just its 'strpos1' to 'strpos2' subpart


Member Data Documentation

const u_id UEvent::MButton1 [static]
 

Initial value:

 Button1Mask 
 UEvent::MButton2 = Button2Mask 
 UEvent::MButton3 = Button3Mask 
 UEvent::MButton4 = Button4Mask 
 UEvent::MButton5 = Button5Mask

const u_id UEvent::MButton5 [static]
 

mouse button IDs for UEvent::getButtons()

note: same values as X defs: Button1Mask etc.

const u_id UEvent::MShift [static]
 

Initial value:

 ShiftMask 
 UEvent::MLock    = LockMask 
 UEvent::MControl = ControlMask
 UEvent::MOption  = Mod1Mask

const u_id UEvent::UbitEventFlow = UMSprotocol::UBIT_EVENT_FLOW [static]
 

state mask raised for non standard event flows

note: same values as X defs: ShiftMask etc.

one of the possible ORed values of getState(). if true, getFlow() will return an non standard event flow.


The documentation for this class was generated from the following files:
Generated on Sat Nov 20 11:58:04 2004 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.3.9.1