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
00101
00102 #include "camtypes.h"
00103
00104 #include "camelot.h"
00105 #include "camframe.h"
00106
00107
00108
00109
00110 #include "wrkrect.h"
00111
00112 #include "menuops.h"
00113 #include "qualops.h"
00114 #include "zoomops.h"
00115
00116 #include "speedtst.h"
00117 #include "oilmenus.h"
00118 #include "csrstack.h"
00119
00120 #include "blobby.h"
00121 #include "dbugtree.h"
00122 #include "stdbars.h"
00123 #include "rendwnd.h"
00124 #include "ccolbar.h"
00125 #include "dragmgr.h"
00126
00127
00128 #define new CAM_DEBUG_NEW
00129
00130 #if defined(USE_WXAUI)
00131
00132 class CamFrameManager : public wxAuiManager
00133 {
00134 private:
00135 DECLARE_CLASS( CamFrameManager )
00136
00137 public:
00138 CamFrameManager(wxFrame* frame = NULL, unsigned int flags = wxAUI_MGR_DEFAULT)
00139 : wxAuiManager(frame, flags)
00140 {
00141 }
00142
00143 void OnSize(wxSizeEvent &event)
00144 {
00145 if (GetMainFrame())
00146 GetMainFrame()->UpdateWndSize();
00147 event.Skip();
00148 }
00149
00150 void OnMove(wxMoveEvent &event)
00151 {
00152 if (GetMainFrame())
00153 GetMainFrame()->UpdateWndSize();
00154 event.Skip();
00155 }
00156
00157 void OnPaneClose(wxAuiManagerEvent& event)
00158 {
00159
00160
00161 wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
00162 wxWindow * pWindow = NULL;
00163 if (event.GetPane() && event.GetPane()->IsOk() )
00164 pWindow = event.GetPane()->window;
00165 if (pWindow && !pWindow->IsBeingDeleted())
00166 {
00167 cancelEvent.SetEventObject( pWindow );
00168 pWindow->GetEventHandler()->AddPendingEvent(cancelEvent);
00169 }
00170
00171 event.Veto();
00172 }
00173
00174 DECLARE_EVENT_TABLE()
00175 };
00176
00177 IMPLEMENT_CLASS( CamFrameManager, wxAuiManager )
00178 BEGIN_EVENT_TABLE( CamFrameManager, wxAuiManager )
00179 EVT_SIZE(CamFrameManager::OnSize)
00180 EVT_MOVE(CamFrameManager::OnMove)
00181 EVT_AUI_PANE_CLOSE(CamFrameManager::OnPaneClose)
00182 END_EVENT_TABLE()
00183
00184 #endif
00185
00186 CCamFrame *CCamFrame::m_pMainFrame = NULL;
00187
00188
00189
00190 IMPLEMENT_CLASS( CCamFrame, wxDocMDIParentFrame )
00191 BEGIN_EVENT_TABLE( CCamFrame, wxDocMDIParentFrame )
00192
00193 EVT_MENU_RANGE( AUTO_MENU_ID_MIN, AUTO_MENU_ID_MAX, CCamFrame::OnMenuCommand )
00194
00195 EVT_MENU( _R(DOCVIEW_ZOOMIN), CCamFrame::OnZoomIn )
00196 EVT_MENU( _R(DOCVIEW_ZOOMOUT), CCamFrame::OnZoomOut )
00197 EVT_MENU( _R(DOCVIEW_ZOOMDRAWING), CCamFrame::OnZoomDrawing )
00198 EVT_MENU( _R(DOCVIEW_ZOOMSPREAD), CCamFrame::OnZoomPage )
00199 EVT_MENU( _R(DOCVIEW_ZOOMPREVIOUS), CCamFrame::OnZoomPrevious )
00200 EVT_MENU( _R(DOCVIEW_QUALITYOUTLINE), CCamFrame::OnQualityOutline )
00201 EVT_MENU( _R(DOCVIEW_QUALITYSIMPLE), CCamFrame::OnQualitySimple )
00202 EVT_MENU( _R(DOCVIEW_QUALITYNORMAL), CCamFrame::OnQualityNormal )
00203 EVT_MENU( _R(DOCVIEW_QUALITYANTIALIASED), CCamFrame::OnQualityAntialiased )
00204 EVT_MENU( _R(DOCVIEW_BACKGROUNDRENDER), CCamFrame::OnBackgroundRender )
00205 EVT_MENU( _R(DOCVIEW_CACHING), CCamFrame::OnCaching )
00206 EVT_MENU( _R(DOCVIEW_DOUBLEBUFFER), CCamFrame::OnDoubleBuffer )
00207 EVT_MENU( _R(DOCVIEW_TIMEREDRAW), CCamFrame::OnTimeRedraw )
00208
00209 EVT_MENU( _R(DOCVIEW_BLOBBYDLG), CCamFrame::OnBlobbyDlg )
00210 EVT_MENU( _R(DOCVIEW_BLOBBYBAR), CCamFrame::OnBlobbyBar )
00211 EVT_MENU( _R(DEBUG_TREEVIEWDLG), CCamFrame::OnTreeView )
00212
00213
00214 EVT_MENU( _R(IDD_BUTTBAR_GENERAL), CCamFrame::OnStandardBar )
00215 EVT_MENU( _R(IDD_BUTTBAR_IMAGESETTING), CCamFrame::OnStandardBar )
00216 EVT_MENU( _R(IDD_BUTTBAR_WINDOW), CCamFrame::OnStandardBar )
00217 EVT_MENU( _R(IDD_BUTTBAR_ARRANGE), CCamFrame::OnStandardBar )
00218 EVT_MENU( _R(IDD_BUTTBAR_EDIT), CCamFrame::OnStandardBar )
00219 EVT_MENU( _R(IDD_BUTTBAR_FILE), CCamFrame::OnStandardBar )
00220 EVT_MENU( _R(IDD_BUTTBAR_GALLERIES), CCamFrame::OnStandardBar )
00221 EVT_MENU( _R(IDD_BUTTBAR_STANDARD), CCamFrame::OnStandardBar )
00222 EVT_MENU( _R(IDD_BUTTBAR_TOOLBAR), CCamFrame::OnStandardBar )
00223 EVT_MENU( _R(IDD_BUTTBAR_ANIMATION), CCamFrame::OnStandardBar )
00224 EVT_MENU( _R(IDD_BUTTBAR_FEATHER), CCamFrame::OnStandardBar )
00225 EVT_MENU( _R(IDD_BUTTBAR_STATUS), CCamFrame::OnStandardBar )
00226
00227 EVT_MENU_OPEN( CCamFrame::OnInitMenuPopup )
00228
00229 EVT_UPDATE_UI( _R(IDD_BUTTBAR_GENERAL), CCamFrame::OnUpdateStandardBar )
00230 EVT_UPDATE_UI( _R(IDD_BUTTBAR_IMAGESETTING), CCamFrame::OnUpdateStandardBar )
00231 EVT_UPDATE_UI( _R(IDD_BUTTBAR_WINDOW), CCamFrame::OnUpdateStandardBar )
00232 EVT_UPDATE_UI( _R(IDD_BUTTBAR_ARRANGE), CCamFrame::OnUpdateStandardBar )
00233 EVT_UPDATE_UI( _R(IDD_BUTTBAR_EDIT), CCamFrame::OnUpdateStandardBar )
00234 EVT_UPDATE_UI( _R(IDD_BUTTBAR_FILE), CCamFrame::OnUpdateStandardBar )
00235 EVT_UPDATE_UI( _R(IDD_BUTTBAR_GALLERIES), CCamFrame::OnUpdateStandardBar )
00236 EVT_UPDATE_UI( _R(IDD_BUTTBAR_STANDARD), CCamFrame::OnUpdateStandardBar )
00237 EVT_UPDATE_UI( _R(IDD_BUTTBAR_TOOLBAR), CCamFrame::OnUpdateStandardBar )
00238 EVT_UPDATE_UI( _R(IDD_BUTTBAR_ANIMATION), CCamFrame::OnUpdateStandardBar )
00239 EVT_UPDATE_UI( _R(IDD_BUTTBAR_FEATHER), CCamFrame::OnUpdateStandardBar )
00240 EVT_UPDATE_UI( _R(IDD_BUTTBAR_STATUS), CCamFrame::OnUpdateStandardBar )
00241
00242 EVT_UPDATE_UI( _R(DOCVIEW_ZOOMPREVIOUS), CCamFrame::OnUpdateZoomPrevious )
00243 EVT_UPDATE_UI( _R(DOCVIEW_QUALITYOUTLINE), CCamFrame::OnUpdateQualityOutline )
00244 EVT_UPDATE_UI( _R(DOCVIEW_QUALITYSIMPLE), CCamFrame::OnUpdateQualitySimple )
00245 EVT_UPDATE_UI( _R(DOCVIEW_QUALITYNORMAL), CCamFrame::OnUpdateQualityNormal )
00246 EVT_UPDATE_UI( _R(DOCVIEW_QUALITYANTIALIASED), CCamFrame::OnUpdateQualityAntialiased )
00247 EVT_UPDATE_UI( _R(DOCVIEW_BACKGROUNDRENDER), CCamFrame::OnUpdateBackgroundRender )
00248 EVT_UPDATE_UI( _R(DOCVIEW_CACHING), CCamFrame::OnUpdateCaching )
00249 EVT_UPDATE_UI( _R(DOCVIEW_DOUBLEBUFFER), CCamFrame::OnUpdateDoubleBuffer )
00250 #if !defined(USE_WXAUI)
00251 EVT_SIZE(CCamFrame::OnSize)
00252 EVT_MOVE(CCamFrame::OnMove)
00253 #endif
00254
00255 EVT_CLOSE(CCamFrame::OnCloseWindow)
00256 END_EVENT_TABLE()
00257
00258
00259
00260 CCamFrame::CCamFrame( wxDocManager *manager, wxFrame *frame, const wxString& title, const wxPoint& pos,
00261 const wxSize& size, long type ) :
00262 wxDocMDIParentFrame( manager, frame, wxID_ANY, title, pos, size, type, wxT("CCamFrame") ),
00263 m_ChangingViewMode( false )
00264 {
00265 wxASSERT( NULL == m_pMainFrame );
00266
00267 m_pMainFrame = this;
00268 m_editMenu = (wxMenu *)NULL;
00269
00270 #if defined(USE_WXAUI)
00271 m_pFrameManager = NULL;
00272 #endif
00273 m_pStatusBar = NULL;
00274
00275 Create( frame, wxID_ANY, title, pos, size, type );
00276
00277 wxBitmap bitmapTmp;
00278 CamResource::LoadwxBitmap( bitmapTmp, _T("camelot.png") );
00279 m_iconAppIcon.CopyFromBitmap( bitmapTmp );
00280 SetIcon( m_iconAppIcon );
00281 }
00282
00283
00284
00285 CCamFrame::~CCamFrame()
00286 {
00287 #if defined(USE_WXAUI)
00288 if (m_pFrameManager)
00289 {
00290 m_pFrameManager->UnInit();
00291 delete m_pFrameManager;
00292 }
00293 #endif
00294
00295 m_pMainFrame = NULL;
00296 }
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306 #if 0
00307 static bool BuildImageList( std::vector<wxBitmap> &lstImage, const TCHAR * str, unsigned cPx = 0 )
00308 {
00309 wxImage imageStandard;
00310 CamResource::LoadwxImage(imageStandard, str );
00311
00312 if( !imageStandard.Ok() )
00313 return false;
00314
00315 unsigned cpxWidth = imageStandard.GetWidth();
00316 unsigned cpxHeight = imageStandard.GetHeight();
00317
00318
00319 INT32 ord = 0;
00320 if( 0 == cPx )
00321 {
00322 for( cPx = 1; cPx < cpxWidth; ++cPx )
00323 {
00324 if( 0 != imageStandard.GetAlpha( cPx, 1 ) )
00325 break;
00326 }
00327 ++cPx;
00328
00329 ++ord;
00330 }
00331
00332
00333 INT32 cImage = cpxWidth / cPx;
00334 for( ; ord < cImage; ++ord )
00335 {
00336 wxImage image( imageStandard.GetSubImage( wxRect( ord * cPx, 0, cPx, cpxHeight ) ) );
00337
00338
00339 image.SetAlpha( NULL, false );
00340 wxByte *pSrc = imageStandard.GetAlpha() + ( ord * cPx );
00341 wxByte *pDst = image.GetAlpha();
00342
00343 for( unsigned posY = 0; posY < cpxHeight; ++posY, pSrc += cpxWidth, pDst += cPx )
00344 {
00345 memcpy( pDst, pSrc, cPx );
00346 }
00347
00348 lstImage.push_back( image );
00349 }
00350
00351 return true;
00352 }
00353 #endif
00354
00355
00356
00357 bool CCamFrame::Create( wxWindow *pParent, wxWindowID id, const wxString &caption, const wxPoint &pos,
00358 const wxSize &size, long style )
00359 {
00360 #if defined(USE_WXAUI)
00361 m_pFrameManager = new CamFrameManager;
00362 if (!m_pFrameManager) return FALSE;
00363 m_pFrameManager->SetManagedWindow(this);
00364
00365 m_pFrameManager->SetFlags(m_pFrameManager->GetFlags() |
00366 wxAUI_MGR_ALLOW_FLOATING
00367 #if defined(__WXMSW__)
00368 | wxAUI_MGR_TRANSPARENT_DRAG | wxAUI_MGR_TRANSPARENT_HINT | wxAUI_MGR_TRANSPARENT_HINT_FADE
00369 #endif
00370 );
00371 #endif
00372 return TRUE;
00373 }
00374
00375 BOOL CCamFrame::CreateToolbars()
00376 {
00377 #if 0
00378
00379 m_pStatusBar = CreateStatusBar();
00380 String_256 strStatus( _R(IDS_NO_OBJECTS_SEL) );
00381 m_pStatusBar->SetStatusText( strStatus );
00382 #endif
00383
00384 CColourBar* pColourBar = new CColourBar();
00385 if (pColourBar)
00386 {
00387 pColourBar->Create(this, 12345);
00388
00389 wxAuiPaneInfo paneinfo;
00390 paneinfo.BottomDockable().Bottom();
00391 paneinfo.CaptionVisible(false);
00392 m_pFrameManager->AddPane(pColourBar, paneinfo);
00393
00394 m_pFrameManager->Update();
00395 }
00396
00397
00398 #if defined(__WXMSW__)
00399 if( wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32 )
00400 {
00401 wxSystemOptions::SetOption( wxT("msw.remap"), 2 );
00402 }
00403 #endif
00404
00405 wxCommandEvent sbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STANDARD));
00406 OnStandardBar(sbe);
00407
00408 wxCommandEvent tbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_TOOLBAR));
00409 OnStandardBar(tbe);
00410
00411 wxCommandEvent sbbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STATUS));
00412 OnStandardBar(sbbe);
00413
00414
00415
00416
00417 return TRUE;
00418 }
00419
00420 void CCamFrame::UpdateFrameManager()
00421 {
00422 #if defined(USE_WXAUI)
00423 if (m_pFrameManager)
00424 m_pFrameManager->Update();
00425 #endif
00426 }
00427
00428
00429
00430 bool CCamFrame::Destroy()
00431 {
00432
00433
00434 Document::SetNoCurrent();
00435 DocView::SetNoCurrent();
00436
00437
00438
00439
00440
00441 bool bMin = IsIconized();
00442 bool bMax = IsMaximized();
00443 wxSize ScreenSize = wxGetDisplaySize();
00444 CCamApp::MainWndPosString._MakeMsg(
00445 _T("#1%d #2%d #3%d #4%d #5%d #6%d"),
00446 m_WndRect.x,
00447 m_WndRect.y,
00448 m_WndRect.width,
00449 m_WndRect.height,
00450 ScreenSize.x,
00451 ScreenSize.y
00452 );
00453 CCamApp::MainWndMaximized = bMax ? TRUE : FALSE;
00454 CCamApp::MainWndMinimized = bMin ? TRUE : FALSE;
00455
00456 PORTNOTE("other","Removed WindowPlacement saving")
00457 #if !defined(EXCLUDE_FROM_XARALX)
00458 #ifndef EXCLUDE_FROM_RALPH
00459
00460 WINDOWPLACEMENT wPlace;
00461 wPlace.length = sizeof(WINDOWPLACEMENT);
00462 if (GetWindowPlacement( &wPlace ))
00463 {
00464
00465
00466 if (FullScreenMode)
00467 {
00468 wPlace = NormalModePlace;
00469 }
00470
00471 CCamApp::MainWndPosString._MakeMsg(
00472 "#1%d #2%d #3%d #4%d #5%d #6%d",
00473 wPlace.rcNormalPosition.left,
00474 wPlace.rcNormalPosition.top,
00475 wPlace.rcNormalPosition.right - wPlace.rcNormalPosition.left,
00476 wPlace.rcNormalPosition.bottom - wPlace.rcNormalPosition.top,
00477 GetSystemMetrics( SM_CXSCREEN ),
00478 GetSystemMetrics( SM_CYSCREEN )
00479 );
00480 CCamApp::MainWndMaximized = (wPlace.showCmd == SW_SHOWMAXIMIZED) ? TRUE : FALSE;
00481 CCamApp::MainWndMinimized = (wPlace.showCmd == SW_SHOWMINIMIZED) ? TRUE : FALSE;
00482 }
00483 else
00484 {
00485 CCamApp::MainWndPosString = "";
00486 CCamApp::MainWndMaximized = FALSE;
00487 CCamApp::MainWndMinimized = FALSE;
00488
00489 }
00490 #endif // EXCLUDE_FROM_RALPH
00491 #endif
00492
00493
00494
00495
00496 Tool::DeinitTools();
00497
00498
00499 BROADCAST_TO_ALL(DeathMsg());
00500
00501 PORTNOTE("other","Removed ExternalClipboard usage")
00502 #if !defined(EXCLUDE_FROM_XARALX)
00503 #ifndef EXCLUDE_FROM_RALPH
00504
00505 ChangeClipboardChain(NextClipboardViewer);
00506 #endif
00507 #endif
00508
00509 return wxDocMDIParentFrame::Destroy();
00510 }
00511
00512
00513
00514 CCamFrame *GetMainFrame(void)
00515 {
00516 return CCamFrame::m_pMainFrame;
00517 }
00518
00519
00520
00521 void CCamFrame::UpdateWndSize()
00522 {
00523 if (!IsIconized() && !IsMaximized())
00524 {
00525 m_WndRect = GetRect();
00526 }
00527 }
00528
00529
00530 #if !defined(USE_WXAUI)
00531 void CCamFrame::OnSize(wxSizeEvent &event)
00532 {
00533
00534 if (!IsIconized() && !IsMaximized())
00535 m_WndRect = GetRect();
00536
00537
00538
00539
00540 }
00541
00542 void CCamFrame::OnMove(wxMoveEvent &event)
00543 {
00544
00545 if (!IsIconized() && !IsMaximized())
00546 m_WndRect = GetRect();
00547
00548
00549 event.Skip();
00550 }
00551
00552 #endif
00553
00554 void CCamFrame::OnCloseWindow(wxCloseEvent& event)
00555 {
00556 Camelot.ShuttingDown(TRUE);
00557
00558 if (m_docManager->Clear(!event.CanVeto()))
00559 {
00560 PORTNOTE("other","Removed ExternalClipboard usage")
00561 #if !defined(EXCLUDE_FROM_XARALX)
00562
00563
00564 ExternalClipboard::PrepareForShutdown();
00565 #endif
00566
00567
00568
00569 DialogManager::DeInit();
00570
00571 this->Destroy();
00572 }
00573 else
00574 {
00575
00576 Camelot.ShuttingDown(FALSE);
00577
00578 event.Veto();
00579 }
00580 }
00581
00582
00583
00584
00585
00586 void CCamFrame::OnMenuCommand( wxCommandEvent& event )
00587 {
00588
00589
00590
00591 Document::GetSelected()->SetCurrent();
00592 DocView::GetSelected()->SetCurrent();
00593
00594 #if !defined(EXCLUDE_FROM_XARALX)
00595 #if (_OLE_VER < 0x200) && (_MSVC_VER < 0x300)
00596 if (COleClientItem::InWaitForRelease())
00597 {
00598 AfxMessageBox(_R(IDP_BUSY));
00599 return TRUE;
00600 }
00601 #endif
00602 #endif
00603
00604
00605 if( IsMenuCommand( event ) )
00606 {
00607 if( PerformMenuCommand( event ) )
00608 return;
00609 }
00610
00611 #if !defined(EXCLUDE_FROM_XARALX)
00612
00613 if (LOWORD(wParam) == _R(ID_HELP))
00614 {
00615
00616 if (HIWORD(wParam))
00617 {
00618 TRACEUSER( "Marc", _T("Processing _R(ID_HELP): wParam = 0x%lX, lParam = 0x%lX\n"),
00619 (UINT32) wParam, (UINT32) lParam);
00620 return TRUE;
00621 }
00622
00623
00624 if (MenuBeingTracked != NULL)
00625 {
00626 OpDescriptor* pOpDesc = MenuBeingTracked->GetOpDescriptor();
00627 ERROR3IF(pOpDesc == NULL, "Null OpDescriptor* in CMainFrame::OnCommand");
00628 if (pOpDesc != NULL) HelpUser(*pOpDesc);
00629
00630
00631
00632
00633 SendMessage(WM_CANCELMODE);
00634 return TRUE;
00635 }
00636 }
00637 #endif
00638
00639
00640 event.Skip();
00641 }
00642
00643
00644
00645
00646
00647
00648
00649
00650 void CCamFrame::OnZoomIn( wxCommandEvent& WXUNUSED(event) )
00651 {
00652 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpZoomIn));
00653 if ( pOpDesc )
00654 pOpDesc->Invoke();
00655 }
00656
00657 void CCamFrame::OnZoomOut( wxCommandEvent& WXUNUSED(event) )
00658 {
00659 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpZoomOut));
00660 if ( pOpDesc )
00661 pOpDesc->Invoke();
00662 }
00663
00664 void CCamFrame::OnZoomDrawing( wxCommandEvent& WXUNUSED(event) )
00665 {
00666 OpZoomDescriptor::FakeInvoke(OPTOKEN_ZOOMDRAWING);
00667 }
00668
00669 void CCamFrame::OnZoomPage( wxCommandEvent& WXUNUSED(event) )
00670 {
00671 OpZoomDescriptor::FakeInvoke(OPTOKEN_ZOOMSPREAD);
00672 }
00673
00674 void CCamFrame::OnZoomPrevious( wxCommandEvent& WXUNUSED(event) )
00675 {
00676 OpZoomDescriptor::FakeInvoke(OPTOKEN_ZOOMPREV);
00677 }
00678
00679 void CCamFrame::OnUpdateZoomPrevious( wxUpdateUIEvent& event )
00680 {
00681 OpZoomDescriptor* pOpDesc = (OpZoomDescriptor*)OpZoomDescriptor::FindOpDescriptor(OPTOKEN_ZOOMPREV);
00682 event.Enable(pOpDesc && pOpDesc->IsAvailable());
00683
00684 }
00685
00686
00687
00688
00689
00690
00691
00692 void CCamFrame::OnQualityOutline( wxCommandEvent& WXUNUSED(event) )
00693 {
00694 Document::GetSelected()->SetCurrent();
00695 DocView::GetSelected()->SetCurrent();
00696 OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYOUTLINE );
00697 if ( pOpDesc )
00698 pOpDesc->Invoke();
00699 }
00700
00701 void CCamFrame::OnQualitySimple( wxCommandEvent& WXUNUSED(event) )
00702 {
00703 Document::GetSelected()->SetCurrent();
00704 DocView::GetSelected()->SetCurrent();
00705 OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYSIMPLE );
00706 if ( pOpDesc )
00707 pOpDesc->Invoke();
00708 }
00709
00710 void CCamFrame::OnQualityNormal( wxCommandEvent& WXUNUSED(event) )
00711 {
00712 Document::GetSelected()->SetCurrent();
00713 DocView::GetSelected()->SetCurrent();
00714 OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYNORMAL );
00715 if ( pOpDesc )
00716 pOpDesc->Invoke();
00717 }
00718
00719 void CCamFrame::OnQualityAntialiased( wxCommandEvent& WXUNUSED(event) )
00720 {
00721 Document::GetSelected()->SetCurrent();
00722 DocView::GetSelected()->SetCurrent();
00723 OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYANTIALIASED );
00724 if ( pOpDesc )
00725 pOpDesc->Invoke();
00726 }
00727
00728 void CCamFrame::OnUpdateQualitySimple( wxUpdateUIEvent& event )
00729 {
00730 const DocView *pDocView = DocView::GetSelected();
00731 event.Check(pDocView && pDocView->RenderQuality.GetQuality()==QUALITY_LEVEL_SIMPLE);
00732 }
00733
00734 void CCamFrame::OnUpdateQualityOutline( wxUpdateUIEvent& event )
00735 {
00736 const DocView *pDocView = DocView::GetSelected();
00737 event.Check(pDocView && pDocView->RenderQuality.GetQuality()==QUALITY_LEVEL_OUTLINE);
00738 }
00739
00740 void CCamFrame::OnUpdateQualityNormal( wxUpdateUIEvent& event )
00741 {
00742 const DocView *pDocView = DocView::GetSelected();
00743 event.Check(pDocView && pDocView->RenderQuality.GetQuality()==QUALITY_LEVEL_NORMAL);
00744 }
00745
00746 void CCamFrame::OnUpdateQualityAntialiased( wxUpdateUIEvent& event )
00747 {
00748 const DocView *pDocView = DocView::GetSelected();
00749 event.Check(pDocView && pDocView->RenderQuality.GetQuality()==QUALITY_LEVEL_ANTI);
00750 }
00751
00752
00753
00754
00755
00756
00757
00758 void CCamFrame::OnBackgroundRender( wxCommandEvent& WXUNUSED(event) )
00759 {
00760 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpToggleFore));
00761 if ( pOpDesc )
00762 pOpDesc->Invoke();
00763 }
00764
00765 void CCamFrame::OnUpdateBackgroundRender( wxUpdateUIEvent& event )
00766 {
00767 event.Check(FALSE != OpToggleFore::GetState(NULL,NULL).Ticked);
00768 }
00769
00770
00771
00772
00773
00774
00775
00776 void CCamFrame::OnCaching( wxCommandEvent& WXUNUSED(event) )
00777 {
00778 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpClearCache));
00779 if ( pOpDesc )
00780 pOpDesc->Invoke();
00781 }
00782
00783 void CCamFrame::OnUpdateCaching( wxUpdateUIEvent& event )
00784 {
00785 event.Check(FALSE != OpClearCache::GetState(NULL,NULL).Ticked);
00786 }
00787
00788
00789 void CCamFrame::OnDoubleBuffer( wxCommandEvent& event )
00790 {
00791 CRenderWnd::SetDoubleBuffer(event.IsChecked());
00792 }
00793
00794 void CCamFrame::OnUpdateDoubleBuffer( wxUpdateUIEvent& event )
00795 {
00796 event.Check(FALSE != CRenderWnd::GetDoubleBuffer());
00797 }
00798
00799
00800
00801
00802
00803
00804
00805
00806 void CCamFrame::OnTimeRedraw( wxCommandEvent& WXUNUSED(event) )
00807 {
00808 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpTimeDraw));
00809 if ( pOpDesc )
00810 pOpDesc->Invoke();
00811 }
00812
00813
00814
00815
00816
00817
00818
00819
00820 void CCamFrame::OnBlobbyDlg( wxCommandEvent& WXUNUSED(event) )
00821 {
00822 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(BlobbyDlg));
00823 if ( pOpDesc )
00824 pOpDesc->Invoke();
00825 }
00826
00827 void CCamFrame::OnBlobbyBar( wxCommandEvent& WXUNUSED(event) )
00828 {
00829 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(BlobbyBar));
00830 if ( pOpDesc )
00831 pOpDesc->Invoke();
00832 }
00833
00834 void CCamFrame::OnTreeView( wxCommandEvent& WXUNUSED(event) )
00835 {
00836
00837 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_DEBUGTREEDLG);
00838 if ( pOpDesc )
00839 pOpDesc->Invoke();
00840 }
00841
00842 void CCamFrame::OnStandardBar( wxCommandEvent& event)
00843 {
00844
00845
00846 ResourceID r = (ResourceID)(event.GetId());
00847
00848 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor((TCHAR *)(CamResource::GetObjectName(r)));
00849
00850
00851 pOpDesc->Invoke();
00852 }
00853
00854 void CCamFrame::OnInitMenuPopup( wxMenuEvent& event )
00855 {
00856
00857
00858
00859 Document::GetSelected()->SetCurrent();
00860 DocView::GetSelected()->SetCurrent();
00861
00862 wxSetCursor( *wxSTANDARD_CURSOR );
00863
00864 PORTNOTE( "other", "Removed usage of bSysMent from OnInitMenuPopup" )
00865 #if !defined(EXCLUDE_FROM_XARALX)
00866 if (bSysMenu)
00867 {
00868 CMDIFrameWnd::OnInitMenuPopup(pMenu, n, bSysMenu);
00869
00870 if(FullScreenMode)
00871 {
00872 pMenu->EnableMenuItem(SC_MOVE,MF_GRAYED);
00873 pMenu->EnableMenuItem(SC_SIZE,MF_GRAYED);
00874 pMenu->EnableMenuItem(SC_MAXIMIZE,MF_GRAYED);
00875 }
00876 }
00877 else
00878 #endif
00879 if( !UpdateMenu( event.GetMenu() ) )
00880 event.Skip();
00881 }
00882
00883
00884 void CCamFrame::OnUpdateStandardBar( wxUpdateUIEvent& event)
00885 {
00886
00887
00888 ResourceID r = (ResourceID)(event.GetId());
00889
00890 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor((TCHAR *)(CamResource::GetObjectName(r)));
00891
00892
00893 OpParam Param((INT32)r, (INT32)0);
00894 String_256 disable;
00895 OpState opst;
00896 if ( pOpDesc) opst = pOpDesc->GetOpsState(&disable,&Param);
00897 event.Enable(pOpDesc && !opst.Greyed);
00898 event.Check(FALSE != opst.Ticked);
00899 }
00900
00901
00902
00903
00904
00905
00906
00907
00908