DialogEventHandler Class Reference

A derived event handler to wire up wxDialog derived classes to DialogManager Notes: In the OIL See Also:. More...

#include <dlgevt.h>

List of all members.

Public Member Functions

 DialogEventHandler ()
 Constructor.
 DialogEventHandler (DialogOp *pOp)
 Constructor.
 ~DialogEventHandler ()
 Destructor.
void Destroy ()
 Disconnect the DialogEventHandler from its pDialogOp and schedule destruction.
void CommandEvent (wxCommandEvent &event)
 Passes an event to DialogManager::Event.
void ScrollEvent (wxScrollEvent &event)
 Passes an event to DialogManager::Event.
void CloseEvent (wxCloseEvent &event)
 Passes an event to DialogManager::Event.
void MouseEvent (wxMouseEvent &event)
 Passes an event to DialogManager::Event.
void WindowDestroyEvent (wxWindowDestroyEvent &event)
 Passes an event to DialogManager::Event.
void OnChildFocus (wxChildFocusEvent &event)
 Gives the event back to the page if need be.
void OnSetFocus (wxFocusEvent &event)
 Passes an event to DialogManager::Event.
void CamDialogEvent (wxCamDialogEvent &event)
 Passes an event to DialogManager::Event.
void MoveEvent (wxMoveEvent &event)
 Passes an event to DialogManager::Event.
void SizeEvent (wxSizeEvent &event)
 Passes an event to DialogManager::Event.
void NotebookEvent (wxNotebookEvent &event)
 Passes an event to DialogManager::Event.
void GrimReaperEvent (wxCamDialogEvent &event)
 Called when we need to kill off a DialogEventHandler.
UINT32 AddTimer (DialogOp *pDialogOp, UINT32 nIDEvent, UINT32 nElapse, void(*lpfnTimer)(void *)=NULL, void *param=NULL, BOOL OneShot=FALSE)
 Initialize resources.
BOOL DeleteTimer (UINT32 nIDEvent)
 Deletes a timer.

Static Public Member Functions

static const TCHARGetEventName (WXTYPE EventNum)
static BOOL Init ()
 Initialize resources.
static void DeInit ()
 Initialize resources.

Private Attributes

wxWindow * pwxWindow
DialogOppDialogOp
CDlgResID ID
BOOL wxAUImanaged
BOOL m_GrimReaperSent
IntegerToKernelTimer m_TimerHash

Static Private Attributes

static EventNumberToName * pHash = NULL
static const TCHARDefaultString = _T("[Event Name Not Found]\0")
static DialogEventHandlerm_GrimReaper = NULL

Friends

class DialogManager
class DlgEvtTimer


Detailed Description

A derived event handler to wire up wxDialog derived classes to DialogManager Notes: In the OIL See Also:.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
19/12/2005

Definition at line 158 of file dlgevt.h.


Constructor & Destructor Documentation

DialogEventHandler::DialogEventHandler  ) 
 

Constructor.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 223 of file dlgevt.cpp.

00224 {
00225     pwxWindow = NULL;
00226     pDialogOp = NULL;
00227     ID=0;
00228     wxAUImanaged=FALSE;
00229     m_GrimReaperSent=FALSE;
00230 }

DialogEventHandler::DialogEventHandler DialogOp pOp  ) 
 

Constructor.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 249 of file dlgevt.cpp.

00250 {
00251     pwxWindow = NULL;
00252     pDialogOp = pOp;
00253     ID=0;
00254     wxAUImanaged=FALSE;
00255     m_GrimReaperSent=FALSE;
00256     m_TimerHash.clear();
00257 }

DialogEventHandler::~DialogEventHandler  ) 
 

Destructor.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
Note we don't normally delete these directly - we Destroy() them, which is safe even within the event handler itself

Definition at line 278 of file dlgevt.cpp.

00279 {
00280     // clear out the kernel timers so they don't go off - this should have been done by Destroy()
00281     while (!m_TimerHash.empty())
00282     {
00283         IntegerToKernelTimer::iterator current = m_TimerHash.begin();
00284         DlgEvtTimer * t=current->second;
00285         m_TimerHash.erase(current);
00286         if (t)
00287             delete t;
00288     }
00289     // for good measure
00290     m_TimerHash.clear();
00291 }


Member Function Documentation

