00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #include "camtypes.h"
00101
00102 #include "camelot.h"
00103 #include "dlgevt.h"
00104 #include "dlgmgr.h"
00105 #include "camframe.h"
00106
00107 #include "ctrllist.h"
00108 #include "dropdown.h"
00109 #include "griddropdown.h"
00110
00111 const TCHAR * DialogEventHandler::DefaultString = _T("[Event Name Not Found]\0");
00112 EventNumberToName * DialogEventHandler::pHash = NULL;
00113 DialogEventHandler * DialogEventHandler::m_GrimReaper = NULL;
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 IMPLEMENT_CLASS( DialogEventHandler, wxEvtHandler )
00124 BEGIN_EVENT_TABLE(DialogEventHandler, wxEvtHandler)
00125 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, DialogEventHandler::CommandEvent)
00126 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, DialogEventHandler::CommandEvent)
00127 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, DialogEventHandler::CommandEvent)
00128 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, DialogEventHandler::CommandEvent)
00129 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, DialogEventHandler::CommandEvent)
00130 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, DialogEventHandler::CommandEvent)
00131 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, DialogEventHandler::CommandEvent)
00132 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TEXT_ENTER, DialogEventHandler::CommandEvent)
00133 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TEXT_URL, DialogEventHandler::CommandEvent)
00134 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TEXT_MAXLEN, DialogEventHandler::CommandEvent)
00135 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, DialogEventHandler::CommandEvent)
00136 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_SLIDER_UPDATED, DialogEventHandler::CommandEvent)
00137 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, DialogEventHandler::CommandEvent)
00138 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, DialogEventHandler::CommandEvent)
00139
00140 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_VLBOX_SELECTED, DialogEventHandler::CommandEvent)
00141 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, DialogEventHandler::CommandEvent)
00142 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TOOL_RCLICKED, DialogEventHandler::CommandEvent)
00143 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TOOL_ENTER, DialogEventHandler::CommandEvent)
00144 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, DialogEventHandler::CommandEvent)
00145 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_TREE_SEL_CHANGED, DialogEventHandler::CommandEvent)
00146 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, DialogEventHandler::CommandEvent)
00147 EVT_COMMAND (wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, DialogEventHandler::CommandEvent)
00148
00149
00150
00151
00152
00153
00154
00155
00156 EVT_COMMAND_SCROLL (wxID_ANY, DialogEventHandler::ScrollEvent)
00157 EVT_SCROLL (DialogEventHandler::ScrollEvent)
00158 EVT_CLOSE (DialogEventHandler::CloseEvent)
00159 EVT_WINDOW_DESTROY (DialogEventHandler::WindowDestroyEvent)
00160 EVT_MOUSE_EVENTS (DialogEventHandler::MouseEvent)
00161 EVT_CHILD_FOCUS( DialogEventHandler::OnChildFocus )
00162 EVT_SET_FOCUS( DialogEventHandler::OnSetFocus )
00163 EVT_CAMDIALOG_DEFERREDMSG (wxID_ANY, DialogEventHandler::CamDialogEvent)
00164 EVT_CAMDIALOG_GRIMREAPER (wxID_ANY, DialogEventHandler::GrimReaperEvent)
00165 EVT_CAMDIALOG_REDRAW (wxID_ANY, DialogEventHandler::CamDialogEvent)
00166 EVT_MOVE (DialogEventHandler::MoveEvent)
00167 EVT_SIZE (DialogEventHandler::SizeEvent)
00168
00169 END_EVENT_TABLE();
00170
00171 DEFINE_EVENT_TYPE(wxEVT_CAMDIALOG_DEFERREDMSG)
00172 DEFINE_EVENT_TYPE(wxEVT_CAMDIALOG_GRIMREAPER)
00173 DEFINE_EVENT_TYPE(wxEVT_CAMDIALOG_REDRAW)
00174 IMPLEMENT_DYNAMIC_CLASS( wxCamDialogEvent, wxEvent )
00175
00176 CC_IMPLEMENT_DYNAMIC(DlgEvtTimer, KernelTimer);
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 void DlgEvtTimer::Notify()
00195 {
00196 if (m_lpfnTimer)
00197 {
00198 (*m_lpfnTimer)(m_Param);
00199 }
00200 else
00201 {
00202
00203 BROADCAST_TO_CLASS(DialogMsg(m_pEvtHandler->pwxWindow, DIM_TIMER, 0, (UINT_PTR)m_IDEvent, 0), DialogOp);
00204 }
00205 }
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223 DialogEventHandler::DialogEventHandler()
00224 {
00225 pwxWindow = NULL;
00226 pDialogOp = NULL;
00227 ID=0;
00228 wxAUImanaged=FALSE;
00229 m_GrimReaperSent=FALSE;
00230 }
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 DialogEventHandler::DialogEventHandler(DialogOp * pOp)
00250 {
00251 pwxWindow = NULL;
00252 pDialogOp = pOp;
00253 ID=0;
00254 wxAUImanaged=FALSE;
00255 m_GrimReaperSent=FALSE;
00256 m_TimerHash.clear();
00257 }
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 DialogEventHandler::~DialogEventHandler()
00279 {
00280
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
00290 m_TimerHash.clear();
00291 }
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312 void DialogEventHandler::Destroy()
00313 {
00314 if (this == m_GrimReaper)
00315 {
00316
00317
00318 ERROR3("You cannot destroy the Grim Reaper that easily!");
00319 return;
00320 }
00321
00322 if (!m_GrimReaperSent)
00323 {
00324
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
00334 m_TimerHash.clear();
00335
00336
00337 if (pDialogOp)
00338 pDialogOp->pEvtHandler=NULL;
00339
00340
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;
00355 }
00356 }
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378 void DialogEventHandler::GrimReaperEvent(wxCamDialogEvent& event)
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");
00403 return;
00404 }
00405
00406 TRACEUSER("amb", _T("Grim reaper reaped an event handler at %016llx"), pEvtHandler);
00407 delete pEvtHandler;
00408 }
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427 void DialogEventHandler::CommandEvent(wxCommandEvent& event)
00428 {
00429 DialogManager::Event(this, event);
00430 }
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449 void DialogEventHandler::ScrollEvent(wxScrollEvent& event)
00450 {
00451 DialogManager::Event(this, event);
00452 }
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471 void DialogEventHandler::MouseEvent(wxMouseEvent& event)
00472 {
00473 DialogManager::Event(this, event);
00474 }
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493 void DialogEventHandler::CloseEvent(wxCloseEvent& event)
00494 {
00495 DialogManager::Event(this, event);
00496 }
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515 void DialogEventHandler::WindowDestroyEvent(wxWindowDestroyEvent& event)
00516 {
00517 if (!event.IsKindOf(CLASSINFO(wxWindowDestroyEvent)))
00518 return;
00519
00520 DialogManager::Event(this, event);
00521
00522
00523
00524 if (event.GetEventObject() != pwxWindow)
00525 return;
00526
00527
00528
00529
00530
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;
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
00546 pDialogOp->End();
00547 }
00548 m_GrimReaperSent = FALSE;
00549 Destroy();
00550 }
00551 }
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570 void DialogEventHandler::OnChildFocus(wxChildFocusEvent &event)
00571 {
00572
00573
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
00589
00590 while( NULL != pWnd && !pWnd->IsKindOf( CLASSINFO(wxPanel) ) )
00591 {
00592
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
00602 break;
00603 }
00604
00605 pWnd = pWnd->GetParent();
00606 }
00607
00608 TRACEUSER("luke", _T("DialogEventHandler::OnSetFocus Focus back to canvas"));
00609
00610 TRACEUSER( "luke", _T("NO, that control is not allowed focus") );
00611 AfxGetApp().GiveActiveCanvasFocus();
00612 }
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631 void DialogEventHandler::OnSetFocus(wxFocusEvent &event)
00632 {
00633 TRACEUSER( "luke", _T("OnSetFocus") );
00634
00635
00636 event.Skip();
00637 }
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657 void DialogEventHandler::CamDialogEvent(wxCamDialogEvent& event)
00658 {
00659 DialogManager::Event(this, event);
00660 }
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679 void DialogEventHandler::MoveEvent(wxMoveEvent& event)
00680 {
00681 DialogManager::Event(this, event);
00682
00683
00684 event.Skip();
00685 }
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704 void DialogEventHandler::SizeEvent(wxSizeEvent& event)
00705 {
00706 DialogManager::Event(this, event);
00707
00708
00709 event.Skip();
00710 }
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729 void DialogEventHandler::NotebookEvent(wxNotebookEvent& event)
00730 {
00731 DialogManager::Event(this, event);
00732 }
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750 #define EVTDECODE(x) if (eventnum == x) return(_T( ## x));
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768 BOOL DialogEventHandler::Init()
00769 {
00770 m_GrimReaper = new DialogEventHandler;
00771 if (!m_GrimReaper) return FALSE;
00772
00773 pHash = new (EventNumberToName);
00774 if (!pHash) return FALSE;
00775
00776
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
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
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
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
00923 if (text)
00924 {
00925 TRACE(_T("Found text %d=%s"),EventNum,text);
00926 }
00927
00928 #endif
00929 return TRUE;
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948 void DialogEventHandler::DeInit()
00949 {
00950 ::wxYield();
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
00968 pHash->clear();
00969 delete (pHash);
00970 pHash=NULL;
00971 }
00972 }
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991 UINT32 DialogEventHandler::AddTimer(DialogOp * pDialogOp, UINT32 nIDEvent, UINT32 nElapse,
00992 void (* lpfnTimer)(void *) , void * param, BOOL OneShot)
00993 {
00994 DeleteTimer(nIDEvent);
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 }
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020 BOOL DialogEventHandler::DeleteTimer(UINT32 nIDEvent)
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 }