|
IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Public Member Functions | |
| GUI_Surface (IMS2 *_vessel, GUI_ElementStyle *_style, int _panelid) | |
| virtual void | Init (RECT &surfacePos, int _id) |
| Creates the surfaces visuals in memory. More... | |
| virtual void | PostInit ()=0 |
| Overload in inheriting classes to do things necessary after initialising, like registering children. More... | |
| bool | ProcessMouse2D (GUI_MOUSE_EVENT _event, int mx, int my) |
| Receives mouse events and sends it to children. More... | |
| bool | Update () |
| Checks all children for visual updates. More... | |
| void | AddChild (GUI_BaseElement *child) |
| Adds a GUI element as a child of this surface. More... | |
| bool | Redraw2D (SURFHANDLE surf) |
| Redraws the surface and all of its children. | |
| int | GetId () |
| int | GetPanelId () |
Public Member Functions inherited from EventHandler | |
| void | ConnectToMyEventGenerator (EventSink *sink, EVENTPIPE pipe) |
| connects an EventSink to the EventGenerator of this in the appropriate pipe. More... | |
| void | ConnectToMyEventSink (EventSink *sink, EVENTPIPE pipe) |
| Connects an EventSink on this to the passed event sink. More... | |
| void | ConnectMySinkToYourNode (EventNode *node, EVENTPIPE pipe) |
| Connects an EventSink on this to the passed EventNode, no matter whether generator or another sink. More... | |
| EVENTHANDLERTYPE | GetEventHandlerType () |
| Returns the EVENTHANDLERTYPE of this event handler. | |
| UINT | GetUID () |
| Returns the globaly unique identifier of this event handler. | |
Protected Member Functions | |
| virtual void | RedrawBackground (SURFHANDLE surf) |
| Redraws this surfaces background. More... | |
| virtual void | RedrawElements (SURFHANDLE surf) |
| Redraws all this surface's children. More... | |
| void | createGuiSurface () |
| int | ProcessChildren (GUI_MOUSE_EVENT _event, int _x, int _y) |
| Sends a mouse event to all children of this surface. More... | |
| virtual bool | ProcessMe (int eventId) |
| Trigers a redraw if any children consumed a mouse event. More... | |
Protected Member Functions inherited from EventHandler | |
| EventGenerator * | createEventGenerator (EVENTPIPE pipe) |
| Creates a new EventGenerator for this handler instance. More... | |
| EventSink * | createEventSink (EVENTPIPE pipe) |
| creates a new EventSink in this handler instance More... | |
| void | disconnect (EventHandler *handler, bool bidirectional=true) |
| Completely severs connections to and from the passed EventHandler, all sinks, all generators. More... | |
| void | sendEvents () |
| Tells all event generators in this event handler to advance their event cue. More... | |
| void | processWaitingQueue () |
| processes all events in the waiting queue. More... | |
| void | addEvent (Event_Base *_event, EVENTPIPE _pipe=DEFAULT_PIPE) |
| Adds an event to the eventcue of an eventpipe. More... | |
| void | addEventToWaitingQueue (Event_Base *_event) |
| Adds an event to this handlers waiting queue. More... | |
| void | relayEvent (Event_Base *_event, EVENTPIPE _pipe) |
| Relays an event to another event pipe. More... | |
| EventSink * | getEventSink (EVENTPIPE pipe) |
| returns the EventSink on this EventHandler that belongs to the passed event pipe More... | |
| EventGenerator * | getEventGenerator (EVENTPIPE pipe) |
| Returns the EventGenerator on this EventHandler that belongs to the passed event pipe. More... | |
| virtual bool | ProcessEvent (Event_Base *e)=0 |
| Receives all events coming through this EventHandler. More... | |
Protected Attributes | |
| IMS2 * | vessel |
| The vessel this surface is a part of. | |
| RECT | rect |
| The rectangle of this surface on the panel. | |
| SURFHANDLE | src |
| Stores the surfaces backgroud visuals. | |
| int | width |
| width of the surface in pixel | |
| int | height |
| height of the surface in pixel | |
| int | id |
| The locally unique identifier of this surface inside its containing GUImanager. | |
| int | panelId |
| The id of the orbiter panel this surface is drawn on. | |
| vector< GUI_BaseElement * > | children |
| List of children of this surface. | |
| bool | isInitialised |
| True if this surface was initialised. | |
| GUI_ElementStyle * | style |
| The style this surface is drawn in. | |
Protected Attributes inherited from EventHandler | |
| EVENTPIPE | defaultpipe = DEFAULT_PIPE |
| Use this to set the defualt event pipe of this event handler. | |
| EVENTHANDLERTYPE | eventhandlertype |
| An identifier that offers a group identification. | |
Friends | |
| class | GUImanager |
Class that embeds the IMS GUI into an Orbiter PanelElement.
This is the class that actually receives input and redwaw events from Orbiter, so every GUI element must be a child of a GUI_Surface at the root of its branch
| GUI_Surface::GUI_Surface | ( | IMS2 * | _vessel, |
| GUI_ElementStyle * | _style, | ||
| int | _panelid | ||
| ) |
| _vessel | The vessel this GUI_Surface runs on |
| _style | The style for this surface |
| _panelid | The orbiter id of the panel this surface is visible on |
| void GUI_Surface::AddChild | ( | GUI_BaseElement * | child | ) |
Adds a GUI element as a child of this surface.
| child | the element to be adopted, obviously. |
|
protected |
brief Creates the surface's background in video memory
| int GUI_Surface::GetId | ( | ) |
| int GUI_Surface::GetPanelId | ( | ) |
|
virtual |
Creates the surfaces visuals in memory.
| surfacePos | Panel coordinates at which this surface should show up |
| _id | Locally unique identifier of the surface inside its containing GUImanager |
|
pure virtual |
Overload in inheriting classes to do things necessary after initialising, like registering children.
|
protected |
Sends a mouse event to all children of this surface.
| _event | The kind of mouse event |
| _x | cursor X position relative to this element |
| _y | cursor Y position relative to this element |
|
protectedvirtual |
Trigers a redraw if any children consumed a mouse event.
| eventId | The Id of the child that consumed the event, -1 if event was not consumed |
| bool GUI_Surface::ProcessMouse2D | ( | GUI_MOUSE_EVENT | _event, |
| int | mx, | ||
| int | my | ||
| ) |
Receives mouse events and sends it to children.
| _event | The kind of mouse event |
| mx | cursor X position relative to this element |
| my | cursor Y position relative to this element |
|
protectedvirtual |
Redraws this surfaces background.
| surf | The target surface to draw on |
|
protectedvirtual |
Redraws all this surface's children.
| surf | The target surface to draw on |
| bool GUI_Surface::Update | ( | ) |
Checks all children for visual updates.