UINT32 DialogEventHandler::AddTimer DialogOp pDialogOp,
UINT32  nIDEvent,
UINT32  nElapse,
void(*)(void *)  lpfnTimer = NULL,
void *  param = NULL,
BOOL  OneShot = FALSE
 

Initialize resources.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
parameters for the timer [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if fails

Errors: via wxMessageBox

See also:
-

Definition at line 991 of file dlgevt.cpp.

00993 {
00994     DeleteTimer(nIDEvent);  // delete any previous timer
00995     DlgEvtTimer * pTimer = new DlgEvtTimer(this, pDialogOp, nIDEvent, lpfnTimer, param);
00996     if (!pTimer)
00997         return 0;
00998 
00999     m_TimerHash[nIDEvent]=pTimer;
01000     pTimer->Start(nElapse, OneShot);
01001     return nIDEvent;
01002 }

void DialogEventHandler::CamDialogEvent wxCamDialogEvent event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 657 of file dlgevt.cpp.

00658 {
00659     DialogManager::Event(this, event);
00660 }

void DialogEventHandler::CloseEvent wxCloseEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 493 of file dlgevt.cpp.

00494 {
00495     DialogManager::Event(this, event);
00496 }

void DialogEventHandler::CommandEvent wxCommandEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 427 of file dlgevt.cpp.

00428 {
00429     DialogManager::Event(this, event);
00430 }

void DialogEventHandler::DeInit void   )  [static]
 

Initialize resources.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if fails

Errors: via wxMessageBox

See also:
-

Definition at line 948 of file dlgevt.cpp.

00949 {
00950     ::wxYield(); // Allow grim repear events to filter through
00951     if (m_GrimReaper)
00952     {
00953         delete m_GrimReaper;
00954         m_GrimReaper = NULL;
00955     }
00956 
00957     if (pHash)
00958     {
00959         EventNumberToName::iterator current;
00960         while (!pHash->empty())
00961         {
00962             current = pHash->begin();
00963             EventNameString s=current->second;
00964             pHash->erase(current);
00965             free((void *)s);
00966         }
00967         // for good measure
00968         pHash->clear();
00969         delete (pHash);
00970         pHash=NULL;
00971     }
00972 }

BOOL DialogEventHandler::DeleteTimer UINT32  nIDEvent  ) 
 

Deletes a timer.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
ID of the timer [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if fails

Errors: -

See also:
-

Definition at line 1020 of file dlgevt.cpp.

01021 {
01022     IntegerToKernelTimer::iterator i=m_TimerHash.find(nIDEvent);
01023     if (i==m_TimerHash.end())
01024         return FALSE;
01025     m_TimerHash.erase(nIDEvent);
01026     return TRUE;
01027 }

void DialogEventHandler::Destroy  ) 
 

Disconnect the DialogEventHandler from its pDialogOp and schedule destruction.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
Note we don't normally delete these directly - we Destroy() them, which is safe even within the event handler itself

Definition at line 312 of file dlgevt.cpp.

00313 {
00314     if (this == m_GrimReaper)
00315     {
00316         // Grim Reaper cannot delete itself as its in its own event handler. It must be
00317         // explicitly deleted on deinit
00318         ERROR3("You cannot destroy the Grim Reaper that easily!");
00319         return;
00320     }
00321 
00322     if (!m_GrimReaperSent)
00323     {
00324         // clear out the kernel timers so they don't go off after Destroy()
00325         while (!m_TimerHash.empty())
00326         {
00327             IntegerToKernelTimer::iterator current = m_TimerHash.begin();
00328             DlgEvtTimer * t=current->second;
00329             m_TimerHash.erase(current);
00330             if (t)
00331                 delete t;
00332         }
00333         // for good measure
00334         m_TimerHash.clear();
00335 
00336         // Disconnect from the DialogOp
00337         if (pDialogOp)
00338             pDialogOp->pEvtHandler=NULL;
00339         
00340         // Zap out all the variables
00341         pDialogOp = NULL;
00342         pwxWindow = NULL;
00343         ID = 0;
00344         wxCamDialogEvent deferredevent (wxEVT_CAMDIALOG_GRIMREAPER, 0, DialogMsg(NULL, DIM_NONE, 0, (UINT_PTR)(void *)(this),0));
00345         if (m_GrimReaper)
00346         {
00347             m_GrimReaper->AddPendingEvent(deferredevent);
00348             return;
00349         }
00350         else
00351         {
00352             ERROR3("Can't call upon the grim reaper. Leaking memory");
00353         }
00354         m_GrimReaperSent = TRUE; // Don't do another
00355     }
00356 }

