MatOCAD Logo

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

events.cpp

Go to the documentation of this file.
00001 
00012 #include "../../include/wxIFM/events.h"
00013 
00014 #if IFM_USE_WX_RTTI
00015 IMPLEMENT_DYNAMIC_CLASS(wxIFMPluginEvent, wxEvent)
00016 #endif
00017 
00018 // mouse events
00019 DEFINE_EVENT_TYPE(wxEVT_IFM_LEFTDOWN)
00020 DEFINE_EVENT_TYPE(wxEVT_IFM_LEFTUP)
00021 DEFINE_EVENT_TYPE(wxEVT_IFM_LEFTDCLICK)
00022 DEFINE_EVENT_TYPE(wxEVT_IFM_RIGHTDOWN)
00023 DEFINE_EVENT_TYPE(wxEVT_IFM_RIGHTUP)
00024 DEFINE_EVENT_TYPE(wxEVT_IFM_RIGHTDCLICK)
00025 DEFINE_EVENT_TYPE(wxEVT_IFM_MIDDLEDOWN)
00026 DEFINE_EVENT_TYPE(wxEVT_IFM_MIDDLEUP)
00027 DEFINE_EVENT_TYPE(wxEVT_IFM_MIDDLEDCLICK)
00028 DEFINE_EVENT_TYPE(wxEVT_IFM_MOTION)
00029 DEFINE_EVENT_TYPE(wxEVT_IFM_MOUSEWHEEL)
00030 
00031 DEFINE_EVENT_TYPE(wxEVT_IFM_SETCURSOR)
00032 
00033 DEFINE_EVENT_TYPE(wxEVT_IFM_SETFOCUS) // parent recieves focus
00034 DEFINE_EVENT_TYPE(wxEVT_IFM_KILLFOCUS) // parent loses focus
00035 DEFINE_EVENT_TYPE(wxEVT_IFM_ACTIVATE) // parent window [de]activates
00036 
00037 DEFINE_EVENT_TYPE(wxEVT_IFM_KEYDOWN)
00038 DEFINE_EVENT_TYPE(wxEVT_IFM_KEYUP)
00039 
00040 DEFINE_EVENT_TYPE(wxEVT_IFM_NEWCOMPONENT) // used to create all components
00041 DEFINE_EVENT_TYPE(wxEVT_IFM_DELETECOMPONENT) // used to delete components (not used during cleanup phase)
00042 DEFINE_EVENT_TYPE(wxEVT_IFM_SHOWCOMPONENT) // used to show or hide components
00043 DEFINE_EVENT_TYPE(wxEVT_IFM_VISIBILITYCHANGED) // used to notify a component that is has been shown or hidden
00044 DEFINE_EVENT_TYPE(wxEVT_IFM_ADDCHILD) // add a child window to the interface
00045 DEFINE_EVENT_TYPE(wxEVT_IFM_SETCHILD) // used to add children to panels
00046 DEFINE_EVENT_TYPE(wxEVT_IFM_REMOVECHILD) // removes a child from its panel (and the interface)
00047 
00048 DEFINE_EVENT_TYPE(wxEVT_IFM_PAINTINTERFACE) // indicates to plugins that some or all of the interface needs to be repainted
00049 DEFINE_EVENT_TYPE(wxEVT_IFM_PAINTBG) // paints a components background
00050 DEFINE_EVENT_TYPE(wxEVT_IFM_PAINTBORDER) // paints a components border
00051 DEFINE_EVENT_TYPE(wxEVT_IFM_PAINTDECOR) // paints a components decorations
00052 DEFINE_EVENT_TYPE(wxEVT_IFM_BEGINPAINT)
00053 DEFINE_EVENT_TYPE(wxEVT_IFM_ENDPAINT)
00054 
00055 DEFINE_EVENT_TYPE(wxEVT_IFM_SHOW) // called to show or hide panels
00056 DEFINE_EVENT_TYPE(wxEVT_IFM_SHOWCHILD) // used to show children managed by the interface
00057 DEFINE_EVENT_TYPE(wxEVT_IFM_HIDECHILD) // used to hide children managed by the interface
00058 DEFINE_EVENT_TYPE(wxEVT_IFM_SETCHILDSIZE) // sets the min / max / desired size of a child
00059 DEFINE_EVENT_TYPE(wxEVT_IFM_QUERYCHILD)
00060 
00061 DEFINE_EVENT_TYPE(wxEVT_IFM_UPDATE) // recalc layout
00062 DEFINE_EVENT_TYPE(wxEVT_IFM_UPDATECOMPONENT) // updates invidual components
00063 DEFINE_EVENT_TYPE(wxEVT_IFM_CALCRECTS)
00064 
00065 DEFINE_EVENT_TYPE(wxEVT_IFM_SETDESIREDSIZE) // sets a component desired size
00066 DEFINE_EVENT_TYPE(wxEVT_IFM_GETDESIREDSIZE) // determines the size a component would like to be
00067 DEFINE_EVENT_TYPE(wxEVT_IFM_GETMINSIZE)
00068 DEFINE_EVENT_TYPE(wxEVT_IFM_GETMAXSIZE)
00069 DEFINE_EVENT_TYPE(wxEVT_IFM_SETMINSIZE)
00070 DEFINE_EVENT_TYPE(wxEVT_IFM_SETMAXSIZE)
00071 
00072 /*
00073 Rect events
00074 
00075     These events are used to set and retrieve both size and position
00076     values for absolute, background, and client ares.
00077 
00078     If you only wish to set either the position or the size of a component,
00079     you may specify IFM_DEFAULT_VALUE for values which you are not changing. The existing
00080     values will be used.
00081 
00082     wxEVT_IFM_CONVERTRECT is used to convert between different rect values. For example,
00083     you can use it to convert a client size into an absolute size without having to
00084     set the size of the component and then use GETCLIENTSIZE.
00085 */
00086 DEFINE_EVENT_TYPE(wxEVT_IFM_SETRECT) // sets absolute size and pos
00087 #define wxEVT_IFM_SETABSOLUTERECT wxEVT_IFM_SETRECT;
00088 DEFINE_EVENT_TYPE(wxEVT_IFM_SETBACKGROUNDRECT) // sets background size and pos
00089 DEFINE_EVENT_TYPE(wxEVT_IFM_SETCLIENTRECT) // sets client size and pos
00090 DEFINE_EVENT_TYPE(wxEVT_IFM_GETRECT) // returns absolute size and pos
00091 #define wxEVT_IFM_GETABSOLUTERECT wxEVT_IFM_GETRECT;
00092 DEFINE_EVENT_TYPE(wxEVT_IFM_GETBACKGROUNDRECT) // returns background size and pos
00093 DEFINE_EVENT_TYPE(wxEVT_IFM_GETCLIENTRECT) // returns client size and pos
00094 DEFINE_EVENT_TYPE(wxEVT_IFM_CONVERTRECT) // used to convert from [client|background]size to [client|background]size
00095 DEFINE_EVENT_TYPE(wxEVT_IFM_HITTEST) // used for position hit testing
00096 DEFINE_EVENT_TYPE(wxEVT_IFM_GETCONTENTRECT) // used to retrieve the rect available for the applications content window
00097 
00098 DEFINE_EVENT_TYPE(wxEVT_IFM_DOCK)
00099 DEFINE_EVENT_TYPE(wxEVT_IFM_UNDOCK)
00100 
00101 /*
00102 Floating events
00103 */
00104 #if IFM_CANFLOAT
00105 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOAT)
00106 DEFINE_EVENT_TYPE(wxEVT_IFM_CREATEFLOATINGWINDOW) // used to create a frame for a floating window
00107 DEFINE_EVENT_TYPE(wxEVT_IFM_DESTROYFLOATINGWINDOW) // used to destroy a frame for a floating window
00108 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_MOVING) // a floating window is being moved
00109 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_SIZING) // a floating window is being sized
00110 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_MOVE) // a floating window has been moved
00111 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_SIZE) // a floating window has been sized
00112 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_SHOW) // used to show a floating window
00113 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_HIDE) // used to hide a floating window
00114 DEFINE_EVENT_TYPE(wxEVT_IFM_FLOATING_NOTIFY) // notifies a component that it has been floated
00115 #endif
00116 
00117 wxIFMPluginEvent::wxIFMPluginEvent(wxEventType id, wxIFMComponent *component)
00118     : wxEvent(wxID_ANY, id),
00119     m_componentType(IFM_COMPONENT_UNDEFINED),
00120     m_component(component)
00121 {
00122     if( component )
00123         m_componentType = component->GetType();
00124 }
00125 
00126 wxIFMDockEvent::wxIFMDockEvent(wxIFMComponent *component, wxIFMComponent *destination, int index)
00127     : wxIFMPluginEvent(wxEVT_IFM_DOCK,component),
00128     m_destination(destination),
00129     m_destinationType(IFM_COMPONENT_UNDEFINED),
00130     m_index(index)
00131 {
00132     wxASSERT_MSG(destination, wxT("NULL docking destination?"));
00133     m_destinationType = destination->GetType();
00134 }
00135 
00136 void wxIFMDockEvent::SetDestination(wxIFMComponent *destination)
00137 {
00138     wxASSERT_MSG(destination, wxT("NULL docking destination?"));
00139     m_destinationType = destination->GetType();
00140     m_destination = destination;
00141 }
00142 
00143 wxIFMUndockEvent::wxIFMUndockEvent(wxIFMComponent *component, bool del)
00144     : wxIFMPluginEvent(wxEVT_IFM_UNDOCK, component),
00145     m_delete(del)
00146 {
00147     wxIFMComponent *parent = component->m_parent;
00148     wxASSERT_MSG(parent, wxT("Undocking from a NULL parent?"));
00149     m_parent = parent;
00150     m_parentType = parent->GetType();
00151 }
00152 
00153 void wxIFMUndockEvent::SetParent(wxIFMComponent *parent)
00154 {
00155     m_parent = parent;
00156     m_parentType = parent->GetType();
00157 }
00158 
00162 wxIFMCalcRectsEvent::wxIFMCalcRectsEvent(wxIFMComponent *component, const wxRect &rect)
00163     : wxIFMPluginEvent(wxEVT_IFM_CALCRECTS, component),
00164     m_rect(rect)
00165 {
00166     if( m_rect == IFM_DEFAULT_RECT )
00167         m_rect = component->GetClientRect();
00168 }
00169 
00170 void wxIFMCalcRectsEvent::SetComponentRect(int index, const wxRect &rect)
00171 {
00172     m_rects[index] = rect;
00173 }
00174 
00175 void wxIFMCalcRectsEvent::AddComponent(wxIFMComponent *component)
00176 {
00177     m_components.push_back(component);
00178     m_rects.push_back(wxRect(wxPoint(), component->GetDesiredSize()));
00179     m_min.push_back(component->GetMinSize());
00180     m_max.push_back(component->GetMaxSize());
00181 }
00182 
00183 const wxRectArray &wxIFMCalcRectsEvent::GetComponentRects()
00184 {
00185     return m_rects;
00186 }
00187 
00188 const wxSizeArray &wxIFMCalcRectsEvent::GetMinSizes()
00189 {
00190     return m_min;
00191 }
00192 
00193 const wxSizeArray &wxIFMCalcRectsEvent::GetMaxSizes()
00194 {
00195     return m_max;
00196 }
00197 
00198 const wxIFMComponentArray &wxIFMCalcRectsEvent::GetComponents()
00199 {
00200     return m_components;
00201 }
00202 
00203 const wxRect &wxIFMCalcRectsEvent::GetRect()
00204 {
00205     return m_rect;
00206 }

 

SourceForge Logo