menucmds.cpp

Go to the documentation of this file.
00001 // $Id: menucmds.cpp 1739 2006-09-05 11:07:16Z luke $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 /********************************************************************************************
00100 
00101     menucmds.cpp - This module provides a set of menu command functions which are called from
00102     OIL Menu Module when an appropriate menu item is selected. 
00103 
00104 ********************************************************************************************/
00105 
00106 
00107 #include "camtypes.h" 
00108 //#include <afxext.h>
00109 
00110 #include <wx/mediactrl.h>
00111 
00112 #include "menucmds.h"
00113 #include "camelot.h"
00114 #include "camframe.h"
00115 #include "camdoc.h"
00116 //#include "camvw.h"
00117 //#include "ensure.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00118 #include "printing.h"
00119 #include "helpuser.h"
00120 #include "menuops.h"
00121 //#include "docview.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00122 //#include "bars.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00123 #include "camview.h"
00124 //#ifdef WEBSTER
00125 //#include "ollie.h"
00126 //#include "resource.h"
00127 //#include "simon.h"
00128 //#include "registry.h"
00129 #include "product.h"
00130 //#include "resimmap.h"
00131 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00132 #include "fileutil.h"
00133 #include "sgliboil.h"
00134 //#endif //webster
00135 //#include "group.h"            // for management of blend stuff - in camtypes.h [AUTOMATICALLY REMOVED]
00136 #include "rechblnd.h"       // so that can reset blend pointers
00137 //#include "urls.h"
00138 #include "filedlgs.h"
00139 #include "tmplmngr.h"
00140 
00141 DECLARE_SOURCE("$Revision: 1739 $");  
00142 #define THIRTY_TWO 32
00143 
00144 /********************************************************************************************
00145 
00146 >   void ExitAction();  
00147 
00148     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00149     Created:    8/7/93
00150     Inputs:     None
00151     Outputs:    None
00152     Returns:    None
00153     Purpose:    Performs Exit application menu function.
00154     Errors:     None
00155     SeeAlso:    MenuCmds
00156     SeeAlso:    SetupDefaultMenu()
00157     SeeAlso:    SetupSharedMenu()
00158     SeeAlso:    State()
00159 
00160 ********************************************************************************************/
00161 /*
00162 Technical Notes:
00163     The AfxGetApp() function is used to obtain the currently active application object.This
00164     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00165     can be used.
00166 ********************************************************************************************/
00167 
00168 void ExitAction() 
00169 {               
00170     AfxGetApp().OnAppExit();
00171 }
00172  
00173  
00174 /********************************************************************************************
00175 
00176 >   void FileNewAction();   
00177 
00178     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00179     Created:    8/7/93
00180     Inputs:     None
00181     Outputs:    None
00182     Returns:    None
00183     Purpose:    Performs New File menu function on the File menu.
00184     Errors:     None
00185     SeeAlso:    MenuCmds
00186     SeeAlso:    SetupDefaultMenu()
00187     SeeAlso:    SetupSharedMenu()
00188 
00189 ********************************************************************************************/
00190 /*
00191 Technical Notes:
00192     The AfxGetApp() function is used to obtain the currently active application object.This
00193     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00194     can be used.
00195 ********************************************************************************************/
00196 
00197 void FileNewAction() 
00198 {               
00199     //First tell the document system that the next template to use is the
00200     //default animation template
00201     CCamDoc::SetNextTemplateToUse( CTemplateManager::GetDefaultDrawingTemplate() );
00202 
00203     // OnFileOpen needs an event, but doesn't use it
00204     wxCommandEvent event;
00205     AfxGetApp().GetDocumentManager()->OnFileNew( event );
00206 
00207     CCamDoc::EnableRemoveUntouchedDocs();       // Next idle event will try ro get rid of 
00208                                                 // the auto-created startup document
00209 }
00210 
00211 /********************************************************************************************
00212 
00213 >   void FileNewAnimationAction();  
00214 
00215     Author:     Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
00216     Created:    21/10/97
00217     Inputs:     -
00218     Outputs:    -
00219     Returns:    -
00220     Purpose:    Opens the animation template
00221     Errors:     -
00222     SeeAlso:    MenuCmds
00223 
00224 ********************************************************************************************/
00225 
00226 void FileNewAnimationAction() 
00227 {               
00228     //First tell the document system that the next template to use is the
00229     //default animation template
00230     CCamDoc::SetNextTemplateToUse( CTemplateManager::GetDefaultAnimationTemplate() );
00231 
00232 PORTNOTETRACE("other", "FileNewAnimationAction does nothing");
00233 #if !defined(EXCLUDE_FROM_XARALX)
00234     AfxGetApp().OnFileNew();
00235 #endif
00236 
00237     CCamDoc::EnableRemoveUntouchedDocs();       // Next idle event will try ro get rid of 
00238                                                 // the auto-created startup document
00239 }
00240 
00241 /********************************************************************************************
00242 
00243 >   void FileNewTemplateAction(INT32 iNumberOfTemplate) 
00244 
00245     Author:     Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
00246     Created:    21/10/97
00247     Inputs:     -
00248     Outputs:    -
00249     Returns:    -
00250     Purpose:    Opens the specified template
00251     Errors:     -
00252     SeeAlso:    MenuCmds
00253 
00254 ********************************************************************************************/
00255 
00256 void FileNewTemplateAction(INT32 iNumberOfTemplate) 
00257 {               
00258     //First find the default template path
00259     CTemplateManager&   TemplateManager = GetApplication()->GetTemplateManager();
00260     String_256          strPathOfFile;
00261     if( !TemplateManager.GetTemplateFilename( iNumberOfTemplate, &strPathOfFile ) )
00262         return;
00263 
00264     TRACEUSER( "jlh92", _T("Opening %s\n"), PCTSTR(strPathOfFile) );
00265 
00266     CCamDoc::SetNextTemplateToUse( strPathOfFile );
00267 
00268     // OnFileOpen needs an event, but doesn't use it
00269     wxCommandEvent event;
00270     AfxGetApp().GetDocumentManager()->OnFileNew( event );
00271 
00272     CCamDoc::EnableRemoveUntouchedDocs();       // Next idle event will try ro get rid of 
00273                                                 // the auto-created startup document
00274 }
00275 
00276 
00277  
00278 /********************************************************************************************
00279 
00280 >   void FileOpenAction();  
00281 
00282     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00283     Created:    8/7/93
00284     Inputs:     None
00285     Outputs:    None
00286     Returns:    None
00287     Purpose:    Performs File Open menu function on the File menu.
00288     Errors:     None
00289     SeeAlso:    MenuCmds
00290     SeeAlso:    SetupDefaultMenu()
00291     SeeAlso:    SetupSharedMenu()
00292 
00293 ********************************************************************************************/
00294 /*
00295 Technical Notes:
00296     The AfxGetApp() function is used to obtain the currently active application object.This
00297     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00298     can be used.
00299 ********************************************************************************************/
00300 
00301 void FileOpenAction() 
00302 {
00303     // OnFileOpen needs an event, but doesn't use it
00304     wxCommandEvent      event;
00305 //  AfxGetApp().GetDocumentManager()->SetLastDirectory(BaseFileDialog::DefaultOpenFilePath);
00306 //  AfxGetApp().GetDocumentManager()->OnFileOpen( event );
00307     AfxGetApp().OnFileOpen();
00308     CCamDoc::EnableRemoveUntouchedDocs();       // Next idle event will try ro get rid of 
00309                                                 // the auto-created startup document
00310 }
00311  
00312 /********************************************************************************************
00313 
00314 >   void FileCloseAction();     
00315 
00316     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00317     Created:    8/7/93
00318     Inputs:     None
00319     Outputs:    None
00320     Returns:    None
00321     Purpose:    Performs File Close menu function on the File menu.
00322     Errors:     None
00323     SeeAlso:    MenuCmds
00324     SeeAlso:    SetupDefaultMenu()
00325     SeeAlso:    SetupSharedMenu()
00326 
00327 ********************************************************************************************/
00328 /*
00329 Technical Notes:
00330     The AfxGetApp() function is used to obtain the currently active application object. The 
00331     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00332     window of the current application object. The MDIGetActive() function is a member func-
00333     tion of the CMDIFrameWnd class and is used to get the currently active child window. 
00334     From the Child window the GetActiveDocument() function will obtain the currently active
00335     document. The OnFileClose() function is then applied to the currently active document 
00336     which is incidently cast to a Camelot Document before this call made.
00337 ********************************************************************************************/
00338 
00339 void FileCloseAction() 
00340 {               
00341     // CGS:  we need to clear out all intermediate blend steps ....
00342     // NOTE:  this clears out all 'built-up' intermediate data
00343     // it clears out the becomea stuff
00344 
00345     NodeGroup::KillAllBlendBecomeAConsLists ();
00346 
00347     // CGS:  these pointers MUST be reset! ....
00348         
00349     BlendRecordHandler::SetLastInsertedNodeBlender (NULL);
00350     BlendRecordHandler::SetLastInsertedNodeBlend (NULL);
00351     BlendRecordHandler::SetLastInsertedNodeBlendPath (NULL);
00352     
00353     // OnFileClose needs an event, but doesn't use it
00354     wxCommandEvent      event;
00355     AfxGetApp().GetDocumentManager()->OnFileClose( event );
00356 }
00357  
00358 /********************************************************************************************
00359 
00360 >   void FileSaveAction();  
00361 
00362     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00363     Created:    8/7/93
00364     Inputs:     None
00365     Outputs:    None
00366     Returns:    None
00367     Purpose:    Performs File Save menu function on the File menu.
00368     Errors:     None
00369     SeeAlso:    MenuCmds
00370     SeeAlso:    SetupDefaultMenu()
00371     SeeAlso:    SetupSharedMenu()
00372 
00373 ********************************************************************************************/
00374 /*
00375 Technical Notes:
00376     The AfxGetApp() function is used to obtain the currently active application object. The 
00377     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00378     window of the current application object. The MDIGetActive() function is a member func-
00379     tion of the CMDIFrameWnd class and is used to get the currently active child window. 
00380     From the Child window the GetActiveDocument() function will obtain the currently active
00381     document. The OnFileSave() function is then applied to the currently active document 
00382     which is incidently cast to a Camelot Document before this call made.
00383 ********************************************************************************************/
00384 
00385 void FileSaveAction() 
00386 {               
00387     wxCommandEvent      event;
00388 //  AfxGetApp().GetDocumentManager()->SetLastDirectory(BaseFileDialog::DefaultSaveFilePath);
00389     AfxGetApp().GetDocumentManager()->OnFileSave( event );
00390 }
00391  
00392 /********************************************************************************************
00393 
00394 >   void FileSaveAsAction();    
00395 
00396     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00397     Created:    8/7/93
00398     Inputs:     None
00399     Outputs:    None
00400     Returns:    None
00401     Purpose:    Performs File SaveAs menu function on the File menu.
00402     Errors:     None
00403     SeeAlso:    MenuCmds
00404     SeeAlso:    SetupDefaultMenu()
00405     SeeAlso:    SetupSharedMenu()
00406 
00407 ********************************************************************************************/
00408 /*
00409 Technical Notes:
00410     The AfxGetApp() function is used to obtain the currently active application object. The 
00411     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00412     window of the current application object. The MDIGetActive() function is a member func-
00413     tion of the CMDIFrameWnd class and is used to get the currently active child window. 
00414     From the Child window the GetActiveDocument() function will obtain the currently active
00415     document. The OnFileSaveAs() function is then applied to the currently active document 
00416     which is incidently cast to a Camelot Document before this call made.
00417 ********************************************************************************************/
00418 
00419 void FileSaveAsAction() 
00420 {               
00421 //  AfxGetApp().GetDocumentManager()->SetLastDirectory(BaseFileDialog::DefaultSaveFilePath);
00422 
00423     // Don't call wxDocManager::OnFileSaveAs because that calls wxDocument non-virtual functions
00424     // We need to ensure our pointer is cast to a CCamDoc*
00425     // Note also that GetCurrentDocument doesn't mean "Current" in the way that the Kernel defines it!!!
00426     //  (It means "Active"...)
00427 //  wxCommandEvent      event;
00428 //  AfxGetApp().GetDocumentManager()->OnFileSaveAs( event );
00429 
00430     wxDocument* pDoc = AfxGetApp().GetDocumentManager()->GetCurrentDocument();
00431     if (pDoc && pDoc->IsKindOf(CLASSINFO(CCamDoc)))
00432         ((CCamDoc*)pDoc)->SaveAs();
00433 }
00434 
00435 
00436 /********************************************************************************************
00437 
00438 >   void FileSaveAllAction()
00439 
00440     Author:     Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
00441     Created:    20/7/95
00442     Purpose:    Performs the File Save All Action in a Kernel / oil compliant way
00443 
00444 ********************************************************************************************/
00445 
00446 void FileSaveAllAction()
00447 {
00448     // We do not want to call our version of this function as for some reason
00449     // it also shuts down the dialog manager...
00450 PORTNOTETRACE("other", "FileSaveAllAction does nothing");
00451 #if !defined(EXCLUDE_FROM_XARALX)
00452     ((CCamApp*)AfxGetApp())->RealSaveAll();
00453 #endif
00454 }
00455 
00456 
00457 /********************************************************************************************
00458 
00459 >   void PrintSetupAction();    
00460 
00461     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00462     Created:    8/7/93
00463     Inputs:     None
00464     Outputs:    None
00465     Returns:    None
00466     Purpose:    Performs Printer Setup menu function on the File menu.
00467     Errors:     None
00468     SeeAlso:    MenuCmds
00469     SeeAlso:    SetupDefaultMenu()
00470     SeeAlso:    SetupSharedMenu()
00471 
00472 ********************************************************************************************/
00473 /*
00474 Technical Notes:
00475     The AfxGetApp() function is used to obtain the currently active application object.This
00476     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00477     can be used.
00478 ********************************************************************************************/
00479 //  WEBSTER-ranbirr-12/11/96
00480 #ifndef WEBSTER
00481 void PrintSetupAction() 
00482 {               
00483     AfxGetApp().OnFilePrintSetup();
00484 }
00485 #endif //webster
00486 /********************************************************************************************
00487 
00488 >   void PrintAction()
00489 
00490     Author:     Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
00491     Created:    16/7/93
00492     Inputs:     None
00493     Outputs:    void for handled or not
00494     Returns:    None
00495     Purpose:    Stop MFC menu items from doing things that don't work (e.g. Print). For
00496                 now calls the Print operation (which ENSURE's).
00497     Errors:     None
00498 
00499 ********************************************************************************************/
00500 /*
00501 Technical Notes:
00502     The AfxGetApp() function is used to obtain the currently active application object. The 
00503     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00504     window of the current application object. The MDIGetActive() function is a member func-
00505     tion of the CMDIFrameWnd class and is used to get the currently active child window. 
00506     From the Child window the GetActiveView() function will obtain the currently active
00507     view. The OnFilePrint() function is then applied to the currently active view 
00508     which is incidently cast to a Camelot View before this call made.
00509 ********************************************************************************************/
00510 //  WEBSTER-ranbirr-12/11/96
00511 #ifndef WEBSTER
00512 void PrintAction() 
00513 {               
00514 #if !defined(STANDALONE)
00515     wxView * pView = AfxGetApp().GetDocumentManager()->GetCurrentView();
00516     if (pView && pView->IsKindOf(CLASSINFO(CCamView)))
00517         ((CCamView*)pView)->OnFilePrint();
00518 
00519 #endif
00520 }
00521 #endif //webster
00522 /********************************************************************************************
00523 
00524 >   void PrintPreviewAction();  
00525 
00526     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00527     Created:    8/7/93
00528     Inputs:     None
00529     Outputs:    None
00530     Returns:    None
00531     Purpose:    Performs File Print Preview menu function on the File menu.
00532     Errors:     None
00533     SeeAlso:    MenuCmds
00534     SeeAlso:    SetupDefaultMenu()
00535     SeeAlso:    SetupSharedMenu()
00536 
00537 ********************************************************************************************/
00538 /*
00539 Technical Notes:
00540     The AfxGetApp() function is used to obtain the currently active application object. The 
00541     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00542     window of the current application object. The MDIGetActive() function is a member func-
00543     tion of the CMDIFrameWnd class and is used to get the currently active child window. 
00544     From the Child window the GetActiveView() function will obtain the currently active
00545     view. The OnFilePrintPreview() function is then applied to the currently active view 
00546     which is incidently cast to a Camelot View before this call made.
00547 ********************************************************************************************/
00548 
00549 void PrintPreviewAction() 
00550 {               
00551     wxView * pView = AfxGetApp().GetDocumentManager()->GetCurrentView();
00552     if (pView && pView->IsKindOf(CLASSINFO(CCamView)))
00553         ((CCamView*)pView)->OnFilePrintPreview();
00554 }
00555  
00556 /********************************************************************************************
00557 
00558 >   void WindowNewAction();     
00559 
00560     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00561     Created:    8/7/93
00562     Inputs:     None
00563     Outputs:    None
00564     Returns:    None
00565     Purpose:    Performs New Window menu function on the Window menu.
00566     Errors:     None
00567     SeeAlso:    MenuCmds
00568     SeeAlso:    SetupDefaultMenu()
00569     SeeAlso:    SetupSharedMenu()
00570 
00571 ********************************************************************************************/
00572 /*
00573 Technical Notes:
00574     The AfxGetApp() function is used to obtain the currently active application object. The 
00575     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00576     window of the current application object. The OnWindowNew() function is then applied to 
00577     the mainframe window of the currently active application.
00578 ********************************************************************************************/
00579 
00580 void WindowNewAction() 
00581 {               
00582 PORTNOTETRACE("other", "WindowNewAction does nothing");
00583 #if !defined(EXCLUDE_FROM_XARALX)
00584     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnWindowNew();
00585 #endif
00586 }
00587 
00588 /********************************************************************************************
00589 
00590 >   void WindowArrangeAction();     
00591 
00592     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00593     Created:    27/93
00594     Inputs:     None
00595     Outputs:    None
00596     Returns:    None
00597     Purpose:    Performs Window menu function Arrange.
00598     Errors:     None
00599     SeeAlso:    MenuCmds
00600     SeeAlso:    SetupDefaultMenu()
00601     SeeAlso:    SetupSharedMenu()
00602 
00603 ********************************************************************************************/
00604 
00605 void WindowArrangeAction() 
00606 {               
00607 PORTNOTETRACE("other", "WindowArrangeAction does nothing");
00608 #if !defined(EXCLUDE_FROM_XARALX)
00609     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnMDIWindowCmd(_R(ID_WINDOW_ARRANGE));
00610 #endif
00611 }
00612 
00613 /********************************************************************************************
00614 
00615 >   void WindowCascadeAction();     
00616 
00617     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00618     Created:    27/7/93
00619     Inputs:     None
00620     Outputs:    None
00621     Returns:    None
00622     Purpose:    Performs Window menu function Cascade.
00623     Errors:     None
00624     SeeAlso:    MenuCmds
00625     SeeAlso:    SetupDefaultMenu()
00626     SeeAlso:    SetupSharedMenu()
00627 
00628 ********************************************************************************************/
00629 
00630 void WindowCascadeAction() 
00631 {               
00632 PORTNOTETRACE("other", "WindowCascadeAction does nothing");
00633 #if !defined(EXCLUDE_FROM_XARALX)
00634     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnMDIWindowCmd(_R(ID_WINDOW_CASCADE));
00635 #endif
00636 }
00637 
00638 /********************************************************************************************
00639 
00640 >   void WindowTileHorzAction();    
00641 
00642     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00643     Created:    27/7/93
00644     Inputs:     None
00645     Outputs:    None
00646     Returns:    None
00647     Purpose:    Performs Window menu function Tile Horizontal.
00648     Errors:     None
00649     SeeAlso:    MenuCmds
00650     SeeAlso:    SetupDefaultMenu()
00651     SeeAlso:    SetupSharedMenu()
00652 
00653 ********************************************************************************************/
00654 
00655 void WindowTileHorzAction() 
00656 {               
00657 PORTNOTETRACE("other", "WindowTileHorzAction does nothing");
00658 #if !defined(EXCLUDE_FROM_XARALX)
00659     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnMDIWindowCmd(_R(ID_WINDOW_TILE_HORZ));
00660 #endif
00661 }
00662 
00663 /********************************************************************************************
00664 
00665 >   void WindowTileVertAction();    
00666 
00667     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00668     Created:    27/7/93
00669     Inputs:     None
00670     Outputs:    None
00671     Returns:    None
00672     Purpose:    Performs Window menu function Tile Verticle.
00673     Errors:     None
00674     SeeAlso:    MenuCmds
00675     SeeAlso:    SetupDefaultMenu()
00676     SeeAlso:    SetupSharedMenu()
00677 
00678 ********************************************************************************************/
00679 
00680 void WindowTileVertAction() 
00681 {               
00682 PORTNOTETRACE("other", "WindowTileVertAction does nothing");
00683 #if !defined(EXCLUDE_FROM_XARALX)
00684     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnMDIWindowCmd(_R(ID_WINDOW_TILE_VERT));
00685 #endif
00686 }
00687 
00688 
00689 /********************************************************************************************
00690 
00691 >   void WindowTileVertAction();    
00692 
00693     Author:     Luke_Hart (Xara Group Ltd) <lukehcamelotdev@xara.com>
00694     Created:    01/08/06
00695     Inputs:     None
00696     Outputs:    None
00697     Returns:    None
00698     Purpose:    Performs Window menu function switch next\last document.
00699     Errors:     None
00700     SeeAlso:    MenuCmds
00701 
00702 ********************************************************************************************/
00703 
00704 void WindowNextDcocument( bool fForward )
00705 {
00706 // This is only needed for Linux (and maybe Mac, we'll see)
00707 #if defined(__WXGTK__)
00708     CCamFrame*          pFrame = (CCamFrame*)AfxGetApp().GetTopWindow();
00709     if( fForward )
00710         pFrame->ActivateNext();
00711     else
00712         pFrame->ActivatePrevious();
00713 #endif
00714 }
00715 
00716 
00717 /********************************************************************************************
00718 
00719 >   OpState WindowCmdState()
00720 
00721     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00722     Created:    27/7/93
00723     Outputs:    None
00724     Returns:    None
00725     Purpose:    Updates the state of the window menu options.
00726     Errors:     None
00727     SeeAlso:    MenuCmds
00728     SeeAlso:    SetupDefaultMenu()
00729     SeeAlso:    SetupSharedMenu()
00730 
00731 ********************************************************************************************/
00732 
00733 OpState WindowCmdState()
00734 {
00735 PORTNOTETRACE("other", "WindowCmdState does nothing");
00736 #if !defined(EXCLUDE_FROM_XARALX)
00737     // Get Active Child Window                                                 
00738     if (((CMDIFrameWnd *) (AfxGetApp())->m_pMainWnd)->MDIGetActive() != NULL)                                               
00739 #endif
00740         return OpState( FALSE, FALSE );                 // not ticked, not greyed
00741 #if !defined(EXCLUDE_FROM_XARALX)
00742     else
00743         return OpState( FALSE, TRUE );                  // not ticked, greyed
00744 #endif
00745 } 
00746 
00747 /********************************************************************************************
00748 
00749 >   void HelpIndexAction();     
00750 
00751     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00752     Created:    8/7/93
00753     Inputs:     None
00754     Outputs:    None
00755     Returns:    None
00756     Purpose:    Performs Help Index menu function on the Help menu.
00757     Errors:     None
00758     SeeAlso:    MenuCmds
00759     SeeAlso:    SetupDefaultMenu()
00760     SeeAlso:    SetupSharedMenu()
00761 
00762 ********************************************************************************************/
00763 /*
00764 Technical Notes:
00765     The AfxGetApp() function is used to obtain the currently active application object.This
00766     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00767     can be used.
00768 ********************************************************************************************/
00769 
00770 void HelpIndexAction() 
00771 {
00772     AfxGetApp().OnHelpIndex();
00773 }
00774 
00775 
00776  
00777 /********************************************************************************************
00778 
00779 >   void HelpUsingAction();     
00780 
00781     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00782     Created:    8/7/93
00783     Inputs:     None
00784     Outputs:    None
00785     Returns:    None
00786     Purpose:    Performs Help Using menu function on the Help menu.
00787     Errors:     None
00788     SeeAlso:    MenuCmds
00789     SeeAlso:    SetupDefaultMenu()
00790     SeeAlso:    SetupSharedMenu()
00791 
00792 ********************************************************************************************/
00793 /*
00794 Technical Notes:
00795     The AfxGetApp() function is used to obtain the currently active application object.This
00796     is used cast to a Camelot Application object so that camelot the camelot menu functions 
00797     can be used.
00798 ********************************************************************************************/
00799 
00800 void HelpUsingAction() 
00801 {               
00802 PORTNOTETRACE("other", "HelpUsingAction does nothing");
00803 #if !defined(EXCLUDE_FROM_XARALX)
00804 #if (_MFC_VER >= 0x250)
00805     GetMainFrame()->OnHelpUsing();
00806 #else
00807     ((CCamApp*) AfxGetApp())->OnHelpUsing();
00808 #endif
00809 #endif
00810 }
00811 
00812 
00813 
00814 void HelpToolsAction() 
00815 {               
00816     HelpUsingTools();
00817 }
00818 
00819 
00820 
00821 void HelpGalleriesAction()
00822 {
00823     HelpUsingGalleries();
00824 }
00825 
00826 static void StartMovie( const wxString &strFile )
00827 {
00828     wxString            strDataPath( (wxChar*)CCamApp::GetResourceDirectory() );
00829     if( !wxDir::Exists( strDataPath ) )
00830     {
00831 #if defined(_DEBUG)
00832         // We'll try default location under debug to make life easier
00833         strDataPath = _T("/usr/share");
00834 #endif
00835     }
00836 
00837     wxString            strVideoPath( strDataPath );
00838     strVideoPath += _("/video");
00839 
00840     wxString            strCommand; // ( _T("mplayer -slave \"") );
00841     strCommand += strVideoPath + _T("/") + strFile + _T("\"");  
00842 
00843 #if true
00844     CCamApp::LaunchMediaApp( strCommand );
00845 #else
00846     long /*TYPENOTE: CORRECT*/ lResult = wxExecute( strCommand, wxEXEC_SYNC, NULL );
00847     if( 255 == lResult )
00848     {
00849         strCommand = strDataPath + _T("/xaralx/bin/mplayer -slave \"");
00850         strCommand += strVideoPath + _T("/") + strFile + _T("\"");
00851 
00852         lResult = wxExecute( strCommand, wxEXEC_SYNC, NULL );
00853         if( 255 == lResult )
00854             InformWarning( _R(IDS_MPLAYER_MISSING), _R(IDS_OK) );
00855     }
00856 #endif
00857 }
00858 
00859 void HelpDemosAction()
00860 {
00861     StartMovie( _T("Part_1_master_inc_audio_smaller_q35_fr15_hi.ogm") );
00862 
00863 //  HelpOnlineDemos();
00864 }
00865 
00866 void HelpPlayerAction()
00867 {
00868     CCamApp::SelectMediaApp();
00869 }
00870 
00871 void HelpTechSupportAction()
00872 {
00873     HelpTechnicalSupport();
00874 }
00875 
00876 
00877 #ifdef STANDALONE
00878 /********************************************************************************************
00879 
00880 >   void HelpSpecAction();  
00881 
00882     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00883     Created:    27/5/95
00884     Purpose:    Performs Help Spec menu function on the Help menu.
00885     SeeAlso:    MenuCmds
00886 
00887 ********************************************************************************************/
00888 
00889 void HelpSpecAction() 
00890 {
00891     ShowHelpSpec();
00892 }
00893 #endif
00894 
00895  
00896  
00897 /********************************************************************************************
00898 
00899 >   void ViewToolBarAction();   
00900 
00901     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00902     Created:    27/7/93
00903     Inputs:     None
00904     Outputs:    None
00905     Returns:    None
00906     Purpose:    Performs View menu function to update ToolBar.
00907     Errors:     None
00908     SeeAlso:    MenuCmds
00909     SeeAlso:    SetupDefaultMenu()
00910     SeeAlso:    SetupSharedMenu()
00911 
00912 ********************************************************************************************/
00913 /*
00914 Technical Notes:
00915     The AfxGetApp() function is used to obtain the currently active application object. The 
00916     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00917     window of the current application object. The OnBarCheck() function is then applied to 
00918     the mainframe window of the currently active application.
00919 ********************************************************************************************/
00920 
00921 void ViewToolBarAction() 
00922 {
00923 PORTNOTETRACE("other", "ViewToolBarAction does nothing");
00924 #if !defined(EXCLUDE_FROM_XARALX)
00925     ((CMainFrame*)((AfxGetApp())->m_pMainWnd))->OnBarCheck(_R(ID_VIEW_TOOLBAR));
00926 #endif
00927 }
00928 
00929 /********************************************************************************************
00930 
00931 >   void ViewStatusBarAction();     
00932 
00933     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00934     Created:    27/7/93
00935     Inputs:     None
00936     Outputs:    None
00937     Returns:    None
00938     Purpose:    Performs View menu function to update StatusBar.
00939     Errors:     None
00940     SeeAlso:    MenuCmds
00941     SeeAlso:    SetupDefaultMenu()
00942     SeeAlso:    SetupSharedMenu()
00943 
00944 ********************************************************************************************/
00945 /*
00946 Technical Notes:
00947     The AfxGetApp() function is used to obtain the currently active application object. The 
00948     m_pMainWnd object is a member variable of a CWinApp class which contains the main frame
00949     window of the current application object. The OnBarCheck() function is then applied to 
00950     the mainframe window of the currently active application.
00951 ********************************************************************************************/
00952 
00953 void ViewStatusBarAction() 
00954 {
00955 PORTNOTETRACE("other", "ViewStatusBarAction does nothing");
00956 #if !defined(EXCLUDE_FROM_XARALX)
00957     GetMainFrame()->ShowStatusBar(!GetMainFrame()->IsStatusBarVisible());
00958 #endif
00959 }
00960 
00961 /********************************************************************************************
00962 
00963 >   void ViewRulersAction();    
00964 
00965     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
00966     Created:    27/7/93
00967     Inputs:     None
00968     Outputs:    None
00969     Returns:    None
00970     Purpose:    Performs View menu function to update Rulers.
00971     Errors:     None
00972     SeeAlso:    MenuCmds
00973     SeeAlso:    SetupDefaultMenu()
00974     SeeAlso:    SetupSharedMenu()
00975 
00976 ********************************************************************************************/
00977 
00978 void ViewRulersAction() 
00979 {
00980     // Get the currently selected view pointer. (can be NULL if no documents!)
00981     DocView *pView = DocView::GetSelected();
00982     
00983     if (pView)
00984     {
00985         BOOL NewState = ! pView->AreRulersVisible();
00986         pView->ShowViewRulers(NewState);
00987         CCamView::SetDefaultRulersState(NewState);
00988     }
00989 }
00990 /********************************************************************************************
00991 
00992 >   OpState ViewToolBarState()
00993 
00994     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
00995     Created:    27/7/93
00996     Outputs:    None
00997     Returns:    None
00998     Purpose:    Updates the state of the ToolBar menu option.
00999     Errors:     None
01000     SeeAlso:    MenuCmds
01001     SeeAlso:    SetupDefaultMenu()
01002     SeeAlso:    SetupSharedMenu()
01003 
01004 ********************************************************************************************/
01005 
01006 OpState ViewToolBarState()
01007 {
01008 PORTNOTETRACE("other", "ViewToolBarState does nothing");
01009 #if !defined(EXCLUDE_FROM_XARALX)
01010     CWnd* pBar = ((CMainFrame*)((AfxGetApp())->m_pMainWnd)
01011                                     )->GetDescendantWindow(_R(AFX_IDW_TOOLBAR));
01012     
01013     if ((pBar != NULL) && ((pBar->GetStyle() & WS_VISIBLE) != 0))
01014 #endif
01015          return OpState( TRUE, FALSE );                 // not ticked, not greyed
01016 #if !defined(EXCLUDE_FROM_XARALX)
01017     else
01018         return OpState( FALSE, FALSE );                 // ticked, not greyed
01019 #endif
01020 } 
01021 
01022 /********************************************************************************************
01023 
01024 >   OpState ViewStatusBarState();   
01025 
01026     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
01027     Created:    27/7/93
01028     Outputs:    None
01029     Returns:    None
01030     Purpose:    Updates the state of the ToolBar menu option.
01031     Errors:     None
01032     SeeAlso:    MenuCmds
01033     SeeAlso:    SetupDefaultMenu()
01034     SeeAlso:    SetupSharedMenu()
01035 
01036 ********************************************************************************************/
01037 
01038 OpState ViewStatusBarState()
01039 {
01040 PORTNOTETRACE("other", "ViewStatusBarState does nothing");
01041 #if !defined(EXCLUDE_FROM_XARALX)
01042     if(GetMainFrame()->IsStatusBarVisible())
01043 #endif
01044         return OpState( TRUE, FALSE );              // not ticked, not greyed
01045 #if !defined(EXCLUDE_FROM_XARALX)
01046     else  
01047         return OpState( FALSE, FALSE );                 // ticked, not greyed
01048 #endif
01049 }
01050 
01051 /********************************************************************************************
01052 
01053 >   OpState ViewColourBarState();   
01054 
01055     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
01056     Created:    7/10/94
01057     Outputs:    None
01058     Returns:    None
01059     Purpose:    Updates the state of the ColourBar menu option.
01060     Errors:     None
01061     SeeAlso:    MenuCmds
01062     SeeAlso:    SetupDefaultMenu()
01063     SeeAlso:    SetupSharedMenu()
01064 
01065 ********************************************************************************************/
01066 
01067 OpState ViewColourBarState()
01068 {
01069 PORTNOTETRACE("other", "ViewColourBarState does nothing");
01070 #if !defined(EXCLUDE_FROM_XARALX)
01071     if(GetMainFrame()->IsColourBarVisible())
01072 #endif
01073         return OpState( TRUE, FALSE );              // not ticked, not greyed
01074 #if !defined(EXCLUDE_FROM_XARALX)
01075     else
01076         return OpState( FALSE, FALSE );                 // ticked, not greyed
01077 #endif  
01078 }
01079 
01080 /********************************************************************************************
01081 
01082 >   OpState ViewRulersState();  
01083 
01084     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
01085     Created:    7/10/94
01086     Outputs:    None
01087     Returns:    None
01088     Purpose:    Updates the state of the Rulers menu option.
01089     Errors:     None
01090     SeeAlso:    MenuCmds
01091     SeeAlso:    SetupDefaultMenu()
01092     SeeAlso:    SetupSharedMenu()
01093 
01094 ********************************************************************************************/
01095 
01096 OpState ViewRulersState()
01097 {
01098     // Get the currently selected view pointer. (can be NULL if no documents!)
01099     DocView *pView = DocView::GetSelected();
01100     if (pView == NULL)
01101         return OpState( FALSE, TRUE );              // not ticked, greyed;
01102 
01103     if(pView->AreRulersVisible())
01104          return OpState( TRUE, FALSE );             // ticked, not greyed
01105     else
01106         return OpState( FALSE, FALSE );             // not ticked, not greyed
01107     
01108 }
01109 
01110 /********************************************************************************************
01111 
01112 >   OpState ViewFullScreenState();  
01113 
01114     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
01115     Created:    7/10/94
01116     Outputs:    None
01117     Returns:    None
01118     Purpose:    Updates the state of the FullScreen menu option.
01119     Errors:     None
01120     SeeAlso:    MenuCmds
01121     SeeAlso:    SetupDefaultMenu()
01122     SeeAlso:    SetupSharedMenu()
01123 
01124 ********************************************************************************************/
01125 
01126 OpState ViewFullScreenState()
01127 {           
01128 PORTNOTETRACE("other", "ViewFullScreenState does nothing");
01129 #if !defined(EXCLUDE_FROM_XARALX)
01130     if(GetMainFrame()->IsFullScreenMode())
01131 #endif
01132         return OpState( TRUE, FALSE );              // not ticked, not greyed
01133 #if !defined(EXCLUDE_FROM_XARALX)
01134     else
01135         return OpState( FALSE, FALSE );                 // ticked, not greyed
01136 #endif  
01137 }
01138 
01139 /********************************************************************************************
01140 
01141 >   OpState ViewScrollBarsState();  
01142 
01143     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
01144     Created:    7/10/94
01145     Outputs:    None
01146     Returns:    None
01147     Purpose:    Updates the state of the ScrollBars menu option.
01148     Errors:     None
01149     SeeAlso:    MenuCmds
01150     SeeAlso:    SetupDefaultMenu()
01151     SeeAlso:    SetupSharedMenu()
01152 
01153 ********************************************************************************************/
01154 
01155 OpState ViewScrollBarsState()
01156 {           
01157     // Get the currently selected view pointer. (can be NULL if no documents!)
01158     DocView *pView = DocView::GetSelected();
01159     if (pView == NULL)
01160         return OpState( FALSE, TRUE );              // not ticked, greyed;
01161 
01162     if(pView->AreScrollersVisible())
01163          return OpState( TRUE, FALSE );             // ticked, not greyed
01164     else
01165         return OpState( FALSE, FALSE );             // not ticked, not greyed
01166     
01167     /* OLD Global version
01168     if(GetMainFrame()->AreScrollBarsVisible())
01169          return OpState( TRUE, FALSE );             // not ticked, not greyed
01170     else  
01171         return OpState( FALSE, FALSE );                 // ticked, not greyed
01172     */
01173 }
01174 
01175 /********************************************************************************************
01176 
01177 >   void ViewColourBarAction();     
01178 
01179     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
01180     Created:    27/7/93
01181     Inputs:     None
01182     Outputs:    None
01183     Returns:    None
01184     Purpose:    Performs View menu function to update Colour Bar.
01185     Errors:     None
01186     SeeAlso:    MenuCmds
01187     SeeAlso:    SetupDefaultMenu()
01188     SeeAlso:    SetupSharedMenu()
01189 
01190 ********************************************************************************************/
01191 
01192 void ViewColourBarAction() 
01193 {
01194 PORTNOTETRACE("other", "ViewColourBarAction does nothing");
01195 #if !defined(EXCLUDE_FROM_XARALX)
01196     GetMainFrame()->ShowColourBar(!GetMainFrame()->IsColourBarVisible());
01197 #endif  
01198 }
01199 
01200 /********************************************************************************************
01201 
01202 >   void ViewScrollBarsAction();    
01203 
01204     Author:     Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
01205     Created:    27/7/93
01206     Inputs:     None
01207     Outputs:    None
01208     Returns:    None
01209     Purpose:    Performs View menu function to update Scroll Bars.
01210     Errors:     None
01211     SeeAlso:    MenuCmds
01212     SeeAlso:    SetupDefaultMenu()
01213     SeeAlso:    SetupSharedMenu()
01214 
01215 ********************************************************************************************/
01216 
01217 void ViewScrollBarsAction() 
01218 {
01219 PORTNOTETRACE("other", "ViewScrollBarsAction does nothing");
01220 #if !defined(EXCLUDE_FROM_XARALX)
01221     // Get the currently selected view pointer. (can be NULL if no documents!)
01222     DocView *pView = DocView::GetSelected();
01223     if (pView)
01224     {
01225         BOOL NewState = ! pView->AreScrollersVisible();
01226         pView->ShowViewScrollers(NewState);
01227         ScreenCamView::SetDefaultScrollersState(NewState);
01228     }
01229 
01230     // OLD Global version           
01231     //  GetMainFrame()->ShowScrollBars(!GetMainFrame()->AreScrollBarsVisible());
01232 #endif
01233 }
01234 
01235 
01236 /********************************************************************************************
01237 
01238 >   void ViewFullScreenAction();    
01239 
01240     Author:     Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
01241     Created:    20/10/94
01242     Inputs:     None
01243     Outputs:    None
01244     Returns:    None
01245     Purpose:    Performs View menu function to Toggle Full Screen mode.
01246                 Full Screen Mode is a bit misleading.. this function actually toggles mode
01247                 by writing/loading either clean.con or normal.con files - all bars except the infobar
01248                 are destroyed and recreated in there new state after the load.The Infobar is a 
01249                 special case this is just moved after the load.  
01250     Errors:     None
01251     SeeAlso:    MenuCmds
01252 
01253 ********************************************************************************************/
01254 
01255 void ViewFullScreenAction() 
01256 {
01257 PORTNOTETRACE("other", "ViewFullScreenAction does nothing");
01258 #if !defined(EXCLUDE_FROM_XARALX)
01259     BOOL NoError = TRUE;
01260     // lock the window to avoid untidy layout recalcs
01261     ::LockWindowUpdate(GetMainFrame()->GetSafeHwnd());
01262     
01263     // tell the mainframe we are changing modes - this prevents
01264     // some unnecessary work
01265     GetMainFrame()->SetChangingMode(TRUE);
01266 
01267     // save current bars setup in clean/normal ini file
01268     if(GetMainFrame()->IsFullScreenMode())
01269         NoError = DialogBarOp::WriteNamedBars("clean");
01270     else
01271         NoError = DialogBarOp::WriteNamedBars("normal");
01272 
01273     if(!NoError)
01274         InformError();
01275     // kill all bars ( except infobar at the mo..)
01276     BROADCAST_TO_CLASS(DialogMsg(NULL, DIM_BAR_DEATH, NULL ),DialogBarOp);
01277     
01278     // hide the info bar
01279     InformationBarOp::SetVisibility(FALSE,TRUE);
01280     
01281     // load clean/normal bars ini file
01282     if(GetMainFrame()->IsFullScreenMode())
01283         DialogBarOp::LoadNamedBars("normal");
01284     else
01285         DialogBarOp::LoadNamedBars("clean");
01286     
01287     // force the info bar to the correct visible state
01288     InformationBarOp::SetVisibility(InformationBarOp::IsVisible(),TRUE);
01289     
01290     // All clear to Mainframe
01291     GetMainFrame()->SetChangingMode(FALSE);
01292     
01293     // Make sure everything is positioned correctly
01294     GetMainFrame()->RecalcLayout();
01295     GetMainFrame()->RelocateToolbar ();
01296     
01297     // and unlock and show the window
01298     ::LockWindowUpdate(NULL);
01299 
01300     // Update all button controls that invoke this Op
01301     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_VIEWFULLSCREEN);
01302     if (pOpDesc!=NULL)
01303     {
01304         // Found the opdescriptor. Now find all the gadgets associated with it
01305         List Gadgets;
01306         if (pOpDesc->BuildGadgetList(&Gadgets))
01307         {
01308             // Found some. Set the controls accordingly
01309             GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();
01310 
01311             while (pGadgetItem != NULL)
01312             {
01313                 // Set the gadget
01314                 pGadgetItem->pDialogBarOp->SetBoolGadgetSelected(pGadgetItem->gidGadgetID,
01315                                                                     GetMainFrame()->IsFullScreenMode());
01316                 // Find the next gadget
01317                 pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
01318             }
01319     
01320             // Clean out the list
01321             Gadgets.DeleteAll();
01322         }
01323     }
01324 #endif
01325 }
01326 
01327 
01328 /*********************************************************************************************************************
01330 ***********************************************************************************************************************/
01331 
01332 
01333 //  WEBSTER-ranbirr-12/11/96
01334 //#ifdef WEBSTER
01335 
01336 
01337 /*********************************************************************************************************************
01338     void HelpXaraForumAction() 
01339 
01340     Author:     Alex
01341     Created:    19/02/2004
01342     Inputs:     -
01343     Outputs:    -
01344     Returns     -
01345     Purpose:    Provides access from a help menu to XaraX's Forum Page (e.g. Talkgraphics)
01346     Errors      If the browser could not be opened, an Error message box is diplayed.
01347     See Also    -
01348 
01349 ***********************************************************************************************************************/
01350 
01351 void HelpXaraForumAction()
01352 {
01353     wxString strURL = CamResource::GetText(_R(IDS_URL_FORUM));
01354     CCamApp::LaunchWebBrowser(strURL);
01355 }
01356 
01357 
01358 /*********************************************************************************************************************
01359     void HelpWebsterHomePage() 
01360 
01361     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01362     Created:    20/01/97
01363     Inputs:     -
01364     Outputs:    -
01365     Returns     -
01366     Purpose:    Provides access from a help menu to Webster's Home Page.
01367     Errors      If the browser could not be opened, an Error message box is diplayed.
01368     See Also    -
01369 
01370 ***********************************************************************************************************************/
01371 
01372 void HelpWebsterHomePage()
01373 {
01374     wxString strURL = CamResource::GetText(_R(IDS_URL_PRODUCT));
01375     CCamApp::LaunchWebBrowser(strURL);
01376 }
01377 /*********************************************************************************************************************
01378     void HelpXaraHomePage()
01379 
01380     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01381     Created:    20/01/97
01382     Inputs:     -
01383     Outputs:    -
01384     Returns     -
01385     Purpose:    Provides access from a help menu to Xara's HomePage Page.
01386     Errors      If the browser could not be opened, an Error message box is diplayed.
01387     See Also    -
01388 
01389 ***********************************************************************************************************************/
01390 void HelpXaraHomePage()
01391 {
01392     wxString strURL = CamResource::GetText(_R(IDS_URL_XARASITE));
01393     CCamApp::LaunchWebBrowser(strURL);
01394 }
01395 
01396 //#endif //webster
01397 
01398 /*********************************************************************************************************************
01399     BOOL IsCDROMOn() 
01400 
01401     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01402     Created:    27/01/97
01403     Inputs:     -
01404     Outputs:    -
01405     Returns     True if this is a CD version of Webster, FALSE if it is a download version.
01406     Purpose:    To discover whether the installed version of Webster is a CD or DownLoad version.
01407     Errors      -
01408     See Also    -
01409 
01410 ***********************************************************************************************************************/
01411 BOOL IsCDROMOn() 
01412 {
01413 PORTNOTETRACE("other","IsCDROMOn - do nothing");
01414 #if !defined(EXCLUDE_FROM_XARALX)
01415     BOOL bSetting;
01416     HKEY arhKeys[3];
01417     DWORD dwBoolSize = sizeof(BOOL);
01418     DWORD dwDisposition;
01419 
01420     BOOL bResult =  ((RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_ALL_ACCESS, &arhKeys[0]) == ERROR_SUCCESS) &&
01421 
01422     (RegCreateKeyEx(arhKeys[0], PRODUCT_MANUFACTURER,  0, NULL, REG_OPTION_NON_VOLATILE,  KEY_ALL_ACCESS, NULL, &arhKeys[1], &dwDisposition) == ERROR_SUCCESS) &&
01423 
01424     (RegCreateKeyEx(arhKeys[1], PRODUCT_WEBLINKNAME,  0, NULL, REG_OPTION_NON_VOLATILE,  KEY_ALL_ACCESS, NULL, &arhKeys[2], &dwDisposition) == ERROR_SUCCESS) &&
01425 
01426     (RegQueryValueEx(arhKeys[2],    "Search CDROM", NULL, NULL,  (LPBYTE) &bSetting,    &dwBoolSize) == ERROR_SUCCESS));
01427 
01428 //  ERROR2IF(!bResult, "Registry read error");
01429 
01430     // If We failed to read from the registry, Untick the Menu item.
01431     if(!bResult)
01432         bSetting = bResult;
01433 
01434     for (INT32 i = 2; i >= 0; i--) 
01435           RegCloseKey(arhKeys[i]);
01436 
01437     return bSetting;
01438 #else
01439     return FALSE;
01440 #endif
01441 }
01442 
01443 /*********************************************************************************************************************
01444     void WebsterDemos()
01445 
01446     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01447     Created:    20/01/97
01448     Inputs:     -
01449     Outputs:    -
01450     Returns     -
01451     Purpose:    Provides access from a help menu to Webster's Movies Demos Page.
01452     Errors      If the browser could not be opened, an Error message box is diplayed.
01453     See Also    -
01454 
01455 ************************************************************************************************************************/
01456 void WebsterDemos()
01457 {
01458 PORTNOTETRACE("other","Movies index - do nothing");
01459 #ifndef EXCLUDE_FROM_XARALX
01460     // Opens the default Browser on Xara's Home Page
01461     const String_256 cmd = TEXT(PRODUCT_WEBLINKEXENAME) TEXT(" movies/index.htm");
01462     InvokeWeblink(cmd);
01463 #endif
01464 }
01465 
01466 /*********************************************************************************************************************
01467     void WebsterHelpPages()
01468 
01469     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01470     Created:    17/02/97
01471     Inputs:     -
01472     Outputs:    -
01473     Returns     -
01474     Purpose:    Provides access from a help menu to Webster's Help Pages
01475     Errors      If the browser could not be opened, an Error message box is diplayed.
01476     See Also    -
01477 
01478 ************************************************************************************************************************/
01479 void WebsterHelpPages()
01480 {
01481     wxString strURL = CamResource::GetText(_R(IDS_URL_TUTORIALS));
01482     CCamApp::LaunchWebBrowser(strURL);
01483 }
01484 
01485 /*********************************************************************************************************************
01486     void HelpXaraPurchasePage()
01487 
01488     Author:     Priestley (Xara Group Ltd) <camelotdev@xara.com>
01489     Created:    28/09/2000
01490     Inputs:     -
01491     Outputs:    -
01492     Returns     -
01493     Purpose:    Provides access from a help menu to Xara's Purchase Page.
01494     Errors      If the browser could not be opened, an Error message box is diplayed.
01495     See Also    -
01496 
01497 ***********************************************************************************************************************/
01498 void HelpXaraPurchasePage()
01499 {
01500     wxString strURL = CamResource::GetText(_R(IDS_URL_PURCHASE));
01501     CCamApp::LaunchWebBrowser(strURL);
01502 }
01503 
01504 
01505 /*********************************************************************************************************************
01506 
01507 >   BOOL InvokeWeblink(const String_256& command)
01508 
01509     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> from Ranbir code
01510     Created:    16/09/97
01511     Inputs:     -
01512     Returns     True if worked ok, False otherwise
01513     Purpose:    Allows a command to be sent to Weblink. This enables the default browser to be fired up
01514                 to display the specified URL or file. If there is a browser open then this will be used
01515                 instead rather than firing up a new instance.
01516     Errors      If the command had a problem, an Error message box is diplayed.
01517     See Also    -
01518 
01519 ************************************************************************************************************************/
01520 
01521 BOOL InvokeWeblink(const String_256& command)
01522 {
01523     CCamApp::LaunchWebBrowser(command);
01524     return TRUE;
01525 }
01526 
01527 
01528 /*********************************************************************************************************************
01529     void SetWebsterReg(BOOL pcData) 
01530 
01531     Author:     Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
01532     Created:    27/01/97
01533     Inputs:     pcdata - To set the state of the Flag
01534     Outputs:    -
01535     Returns     -
01536     Purpose:    To set the registry flag for Webster.
01537                 i.e. Is the Help to be obtained from the CD or from the Net.
01538     Errors      
01539     See Also    -
01540 
01541 ***********************************************************************************************************************/
01542 //#ifdef WEBSTERCD
01543 void SetWebsterReg(BOOL pcData) 
01544 {
01545 PORTNOTETRACE("other","SetWebsterReg - do nothing");
01546 #ifndef EXCLUDE_FROM_XARALX
01547     HKEY arhKeys[3];
01548     DWORD dwBoolSize = sizeof(BOOL);
01549     DWORD dwDisposition;
01550 
01551         BOOL bResult = ((RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_ALL_ACCESS, &arhKeys[0]) == ERROR_SUCCESS) &&
01552 
01553         (RegCreateKeyEx(arhKeys[0], PRODUCT_MANUFACTURER,  0, NULL, REG_OPTION_NON_VOLATILE,  KEY_ALL_ACCESS, NULL, &arhKeys[1], &dwDisposition) == ERROR_SUCCESS) &&
01554 
01555         (RegCreateKeyEx(arhKeys[1], PRODUCT_WEBLINKNAME,  0, NULL, REG_OPTION_NON_VOLATILE,  KEY_ALL_ACCESS, NULL, &arhKeys[2], &dwDisposition) == ERROR_SUCCESS) &&
01556 
01557         (RegSetValueEx (arhKeys[2], "Search CDROM", NULL, REG_DWORD,  (LPBYTE) &pcData, dwBoolSize) == ERROR_SUCCESS));
01558 
01559     for (INT32 i = 2; i >= 0; i--) 
01560           RegCloseKey(arhKeys[i]);
01561 #endif
01562 }
01563 //#endif

Generated on Sat Nov 10 03:48:39 2007 for Camelot by  doxygen 1.4.4