static const TCHAR* DialogEventHandler::GetEventName WXTYPE  EventNum  )  [inline, static]
 

Definition at line 185 of file dlgevt.h.

00186     {
00187         if (!pHash) return DefaultString;
00188         EventNumberToName::iterator i=pHash->find(EventNum);
00189         const TCHAR * text = (const TCHAR *)((i==pHash->end())?NULL:i->second);
00190         return text?text:DefaultString;
00191     };

void DialogEventHandler::GrimReaperEvent wxCamDialogEvent event  ) 
 

Called when we need to kill off a DialogEventHandler.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
For some reason we can't declare this guy static.

Definition at line 378 of file dlgevt.cpp.

00379 {
00380     WXTYPE EventType = event.GetEventType();
00381     if (!(event.IsKindOf(CLASSINFO(wxCamDialogEvent)) && (EventType == wxEVT_CAMDIALOG_GRIMREAPER)))
00382     {
00383         ERROR3("Grim Reaper called with bad parameters");
00384         return;
00385     }
00386     
00387     if (this != m_GrimReaper)
00388     {
00389         ERROR3("Grim Reaper event sent to an event handler other than the GrimReaper");
00390         return;
00391     }
00392 
00393     DialogEventHandler * pEvtHandler = (DialogEventHandler *)(void *)event.msg.DlgMsgParam;
00394     if (!pEvtHandler->IsKindOf(CLASSINFO(DialogEventHandler)))
00395     {
00396         ERROR3("Grim Reaper called with a non event handler parameter");
00397         return;
00398     }
00399 
00400     if (pEvtHandler == this)
00401     {
00402         ERROR3("The grim reaper cannot kill itself"); // we are in our own event handler, so this would be bad
00403         return;
00404     }
00405 
00406     TRACEUSER("amb", _T("Grim reaper reaped an event handler at %016llx"), pEvtHandler);
00407     delete pEvtHandler;
00408 }

BOOL DialogEventHandler::Init void   )  [static]
 

Initialize resources.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if fails

Errors: via wxMessageBox

See also:
-

Definition at line 768 of file dlgevt.cpp.

