22 set_name(
const string &name) {
23 Namable::set_name(name);
57 _notify->remove_item(
this);
61 _notify->add_item(
this);
100 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
116 if (!_has_frame || _frame != frame) {
201 return (_flags & F_active) != 0;
213 return (_flags & F_focus) != 0;
225 return (_flags & F_background_focus) != 0;
238 _region->set_suppress_flags(suppress_flags);
251 return _region->get_suppress_flags();
265 return _region->get_name();
284 _region->set_name(
id);
585 return _frame_inv_xform;
593 INLINE PN_stdfloat PGItem::
595 return (frame[1] - frame[0]) * (frame[3] - frame[2]);
608 compare_largest(
const LVecBase4 *&largest, PN_stdfloat &largest_area,
610 PN_stdfloat new_area = compute_area(*new_frame);
611 if (new_area > largest_area) {
613 largest_area = new_area;
622 INLINE PGItem::StateDef::
string get_focus_in_event() const
Returns the event name that will be thrown when the item gets the keyboard focus. ...
bool get_background_focus() const
Returns whether background_focus is currently enabled.
void set_name(const string &name)
The mutex name is only defined when compiling in DEBUG_THREADS mode.
static string get_press_prefix()
Returns the prefix that is used to define the press event for all PGItems.
void set_id(const string &id)
Set the unique ID assigned to this PGItem.
This is the base class for all the various kinds of gui widget objects.
const string & get_id() const
Returns the unique ID assigned to this PGItem.
int get_state() const
Returns the "state" of this particular PGItem.
bool get_active() const
Returns whether the PGItem is currently active for mouse events.
void clear_frame()
Removes the bounding rectangle from the item.
static string get_focus_out_prefix()
Returns the prefix that is used to define the focus_out event for all PGItems.
string get_repeat_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets the bounding rectangle of the item, in local coordinates.
static string get_release_prefix()
Returns the prefix that is used to define the release event for all PGItems.
string get_press_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
static PGItem * get_focus_item()
Returns the one PGItem in the world that currently has keyboard focus, if any, or NULL if no item has...
int get_suppress_flags() const
This is just an interface to get the suppress flags on the underlying MouseWatcherRegion.
static string get_keystroke_prefix()
Returns the prefix that is used to define the keystroke event for all PGItems.
static string get_focus_in_prefix()
Returns the prefix that is used to define the focus_in event for all PGItems.
string get_enter_event() const
Returns the event name that will be thrown when the item is active and the mouse enters its frame...
string get_focus_out_event() const
Returns the event name that will be thrown when the item loses the keyboard focus.
PGMouseWatcherRegion * get_region() const
Returns the MouseWatcherRegion associated with this item.
string get_without_event() const
Returns the event name that will be thrown when the item is active and the mouse moves completely out...
bool has_notify() const
Returns true if there is an object configured to be notified when the PGItem changes, false otherwise.
static void set_text_node(TextNode *node)
Changes the TextNode object that will be used by all PGItems to generate default labels given a strin...
LMatrix4 get_frame_inv_xform() const
Returns the inverse of the frame transform matrix.
string get_keystroke_event() const
Returns the event name that will be thrown when the item is active and any key is pressed by the user...
This is a 4-by-4 transform matrix.
string get_within_event() const
Returns the event name that will be thrown when the item is active and the mouse moves within the bou...
PGItemNotify * get_notify() const
Returns the object which will be notified when the PGItem changes, if any.
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
bool get_focus() const
Returns whether the PGItem currently has focus for keyboard events.
static string get_exit_prefix()
Returns the prefix that is used to define the exit event for all PGItems.
Similar to MutexHolder, but for a light reentrant mutex.
static string get_without_prefix()
Returns the prefix that is used to define the without event for all PGItems.
string get_release_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
This is the base class for all three-component vectors and points.
void set_state(int state)
Sets the "state" of this particular PGItem.
static string get_within_prefix()
Returns the prefix that is used to define the within event for all PGItems.
The primary interface to this module.
bool has_frame() const
Returns true if the item has a bounding rectangle; see set_frame().
string get_exit_event() const
Returns the event name that will be thrown when the item is active and the mouse exits its frame...
Objects that inherit from this class can receive specialized messages when PGItems change in certain ...
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
void set_suppress_flags(int suppress_flags)
This is just an interface to set the suppress flags on the underlying MouseWatcherRegion.
static string get_repeat_prefix()
Returns the prefix that is used to define the repeat event for all PGItems.
static string get_enter_prefix()
Returns the prefix that is used to define the enter event for all PGItems.
void set_notify(PGItemNotify *notify)
Sets the object which will be notified when the PGItem changes.