DarkRadiant EventManager: Difference between revisions
From The DarkMod Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
== Event Types == | == Event Types == | ||
The interface of an event (IEvent) is defined in ieventmanager.h. | The interface of an event (IEvent) is defined in ieventmanager.h. | ||
* ('''Event''') - this is the basic, empty implementation of an event. | * ('''Event''') - this is the basic, empty implementation of an event. It is used internally by the EventManager only. | ||
* '''Command''' | * '''Command''' - this is a single-fire command that can be connected to a GtkMenuItem or a GtkToolButton widget. | ||
* '''Toggle''' | * '''Toggle''' | ||
* '''KeyEvent''' | * '''KeyEvent''' | ||
== Accelerators == | == Accelerators == |
Revision as of 11:16, 12 January 2007
The EventManager plugin provides methods to define events and connect them to (member) functions that are called upon connect. This document is WIP.
Connecting Widgets
The events can be connected to certain GtkWidgets (like GtkMenuItems, GtkCheckMenuItems and GtkToolButtons/GtkToggleToolButtons). The events recognise the supported widet types and connect the callbacks automatically. For example, a "Toggle" event can of course be connected to a GtkCheckMenuItem or a GtkToggleToolButton, whereas a "Command" event cannot (connect it to a GtkMenuItem instead).
Event Types
The interface of an event (IEvent) is defined in ieventmanager.h.
- (Event) - this is the basic, empty implementation of an event. It is used internally by the EventManager only.
- Command - this is a single-fire command that can be connected to a GtkMenuItem or a GtkToolButton widget.
- Toggle
- KeyEvent