00769 {
00770     m_GrimReaper = new DialogEventHandler;
00771     if (!m_GrimReaper) return FALSE;
00772 
00773     pHash = new (EventNumberToName);
00774     if (!pHash) return FALSE;
00775 
00776     // Clear our own hash tables
00777     pHash->clear();
00778 
00779 #if _DEBUG
00780 
00781     #if 0 != wxUSE_UNICODE
00782     #define HASHEVENTNAME(x) (*pHash)[x] = (EventNameString)camStrdup(L ## #x)
00783     #else
00784     #define HASHEVENTNAME(x) (*pHash)[x] = (EventNameString)camStrdup(#x)
00785     #endif
00786 
00787     HASHEVENTNAME(wxEVT_COMMAND_BUTTON_CLICKED);
00788     HASHEVENTNAME(wxEVT_COMMAND_CHECKBOX_CLICKED);
00789     HASHEVENTNAME(wxEVT_COMMAND_CHOICE_SELECTED);
00790     HASHEVENTNAME(wxEVT_COMMAND_LISTBOX_SELECTED);
00791     HASHEVENTNAME(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
00792     HASHEVENTNAME(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED);
00793     HASHEVENTNAME(wxEVT_COMMAND_TEXT_UPDATED);
00794     HASHEVENTNAME(wxEVT_COMMAND_TEXT_ENTER);
00795     HASHEVENTNAME(wxEVT_COMMAND_TEXT_URL);
00796     HASHEVENTNAME(wxEVT_COMMAND_TEXT_MAXLEN);
00797     HASHEVENTNAME(wxEVT_COMMAND_MENU_SELECTED);
00798     HASHEVENTNAME(wxEVT_COMMAND_SLIDER_UPDATED);
00799     HASHEVENTNAME(wxEVT_COMMAND_RADIOBOX_SELECTED);
00800     HASHEVENTNAME(wxEVT_COMMAND_RADIOBUTTON_SELECTED);
00801     HASHEVENTNAME(wxEVT_COMMAND_SCROLLBAR_UPDATED);
00802     HASHEVENTNAME(wxEVT_COMMAND_VLBOX_SELECTED);
00803     HASHEVENTNAME(wxEVT_COMMAND_COMBOBOX_SELECTED);
00804     HASHEVENTNAME(wxEVT_COMMAND_TOOL_RCLICKED);
00805     HASHEVENTNAME(wxEVT_COMMAND_TOOL_ENTER);
00806     HASHEVENTNAME(wxEVT_COMMAND_SPINCTRL_UPDATED);
00807     HASHEVENTNAME(wxEVT_COMMAND_TREE_SEL_CHANGED);
00808     HASHEVENTNAME(wxEVT_SOCKET);
00809     HASHEVENTNAME(wxEVT_TIMER);
00810     HASHEVENTNAME(wxEVT_LEFT_DOWN);
00811     HASHEVENTNAME(wxEVT_LEFT_UP);
00812     HASHEVENTNAME(wxEVT_MIDDLE_DOWN);
00813     HASHEVENTNAME(wxEVT_MIDDLE_UP);
00814     HASHEVENTNAME(wxEVT_RIGHT_DOWN);
00815     HASHEVENTNAME(wxEVT_RIGHT_UP);
00816     HASHEVENTNAME(wxEVT_MOTION);
00817     HASHEVENTNAME(wxEVT_ENTER_WINDOW);
00818     HASHEVENTNAME(wxEVT_LEAVE_WINDOW);
00819     HASHEVENTNAME(wxEVT_LEFT_DCLICK);
00820     HASHEVENTNAME(wxEVT_MIDDLE_DCLICK);
00821     HASHEVENTNAME(wxEVT_RIGHT_DCLICK);
00822     HASHEVENTNAME(wxEVT_SET_FOCUS);
00823     HASHEVENTNAME(wxEVT_KILL_FOCUS);
00824     HASHEVENTNAME(wxEVT_CHILD_FOCUS);
00825     HASHEVENTNAME(wxEVT_MOUSEWHEEL);
00826     HASHEVENTNAME(wxEVT_NC_LEFT_DOWN);
00827     HASHEVENTNAME(wxEVT_NC_LEFT_UP);
00828     HASHEVENTNAME(wxEVT_NC_MIDDLE_DOWN);
00829     HASHEVENTNAME(wxEVT_NC_MIDDLE_UP);
00830     HASHEVENTNAME(wxEVT_NC_RIGHT_DOWN);
00831     HASHEVENTNAME(wxEVT_NC_RIGHT_UP);
00832     HASHEVENTNAME(wxEVT_NC_MOTION);
00833     HASHEVENTNAME(wxEVT_NC_ENTER_WINDOW);
00834     HASHEVENTNAME(wxEVT_NC_LEAVE_WINDOW);
00835     HASHEVENTNAME(wxEVT_NC_LEFT_DCLICK);
00836     HASHEVENTNAME(wxEVT_NC_MIDDLE_DCLICK);
00837     HASHEVENTNAME(wxEVT_NC_RIGHT_DCLICK);
00838     HASHEVENTNAME(wxEVT_CHAR);
00839     HASHEVENTNAME(wxEVT_CHAR_HOOK);
00840     HASHEVENTNAME(wxEVT_NAVIGATION_KEY);
00841     HASHEVENTNAME(wxEVT_KEY_DOWN);
00842     HASHEVENTNAME(wxEVT_KEY_UP);
00843 //    HASHEVENTNAME(wxEVT_HOTKEY);
00844     HASHEVENTNAME(wxEVT_SET_CURSOR);
00845     HASHEVENTNAME(wxEVT_SCROLL_TOP);
00846     HASHEVENTNAME(wxEVT_SCROLL_BOTTOM);
00847     HASHEVENTNAME(wxEVT_SCROLL_LINEUP);
00848     HASHEVENTNAME(wxEVT_SCROLL_LINEDOWN);
00849     HASHEVENTNAME(wxEVT_SCROLL_PAGEUP);
00850     HASHEVENTNAME(wxEVT_SCROLL_PAGEDOWN);
00851     HASHEVENTNAME(wxEVT_SCROLL_THUMBTRACK);
00852     HASHEVENTNAME(wxEVT_SCROLL_THUMBRELEASE);
00853     HASHEVENTNAME(wxEVT_SCROLL_CHANGED);
00854     HASHEVENTNAME(wxEVT_SCROLLWIN_TOP);
00855     HASHEVENTNAME(wxEVT_SCROLLWIN_BOTTOM);
00856     HASHEVENTNAME(wxEVT_SCROLLWIN_LINEUP);
00857     HASHEVENTNAME(wxEVT_SCROLLWIN_LINEDOWN);
00858     HASHEVENTNAME(wxEVT_SCROLLWIN_PAGEUP);
00859     HASHEVENTNAME(wxEVT_SCROLLWIN_PAGEDOWN);
00860     HASHEVENTNAME(wxEVT_SCROLLWIN_THUMBTRACK);
00861     HASHEVENTNAME(wxEVT_SCROLLWIN_THUMBRELEASE);
00862     HASHEVENTNAME(wxEVT_SIZE);
00863     HASHEVENTNAME(wxEVT_MOVE);
00864     HASHEVENTNAME(wxEVT_CLOSE_WINDOW);
00865     HASHEVENTNAME(wxEVT_END_SESSION);
00866     HASHEVENTNAME(wxEVT_QUERY_END_SESSION);
00867     HASHEVENTNAME(wxEVT_ACTIVATE_APP);
00868 //    HASHEVENTNAME(wxEVT_POWER);
00869     HASHEVENTNAME(wxEVT_ACTIVATE);
00870     HASHEVENTNAME(wxEVT_CREATE);
00871     HASHEVENTNAME(wxEVT_DESTROY);
00872     HASHEVENTNAME(wxEVT_SHOW);
00873     HASHEVENTNAME(wxEVT_ICONIZE);
00874     HASHEVENTNAME(wxEVT_MAXIMIZE);
00875     HASHEVENTNAME(wxEVT_MOUSE_CAPTURE_CHANGED);
00876     HASHEVENTNAME(wxEVT_PAINT);
00877     HASHEVENTNAME(wxEVT_ERASE_BACKGROUND);
00878     HASHEVENTNAME(wxEVT_NC_PAINT);
00879     HASHEVENTNAME(wxEVT_PAINT_ICON);
00880     HASHEVENTNAME(wxEVT_MENU_OPEN);
00881     HASHEVENTNAME(wxEVT_MENU_CLOSE);
00882     HASHEVENTNAME(wxEVT_MENU_HIGHLIGHT);
00883     HASHEVENTNAME(wxEVT_CONTEXT_MENU);
00884     HASHEVENTNAME(wxEVT_SYS_COLOUR_CHANGED);
00885     HASHEVENTNAME(wxEVT_DISPLAY_CHANGED);
00886     HASHEVENTNAME(wxEVT_SETTING_CHANGED);
00887     HASHEVENTNAME(wxEVT_QUERY_NEW_PALETTE);
00888     HASHEVENTNAME(wxEVT_PALETTE_CHANGED);
00889     HASHEVENTNAME(wxEVT_JOY_BUTTON_DOWN);
00890     HASHEVENTNAME(wxEVT_JOY_BUTTON_UP);
00891     HASHEVENTNAME(wxEVT_JOY_MOVE);
00892     HASHEVENTNAME(wxEVT_JOY_ZMOVE);
00893     HASHEVENTNAME(wxEVT_DROP_FILES);
00894     HASHEVENTNAME(wxEVT_DRAW_ITEM);
00895     HASHEVENTNAME(wxEVT_MEASURE_ITEM);
00896     HASHEVENTNAME(wxEVT_COMPARE_ITEM);
00897     HASHEVENTNAME(wxEVT_INIT_DIALOG);
00898     HASHEVENTNAME(wxEVT_IDLE);
00899     HASHEVENTNAME(wxEVT_UPDATE_UI);
00900     HASHEVENTNAME(wxEVT_SIZING);
00901     HASHEVENTNAME(wxEVT_MOVING);
00902     HASHEVENTNAME(wxEVT_HIBERNATE);
00903     HASHEVENTNAME(wxEVT_COMMAND_LEFT_CLICK);
00904     HASHEVENTNAME(wxEVT_COMMAND_LEFT_DCLICK);
00905     HASHEVENTNAME(wxEVT_COMMAND_RIGHT_CLICK);
00906     HASHEVENTNAME(wxEVT_COMMAND_RIGHT_DCLICK);
00907     HASHEVENTNAME(wxEVT_COMMAND_SET_FOCUS);
00908     HASHEVENTNAME(wxEVT_COMMAND_KILL_FOCUS);
00909     HASHEVENTNAME(wxEVT_COMMAND_ENTER);
00910     HASHEVENTNAME(wxEVT_HELP);
00911     HASHEVENTNAME(wxEVT_DETAILED_HELP);
00912 
00913     // And now our own...
00914     HASHEVENTNAME(wxEVT_CAMDIALOG_DEFERREDMSG);
00915     HASHEVENTNAME(wxEVT_CAMDIALOG_REDRAW);
00916 
00917     TRACE(_T(">>> Event name %d=%s"),wxEVT_COMMAND_BUTTON_CLICKED,GetEventName(wxEVT_COMMAND_BUTTON_CLICKED));
00918 
00919     WXTYPE EventNum=wxEVT_COMMAND_BUTTON_CLICKED;
00920     EventNumberToName::iterator i=pHash->find(EventNum);
00921     const TCHAR * text = (const TCHAR *)((i==pHash->end())?NULL:i->second);
00922     //return text?text:DefaultString;
00923     if (text)
00924     {
00925         TRACE(_T("Found text %d=%s"),EventNum,text);
00926     }
00927 
00928 #endif
00929     return TRUE;
00930 }

void DialogEventHandler::MouseEvent wxMouseEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 471 of file dlgevt.cpp.

00472 {
00473     DialogManager::Event(this, event);
00474 }

void DialogEventHandler::MoveEvent wxMoveEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 679 of file dlgevt.cpp.

00680 {
00681     DialogManager::Event(this, event);
00682 
00683     // We pretend we didn't handle it, since dialogs with sizers etc. will need it
00684     event.Skip();
00685 }

void DialogEventHandler::NotebookEvent wxNotebookEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 729 of file dlgevt.cpp.

00730 {
00731     DialogManager::Event(this, event);
00732 }

void DialogEventHandler::OnChildFocus wxChildFocusEvent &  event  ) 
 

