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
00103
00104
00105
00106
00107 #include "camtypes.h"
00108
00109
00110
00111
00112
00113 #define E_XM_CONNECTCANCELLED ( 0x80041000 )
00114
00115
00116
00117 #include "camelot.h"
00118
00119
00120
00121 #include "camdoc.h"
00122
00123 #include "menuops.h"
00124 #include "menucmds.h"
00125
00126
00127
00128 #include "toollist.h"
00129
00130
00131
00132 #include "helpids.h"
00133 #include "bubbleid.h"
00134
00135 #include "dlgmgr.h"
00136 #include "combshps.h"
00137
00138 #include "shapeops.h"
00139
00140
00141
00142
00143 #include "csrstack.h"
00144
00145 #include "progress.h"
00146
00147
00148
00149
00150
00151 #include "sgliboil.h"
00152 #include "fileutil.h"
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 #include "product.h"
00163
00164
00165
00166
00167
00168 #include "tmplmngr.h"
00169
00170 #if (_OLE_VER >= 0x200)
00171 #include "srvritem.h"
00172 #endif
00173
00174
00175 #define INC_WEB_MENU_ITEMS
00176
00177
00178
00179 #ifdef INC_WEB_MENU_ITEMS
00180 BOOL HelpOps::CDHelpOn = FALSE;
00181 #endif //INC_WEB_MENU_ITEMS
00182
00183 BOOL ViewOps::DoFullScreen = FALSE;
00184
00185 #if !defined(EXCLUDE_FROM_RALPH)
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 #define DUMMYOP(TEXT,TOKEN) {\
00201 BOOL blobby = RegisterOpDescriptor(\
00202 0,\
00203 TEXT,\
00204 CC_RUNTIME_CLASS(DummyOp),\
00205 TOKEN,\
00206 DummyOp::GetState,\
00207 0, \
00208 0, \
00209 0, \
00210 0 \
00211 );\
00212 ERRORIF(!blobby, _R(IDE_NOMORE_MEMORY), FALSE);\
00213 }
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249 #define REGOP(MENU,NAME,OPCLASS)\
00250 {\
00251 BOOL Blobby = RegisterOpDescriptor(\
00252 0,\
00253 _R(IDS_ ## MENU ## _ ## NAME), \
00254 CC_RUNTIME_CLASS(OPCLASS),\
00255 OPTOKEN_ ## MENU ## NAME,\
00256 OPCLASS::GetState,\
00257 HID_ ## MENU ## _ ## NAME,\
00258 _R(IDBBL_ ## MENU ## NAME ## OP), \
00259 _R(IDD_BARCONTROLSTORE),\
00260 _R(IDC_BTN_ ## MENU ## NAME) ,\
00261 SYSTEMBAR_ ## MENU,\
00262 TRUE\
00263 );\
00264 ERRORIF(!Blobby, _R(IDE_NOMORE_MEMORY), FALSE);\
00265 }
00266
00267
00268
00269
00270 CC_IMPLEMENT_DYNCREATE (DocOps, Operation)
00271 CC_IMPLEMENT_DYNCREATE (MenuPopupOps, Operation)
00272 CC_IMPLEMENT_DYNCREATE (HelpOps, Operation)
00273 CC_IMPLEMENT_DYNCREATE (WindowOps, Operation)
00274 CC_IMPLEMENT_DYNCREATE (ViewOps, Operation)
00275 CC_IMPLEMENT_DYNCREATE (OpExit, Operation)
00276 CC_IMPLEMENT_DYNCREATE (OpUpdate, Operation)
00277 CC_IMPLEMENT_DYNCREATE (OpRegister, Operation)
00278 CC_IMPLEMENT_DYNCREATE (DummyOp, Operation)
00279 #endif
00280
00281 CC_IMPLEMENT_DYNCREATE (OpToolSelect, Operation)
00282
00283
00284
00285 #define new CAM_DEBUG_NEW
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306 OpToolSelect::OpToolSelect(): Operation()
00307 {
00308 }
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326 BOOL OpToolSelect::Init()
00327 {
00328
00329 ToolListItem* ToolItem = Tool::GetFirstTool();
00330
00331 ToolInfo *Info = new ToolInfo;
00332 if (Info == NULL)
00333 return FALSE;
00334
00335 while (ToolItem != NULL)
00336 {
00337 Tool* ATool = ToolItem->m_pTool;
00338
00339
00340 Info->BubbleID=0;
00341 ATool->Describe(Info);
00342
00343
00344 String OpToken;
00345 camSnprintf( OpToken, 16, _T("TOOL%u"), (Info->ID) );
00346
00347
00348 ToolOpDescriptor* ToolOp = new ToolOpDescriptor(
00349 Info->ID,
00350 Info->TextID,
00351 CC_RUNTIME_CLASS(OpToolSelect),
00352 OpToken,
00353 OpToolSelect::GetState,
00354 0,
00355 Info->BubbleID
00356 );
00357
00358 ERRORIF(!ToolOp, _R(IDE_NOMORE_MEMORY), FALSE);
00359
00360
00361 ToolItem = Tool::GetNextTool(ToolItem);
00362 }
00363
00364 delete Info;
00365
00366 return TRUE;
00367 }
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385 OpState OpToolSelect::GetState(String_256* UIDescription, OpDescriptor* ToolOp)
00386 {
00387 OpState mState;
00388
00389 UINT32 ToolId = ToolOp->GetToolID();
00390
00391 ENSURE(Tool::Find(ToolId) != NULL, "Tool Id does not exist!");
00392
00393 Tool* thisTool = ((Tool::Find(ToolId))->m_pTool);
00394
00395 if (thisTool ==((Tool::Find(ToolId))->m_pTool)->GetCurrent())
00396 mState.Ticked = TRUE;
00397 else
00398 mState.Ticked = FALSE;
00399
00400 mState.Greyed = FALSE;
00401
00402 return mState;
00403 }
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421 void OpToolSelect::Do(OpDescriptor* ToolOp)
00422 {
00423 UINT32 ToolId = ToolOp->GetToolID();
00424
00425 ENSURE(Tool::Find(ToolId) != NULL, "Tool Id does not exist!");
00426 ToolListItem * pItem = NULL;
00427 pItem = Tool::Find(ToolId);
00428 if(pItem)
00429 pItem->m_pTool->SetCurrent();
00430
00431
00432
00433 End();
00434 }
00435
00436 #if !defined(EXCLUDE_FROM_RALPH)
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 OpState DocOps::GetState(String_256* UIDescription, OpDescriptor* pOp)
00459 {
00460
00461 if (pOp->Token == String(OPTOKEN_FILENEW) ||
00462 pOp->Token == String(OPTOKEN_FILEOPEN))
00463 {
00464 return OpState(FALSE, FALSE);
00465 }
00466
00467
00468 if (pOp->Token == String(OPTOKEN_FILENEW_DRAWING))
00469 {
00470
00471
00472
00473 PathName pathDefaultDrawingTemplate = CTemplateManager::GetDefaultDrawingTemplate();
00474
00475 String_256 strToReturn=pathDefaultDrawingTemplate.GetFileName(FALSE);
00476
00477 if (strToReturn.IsEmpty())
00478 strToReturn.Load(_R(IDS_NEWTEMPLATES_DEFAULTNAMEFORDRAWINGMENUITEM));
00479
00480 strToReturn.toTitle();
00481
00482 PORTNOTE("other", "Mangle file name to replace _'s with spaces")
00483 strToReturn.SwapChar( _T('_'), _T(' ') );
00484
00485 *UIDescription=strToReturn;
00486
00487 return OpState(FALSE, FALSE);
00488 }
00489
00490 if (pOp->Token == String(OPTOKEN_FILENEW_ANIMATION))
00491 {
00492 PORTNOTE("other", "Remove template existance check - too annoying while it's not there!")
00493 #ifndef EXCLUDE_FROM_XARALX
00494
00495 PathName pathDefaultAnimationTemplate=GetDefaultAnimationTemplate();
00496 BOOL fFileExists=SGLibOil::FileExists(&pathDefaultAnimationTemplate);
00497
00498 TRACEUSER( "jlh92", _T("Template Anim = %s, %d\n"), PCTSTR(pathDefaultAnimationTemplate.GetPath()), fFileExists );
00499
00500 String_256 strToReturn=pathDefaultAnimationTemplate.GetFileName(FALSE);
00501
00502 if (strToReturn.IsEmpty())
00503 strToReturn.Load(_R(IDS_NEWTEMPLATES_DEFAULTNAMEFORANIMATIONMENUITEM));
00504
00505 strToReturn.toTitle();
00506
00507 *UIDescription=strToReturn;
00508 #else
00509 BOOL fFileExists = FALSE;
00510 #endif
00511
00512
00513 return OpState(FALSE, !fFileExists, TRUE);
00514 }
00515
00516 if (pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE1) ||
00517 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE2) ||
00518 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE3) ||
00519 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE4) ||
00520 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE5) ||
00521 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE6) ||
00522 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE7) ||
00523 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE8) ||
00524 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE9) ||
00525 pOp->Token == String(OPTOKEN_FILENEW_TEMPLATE10))
00526 {
00527
00528
00529 INT32 iPositionOfFCharacter = pOp->Token.FindNextChar( 'F', 0 );
00530 TRACEUSER( "jlh92", _T("Token = %s(%d)\n"), PCTSTR(pOp->Token), iPositionOfFCharacter );
00531 String_256 strNumberOfTemplate;
00532 pOp->Token.Left( &strNumberOfTemplate, iPositionOfFCharacter );
00533
00534
00535 TCHAR* pszTmp;
00536 INT32 iNumberOfTemplate = camStrtol( (TCHAR *)strNumberOfTemplate, &pszTmp, 10 );
00537 String_256 strNameOfFile;
00538 CTemplateManager& TemplateManager( GetApplication()->GetTemplateManager() );
00539 bool fSuccess = TemplateManager.GetTemplateFilename( iNumberOfTemplate, &strNameOfFile );
00540
00541
00542 Error::ClearError();
00543
00544
00545 if( !fSuccess )
00546 return OpState(FALSE, FALSE, TRUE);
00547
00548
00549 PathName pathTemplates;
00550 pathTemplates.SetFileNameAndType( strNameOfFile );
00551 *UIDescription = pathTemplates.GetFileName(FALSE);
00552 UIDescription->toTitle();
00553
00554 return OpState(FALSE, FALSE, FALSE);
00555 }
00556
00557
00558 if (pOp->Token == String(OPTOKEN_FILESAVEALL))
00559 {
00560
00561 wxDocManager *pDocManager = AfxGetApp().GetDocumentManager();
00562 wxList &lstDocuemnt = pDocManager->GetDocuments();
00563 wxNode *pNode = lstDocuemnt.GetFirst();
00564 while( NULL != pNode )
00565 {
00566 CCamDoc *pDoc = (CCamDoc *)pNode->GetData();
00567
00568 PORTNOTE("other","Removed OLE usage")
00569 #ifndef EXCLUDE_FROM_XARALX
00570 #if (_OLE_VER >= 0x200)
00571
00572 if (pDoc->IsEmbedded()) continue;
00573 #endif
00574 #endif
00575
00576
00577 if( pDoc->IsModified() )
00578 return OpState(FALSE, FALSE);
00579
00580
00581 pNode = pNode->GetNext();
00582 }
00583
00584
00585 UIDescription->Load(_R(IDS_FILE_SAVE_ALL_NONE_CHANGED_GREYED));
00586 return OpState(FALSE, TRUE);
00587 }
00588
00589
00590 Document* pKernelDoc = Document::GetSelected();
00591 CCamDoc* pOilDoc = (pKernelDoc) ? pKernelDoc->GetOilDoc() : 0;
00592
00593
00594 if (!pOilDoc)
00595 {
00596
00597 UIDescription->Load(_R(IDS_FILE_NO_DOC_GREYED));
00598 return OpState(FALSE, TRUE);
00599 }
00600
00601
00602 if (pOp->Token == String(OPTOKEN_FILESAVE))
00603 {
00604
00605 BOOL fGreyed = FALSE;
00606 pOp->EnableHotKey();
00607 #if (_OLE_VER >= 0x200)
00608
00609 if (pOilDoc->IsEmbedded())
00610 {
00611 UIDescription->MakeMsg(_R(IDS_FILE_UPDATE), (LPCTSTR) pOilDoc->GetContainerName());
00612 pOp->DisableHotKey();
00613 }
00614 else
00615 #endif
00616
00617 if (!pOilDoc->IsModified())
00618 {
00619 fGreyed = TRUE;
00620 UIDescription->Load(_R(IDS_FILE_SAVE_NOT_CHANGED_GREYED));
00621 }
00622
00623
00624 return OpState(FALSE, fGreyed);
00625 }
00626
00627
00628 if (pOp->Token == String(OPTOKEN_FILECLOSE))
00629 {
00630
00631 BOOL fGreyed = FALSE;
00632
00633 #if (_OLE_VER >= 0x200)
00634
00635 if (pOilDoc->IsEmbedded())
00636 {
00637
00638
00639
00640 if (!AfxOleGetUserCtrl())
00641 {
00642
00643 fGreyed = TRUE;
00644 UIDescription->Load(_R(IDS_FILE_CLOSE_SERVER_MODE_GREYED));
00645 }
00646 else
00647 {
00648
00649
00650 UIDescription->MakeMsg(_R(IDS_FILE_CLOSE_AND_RETURN),
00651 (LPCTSTR) pOilDoc->GetContainerName());
00652 }
00653 }
00654 #endif
00655
00656
00657 return OpState(FALSE, fGreyed);
00658 }
00659
00660
00661
00662 #if (_OLE_VER >= 0x200)
00663 if (pOp->Token == String(OPTOKEN_FILESAVEAS))
00664 {
00665
00666 if (pOilDoc->IsEmbedded()) UIDescription->Load(_R(IDS_FILE_SAVE_COPY_AS));
00667 }
00668 #endif
00669
00670
00671 return OpState(FALSE, FALSE);
00672 }
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687 OpState OpExit::GetState(String_256* UIDescription, OpDescriptor*)
00688 {
00689 PORTNOTE("other","Removed OLE usage")
00690 #ifndef EXCLUDE_FROM_XARALX
00691 #if (_OLE_VER >= 0x200)
00692
00693
00694 Document* pKernelDoc = Document::GetSelected();
00695 CCamDoc* pOilDoc = (pKernelDoc != 0) ? pKernelDoc->GetOilDoc() : 0;
00696
00697
00698 OpDescriptor* pDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_EXIT);
00699 ERROR3IF(!pDesc, "Null OpDescriptor* in OpExit::GetState");
00700
00701
00702 if (pOilDoc && pOilDoc->IsServer())
00703 {
00704
00705 UIDescription->MakeMsg(_R(IDS_FILE_EXIT_AND_RETURN),
00706 (LPCTSTR) pOilDoc->GetContainerName());
00707 }
00708 else if (CCamSrvrItem::HowMany() > 0)
00709 {
00710
00711 POSITION posTpl = AfxGetApp()->GetFirstDocTemplatePosition();
00712 CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(posTpl);
00713 POSITION posDoc = pTemplate->GetFirstDocPosition();
00714 while (posDoc)
00715 {
00716
00717 CCamDoc* pDoc = (CCamDoc*) pTemplate->GetNextDoc(posDoc);
00718 if (pDoc->IsServer())
00719 {
00720
00721
00722 UIDescription->MakeMsg(_R(IDS_FILE_EXIT_AND_RETURN),
00723 (LPCTSTR) String_64(_R(IDS_DEFAULT_HOST_NAME)));
00724 break;
00725 }
00726 }
00727
00728 }
00729
00730 #endif
00731 #endif
00732
00733
00734 return OpState(FALSE, FALSE);
00735 }
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755 OpExit::OpExit(): Operation()
00756 {
00757
00758 OpFlags.HasOwnTimeIndicator = TRUE;
00759 }
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781 void OpExit::Do(OpDescriptor*)
00782 {
00783
00784
00785
00786
00787
00788 NodeGroup::KillAllBlendBecomeAConsLists (TRUE);
00789
00790 GetApplication ()->ResetRealDownload ();
00791
00792
00793 pOurDoc = NULL;
00794
00795 PORTNOTE("other","Removed InternetManager usage")
00796 #ifndef EXCLUDE_FROM_XARALX
00797
00798 #endif
00799
00800 ExitAction();
00801
00802 End();
00803 }
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822 BOOL OpExit::Init()
00823 {
00824 return (RegisterOpDescriptor(0,
00825 _R(IDS_APP_EXIT),
00826 CC_RUNTIME_CLASS(OpExit),
00827 OPTOKEN_EXIT,
00828 OpExit::GetState,
00829 HID_APP_EXIT,
00830 _R(IDBBL_EXITOP),
00831 _R(IDD_BARCONTROLSTORE),
00832 _R(IDC_BTN_FILEEXIT)
00833 )
00834 );
00835 }
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855 MenuPopupOps::MenuPopupOps(): Operation()
00856 {
00857 }
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877 void MenuPopupOps::Do(OpDescriptor* WhichOp)
00878 {
00879 End();
00880 }
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899 OpState MenuPopupOps::GetState(String_256* UIDescription, OpDescriptor*)
00900 {
00901 return OpState(FALSE, FALSE);
00902 }
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920 BOOL MenuPopupOps::Init()
00921 {
00922
00923
00924
00925 OpDescriptor* FileOp = new OpDescriptor(
00926 0,
00927 _R(IDS_FILE_MENU),
00928 CC_RUNTIME_CLASS(MenuPopupOps),
00929 OPTOKEN_FILE_MENU,
00930 MenuPopupOps::GetState,
00931 0,
00932 _R(IDBBL_FILEOP),
00933 0 );
00934 ERRORIF(!FileOp, _R(IDE_NOMORE_MEMORY), FALSE);
00935
00936 OpDescriptor* EditOp = new OpDescriptor(
00937 0,
00938 _R(IDS_EDIT_MENU),
00939 CC_RUNTIME_CLASS(MenuPopupOps),
00940 OPTOKEN_EDIT_MENU,
00941 MenuPopupOps::GetState,
00942 0,
00943 _R(IDBBL_EDITOP),
00944 0 );
00945 ERRORIF(!EditOp, _R(IDE_NOMORE_MEMORY), FALSE);
00946
00947 OpDescriptor* AttrOp = new OpDescriptor(
00948 0,
00949 _R(IDS_ATTRIBUTE_MENU),
00950 CC_RUNTIME_CLASS(MenuPopupOps),
00951 OPTOKEN_ATTRIBUTE_MENU,
00952 MenuPopupOps::GetState,
00953 0,
00954 0,
00955 0 );
00956 ERRORIF(!AttrOp, _R(IDE_NOMORE_MEMORY), FALSE);
00957
00958 OpDescriptor* HelpOp = new OpDescriptor(
00959 0,
00960 _R(IDS_HELP_MENU),
00961 CC_RUNTIME_CLASS(MenuPopupOps),
00962 OPTOKEN_HELP_MENU,
00963 MenuPopupOps::GetState,
00964 0,
00965 _R(IDBBL_HELPOP),
00966 0 );
00967 ERRORIF(!HelpOp, _R(IDE_NOMORE_MEMORY), FALSE);
00968
00969 OpDescriptor* WindowOp = new OpDescriptor(
00970 0,
00971 _R(IDS_WINDOW_MENU),
00972 CC_RUNTIME_CLASS(MenuPopupOps),
00973 OPTOKEN_WINDOW_MENU,
00974 MenuPopupOps::GetState,
00975 0,
00976 _R(IDBBL_WINDOWOP),
00977 0 );
00978 ERRORIF(!WindowOp, _R(IDE_NOMORE_MEMORY), FALSE);
00979
00980 OpDescriptor* UtilsOp = new OpDescriptor(
00981 0,
00982 _R(IDS_UTILS_MENU),
00983 CC_RUNTIME_CLASS(MenuPopupOps),
00984 OPTOKEN_UTILS_MENU,
00985 MenuPopupOps::GetState,
00986 0,
00987 0,
00988 0 );
00989 ERRORIF(!UtilsOp, _R(IDE_NOMORE_MEMORY), FALSE);
00990
00991 OpDescriptor* ArrangeOp = new OpDescriptor(
00992 0,
00993 _R(IDS_ARRANGE_MENU),
00994 CC_RUNTIME_CLASS(MenuPopupOps),
00995 OPTOKEN_ARRANGE_MENU,
00996 MenuPopupOps::GetState,
00997 0,
00998 0,
00999 0 );
01000 ERRORIF(!ArrangeOp, _R(IDE_NOMORE_MEMORY), FALSE);
01001
01002 OpDescriptor* DebugOp = new OpDescriptor(
01003 0,
01004 _R(IDS_DEBUG_MENU),
01005 CC_RUNTIME_CLASS(MenuPopupOps),
01006 OPTOKEN_DEBUG_MENU,
01007 MenuPopupOps::GetState,
01008 0,
01009 0,
01010 0 );
01011 ERRORIF(!DebugOp, _R(IDE_NOMORE_MEMORY), FALSE);
01012
01013 OpDescriptor* QualityOp = new OpDescriptor(
01014 0,
01015 _R(IDS_QUALITY_MENU),
01016 CC_RUNTIME_CLASS(MenuPopupOps),
01017 OPTOKEN_QUALITY_MENU,
01018 MenuPopupOps::GetState,
01019 0,
01020 0,
01021 0 );
01022 ERRORIF(!QualityOp, _R(IDE_NOMORE_MEMORY), FALSE);
01023
01024 OpDescriptor* BarsOp = new OpDescriptor(
01025 0,
01026 _R(IDS_BARS_CONFIG),
01027 CC_RUNTIME_CLASS(MenuPopupOps),
01028 OPTOKEN_BARS_MENU,
01029 MenuPopupOps::GetState,
01030 0,
01031 0,
01032 0 );
01033 ERRORIF(!BarsOp, _R(IDE_NOMORE_MEMORY), FALSE);
01034
01035 OpDescriptor* CombineOp = new OpDescriptor(
01036 0,
01037 _R(IDS_COMBINE_MENU),
01038 CC_RUNTIME_CLASS(MenuPopupOps),
01039 OPTOKEN_COMBINESHAPES,
01040 MenuPopupOps::GetState,
01041 0,
01042 0,
01043 0 );
01044 ERRORIF(!CombineOp, _R(IDE_NOMORE_MEMORY), FALSE);
01045
01046 OpDescriptor* NumSidesOp = new OpDescriptor(
01047 0,
01048 _R(IDS_QUICKSHAPES_NUMBERSIDES),
01049 CC_RUNTIME_CLASS(MenuPopupOps),
01050 OPTOKEN_QUICKSHAPE_NUMBERSIDES,
01051 MenuPopupOps::GetState,
01052 0,
01053 0,
01054 0 );
01055 ERRORIF(!NumSidesOp, _R(IDE_NOMORE_MEMORY), FALSE);
01056
01057
01058 PORTNOTE("other","Removed bitmap effects usage")
01059 #ifndef EXCLUDE_FROM_XARALX
01060 OpDescriptor* EditEffectOp = new OpDescriptor(
01061 0,
01062 _R(IDS_EDITEFFECT_MENU),
01063 CC_RUNTIME_CLASS(MenuPopupOps),
01064 OPTOKEN_EDITEFFECTS,
01065 MenuPopupOps::GetState,
01066 0,
01067 0,
01068 0 );
01069 ERRORIF(!EditEffectOp, _R(IDE_NOMORE_MEMORY), FALSE);
01070 #endif
01071 return TRUE;
01072 }
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093 DocOps::DocOps(): Operation()
01094 {
01095 }
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115 void DocOps::Do(OpDescriptor* WhichOp)
01116 {
01117 if ((WhichOp->Token) == String(OPTOKEN_FILEOPEN))
01118 FileOpenAction();
01119 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW))
01120 FileNewAction();
01121 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_DRAWING))
01122 FileNewAction();
01123 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_ANIMATION))
01124 FileNewAnimationAction();
01125 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE1))
01126 FileNewTemplateAction(1);
01127 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE2))
01128 FileNewTemplateAction(2);
01129 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE3))
01130 FileNewTemplateAction(3);
01131 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE4))
01132 FileNewTemplateAction(4);
01133 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE5))
01134 FileNewTemplateAction(5);
01135 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE6))
01136 FileNewTemplateAction(6);
01137 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE7))
01138 FileNewTemplateAction(7);
01139 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE8))
01140 FileNewTemplateAction(8);
01141 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE9))
01142 FileNewTemplateAction(9);
01143 else if ((WhichOp->Token) == String(OPTOKEN_FILENEW_TEMPLATE10))
01144 FileNewTemplateAction(10);
01145 else if ((WhichOp->Token) == String(OPTOKEN_FILECLOSE))
01146 {
01147
01148 FileCloseAction();
01149
01150
01151
01152
01153
01154 pOurDoc = NULL;
01155 }
01156 else if ((WhichOp->Token) == String(OPTOKEN_FILESAVE))
01157 FileSaveAction();
01158 else if ((WhichOp->Token) == String(OPTOKEN_FILESAVEAS))
01159 FileSaveAsAction();
01160 else if ((WhichOp->Token) == String(OPTOKEN_FILESAVEALL))
01161 {
01162
01163 FileSaveAllAction();
01164 }
01165 End();
01166 }
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185 BOOL DocOps::Init()
01186 {
01187 REGOP(FILE,OPEN,DocOps)
01188 REGOP(FILE,CLOSE,DocOps)
01189 REGOP(FILE,NEW,DocOps)
01190 REGOP(FILE,SAVE,DocOps)
01191 REGOP(FILE,SAVEAS,DocOps)
01192
01193 REGOP(FILE,NEW_DRAWING,DocOps)
01194 REGOP(FILE,NEW_ANIMATION,DocOps)
01195 REGOP(FILE,NEW_TEMPLATE1,DocOps)
01196 REGOP(FILE,NEW_TEMPLATE2,DocOps)
01197 REGOP(FILE,NEW_TEMPLATE3,DocOps)
01198 REGOP(FILE,NEW_TEMPLATE4,DocOps)
01199 REGOP(FILE,NEW_TEMPLATE5,DocOps)
01200 REGOP(FILE,NEW_TEMPLATE6,DocOps)
01201 REGOP(FILE,NEW_TEMPLATE7,DocOps)
01202 REGOP(FILE,NEW_TEMPLATE8,DocOps)
01203 REGOP(FILE,NEW_TEMPLATE9,DocOps)
01204 REGOP(FILE,NEW_TEMPLATE10,DocOps)
01205
01206 BOOL ok = RegisterOpDescriptor(
01207 0,
01208 _R(IDS_FILE_SAVEALL),
01209 CC_RUNTIME_CLASS(DocOps),
01210 OPTOKEN_FILESAVEALL,
01211 DocOps::GetState,
01212 0,
01213 _R(IDBBL_FILESAVEALL),
01214 _R(IDD_BARCONTROLSTORE),
01215 _R(IDC_FILESAVEALL),
01216 SYSTEMBAR_FILE,
01217 TRUE
01218 );
01219 ERRORIF(!ok, _R(IDE_NOMORE_MEMORY), FALSE);
01220
01221 return TRUE;
01222 }
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245 HelpOps::HelpOps(): Operation()
01246 {
01247 }
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267 void HelpOps::Do(OpDescriptor* WhichOp)
01268 {
01269 if ((WhichOp->Token) == String(OPTOKEN_HELPUSING))
01270 HelpUsingAction();
01271 else if ((WhichOp->Token) == String(OPTOKEN_HELPINDEX))
01272 HelpIndexAction();
01273 else if (WhichOp->Token == String(OPTOKEN_HELPTOOLS))
01274 HelpToolsAction();
01275 else if (WhichOp->Token == String(OPTOKEN_HELPGALLERIES))
01276 HelpGalleriesAction();
01277 else if (WhichOp->Token == String(OPTOKEN_HELPDEMOS))
01278 {
01279 #ifndef WEBSTER
01280 HelpDemosAction();
01281 #else // webster
01282 WebsterDemos();
01283 #endif //webster
01284 }
01285 else if (WhichOp->Token == String(OPTOKEN_HELPPLAYER))
01286 {
01287 HelpPlayerAction();
01288 }
01289 else if (WhichOp->Token == String(OPTOKEN_HELPTECHSUPPORT))
01290 HelpTechSupportAction();
01291
01292 #ifdef INC_WEB_MENU_ITEMS
01293 else if (WhichOp->Token == String(OPTOKEN_XARAX_FORUM))
01294 HelpXaraForumAction();
01295 else if (WhichOp->Token == String(OPTOKEN_WEBSTER_HOME_PAGE))
01296 HelpWebsterHomePage();
01297 else if (WhichOp->Token == String(OPTOKEN_XARA_HOME_PAGE))
01298 HelpXaraHomePage();
01299 else if (WhichOp->Token == String(OPTOKEN_HINTS_AND_TIPS_PAGES))
01300 WebsterHelpPages();
01301 else if (WhichOp->Token == String(OPTOKEN_XARA_PURCHASE_PAGE))
01302 HelpXaraPurchasePage();
01303
01304 #endif //INC_WEB_MENU_ITEMS
01305
01306 #ifdef INC_WEB_MENU_ITEMS
01307 else if (WhichOp->Token == String(OPTOKEN_WEBLINK))
01308 if(GetCDHelpOn())
01309 SetWebsterReg(FALSE);
01310 else
01311 SetWebsterReg(TRUE);
01312 #endif //INC_WEB_MENU_ITEMS
01313
01314 #ifdef STANDALONE
01315 else if ((WhichOp->Token) == String(OPTOKEN_HELPSPEC))
01316 HelpSpecAction();
01317 #endif
01318
01319 End();
01320 }
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339 OpState HelpOps::GetState(String_256* UIDescription, OpDescriptor* OpDesc)
01340 {
01341
01342 #ifdef INC_WEB_MENU_ITEMS
01343 if (OpDesc->Token == String(OPTOKEN_WEBLINK))
01344 {
01345 OpState Opst;
01346 BOOL RegistryFlag = IsCDROMOn();
01347 if(RegistryFlag)
01348 {
01349 Opst.Ticked = TRUE;
01350 SetCDHelpOn(TRUE);
01351 }
01352 else
01353 {
01354 Opst.Ticked = FALSE;
01355 SetCDHelpOn(FALSE);
01356 }
01357 return Opst;
01358 }
01359 else
01360 #endif //INC_WEB_MENU_ITEMS
01361 return OpState(FALSE, FALSE);
01362 }
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380 #define HID_HELP_TOOLS (0)
01381 #define HID_HELP_GALLERIES (0)
01382 #define HID_HELP_DEMOS (0)
01383 #define HID_HELP_PLAYER (0)
01384 #define HID_HELP_TECHSUPPORT (0)
01385
01386 BOOL HelpOps::Init()
01387 {
01388 REGOP(HELP,USING,HelpOps)
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402 OpDescriptor* IndexOp = new OpDescriptor(
01403 0,
01404 _R(IDS_HELP_TOPICS),
01405 CC_RUNTIME_CLASS(HelpOps),
01406 OPTOKEN_HELPINDEX,
01407 HelpOps::GetState,
01408 HID_HELP_INDEX,
01409 _R(IDBBL_HELPINDEXOP),
01410 0 );
01411
01412 ERRORIF(!IndexOp, _R(IDE_NOMORE_MEMORY), FALSE);
01413
01414
01415 OpDescriptor* DemosOp = new OpDescriptor(
01416 0,
01417 _R(IDS_HELP_MOVIES),
01418 CC_RUNTIME_CLASS(HelpOps),
01419 OPTOKEN_HELPDEMOS,
01420 HelpOps::GetState,
01421 HID_HELP_DEMOS,
01422 _R(IDBBL_HELPDEMOSOP),
01423 0 );
01424
01425 ERRORIF(!DemosOp, _R(IDE_NOMORE_MEMORY), FALSE);
01426
01427
01428 OpDescriptor* PlayerOp = new OpDescriptor(
01429 0,
01430 _R(IDS_HELP_PLAYER),
01431 CC_RUNTIME_CLASS(HelpOps),
01432 OPTOKEN_HELPPLAYER,
01433 HelpOps::GetState,
01434 HID_HELP_PLAYER,
01435 _R(IDBBL_HELPPLAYEROP),
01436 0 );
01437
01438 ERRORIF(!PlayerOp, _R(IDE_NOMORE_MEMORY), FALSE);
01439
01440
01441 #ifdef INC_WEB_MENU_ITEMS
01442
01443 OpDescriptor* WebsOp = new OpDescriptor(
01444 0,
01445 _R(IDS_XARA_WEB),
01446 CC_RUNTIME_CLASS(HelpOps),
01447 OPTOKEN_XARA_WEB_MENU,
01448 HelpOps::GetState,
01449 0,
01450 0,
01451 0 );
01452
01453 ERRORIF(!WebsOp, _R(IDE_NOMORE_MEMORY), FALSE);
01454
01455
01456 OpDescriptor* ForumOp = new OpDescriptor(
01457 0,
01458 _R(IDS_XARAX_FORUM),
01459 CC_RUNTIME_CLASS(HelpOps),
01460 OPTOKEN_XARAX_FORUM,
01461 HelpOps::GetState,
01462 0,
01463 0,
01464 0 );
01465
01466 ERRORIF(!ForumOp, _R(IDE_NOMORE_MEMORY), FALSE);
01467
01468
01469 OpDescriptor* WebsHomePageOp = new OpDescriptor(
01470 0,
01471 _R(IDS_WEBSTER_HOME_PAGE),
01472 CC_RUNTIME_CLASS(HelpOps),
01473 OPTOKEN_WEBSTER_HOME_PAGE,
01474 HelpOps::GetState,
01475 0,
01476 0,
01477 0 );
01478
01479 ERRORIF(!WebsHomePageOp, _R(IDE_NOMORE_MEMORY), FALSE);
01480
01481
01482 OpDescriptor* XaraHomePageOp = new OpDescriptor(
01483 0,
01484 _R(IDS_XARA_HOME_PAGE),
01485 CC_RUNTIME_CLASS(HelpOps),
01486 OPTOKEN_XARA_HOME_PAGE,
01487 HelpOps::GetState,
01488 0,
01489 0,
01490 0 );
01491
01492 ERRORIF(!XaraHomePageOp, _R(IDE_NOMORE_MEMORY), FALSE);
01493
01494
01495 OpDescriptor* XaraPurchasePageOp = new OpDescriptor(
01496 0,
01497 _R(IDS_XARA_PURCHASE_PAGE),
01498 CC_RUNTIME_CLASS(HelpOps),
01499 OPTOKEN_XARA_PURCHASE_PAGE,
01500 HelpOps::GetState,
01501 0,
01502 0,
01503 0 );
01504
01505 ERRORIF(!XaraPurchasePageOp, _R(IDE_NOMORE_MEMORY), FALSE);
01506
01507 OpDescriptor* HintsAndTipsPagesOp = new OpDescriptor(
01508 0,
01509 _R(IDS_HINTS_AND_TIPS_PAGES),
01510 CC_RUNTIME_CLASS(HelpOps),
01511 OPTOKEN_HINTS_AND_TIPS_PAGES,
01512 HelpOps::GetState,
01513 0,
01514 0,
01515 0 );
01516
01517 ERRORIF(!HintsAndTipsPagesOp, _R(IDE_NOMORE_MEMORY), FALSE);
01518
01519
01520
01521 OpDescriptor* WebLink = new OpDescriptor(
01522 0,
01523 _R(IDS_WEBLINK),
01524 CC_RUNTIME_CLASS(HelpOps),
01525 OPTOKEN_WEBLINK,
01526 HelpOps::GetState,
01527 0,
01528 0,
01529 0 );
01530
01531 ERRORIF(!WebLink, _R(IDE_NOMORE_MEMORY), FALSE);
01532
01533 #endif // INC_WEB_MENU_ITEMS
01534
01535 REGOP(HELP, TOOLS, HelpOps);
01536 REGOP(HELP, GALLERIES, HelpOps);
01537
01538 REGOP(HELP, TECHSUPPORT, HelpOps);
01539
01540 #ifdef STANDALONE
01541 REGOP(HELP,SPEC,HelpOps)
01542 #endif
01543
01544 return TRUE;
01545 }
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566 WindowOps::WindowOps(): Operation()
01567 {
01568 }
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588 void WindowOps::Do(OpDescriptor* WhichOp)
01589 {
01590 if( WhichOp->Token == String( OPTOKEN_NEXTDOCUMENT ) )
01591 WindowNextDcocument( true );
01592 else if( WhichOp->Token == String( OPTOKEN_LASTDOCUMENT ) )
01593 WindowNextDcocument( false );
01594
01595 PORTNOTETRACE("other","WindowOps::Do - do nothing");
01596 #ifndef EXCLUDE_FROM_XARALX
01597 else if ((WhichOp->Token) == String(OPTOKEN_WINDOWNEWVIEW))
01598 WindowNewAction();
01599 else if ((WhichOp->Token) == String(OPTOKEN_WINDOWARRANGE))
01600 WindowArrangeAction();
01601 else if ((WhichOp->Token) == String(OPTOKEN_WINDOWCASCADE))
01602 WindowCascadeAction();
01603 else if ((WhichOp->Token) == String(OPTOKEN_WINDOWTILE))
01604 WindowTileHorzAction();
01605
01606
01607
01608
01609 #endif
01610 End();
01611 }
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630 OpState WindowOps::GetState(String_256* UIDescription, OpDescriptor*)
01631 {
01632 PORTNOTETRACE("other","WindowOps::GetState - do nothing");
01633 #ifndef EXCLUDE_FROM_XARALX
01634 return WindowCmdState();
01635 #else
01636 return OpState();
01637 #endif
01638 }
01639
01640
01641
01642
01643
01644
01645
01646
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656 BOOL WindowOps::Init()
01657 {
01658 PORTNOTETRACE("other","WindowOps::Do - do nothing");
01659 #ifndef EXCLUDE_FROM_XARALX
01660 REGOP(WINDOW,NEWVIEW,WindowOps)
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673 REGOP(WINDOW,ARRANGE,WindowOps)
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686 REGOP(WINDOW,CASCADE,WindowOps)
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699 REGOP(WINDOW,TILE,WindowOps)
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710 #endif
01711
01712
01713 OpDescriptor* NextDocumentOp = new OpDescriptor(
01714 0,
01715 _R(IDS_NEXTDOCUMENT),
01716 CC_RUNTIME_CLASS(WindowOps),
01717 OPTOKEN_NEXTDOCUMENT,
01718 WindowOps::GetState,
01719 0,
01720 _R(IDBBL_NEXTDOCUMENT),
01721 0 );
01722
01723 ERRORIF(!NextDocumentOp, _R(IDE_NOMORE_MEMORY), FALSE);
01724
01725
01726 OpDescriptor* LastDocumentOp = new OpDescriptor(
01727 0,
01728 _R(IDS_LASTDOCUMENT),
01729 CC_RUNTIME_CLASS(WindowOps),
01730 OPTOKEN_LASTDOCUMENT,
01731 WindowOps::GetState,
01732 0,
01733 _R(IDBBL_LASTDOCUMENT),
01734 0 );
01735
01736 ERRORIF(!LastDocumentOp, _R(IDE_NOMORE_MEMORY), FALSE);
01737
01738 return TRUE;
01739 }
01740
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760 ViewOps::ViewOps(): Operation()
01761 {
01762 }
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778 BOOL ViewOps::OnIdleEvent(void)
01779 {
01780 if(DoFullScreen)
01781 {
01782 Progress::Start(FALSE);
01783
01784 PORTNOTE("other","Removed ViewFullScreenAction usage")
01785 #ifndef EXCLUDE_FROM_XARALX
01786 ViewFullScreenAction();
01787 #endif
01788
01789 GetApplication()->RemoveIdleProcessor(IDLEPRIORITY_HIGH, this);
01790
01791 End();
01792 DoFullScreen = FALSE;
01793
01794 #ifndef STANDALONE
01795 PORTNOTE("other","Removed ToolbarDlg usage")
01796 #ifndef EXCLUDE_FROM_XARALX
01797
01798 ToolbarDlg * pToolbarDlg = ToolbarDlg::GetToolbarDlg();
01799 if(pToolbarDlg)
01800 pToolbarDlg->ShowToolbarList();
01801 #endif
01802 #endif
01803 Progress::Stop();
01804 }
01805 return(FALSE);
01806 }
01807
01808
01809
01810
01811
01812
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829 void ViewOps::Do(OpDescriptor* WhichOp)
01830 {
01831 DoFullScreen = FALSE;
01832 if ((WhichOp->Token) == String(OPTOKEN_VIEWFULLSCREEN))
01833 {
01834
01835 GetApplication()->RemoveIdleProcessor(IDLEPRIORITY_HIGH, this);
01836
01837 GetApplication()->RegisterIdleProcessor(IDLEPRIORITY_HIGH, this);
01838 DoFullScreen = TRUE;
01839
01840 return;
01841 }
01842
01843 if ((WhichOp->Token) == String(OPTOKEN_VIEWTOOLBAR))
01844 ViewToolBarAction();
01845 else if ((WhichOp->Token) == String(OPTOKEN_VIEWSTATUSBAR))
01846 ViewStatusBarAction();
01847 else if ((WhichOp->Token) == String(OPTOKEN_VIEWCOLOURBAR))
01848 ViewColourBarAction();
01849 else if ((WhichOp->Token) == String(OPTOKEN_VIEWSCROLLBARS))
01850 ViewScrollBarsAction();
01851 else if ((WhichOp->Token) == String(OPTOKEN_VIEWRULERS))
01852 ViewRulersAction();
01853
01854 End();
01855 }
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874 OpState ViewOps::GetState(String_256* UIDescription, OpDescriptor* WhichOp)
01875 {
01876 if ((WhichOp->Token) == String(OPTOKEN_VIEWTOOLBAR))
01877 return ViewToolBarState();
01878 else if ((WhichOp->Token) == String(OPTOKEN_VIEWSTATUSBAR))
01879 return ViewStatusBarState();
01880 else if ((WhichOp->Token) == String(OPTOKEN_VIEWCOLOURBAR))
01881 return ViewColourBarState();
01882 else if ((WhichOp->Token) == String(OPTOKEN_VIEWFULLSCREEN))
01883 return ViewFullScreenState();
01884 else if ((WhichOp->Token) == String(OPTOKEN_VIEWSCROLLBARS))
01885 return ViewScrollBarsState();
01886 else if ((WhichOp->Token) == String(OPTOKEN_VIEWRULERS))
01887 return ViewRulersState();
01888
01889 return OpState(FALSE, FALSE);
01890 }
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908 BOOL ViewOps::Init()
01909 {
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922 REGOP(VIEW,STATUSBAR,ViewOps)
01923 OpDescriptor* ColourOp = new OpDescriptor(
01924 0,
01925 _R(IDS_VIEW_COLOURBAR),
01926 CC_RUNTIME_CLASS(ViewOps),
01927 OPTOKEN_VIEWCOLOURBAR,
01928 ViewOps::GetState,
01929 0,
01930 0,
01931 0,
01932 0,
01933 TRUE,
01934 FALSE,
01935 TRUE,
01936 0,
01937 0,
01938 TRUE
01939 );
01940
01941 ERRORIF(!ColourOp, _R(IDE_NOMORE_MEMORY), FALSE);
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954 PORTNOTETRACE("other","ViewOps::Init - do nothing");
01955 #ifndef EXCLUDE_FROM_XARALX
01956 BOOL FullScreenOp = RegisterOpDescriptor(
01957 0,
01958 _R(IDS_VIEW_FULLSCREEN),
01959 CC_RUNTIME_CLASS(ViewOps),
01960 OPTOKEN_VIEWFULLSCREEN,
01961 ViewOps::GetState,
01962 HID_VIEW_FULLSCREEN,
01963 _R(IDBBL_VIEWFULLSCREENOP),
01964 _R(IDD_BARCONTROLSTORE),
01965 _R(IDC_BTN_VIEWFULLSCREEN),
01966 SYSTEMBAR_VIEW,
01967 TRUE
01968 );
01969
01970
01971 ERRORIF(!FullScreenOp, _R(IDE_NOMORE_MEMORY), FALSE);
01972 #endif
01973
01974 OpDescriptor* ScrollBarsOp = new OpDescriptor(
01975 0,
01976 _R(IDS_VIEW_SCROLLBARS),
01977 CC_RUNTIME_CLASS(ViewOps),
01978 OPTOKEN_VIEWSCROLLBARS,
01979 ViewOps::GetState,
01980 0,
01981 0,
01982 0,
01983 0,
01984 TRUE,
01985 FALSE,
01986 TRUE,
01987 0,
01988 0,
01989 TRUE
01990 );
01991
01992 ERRORIF(!ScrollBarsOp, _R(IDE_NOMORE_MEMORY), FALSE);
01993
01994
01995 OpDescriptor* RulerOp = new OpDescriptor(
01996 0,
01997 _R(IDS_VIEW_RULERS),
01998 CC_RUNTIME_CLASS(ViewOps),
01999 OPTOKEN_VIEWRULERS,
02000 ViewOps::GetState,
02001 0,
02002 _R(IDBBL_PAGERULERS),
02003 _R(IDD_BARCONTROLSTORE),
02004 _R(IDC_PAGERULERS),
02005 TRUE,
02006 FALSE,
02007 TRUE,
02008 0,
02009 0,
02010 TRUE
02011 );
02012
02013 ERRORIF(!RulerOp, _R(IDE_NOMORE_MEMORY), FALSE);
02014
02015 return TRUE;
02016 }
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040 DummyOp::DummyOp(): Operation()
02041 {
02042 }
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052
02053
02054
02055
02056
02057
02058
02059
02060
02061 void DummyOp::Do(OpDescriptor*)
02062 {
02063 End();
02064 }
02065
02066
02067
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083 OpState DummyOp::GetState(String_256* UIDescription, OpDescriptor*)
02084 {
02085 return OpState( FALSE, TRUE );
02086 }
02087
02088
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098
02099
02100
02101
02102
02103 BOOL DummyOp::Init()
02104 {
02105 DUMMYOP( _R(IDS_DO_NOTHING), OPTOKEN_DO_NOTHING);
02106
02107
02108 DUMMYOP(_R(IDS_FILE_MERGE), OPTOKEN_FILEMERGE);
02109
02110
02111
02112
02113
02114
02115
02116
02117 DUMMYOP(_R(IDS_EDIT_OBJECT_INFO), OPTOKEN_EDITOBJECTINFO);
02118 DUMMYOP(_R(IDS_ATTR_FONT), OPTOKEN_ATTRFONT);
02119 DUMMYOP(_R(IDS_ATTR_LINE), OPTOKEN_ATTRLINE);
02120 DUMMYOP(_R(IDS_ATTR_FILL), OPTOKEN_ATTRFILL);
02121 DUMMYOP(_R(IDS_ATTR_STYLE), OPTOKEN_ATTRSTYLE);
02122
02123
02124
02125
02126
02127
02128
02129
02130 DUMMYOP(_R(IDS_MAKEMASK), OPTOKEN_MAKEMASK);
02131 DUMMYOP(_R(IDS_MASKINSIDE), OPTOKEN_MASKINSIDE);
02132
02133
02134
02135
02136 DUMMYOP(_R(IDS_UTIL_CUSTOMIZE), OPTOKEN_UTILCUSTOMIZE);
02137
02138
02139 DUMMYOP(_R(IDS_WINDOW_EASY_MDI), OPTOKEN_WINDOWEASYMDI);
02140
02141 DUMMYOP(_R(IDS_WINDOW_RULERS), OPTOKEN_WINDOWRULERS);
02142
02143
02144 DUMMYOP(_R(IDS_WINDOW_BORDERS), OPTOKEN_WINDOWBORDERS);
02145 DUMMYOP(_R(IDS_WINDOW_QUALITY), OPTOKEN_WINDOWQUALITY);
02146 DUMMYOP(_R(IDS_WINDOW_SEPARATION), OPTOKEN_WINDOWSEPARATION);
02147
02148
02149
02150 DUMMYOP(_R(IDS_EDIT_PASTE_LINK), OPTOKEN_EDITPASTESPECIAL);
02151 DUMMYOP(_R(IDS_EDIT_OLE_INSERT), OPTOKEN_EDITOLEINSERT);
02152 DUMMYOP(_R(IDS_EDIT_OLE_LINKS), OPTOKEN_EDITOLELINKS);
02153 DUMMYOP(_R(IDS_EDIT_OLE_OBJECT), OPTOKEN_EDITOLEOBJECT);
02154
02155
02156
02157
02158
02159 DUMMYOP(_R(IDS_GALLERIES_SUB_OP), OPTOKEN_GALLERIES_SUBMENU);
02160 DUMMYOP(_R(IDS_ANIMATION_SUB_OP), OPTOKEN_ANIMATION_SUBMENU);
02161 return (TRUE);
02162 }
02163
02164
02165
02166
02167 String_256 OpUpdate::IndexBaseURL = _T("http://xara.xaraonline.com/XaraX2/WebFiles/");
02168 String_32 OpUpdate::IndexLeafName = _T("index.xml");
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180
02181 OpUpdate::OpUpdate(): Operation()
02182 {}
02183
02184
02185
02186
02187
02188
02189
02190
02191
02192
02193
02194
02195 void OpUpdate::DoWithParam(OpDescriptor*, OpParam* pOpParam)
02196 {
02197 PORTNOTETRACE("other","OpUpdate::DoWithParam - do nothing");
02198 #ifndef EXCLUDE_FROM_XARALX
02199 BOOL forcedByUser = (BOOL)pOpParam->Param1;
02200
02201 if (!forcedByUser)
02202 {
02203
02204 CheckForNewFiles();
02205
02206
02207
02208 if (!UpdateDontShowAgain)
02209 {
02210 CWebDialogDlg webdlg(TRUE, _T("UpgradeLX.web"), TRUE, NULL, 0, FALSE);
02211 webdlg.DoModal();
02212 UpdateDontShowAgain = webdlg.DontShowAgain();
02213 }
02214 else if (!SpecialsDontShowAgain)
02215 {
02216 CWebDialogDlg webdlg(TRUE, GetSpecialsFile());
02217 webdlg.DoModal();
02218 SpecialsDontShowAgain = webdlg.DontShowAgain();
02219 }
02220 }
02221 else
02222 Progress::Start(FALSE, _R(IDS_UPDATING_SPECIALS), -1);
02223
02224
02225
02226 BOOL bOK = UpdateFiles(forcedByUser);
02227
02228 if (forcedByUser)
02229 Progress::Stop();
02230
02231 if (bOK && forcedByUser)
02232 {
02233
02234 CheckForNewFiles();
02235
02236
02237
02238
02239 CWebDialogDlg webdlg(FALSE, _T("UpgradeLX.web"), FALSE, NULL, 0, TRUE);
02240 webdlg.DoModal();
02241
02242
02243 }
02244
02245
02246
02247 if (forcedByUser)
02248 {
02249 HelpDownloadOp::CheckForNewFiles(forcedByUser);
02250 }
02251 #endif
02252 End();
02253 }
02254
02255
02256
02257
02258
02259
02260
02261
02262
02263
02264
02265
02266 void OpUpdate::Do(OpDescriptor* od)
02267 {
02268 PORTNOTETRACE("other","OpUpdate::Do - do nothing");
02269 #ifndef EXCLUDE_FROM_XARALX
02270 this->DoWithParam(od,&OpParam((INT32) TRUE, NULL));
02271 #endif
02272 }
02273
02274
02275
02276
02277
02278
02279
02280 BOOL OpUpdate::UpdateDontShowAgain = TRUE;
02281 BOOL OpUpdate::SpecialsDontShowAgain = TRUE;
02282 INT32 OpUpdate::UpdateFileDate = 0;
02283 INT32 OpUpdate::SpecialsFileDate = 0;
02284
02285
02286
02287
02288
02289
02290
02291
02292
02293
02294
02295
02296
02297 BOOL OpUpdate::Init()
02298 {
02299 PORTNOTETRACE("other","OpUpdate::Init - do nothing");
02300 #ifndef EXCLUDE_FROM_XARALX
02301 if (!
02302 RegisterOpDescriptor(
02303 0,
02304 _T( _R(IDS_APP_UPDATE) ),
02305 CC_RUNTIME_CLASS(OpUpdate),
02306 OPTOKEN_UPDATE,
02307 OpUpdate::GetState
02308 )
02309 )
02310 {
02311 return FALSE;
02312 }
02313 if (!Camelot.DeclareSection(TEXT("Update"), 12)
02314 || !Camelot.DeclarePref(TEXT("Update"), TEXT("UpdateDontShowAgain"), &UpdateDontShowAgain)
02315 || !Camelot.DeclarePref(TEXT("Update"), TEXT("SpecialsDontShowAgain"), &SpecialsDontShowAgain)
02316 || !Camelot.DeclarePref(TEXT("Update"), TEXT("UpdateFileDate"), &UpdateFileDate)
02317 || !Camelot.DeclarePref(TEXT("Update"), TEXT("SpecialsFileDate"), &SpecialsFileDate)
02318 || !Camelot.DeclarePref(TEXT("Update"), TEXT("WebFilesIndexLeafName"), &IndexLeafName)
02319
02320
02321
02322 #ifdef _DEBUG
02323 || !Camelot.DeclarePref(TEXT("Update"), TEXT("WebFilesBaseURL"), &IndexBaseURL)
02324 #endif
02325 )
02326 {
02327 return FALSE;
02328 }
02329 #endif
02330
02331 return TRUE;
02332 }
02333
02334
02335
02336
02337
02338
02339
02340
02341
02342
02343
02344
02345 void OpUpdate::CheckForNewFiles()
02346 {
02347 PORTNOTETRACE("other","OpUpdate::CheckForNewFiles - do nothing");
02348 #ifndef EXCLUDE_FROM_XARALX
02349
02350
02351
02352 String_256 sUpgradeFile = GetWebFilePath(_T("UpgradeLX.web"));
02353 String_256 sSpecialsFileName = GetSpecialsFile();
02354 String_256 sSpecialsFilePath = GetWebFilePath(sSpecialsFileName);
02355
02356 CFileStatus status;
02357
02358 if (CFile::GetStatus(sUpgradeFile, status))
02359 {
02360 if (status.m_mtime.GetTime() > UpdateFileDate)
02361 {
02362
02363 if (UpdateFileDate != 0)
02364 UpdateDontShowAgain = FALSE;
02365
02366 UpdateFileDate = status.m_mtime.GetTime();
02367 }
02368 }
02369 if (CFile::GetStatus(sSpecialsFilePath, status))
02370 {
02371 if (status.m_mtime.GetTime() > SpecialsFileDate)
02372 {
02373 SpecialsDontShowAgain = FALSE;
02374 SpecialsFileDate = status.m_mtime.GetTime();
02375 }
02376 }
02377 #endif
02378 }
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391 String_256 OpUpdate::GetSpecialsFile()
02392 {
02393 String_256 SpecialsFile;
02394
02395 SpecialsFile = _T("SpecialsLX.web");
02396
02397 return SpecialsFile;
02398 }
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408 String_256 OpUpdate::GetWebFileRoot()
02409 {
02410 String_256 exepath;
02411 PORTNOTETRACE("other","OpUpdate::GetWebFileRoot - do nothing");
02412 #ifndef EXCLUDE_FROM_XARALX
02413
02414 PORTNOTE("other","Removed CResDll usage")
02415 #ifndef EXCLUDE_FROM_XARALX
02416 CResDll::GetExecutablePath(exepath);
02417 #endif
02418 return String_256(exepath) + _T("\\WebFiles");
02419 #else
02420 return exepath;
02421 #endif
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436 }
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449 String_256 OpUpdate::GetWebFilePath(LPCTSTR filename)
02450 {
02451 String_256 webfilepath;
02452
02453 PORTNOTETRACE("other","OpUpdate::GetWebFilePath - do nothing");
02454 #ifndef EXCLUDE_FROM_XARALX
02455 CFileStatus TempStatus;
02456
02457
02458 webfilepath = GetWebFileRoot() + _T("\\") + CResDll::GetCurrentLocale();
02459 webfilepath += _T("\\") + String_256(filename);
02460
02461
02462 if (!CFile::GetStatus(webfilepath, TempStatus))
02463 {
02464 webfilepath = GetWebFileRoot() + _T("\\ENG\\") + String_256(filename);
02465 }
02466 TRACEUSER( "Marc", _T("webfilepath = %s\n"),webfilepath);
02467 #endif
02468 return webfilepath;
02469 }
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483 BOOL OpUpdate::UpdateFiles(BOOL bForeground)
02484 {
02485 return UpdateFiles(bForeground, GetWebFileRoot(), GetUpdateURL(), (String_256)IndexLeafName, _T("UpdateMessages"));
02486 }
02487
02488
02489
02490
02491
02492
02493
02494
02495
02496
02497
02498
02499
02500
02501
02502
02503
02504
02505 BOOL OpUpdate::UpdateFiles(BOOL bForeground,
02506 const String_256& strClientFolder,
02507 const String_256& strURL,
02508 const String_256& strIndexLeafName,
02509 const String_256& strRegKeyName
02510 )
02511 {
02512 PORTNOTETRACE("other","OpUpdate::UpdateFiles - do nothing");
02513 #ifndef EXCLUDE_FROM_XARALX
02514 WEBFILEUPDATERLib::IWebFileUpdaterPtr pWebFileUpdater;
02515 HRESULT hr = pWebFileUpdater.CreateInstance(__uuidof(WebFileUpdater));
02516 ERROR2IF(FAILED(hr), FALSE, "Failed To create WebFileUpdater object");
02517
02518 pWebFileUpdater->put_ClientFolder(_bstr_t(strClientFolder));
02519 pWebFileUpdater->put_ServerURL(_bstr_t(strURL));
02520 pWebFileUpdater->put_IndexName(_bstr_t(strIndexLeafName));
02521
02522 #ifndef _DEBUG
02523
02524
02525
02526
02527
02528 HKEY hKey = CreateRegKey(hAppStateRegKey, strRegKeyName);
02529 if (hKey)
02530 {
02531
02532 if (GetRegDword(hKey, _T("ServerCheck"))==0)
02533 SetRegDword(hKey, _T("ServerCheck"), 0);
02534 CloseRegKey(hKey);
02535
02536 String_256 strFullRegKeyPath = _T(PRODUCT_REGISTRYKEY_USERPATH) + strRegKeyName;
02537 pWebFileUpdater->put_RegistryKeyPath(_bstr_t(strFullRegKeyPath));
02538 }
02539 #endif
02540
02541 hr = pWebFileUpdater->raw_Update((BSTR)NULL, !bForeground);
02542 if (FAILED(hr))
02543 {
02544 UINT32 idMessage = 0;
02545
02546
02547 if (hr==0x80041008)
02548 idMessage = _R(IDS_WARN_PROGRAMFOLDER_READONLY);
02549
02550 else if (hr==0x80041009)
02551 idMessage = _R(IDS_WARN_PROGRAMFOLDER_UNAVAILABLE);
02552
02553 else if (hr==0x80041007)
02554 idMessage = _R(IDS_WARN_PROGRAMFOLDER_NOTWRITABLE);
02555
02556 if (idMessage!=0)
02557 {
02558 if (bForeground)
02559 idMessage = idMessage+1;
02560 ErrorInfo error;
02561 error.ErrorMsg = idMessage;
02562 error.Button[0] = _R(IDS_CONTINUE);
02563 INT32 ret = InformWarning(&error);
02564 }
02565 else if (bForeground)
02566 {
02567
02568
02569
02570 ErrorInfo error;
02571 error.ErrorMsg = _R(IDE_FAILEDTOUPDATEHANDS);
02572 error.Button[0] = _R(IDS_CONTINUE);
02573 INT32 ret = InformWarning(&error);
02574 }
02575 return FALSE;
02576 }
02577 #endif
02578 return TRUE;
02579 }
02580
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592
02593
02594 String_256 OpUpdate::GetUpdateURL()
02595 {
02596 PORTNOTETRACE("other","OpUpdate::GetUpdateURL() - do nothing");
02597 #ifndef EXCLUDE_FROM_XARALX
02598 String_256 sTemp;
02599 sTemp = IndexBaseURL;
02600 sTemp += PRODUCT_RETAIL_VERSION_NO;
02601 LPCTSTR szURL = sTemp;
02602 String_256 strURLEnc(szURL);
02603 DWORD dwLen = camStrlen(szURL) * 3;
02604
02605
02606 InternetCanonicalizeUrl(szURL, strURLEnc.GetBuffer(dwLen), &dwLen, 0);
02607 strURLEnc.ReleaseBuffer();
02608
02609 return strURLEnc;
02610 #else
02611 return String_256(_T(""));
02612 #endif
02613 }
02614
02615
02616
02617
02618
02619
02620
02621
02622
02623 OpRegister::OpRegister(): Operation()
02624 {}
02625
02626 BOOL OpRegister::RegisteredOnline = FALSE;
02627 PORTNOTE("other","OpRegister removed use of DATE type");
02628 #ifndef EXCLUDE_FROM_XARALX
02629 DATE OpRegister::LastCheck = (DATE)1.0;
02630 #endif
02631 INT32 OpRegister::DaysBetweenAutoChecks = 5 ;
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642 void OpRegister::DoWithParam(OpDescriptor*, OpParam* pOpParam)
02643 {
02644 PORTNOTETRACE("other","OpRegister::DoWithParam - do nothing");
02645 #ifndef EXCLUDE_FROM_XARALX
02646 BOOL Requested = (BOOL)pOpParam->Param1;
02647 if(Requested)
02648 {
02649 if(RegisterOnline())
02650 {
02651 put_HasRegistered(TRUE);
02652 }
02653 }
02654 else
02655 {
02656
02657 if(!get_HasRegistered())
02658 {
02659 COleDateTimeSpan ts = COleDateTime::GetCurrentTime() - COleDateTime(LastCheck);
02660 INT32 DaysSinceLastCheck = ts.GetTotalDays();
02661 if( DaysSinceLastCheck >= DaysBetweenAutoChecks )
02662 {
02663 CRegisterDialog RegisterDlg;
02664 switch(RegisterDlg.DoModal())
02665 {
02666 case IDOK:
02667 if(RegisterOnline())
02668 {
02669 put_HasRegistered(TRUE);
02670 }
02671 break;
02672 case IDCANCEL:
02673 default:
02674 {
02675 LastCheck = COleDateTime::GetCurrentTime().m_dt;
02676 }
02677 break;
02678 }
02679 }
02680 }
02681 }
02682 #endif
02683 }
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693 void OpRegister::Do(OpDescriptor* od)
02694 {
02695 OpParam temp((INT32) TRUE, (void *)NULL);
02696 this->DoWithParam(od, &temp);
02697 }
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707 BOOL OpRegister::Init()
02708 {
02709 PORTNOTETRACE("other","OpRegister::Init - do nothing");
02710 #ifndef EXCLUDE_FROM_XARALX
02711 if (!
02712 RegisterOpDescriptor(
02713 0,
02714 _R(IDS_REGISTER_MENUTEXT),
02715 CC_RUNTIME_CLASS(OpRegister),
02716 OPTOKEN_REGISTER,
02717 OpRegister::GetState
02718 )
02719 )
02720 {
02721 return FALSE;
02722 }
02723 if (!Camelot.DeclareSection(TEXT("Register"), 2)
02724 || !Camelot.DeclarePref(TEXT("Register"), TEXT("LastCheck"), &LastCheck)
02725 )
02726 {
02727 return FALSE;
02728 }
02729 #endif
02730
02731 return TRUE;
02732 }
02733
02734
02735
02736
02737
02738
02739
02740
02741
02742 String_256 OpRegister::GetSerialNumber()
02743 {
02744
02745
02746 String_256 serialNumber = "";
02747
02748 PORTNOTETRACE("other","OpRegister::getSerialNumber - do nothing");
02749 #ifndef EXCLUDE_FROM_XARALX
02750
02751 HKEY hKey = NULL;
02752 INT32 i;
02753 char unlockCode[32];
02754 DWORD dwType = REG_SZ;
02755 DWORD dwSize = sizeof(unlockCode);
02756
02757
02758 for(i=0;i<32;i++)
02759 {
02760 unlockCode[i] = NULL;
02761 }
02762
02763
02764 hKey = OpenRegKey(HKEY_CLASSES_ROOT,SERIALNO_REGPATH);
02765 if(hKey != NULL)
02766 {
02767 GetRegValue(hKey,"ulc",&dwType,unlockCode,&dwSize);
02768
02769 serialNumber = unlockCode;
02770
02771
02772 RegCloseKey(hKey);
02773 }
02774 #endif
02775
02776 return serialNumber;
02777 }
02778
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790 BOOL OpRegister::get_HasRegistered()
02791 {
02792 PORTNOTETRACE("other","OpRegister::get_HasRegistered - do nothing - always registered?");
02793 #ifndef EXCLUDE_FROM_XARALX
02794
02795 HKEY hKey = OpenRegKey(HKEY_CLASSES_ROOT,SERIALNO_REGPATH);
02796 BOOL bRegistered = GetRegBool(hKey,TEXT("HasRegistered"));
02797 CloseRegKey(hKey);
02798 return bRegistered;
02799 #else
02800 return TRUE;
02801 #endif
02802 }
02803
02804
02805
02806
02807
02808
02809
02810
02811
02812 void OpRegister::put_HasRegistered(BOOL bHasRegistered)
02813 {
02814 PORTNOTETRACE("other","OpRegister::get_HasRegistered - do nothing - always registered?");
02815 #ifndef EXCLUDE_FROM_XARALX
02816 HKEY hKey = OpenRegKey(HKEY_CLASSES_ROOT,SERIALNO_REGPATH);
02817 SetRegBool(hKey, TEXT("HasRegistered"), bHasRegistered);
02818 CloseRegKey(hKey);
02819 #endif
02820 }
02821
02822
02823
02824
02825
02826
02827
02828
02829
02830
02831
02832 BOOL OpRegister::RegisterOnline()
02833 {
02834 PORTNOTETRACE("other","OpRegister::RegsiterOnline - do nothing");
02835 #ifndef EXCLUDE_FROM_XARALX
02836 BOOL RegSuccess = FALSE;
02837 IStratusClient2Ptr pStratusClient;
02838 HRESULT hr = pStratusClient.CreateInstance(__uuidof(StratusClient_1_0_2)) ;
02839 ERROR2IF(FAILED(hr), FALSE, "Stratus Client didn't create") ;
02840
02841 pStratusClient->put_ParentWindow((INT32)(GetMainFrame()->GetSafeHwnd()));
02842 pStratusClient->put_SerialNumber(_bstr_t(OpRegister::GetSerialNumber())) ;
02843 pStratusClient->put_RegistryKey(_bstr_t(_T("\\" PRODUCT_REGISTRYKEY_FULLPATH "Connect")));
02844 pStratusClient->put_HintText(_bstr_t(_T("")));
02845 pStratusClient->put_ShowStorePassword(FALSE) ;
02846 pStratusClient->put_ConnectButtonText(_bstr_t(String_256((LPCSTR)_R(IDS_REGISTER_BUTTON))));
02847 pStratusClient->put_ConnectTitle(_bstr_t(String_256((LPCSTR)_R(IDS_REGISTER_TITLE))));
02848 pStratusClient->put_JoinTitle(_bstr_t(String_256((LPCSTR)_R(IDS_REGISTER_TITLE))));
02849 pStratusClient->put_ConnectText(_bstr_t(String_256((LPCSTR)_R(IDS_REGISTER_MAINTEXT))));
02850 pStratusClient->put_JoinText(_bstr_t(String_256((LPCSTR)_R(IDS_REGISTER_JOINTEXT))));
02851
02852 try
02853 {
02854
02855 pStratusClient->SignIn((BSTR)NULL,(BSTR)NULL);
02856 RegSuccess = TRUE;
02857 }
02858 catch(_com_error e)
02859 {
02860 if (e.Error() != E_XM_CONNECTCANCELLED)
02861 {
02862 String_256 strError;
02863 strError.Format(String_256((LPCSTR)_R(IDS_REGISTER_CONNECTPROBLEM)),e.Error());
02864 ::MessageBox(NULL, strError, PRODUCT_NAME, MB_OK);
02865 }
02866 }
02867
02868 if(RegSuccess)
02869 ::MessageBox(NULL, String_256((LPCSTR)_R(IDS_REGISTER_REGSUCCESS)), PRODUCT_NAME, MB_OK);
02870
02871 return RegSuccess;
02872 #else
02873 return TRUE;
02874 #endif
02875 }
02876
02877
02878 #endif