Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATGUI/CATEventDefs.h Source File

CATEventDefs.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 /// \file   CATEventDefs.h
00003 /// \brief   Event Definitions file
00004 /// \ingroup CATGUI
00005 /// 
00006 /// Copyright (c) 2003-2008 by Michael Ellison.
00007 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00008 ///
00009 // $Author: mikeellison $
00010 // $Date: 2008-01-23 01:43:25 -0600 (Wed, 23 Jan 2008) $
00011 // $Revision:   $
00012 // $NoKeywords: $
00013 //---------------------------------------------------------------------------
00014 #ifndef _CATEventDefs_H_
00015 #define _CATEventDefs_H_
00016 
00017 /// System/Application events
00018 ///
00019 /// Events have a code identifying the event type (as enumerated below or in 
00020 /// the an app header) and any of the following data components:
00021 ///
00022 ///      CATInt32         fIntParam1;
00023 ///      CATInt32         fIntParam2;
00024 ///      CATInt32         fIntParam3;
00025 ///      CATInt32         fIntParam4;
00026 ///      CATFloat32       fFloatParam1;
00027 ///      CATString        fStringParam1;
00028 ///      CATString        fStringParam2;
00029 ///      void*            fVoidParam;
00030 ///
00031 /// Events are passed from the Window down, although a window may choose not
00032 /// to pass an event to its controls.
00033 ///
00034 /// Event handlers should return a CATResult.
00035 enum CATEVENTDEFS
00036 {
00037     //-----------------------------------------------------------------------------
00038 
00039     /// CATEVENT_EXIT
00040     /// App Exit event. Non-negotiable.
00041     /// fIntParam1 - exit code   
00042     CATEVENT_EXIT = 0,
00043 
00044     /// CATEVENT_SHUTDOWN
00045     /// Let everyone know we're shutting down.
00046     /// return non-zero to disallow.
00047     CATEVENT_SHUTDOWN,
00048 
00049     /// CATEVENT_WINDOWS_EVENT
00050     /// Encapsulated Win32 event.
00051     /// This may be needed by some controls.
00052     ///
00053     /// fIntParam1 - hWnd
00054     /// fIntParam2 - uMsg
00055     /// fIntParam3 - wParam
00056     /// fIntParam4 - lParam
00057     CATEVENT_WINDOWS_EVENT,  
00058 
00059 
00060     /// CATEVENT_WINDOW_CLOSE:
00061     /// A window has received a request to close.
00062     /// This message is sent to the app by the 
00063     /// default OnClose() handler in CATWindow.
00064     ///
00065     /// fStringParam1 - name of the window from skin.
00066     /// fVoidParam - CATWindow* to window.  
00067     CATEVENT_WINDOW_CLOSE,   
00068 
00069     /// CATEVENT_WINDOW_HIDDEN,
00070     /// A window has closed or been made hidden.
00071     ///
00072     /// fStringParam1 - name of the window from skin.
00073     /// fVoidParam - CATWindow* to window.  
00074     CATEVENT_WINDOW_HIDDEN,
00075 
00076     /// CATEVENT_WINDOW_SHOWN
00077     /// A window has opened or been made visible.
00078     ///
00079     /// fStringParam1 - name of the window from skin.
00080     /// fVoidParam - CATWindow* to window.  
00081     CATEVENT_WINDOW_SHOWN,
00082 
00083 
00084     /// CATEVENT_ENABLE_CHANGE
00085     /// A layer's enabled state has changed.  Most controls
00086     /// will be automatically updated, but controlwnd's and the
00087     /// like may need to update their own states.
00088     CATEVENT_ENABLE_CHANGE,
00089 
00090     /// CATEVENT_GUI_VAL_CHANGE
00091     ///
00092     /// Event signaling that the value of a GUI control changed.
00093     /// Each control should check to see if it has the same command string, and 
00094     /// if so, reflect the same value.
00095     ///
00096     /// Controls with a command name of "SetValue" are ignored and do not
00097     /// produce this event directly. Instead, they send it to the command string
00098     /// from their Target member.
00099     ///
00100     /// This is typically sent when a command is received.
00101     ///
00102     /// fStringParam1 - Command string / value name (fCmdString on GGControls)
00103     /// fStringParam2 - String parameter of command
00104     /// fStringParam3 - String value for control, or empty if numeric.
00105     /// fFloatParam1  - Value of control
00106     /// fVoidParam - ptr to control that caused it, or null.
00107     ///
00108     /// If a control responds to this event, it should increment the
00109     /// result value.  It should not respond if it is the same as the 
00110     /// fVoidParam control.
00111     ///
00112     CATEVENT_GUI_VAL_CHANGE,
00113 
00114     /// CATEVENT_GUI_VAL_CHANGE_MATCHPARAM_ONLY
00115     ///
00116     /// Event signaling that the value of a GUI control changed.
00117     /// As above, except that only controls with a matching string
00118     /// parameter should reflect the new value.
00119     ///
00120     /// fStringParam1 - Command string / value name (fCmdString on GGControls)
00121     /// fStringParam2 - String parameter of command - MATCH THIS AS WELL AS COMMAND!
00122     /// fFloatParam1  - Value of control
00123     /// fVoidParam - ptr to control that caused it, or null.
00124     ///
00125     /// If a control responds to this event, it should increment the
00126     /// result value.  It should not respond if it is the same as the 
00127     /// fVoidParam control.
00128     ///
00129     CATEVENT_GUI_VAL_CHANGE_MATCHPARAM_ONLY,
00130 
00131 
00132     /// CATEVENT_GUI_UPDATE
00133     ///
00134     /// Windows should call Update() when they receive this event, then
00135     /// increment the result value.
00136     CATEVENT_GUI_UPDATE,
00137 
00138     //-----------------------------------------------------------------------------
00139     // Control Events
00140     //-----------------------------------------------------------------------------
00141     /// In all of the following events, if fStringParam2 is non-empty, 
00142     /// then it refers to a specific targetted control name, and only the control 
00143     /// matching that name should perform the action.
00144     ///
00145     /// Otherwise, all controls receiving the event should respond.
00146     ///
00147     /// Hereafter, events are just marked with 'fStringParam2 - Target' to indicate
00148     /// this behaviour.
00149     //-----------------------------------------------------------------------------
00150 
00151     /// CATEVENT_LISTBOX_ADD
00152     ///
00153     /// This event adds an item to the specified list box
00154     ///
00155     /// fIntParam1    - index to add at, or -1 for end of list
00156     /// fStringParam1 - text to add
00157     /// fStringParam2 - target
00158     /// fVoidParam    - list data
00159     CATEVENT_LISTBOX_ADD,
00160 
00161     /// CATEVENT_LISTBOX_REMOVE_INDEX
00162     ///
00163     /// This event adds an item to the specified list box
00164     ///
00165     /// fIntParam1    - index of item to remove
00166     /// fStringParam2 - target
00167     CATEVENT_LISTBOX_REMOVE_INDEX,
00168 
00169     /// CATEVENT_LISTBOX_REMOVE_STRING
00170     ///
00171     /// This event adds an item to the specified list box
00172     ///
00173     /// fStringParam1 - string to find and remove
00174     /// fStringParam2 - target
00175     CATEVENT_LISTBOX_REMOVE_STRING,
00176 
00177     /// CATEVENT_LISTBOX_SET_SEL
00178     ///
00179     /// Sets the current item - -1 is none
00180     ///
00181     /// fIntParam1 - index of selection
00182     /// fStringParam2 - target
00183     CATEVENT_LISTBOX_SET_SEL,
00184 
00185     /// CATEVENT_LISTBOX_SET_SEL_STRING
00186     ///
00187     /// fStringParam1 - string to find and select
00188     /// fStringParam2 - target
00189     CATEVENT_LISTBOX_SET_SEL_STRING,
00190 
00191     /// CATEVENT_LISTBOX_CLEAR
00192     ///
00193     /// Clears the listbox
00194     ///   
00195     /// fStringParam2 - target
00196     CATEVENT_LISTBOX_CLEAR,
00197 
00198     /// CATEVENT_LISTBOX_GET_SEL
00199     ///
00200     /// Retrieves the current item in retval
00201     ///
00202     /// fStringParam2 - target
00203     CATEVENT_LISTBOX_GET_SEL,
00204 
00205     /// CATEVENT_LISTBOX_GET_SEL_DATA
00206     ///
00207     /// Retrieves the currently selected item's data into
00208     /// a void* pointed to by fVoidParam - i.e. fVoidParam is a
00209     /// void**.
00210     ///
00211     /// fStringParam2 - target
00212     /// fVoidParam - void** to receive data
00213     CATEVENT_LISTBOX_GET_SEL_DATA,
00214 
00215     /// CATEVENT_BROWSER_REFRESH
00216     ///
00217     /// This event requests browser controls to refresh. 
00218     ///
00219     /// fStringParam2 - Target
00220     CATEVENT_BROWSER_REFRESH,
00221 
00222     /// CATEVENT_BROWSER_GO
00223     ///
00224     /// This event requests browser controls to go to a URL. 
00225     ///
00226     /// fStringParam1 - URL
00227     /// fStringParam2 - Target
00228     CATEVENT_BROWSER_GO,
00229 
00230     /// CATEVENT_BROWSER_STOP
00231     ///
00232     /// This event requests browser controls to stop loading any current page. 
00233     ///
00234     /// fStringParam2 - Target
00235     CATEVENT_BROWSER_STOP,
00236 
00237     /// CATEVENT_BROWSER_BACK
00238     ///
00239     /// This event requests browser controls to go back in history. 
00240     ///
00241     /// fStringParam2 - Target
00242     CATEVENT_BROWSER_BACK,
00243 
00244     /// CATEVENT_BROWSER_FORWARD
00245     ///
00246     /// This event requests browser controls to forward in history. 
00247     ///
00248     /// fStringParam2 - Target
00249     CATEVENT_BROWSER_FORWARD,
00250 
00251     /// CATEVENT_BROWSER_ZOOM
00252     ///
00253     /// This event requests browser controls to set their zoom level
00254     /// to whatever is proportionate to the float value.
00255     /// So right now, 0.0 becomes a zoom of 1, and 1.0f becomes
00256     /// a zoom of 4 (the max)
00257     ///
00258     /// fFloatParam1 - Zoom level (0.0f - 1.0f)
00259     /// fStringParam2 - Target
00260     CATEVENT_BROWSER_ZOOM,
00261 
00262     /// CATEVENT_TAB_HIDE is sent to the controls on a tabbed layer when
00263     /// a different layer is selected.
00264     CATEVENT_TAB_HIDE,
00265 
00266     /// CATEVENT_TAB_SHOW is sent to the controls on a tabbed layer when
00267     /// the layer is selected.
00268     CATEVENT_TAB_SHOW,      
00269 
00270     /// CATEVENT_PREF_CHANGED is called when prefs are changed.
00271     /// You must request the pref from the prefs manager to retrieve the value.
00272     /// fStringParam1 - Pref name   
00273     CATEVENT_PREF_CHANGED,
00274 
00275     /// CATEVENT_ON_EDITBOX_SELECT
00276     /// Called when an editbox is selected. This may be used to perform
00277     /// an alternate action to normal text editing.
00278     ///
00279     /// fFloatParam1 - value of control
00280     /// fStringParam1 - string of control
00281     /// fStringParam2 - command of control
00282     /// fStringParam3 - parameter of control
00283     /// fVoidParam1 - ptr to control
00284     ///
00285     /// retVal should be 0 if handling normally, or 1 if handled.
00286     CATEVENT_ON_EDITBOX_SELECT,
00287 
00288 
00289     CATEVENT_APP = 0x1000,
00290     //-----------------------------------------------------------------------------
00291     CATEVENT_LAST
00292 };
00293 
00294 #endif // _CATEventDefs_H_
00295 
00296 

Generated on Mon Feb 11 04:09:53 2008 for Game Accessibility Suite by doxygen 1.5.4