Gives the event back to the page if need be.

Author:
Luke_Hart <alex@alex.org.uk>
Date:
02/05/06
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 570 of file dlgevt.cpp.

00571 {
00572     // Check if focus is going to an always focus object (may need more tests
00573     // as more controls come online). If so just return allowing focus to stay
00574     wxWindow*   pWnd = (wxWindow*)event.GetEventObject();
00575 
00576     TRACEUSER("luke", _T("DialogEventHandler::OnSetFocus %s"), pWnd->GetClassInfo()->GetClassName());
00577 
00578     if( pWnd->IsKindOf( CLASSINFO(wxTextCtrl) ) ||
00579         pWnd->IsKindOf( CLASSINFO(wxSliderCombo) ) ||
00580         pWnd->IsKindOf( CLASSINFO(wxComboBox) ) ||
00581         pWnd->IsKindOf( CLASSINFO(wxOwnerDrawnComboBox) ) ||
00582         pWnd->IsKindOf( CLASSINFO(wxComboCtrl) ) )
00583     {
00584         TRACEUSER("luke", _T("DialogEventHandler::OnSetFocus Focus undisturbed 1"));
00585         return;
00586     }
00587 
00588     // Scan down ancestors looking for either wxPanels (always non-modal) and
00589     // wxDailogs (can be modal, so we check)
00590     while( NULL != pWnd && !pWnd->IsKindOf( CLASSINFO(wxPanel) ) )
00591     {
00592         // Dialogs may-be modal so check
00593         if( pWnd->IsKindOf( CLASSINFO(wxDialog) ) )
00594         {
00595             if( ((wxDialog*)pWnd)->IsModal() )
00596             {
00597                 TRACEUSER("luke", _T("Focus undisturbed 2"));
00598                 return;
00599             }
00600 
00601             // Non-modal dialog so do focus handling
00602             break;
00603         }
00604 
00605         pWnd = pWnd->GetParent();
00606     }
00607 
00608     TRACEUSER("luke", _T("DialogEventHandler::OnSetFocus Focus back to canvas"));
00609     // Put the focus back into active view
00610     TRACEUSER( "luke", _T("NO, that control is not allowed focus") );
00611     AfxGetApp().GiveActiveCanvasFocus();
00612 }

void DialogEventHandler::OnSetFocus wxFocusEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Luke_Hart <alex@alex.org.uk>
Date:
02/05/06
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 631 of file dlgevt.cpp.

00632 {
00633     TRACEUSER( "luke", _T("OnSetFocus") );
00634     
00635     // Do nothing for the time being
00636     event.Skip();
00637 }

void DialogEventHandler::ScrollEvent wxScrollEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 449 of file dlgevt.cpp.

00450 {
00451     DialogManager::Event(this, event);
00452 }

void DialogEventHandler::SizeEvent wxSizeEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 704 of file dlgevt.cpp.

00705 {
00706     DialogManager::Event(this, event);
00707     
00708     // We pretend we didn't handle it, since dialogs with sizers etc. will need it
00709     event.Skip();
00710 }

void DialogEventHandler::WindowDestroyEvent wxWindowDestroyEvent &  event  ) 
 

Passes an event to DialogManager::Event.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
02/12/2005
Parameters:
event - the wxEvent [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 515 of file dlgevt.cpp.

00516 {
00517     if (!event.IsKindOf(CLASSINFO(wxWindowDestroyEvent)))
00518         return; // How did that get here?
00519 
00520     DialogManager::Event(this, event);
00521 
00522     // we are only interested in our window being destroyed from now on, as opposed to
00523     // children of our window
00524     if (event.GetEventObject() != pwxWindow)
00525         return;
00526 
00527     // Now diassociate all the window controls
00528     // Note this may have already been done by DialogManager, but in that case (a) pwxWindow won't
00529     // be non-NULL, and (b) we'll have removed the EventHandler from the queue, so we won't be
00530     // called anyway
00531     if (pwxWindow)
00532     {
00533         DropDown::KillDropDownsByWindow(pwxWindow);
00534         CGridDropDown::KillDropDownsByWindow(pwxWindow);
00535         ControlList::Get()->RemoveWindowAndChildren(pwxWindow);
00536     }
00537 
00538     if (!m_GrimReaperSent)
00539     {
00540         m_GrimReaperSent= TRUE; // Stop DialogManager::Delete() from doing anything
00541         TRACE(_T("DialogEventHandler::CloseEvent called on window which has been closed other than through DialogManager\n"));
00542         TRACE(_T("This should never happen. Cleaning up the horrible mess as best we can\n"));
00543         if (pDialogOp)
00544         {
00545             // there is a running DialogOp. Let's try ending it
00546             pDialogOp->End();
00547         }
00548         m_GrimReaperSent = FALSE; // ensure Destroy() works
00549         Destroy(); // Destroy ourselves (as opposed to the window) if this hasn't happened already
00550     }
00551 }


Friends And Related Function Documentation

friend class DialogManager [friend]
 

Definition at line 160 of file dlgevt.h.

friend class DlgEvtTimer [friend]
 

Definition at line 161 of file dlgevt.h.


Member Data Documentation

const TCHAR * DialogEventHandler::DefaultString = _T("[Event Name Not Found]\0") [static, private]
 

Definition at line 208 of file dlgevt.h.

CDlgResID DialogEventHandler::ID [private]
 

Definition at line 201 of file dlgevt.h.

DialogEventHandler * DialogEventHandler::m_GrimReaper = NULL [static, private]
 

Definition at line 210 of file dlgevt.h.

BOOL DialogEventHandler::m_GrimReaperSent [private]
 

Definition at line 203 of file dlgevt.h.

IntegerToKernelTimer DialogEventHandler::m_TimerHash [private]
 

Definition at line 205 of file dlgevt.h.

DialogOp* DialogEventHandler::pDialogOp [private]
 

Definition at line 200 of file dlgevt.h.

EventNumberToName * DialogEventHandler::pHash = NULL [static, private]
 

Definition at line 207 of file dlgevt.h.

wxWindow* DialogEventHandler::pwxWindow [private]
 

Definition at line 199 of file dlgevt.h.

BOOL DialogEventHandler::wxAUImanaged [private]
 

Definition at line 202 of file dlgevt.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:31 2007 for Camelot by  doxygen 1.4.4