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 #include "camtypes.h"
00105
00106
00107 #ifdef BUILDSHADOWS
00108
00109 #include "shadtool.h"
00110 #include "shadinfo.h"
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 #include "optsmsgs.h"
00123
00124
00125 #include "pathops.h"
00126 #include "opshadow.h"
00127 #include "opbevel.h"
00128 #include "nodeshad.h"
00129
00130 #include "cutop.h"
00131 #include "blobs.h"
00132 #include "camelot.h"
00133 #include "dragmgr.h"
00134
00135
00136 #include "objchge.h"
00137 #include "biasdlg.h"
00138 #include "nodeblnd.h"
00139 #include "opliveeffects.h"
00140 #include "selector.h"
00141 #include "ophist.h"
00142
00143 DECLARE_SOURCE( "$Revision: 1401 $" );
00144 CC_IMPLEMENT_DYNCREATE(SoftShadowInfoBarOp,InformationBarOp)
00145 CC_IMPLEMENT_DYNCREATE(ShadowDragData,ListItem)
00146
00147 #define new CAM_DEBUG_NEW
00148
00149
00150 const INT32 PositionShadowLimit = 999;
00151 const INT32 PenumbraSizeLimit = 999;
00152 const INT32 ShadowSizeLimit = 999;
00153 MILLIPOINT IncPositionShadow = 750;
00154 const MILLIPOINT IncPenumbraSize = 750;
00155
00156
00157 const INT32 CONTRASTSLIDERMAX = 100;
00158 const INT32 BLURSLIDERMAX = 40 * 750;
00159 const double ANGLESLIDERMAX = 69;
00160 const double SIZESLIDERMAX = 200;
00161 const float SHADOWHEIGHTMAX = 1.5;
00162 const INT32 WIDTHSLIDERMAX = 250000;
00163
00164
00165 InformationBarOp* SoftShadowInfoBarOp::pSoftShadowInfoBar = NULL;
00166 Document* SoftShadowInfoBarOp::pDoc = NULL;
00167
00169
00170 CProfileBiasGain GlowSliderProfile((AFp)0.7, (AFp)0.0);
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 SoftShadowInfoBarOp::SoftShadowInfoBarOp()
00183 {
00184 pSoftShadowTool = NULL;
00185 CurrentSpread = NULL;
00186 CurrentNodePath = NULL;
00187
00188
00189 ApplyButton = TRUE;
00190
00191 m_bControlsExist = FALSE;
00192
00193 m_bBumping = FALSE;
00194
00195 DlgResID = _R(IDD_SOFTSHADOWTOOLBAR);
00196 }
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 void SoftShadowInfoBarOp::Init()
00212 {
00213
00214 pSoftShadowInfoBar = this;
00215
00216
00217
00218 pSoftShadowInfoBar->SetGadgetRange(_R(IDC_SOFTSHADOWSLIDER), 0, CONTRASTSLIDERMAX, 1);
00219
00220 pSoftShadowInfoBar->SetGadgetBitmaps(_R(IDC_SOFTSHADOWSLIDER), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
00221
00222 pSoftShadowInfoBar->SetGadgetRange(_R(IDC_SOFTSHADOWSLIDER), 0, CONTRASTSLIDERMAX, 1);
00223 pSoftShadowInfoBar->SetGadgetBitmaps(_R(IDC_SOFTSHADOWTRANSPSLIDER), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
00224
00225
00226 String_64 Str;
00227
00228 UpdateGadgetBlurSlider();
00229 UpdateGadgetTranspSlider();
00230
00231
00232 BiasGainGadget_m.Init(this, _R(IDC_BIASGAIN), _R(IDBBL_BIASGAIN), _R(IDS_BIASGAINDLG) );
00233 BiasGainGadget_m.ToggleFillProfile ();
00234
00235 UpdateInfoBar();
00236 }
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 BOOL SoftShadowInfoBarOp::ConvertValueToString(String_256 &In, const INT32 value, UnitType type, TCHAR *unit)
00253 {
00254 BOOL Converted = FALSE;
00255 Range Selection(*(GetApplication()->FindSelection()));
00256 RangeControl rg = Selection.GetRangeControlFlags();
00257 rg.PromoteToParent = TRUE;
00258 Selection.SetRangeControl(rg);
00259
00260 if (Document::GetCurrent() == NULL)
00261 return FALSE;
00262
00263 Node* pNode = Selection.FindFirst();
00264
00265 while (pNode != NULL)
00266 {
00267 CurrentSpread = pNode->FindParentSpread();
00268
00269 if (CurrentSpread != NULL)
00270 {
00271
00272
00273 DimScale* pDimScale = DimScale::GetPtrDimScale((Node*) CurrentSpread);
00274
00275 pDimScale->ConvertToUnits((INT32)value , &In);
00276
00277 Converted = TRUE;
00278 }
00279 else
00280 {
00281
00282 }
00283
00284 pNode = Selection.FindNext(pNode);
00285 }
00286
00287 return Converted;
00288
00289 }
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305 BOOL SoftShadowInfoBarOp::ConvertStringToValue(CGadgetID ID, MILLIPOINT& Value)
00306 {
00307 BOOL Valid = FALSE;
00308
00309 Range Selection(*(GetApplication()->FindSelection()));
00310 RangeControl rg = Selection.GetRangeControlFlags();
00311 rg.PromoteToParent = TRUE;
00312 Selection.SetRangeControl(rg);
00313 Node* pNode = Selection.FindFirst();
00314
00315 BOOL bContinue = FALSE;
00316
00317 while (pNode != NULL)
00318 {
00319 CurrentSpread = pNode->FindParentSpread();
00320
00321 if (CurrentSpread != NULL)
00322 {
00323
00324
00325 DimScale* pDimScale = DimScale::GetPtrDimScale((Node*) CurrentSpread);
00326
00327 String_128 FieldContents = GetStringGadgetValue(ID, &Valid);
00328 String_128 NumberString;
00329
00330 bContinue = TRUE;
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 Valid = pDimScale->ConvertToMillipoints(FieldContents, &Value);
00352
00353 }
00354 else
00355 {
00356
00357 }
00358
00359 pNode = Selection.FindNext(pNode);
00360 }
00361
00362 return Valid;
00363 }
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378 void SoftShadowInfoBarOp::UpdateGadgetPositionShadowX()
00379 {
00380 String_256 In(_T("0 pix"));
00381
00382 NodeShadowController* pMaster = pSoftShadowTool->GetShadowEditField(smOFFSETX, &In);
00383 if (pMaster)
00384 ConvertValueToString(In, pMaster->GetOffsetX() , PIXELS, _T(" pix"));
00385
00386 pSoftShadowInfoBar->SetStringGadgetValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), In);
00387 }
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402 void SoftShadowInfoBarOp::UpdateGadgetPositionShadowY()
00403 {
00404 String_256 In(_T("0pix"));
00405
00406 NodeShadowController* pMaster = pSoftShadowTool->GetShadowEditField(smOFFSETY, &In);
00407 if (pMaster)
00408 ConvertValueToString(In, pMaster->GetOffsetY(), PIXELS, _T(" pix"));
00409
00410 pSoftShadowInfoBar->SetStringGadgetValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), In);
00411 }
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428 void SoftShadowInfoBarOp::UpdateGadgetBlurSlider(BOOL bUpdateSlider)
00429 {
00430
00431 pSoftShadowInfoBar->SetGadgetRange(_R(IDC_SOFTSHADOWSLIDER), 0, CONTRASTSLIDERMAX, 1);
00432
00433
00434 String_256 Str(_T("0%"));
00435
00436 double d = NodeShadowController::DefaultBlurSize;
00437
00438 NodeShadowController* pMaster = pSoftShadowTool->GetShadowEditField(smPENUMBRA, &Str);
00439
00440
00441
00442
00443
00444
00445 if (pMaster)
00446 {
00447 d = pMaster->GetPenumbraWidth();
00448 ConvertValueToString(Str, (INT32)d, PIXELS, _T(" pix"));
00449 }
00450
00451
00452 pSoftShadowInfoBar->SetStringGadgetValue(_R(IDC_SHADOW_SLIDER_EDIT), Str);
00453
00454 d /= (double)BLURSLIDERMAX;
00455
00456 d *= 100;
00457
00458 if (bUpdateSlider)
00459 pSoftShadowInfoBar->SetLongGadgetValue(_R(IDC_SOFTSHADOWSLIDER), (INT32)d);
00460
00461 UpdateGadgetHelp();
00462
00463 }
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480 void SoftShadowInfoBarOp::UpdateGadgetTranspSlider(BOOL bUpdateSlider)
00481 {
00482
00483 pSoftShadowInfoBar->SetGadgetRange(_R(IDC_SOFTSHADOWTRANSPSLIDER), 0, CONTRASTSLIDERMAX, 1);
00484
00485
00486 String_256 Str(_T("0%"));
00487 double dDarkness = 0;
00488
00489 NodeShadowController* pMaster = pSoftShadowTool->GetShadowEditField(smDARKNESS, &Str);
00490 if (pMaster)
00491 {
00492 dDarkness = pMaster->GetShadow()->GetDarkness();
00493 SetDarknessEditGadget(dDarkness);
00494 }
00495 else
00496 pSoftShadowInfoBar->SetStringGadgetValue(_R(IDC_SHADOWTRANSP_EDIT), Str);
00497
00498 if (bUpdateSlider)
00499 SetDarknessSlider(dDarkness);
00500
00501 UpdateGadgetHelp();
00502 }
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518 void SoftShadowInfoBarOp::UpdateGadgetPenumbraSize()
00519 {
00520
00521 }
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536 void SoftShadowInfoBarOp::UpdateAllGadgets()
00537 {
00538 UpdateGadgetPositionShadowX();
00539 UpdateGadgetPositionShadowY();
00540 UpdateGadgetBlurSlider();
00541 UpdateGadgetTranspSlider();
00542 UpdateGadgetPenumbraSize();
00543 UpdateGadgetTypeButtons();
00544 UpdateGadgetHelp();
00545 }
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560 void SoftShadowInfoBarOp::UpdateInfoBar()
00561 {
00562 BOOL bNothingSelected = (GetApplication()->FindSelection()->FindFirst()==NULL);
00563
00564
00565 NodeShadowController* pMaster = NULL;
00566 pSoftShadowTool->GetShadowEditRange(&pMaster);
00567 if (pMaster==NULL)
00568 {
00569 UpdateAllGadgets();
00570
00571 if (bNothingSelected)
00572 EnableGadgets(FALSE);
00573 else
00574 {
00575
00576 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_X),FALSE);
00577 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y),FALSE);
00578 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_LESS) ,FALSE);
00579 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_MORE) ,FALSE);
00580 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_LESS) ,FALSE);
00581 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_MORE) ,FALSE);
00582 pSoftShadowInfoBar->EnableGadget(_R(IDC_BIASGAIN) ,FALSE);
00583
00584
00585
00586 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWSLIDER) ,TRUE);
00587 pSoftShadowInfoBar->EnableGadget(_R(IDC_SHADOW_SLIDER_EDIT), TRUE);
00588
00589
00590 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWTRANSPSLIDER), TRUE);
00591 pSoftShadowInfoBar->EnableGadget(_R(IDC_SHADOWTRANSP_EDIT), TRUE);
00592 }
00593 }
00594 else
00595 {
00596
00597
00598
00599 UpdateAllGadgets();
00600 EnableGadgets(TRUE);
00601 }
00602
00603 UpdateGadgetHelp();
00604 }
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620 void SoftShadowInfoBarOp::DoChangeShadPos(INT32 x, INT32 y, BOOL PosX, BOOL PosY)
00621 {
00622 ShadowPosition ShadPos(x, y, PosX, PosY, pSoftShadowTool);
00623
00624 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWPOSITION);
00625 if (pOpDesc != NULL)
00626 {
00627 String_256 UIDesc;
00628 OpState State = OpShadowPosition::GetState(&UIDesc, pOpDesc);
00629 if (!State.Greyed)
00630 pOpDesc->Invoke(&ShadPos);
00631 }
00632 }
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 void SoftShadowInfoBarOp::EnableGadgets(BOOL Enable)
00649 {
00650 if(pSoftShadowInfoBar== NULL)
00651 return;
00652 if(!pSoftShadowInfoBar->HasWindow())
00653 return;
00654
00655 if (!Enable)
00656 {
00657 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), FALSE);
00658 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), FALSE);
00659 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_LESS), FALSE);
00660 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_MORE), FALSE);
00661 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_LESS), FALSE);
00662 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_MORE), FALSE);
00663 pSoftShadowInfoBar->EnableGadget(_R(IDC_BIASGAIN), FALSE);
00664
00665
00666
00667
00668
00669
00670 }
00671 else
00672 {
00673 NodeShadowController* pMaster = pSoftShadowTool->GetShadowEditField(smTYPE);
00674 ShadowType stype = SHADOWTYPE_NONE;
00675 if (pMaster)
00676 stype = pMaster->GetShadowType();
00677
00678 pSoftShadowInfoBar->EnableGadget(_R(IDC_BIASGAIN), (stype != SHADOWTYPE_NONE));
00679
00680 if (stype == SHADOWTYPE_NONE ||
00681 stype == SHADOWTYPE_FLOOR ||
00682 stype == SHADOWTYPE_GLOW)
00683 {
00684 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), FALSE);
00685 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), FALSE);
00686 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_LESS), FALSE);
00687 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_MORE), FALSE);
00688 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_LESS), FALSE);
00689 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_MORE), FALSE);
00690
00691 }
00692 else
00693 {
00694 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), TRUE);
00695 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), TRUE);
00696 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_LESS), TRUE);
00697 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_X_MORE), TRUE);
00698 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_LESS), TRUE);
00699 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWCENTRE_Y_MORE), TRUE);
00700
00701 }
00702 }
00703
00704
00705 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWSLIDER) ,Enable);
00706 pSoftShadowInfoBar->EnableGadget(_R(IDC_SHADOW_SLIDER_EDIT) ,Enable);
00707 pSoftShadowInfoBar->EnableGadget(_R(IDC_SOFTSHADOWTRANSPSLIDER), Enable);
00708 pSoftShadowInfoBar->EnableGadget(_R(IDC_SHADOWTRANSP_EDIT), Enable);
00709
00710 pSoftShadowInfoBar->EnableGadget(_R(IDC_BTN_NOSHADOW), Enable);
00711 pSoftShadowInfoBar->EnableGadget(_R(IDC_BTN_WALLSHADOW), Enable);
00712 pSoftShadowInfoBar->EnableGadget(_R(IDC_BTN_FLOORSHADOW), Enable);
00713 pSoftShadowInfoBar->EnableGadget(_R(IDC_BTN_GLOWSHADOW), Enable);
00714
00715 UpdateGadgetHelp();
00716 }
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731 void SoftShadowInfoBarOp::ChangeShadowPosIncremental(INT32 incx, INT32 incy)
00732 {
00733 Document * pDoc = Document::GetCurrent();
00734 Spread * pSpread = Document::GetSelectedSpread();
00735 BlobManager * pBlobMgr = GetApplication()->GetBlobManager();
00736 DocRect BoundsToDraw;
00737 BOOL Valid = FALSE;
00738 MILLIPOINT x = 0;
00739 MILLIPOINT y = 0;
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), x);
00753 if (!Valid)
00754 incx = 0;
00755 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), y);
00756 if (!Valid)
00757 incy = 0;
00758
00759 if (incx==0 && incy==0)
00760 return;
00761
00762 NodeShadowController* pMaster = NULL;
00763 ListRange* pEditRange = pSoftShadowTool->GetShadowEditRange(&pMaster);
00764 if (pEditRange)
00765 {
00766 Node* pNode = pEditRange->FindFirst();
00767 while (pNode)
00768 {
00769 ENSURE(pNode->IsAShadowController(), "Found unexpected node type in shadow stack level");
00770 NodeShadowController* pControl = (NodeShadowController*)pNode;
00771
00772 pControl->ReleaseCached(TRUE, FALSE, FALSE, TRUE);
00773
00774 if (pControl->GetShadowType() == SHADOWTYPE_WALL)
00775 {
00776 BoundsToDraw = BoundsToDraw.Union(pControl->GetBoundingRect());
00777
00778 DocCoord offset = pControl->GetWallShadowOffset();
00779 offset.x += incx;
00780 offset.y += incy;
00781 pControl->SetWallShadowOffset(offset, TRUE);
00782
00783 DocRect dr = pControl->GetInsideBoundingRect();
00784 DocRect shadRect = dr;
00785
00786 dr.lo.x += pControl->GetOffsetX();
00787 dr.hi.x += pControl->GetOffsetX();
00788 dr.lo.y += pControl->GetOffsetY();
00789 dr.hi.y += pControl->GetOffsetY();
00790 dr.Inflate(pControl->GetPenumbraWidth() + pBlobMgr->GetBlobSize());
00791
00792 BoundsToDraw = BoundsToDraw.Union(dr);
00793 BoundsToDraw = BoundsToDraw.Union(shadRect);
00794 }
00795
00796 pNode = pEditRange->FindNext(pNode);
00797 }
00798
00799 UpdateGadgetPositionShadowX();
00800 UpdateGadgetPositionShadowY();
00801
00802 if (pDoc && pSpread && BoundsToDraw.IsValid() && !BoundsToDraw.IsEmpty())
00803 {
00804 pDoc->ForceRedraw(pSpread, BoundsToDraw);
00805 GetApplication()->ServiceRendering();
00806 }
00807 }
00808 }
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825 void SoftShadowInfoBarOp::DoChangeShadowPosIncremental(MILLIPOINT incx, MILLIPOINT incy)
00826 {
00827 BOOL Valid = FALSE;
00828 MILLIPOINT x = 0;
00829 MILLIPOINT y = 0;
00830 String_256 ManyStr;
00831 ManyStr.Load(_R(IDS_SHADOWSTRING_MANY));
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_X), x);
00842 if (!Valid)
00843 incx = 0;
00844 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y), y);
00845 if (!Valid)
00846 incy = 0;
00847
00848 if (incx==0 && incy==0)
00849 return;
00850
00851 ShadowPosition ShadPos(x + incx, y + incy, incx!=0, incy!=0, pSoftShadowTool);
00852
00853 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWPOSITION);
00854 if (pOpDesc != NULL)
00855 {
00856 String_256 UIDesc;
00857 OpState State = OpShadowPosition::GetState(&UIDesc, pOpDesc);
00858 if (!State.Greyed)
00859 pOpDesc->Invoke(&ShadPos);
00860 }
00861
00862 UpdateGadgetPositionShadowX();
00863 UpdateGadgetPositionShadowY();
00864 }
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882 void SoftShadowInfoBarOp::HandleProfileSelChangingMsg(CBiasGainGadget& Gadget, CGadgetID GadgetID)
00883 {
00884
00885 InformationBarOp::HandleProfileSelChangingMsg(Gadget, GadgetID);
00886 return;
00887
00888
00889
00890
00891
00892 BOOL bNone = TRUE;
00893 BOOL bConsistent = FALSE;
00894 BOOL bMany = FALSE;
00895 CProfileBiasGain* pProfile = NULL;
00896 NodeShadowController* pMasterProfile = pSoftShadowTool->GetShadowEditField(smBIASGAIN, &bNone, &bConsistent, &bMany);
00897
00898 if (pMasterProfile)
00899 {
00900 NodeShadow* pShadow = pMasterProfile->GetShadow();
00901 ERROR3IF(pShadow==NULL, "GetProfileFromSelection");
00902
00903 pProfile = pShadow->GetBiasGainPtr();
00904 }
00905
00906 if (Gadget.IsDialogOpen())
00907 {
00908 if (bNone && !SelectorTool::GetNormalClick_CheckProfileDialog())
00909 {
00910 Gadget.CloseDialog();
00911 return;
00912 }
00913
00914 Gadget.ReInitialiseDialog(pProfile, bMany);
00915 EnableGadget(GadgetID, FALSE);
00916 }
00917 else
00918 {
00919 EnableGadget(GadgetID, !bNone);
00920 }
00921 }
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940 CProfileBiasGain* SoftShadowInfoBarOp::GetProfileFromSelection(CGadgetID GadgetID, BOOL* bMany, BOOL* bAllSameType)
00941 {
00942 BOOL ok = (GadgetID == _R(IDC_BIASGAIN));
00943
00944 ERROR2IF(ok==FALSE, FALSE, "Invalid gadgetID passed");
00945
00946 BOOL bProfileNone = TRUE;
00947 BOOL bProfileConsistent = FALSE;
00948 BOOL bProfileMany = FALSE;
00949 NodeShadowController* pMasterProfile = pSoftShadowTool->GetShadowEditField(smBIASGAIN, &bProfileNone, &bProfileConsistent, &bProfileMany);
00950
00951
00952 *bMany = bProfileMany ;
00953 *bAllSameType = bProfileConsistent && !bProfileNone;
00954
00955 if (pMasterProfile)
00956 {
00957 NodeShadow* pShadow = pMasterProfile->GetShadow();
00958 ERROR3IF(pShadow==NULL, "GetProfileFromSelection");
00959
00960 return pShadow->GetBiasGainPtr();
00961 }
00962
00963 return NULL;
00964 }
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980 void SoftShadowInfoBarOp::DoPenumbraSizeBumps(UINT32 Button)
00981 {
00982 }
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000 MsgResult SoftShadowInfoBarOp::Message(Msg* Message)
01001 {
01002
01003 if (!SoftShadowTool::IsCurrentTool() || !IsVisible())
01004 return (InformationBarOp::Message(Message));
01005
01006
01007
01008 String_256 ManyStr;
01009 ManyStr.Load(_R(IDS_SHADOWSTRING_MANY));
01010
01011 CProfileBiasGain Profile;
01012
01013
01014 BOOL Valid = FALSE;
01015
01016
01017
01018 if (IS_OUR_DIALOG_MSG(Message))
01019 {
01020 DialogMsg* Msg = (DialogMsg*)Message;
01021
01022
01023 if (Msg->DlgMsg == DIM_CANCEL)
01024 {
01025 m_bControlsExist = FALSE;
01026
01027 Close();
01028 }
01029 else if (Msg->DlgMsg == DIM_CREATE)
01030 {
01031 SliderDragged = FALSE;
01032
01033
01034 Init();
01035
01036 UpdateInfoBar();
01037
01038 m_bControlsExist = TRUE;
01039 }
01040 else
01041 {
01042
01043
01044
01045
01046 if (Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_EDIT_X) || Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_EDIT_Y))
01047 {
01048 if (Msg->DlgMsg == DIM_SELECTION_CHANGED)
01049 {
01050 BOOL Valid = FALSE;
01051 String_256 Str = GetStringGadgetValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_X),&Valid);
01052
01053 INT32 PosShadowX = 0;
01054
01055
01056 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_X),PosShadowX);
01057
01058 if (Str != ManyStr)
01059 {
01060
01061 if(Valid)
01062 {
01063
01064 DoChangeShadPos(PosShadowX, 0, TRUE, FALSE);
01065 }
01066 else
01067 {
01068
01069 DoInputError(Msg->GadgetID);
01070 UpdateGadgetPositionShadowX();
01071 }
01072 }
01073
01074
01075
01076 Str = GetStringGadgetValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y),&Valid);
01077 INT32 PosShadowY = 0;
01078
01079
01080
01081 if (Str != ManyStr)
01082 {
01083 Valid = ConvertStringToValue(_R(IDC_SOFTSHADOWCENTRE_EDIT_Y),PosShadowY);
01084
01085 if(Valid)
01086 {
01087
01088 DoChangeShadPos(0, PosShadowY, FALSE, TRUE);
01089 }
01090 else
01091 {
01092
01093 DoInputError(Msg->GadgetID);
01094 UpdateGadgetPositionShadowY();
01095 }
01096 }
01097 }
01098 }
01099
01100 else if (Msg->GadgetID == _R(IDC_BIASGAIN))
01101 {
01102 switch (Msg->DlgMsg)
01103 {
01104 case DIM_LFT_BN_CLICKED:
01105 HandleProfileButtonClick (BiasGainGadget_m, _R(IDC_BIASGAIN));
01106 break;
01107
01108 default:
01109 ProfileSelectionChange( Msg, Msg->GadgetID );
01110 break;
01111 }
01112 }
01113
01114 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_Y_LESS))
01115 HandleShadowPosBump(Msg, 0, -Document::GetCurrent()->GetDocNudge());
01116
01117 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_Y_MORE))
01118 HandleShadowPosBump(Msg, 0, Document::GetCurrent()->GetDocNudge());
01119
01120 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_X_LESS))
01121 HandleShadowPosBump(Msg, -Document::GetCurrent()->GetDocNudge(), 0);
01122
01123 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWCENTRE_X_MORE))
01124 HandleShadowPosBump(Msg, Document::GetCurrent()->GetDocNudge(), 0);
01125
01127
01128 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWTRANSPSLIDER))
01129 {
01130 switch (Msg->DlgMsg)
01131 {
01132 case DIM_SLIDER_POS_CHANGING:
01133 {
01134 if (!SliderDragged)
01135 {
01136 SaveShadowDragData(&ShadowDataList);
01137 Operation::SetQuickRender(TRUE);
01138 }
01139
01140 Valid = FALSE;
01141 double dDarkness = GetDarknessSlider(&Valid);
01142 SetDarknessEditGadget(dDarkness);
01143
01144 ChangeShadowDarkness(dDarkness);
01145
01146 PaintGadgetNow(_R(IDC_SHADOWTRANSP_EDIT));
01147 SliderDragged = TRUE;
01148 }
01149 break;
01150
01151 case DIM_SLIDER_POS_SET:
01152 {
01153 Operation::SetQuickRender(FALSE);
01154
01155
01156 RestoreShadowDragData(&ShadowDataList, FALSE);
01157
01158
01159 SliderDragged = FALSE;
01160 double dDarkness = GetDarknessSlider(&Valid);
01161 SetDarknessEditGadget(dDarkness);
01162
01163 DoChangeShadowDarkness(dDarkness);
01164
01165 SliderDragged = FALSE;
01166
01167 SetBitmapUpdate(TRUE);
01168 }
01169 break;
01170
01171 default:
01172 {
01173
01174 break;
01175 }
01176 }
01177 }
01178
01180
01181 else if (Msg->GadgetID == _R(IDC_SOFTSHADOWSLIDER))
01182 {
01183 switch (Msg->DlgMsg)
01184 {
01185 case DIM_SLIDER_POS_CHANGING:
01186 {
01187 if (!SliderDragged)
01188 {
01189 SaveShadowDragData(&ShadowDataList);
01190 Operation::SetQuickRender(TRUE);
01191 }
01192
01193 SetBitmapUpdate(FALSE);
01194
01195
01196 BOOL Valid = FALSE;
01197 INT32 Result = GetLongGadgetValue(_R(IDC_SOFTSHADOWSLIDER), 0, CONTRASTSLIDERMAX, 0, &Valid);
01198
01199 NodeShadowController* pMaster = NULL;
01200 pSoftShadowTool->GetShadowEditRange(&pMaster);
01201 if (pMaster!=NULL)
01202 {
01203 ChangeShadowPenumbra((MILLIPOINT)((((double)(Result)) / 100.0) * ((double)BLURSLIDERMAX)));
01204
01205 UpdateGadgetBlurSlider(FALSE);
01206 }
01207
01208 PaintGadgetNow(_R(IDC_SHADOW_SLIDER_EDIT));
01209
01210 SliderDragged = TRUE;
01211
01212 break;
01213 }
01214
01215 case DIM_SLIDER_POS_SET:
01216 {
01217 Operation::SetQuickRender(FALSE);
01218
01219
01220 RestoreShadowDragData(&ShadowDataList, FALSE);
01221
01222
01223 BOOL Valid;
01224 SliderDragged = FALSE;
01225 INT32 Result = GetLongGadgetValue(_R(IDC_SOFTSHADOWSLIDER), 0, CONTRASTSLIDERMAX, 0, &Valid);
01226
01227 DoChangePenumbra((MILLIPOINT)((((double)(Result)) / 100.0) * ((double)BLURSLIDERMAX)));
01228 SliderDragged = FALSE;
01229
01230 SetBitmapUpdate(TRUE);
01231 break;
01232 }
01233
01234 default:
01235 {
01236
01237 break;
01238 }
01239 }
01240 }
01241
01242 else if (Msg->GadgetID == _R(IDC_SHADOW_SLIDER_EDIT))
01243 {
01244 if (Msg->DlgMsg == DIM_SELECTION_CHANGED)
01245 {
01246
01247 HandleSliderEditChange();
01248 }
01249 }
01250 else if (Msg->GadgetID == _R(IDC_SHADOWTRANSP_EDIT))
01251 {
01252 if (Msg->DlgMsg == DIM_SELECTION_CHANGED)
01253 {
01254
01255 HandleSliderTranspEditChange();
01256 }
01257 }
01258 else if (Msg->GadgetID == _R(IDC_BTN_NOSHADOW))
01259 {
01260 if (Msg->DlgMsg == DIM_LFT_BN_CLICKED)
01261 {
01262 HandleNoShadowBtnClicked();
01263 return OK;
01264 }
01265 }
01266 else if (Msg->GadgetID == _R(IDC_BTN_WALLSHADOW))
01267 {
01268 if (Msg->DlgMsg == DIM_LFT_BN_CLICKED)
01269 {
01270 HandleWallShadowBtnClicked();
01271 return OK;
01272 }
01273 }
01274 else if (Msg->GadgetID == _R(IDC_BTN_FLOORSHADOW))
01275 {
01276 if (Msg->DlgMsg == DIM_LFT_BN_CLICKED)
01277 {
01278 HandleFloorShadowBtnClicked();
01279 return OK;
01280 }
01281 }
01282 else if (Msg->GadgetID == _R(IDC_BTN_GLOWSHADOW))
01283 {
01284 if (Msg->DlgMsg == DIM_LFT_BN_CLICKED)
01285 {
01286 HandleGlowShadowBtnClicked();
01287 return OK;
01288 }
01289 }
01290 }
01291 }
01292
01293 else if (MESSAGE_IS_A(Message,OpMsg))
01294 {
01295 if ( (((OpMsg*)Message)->MsgType == OpMsg::AFTER_UNDO) ||
01296 (((OpMsg*)Message)->MsgType == OpMsg::AFTER_REDO) )
01297 {
01298 if (pSoftShadowInfoBar != NULL)
01299 {
01300
01301
01302
01303
01304 UpdateInfoBar();
01305
01306 }
01307 }
01308 }
01309
01310 else if (MESSAGE_IS_A(Message, SelChangingMsg))
01311 {
01312
01313 if (pSoftShadowInfoBar==NULL || !pSoftShadowInfoBar->HasWindow())
01314 return InformationBarOp::Message(Message);
01315
01316
01317
01318 pSoftShadowTool->SetShadowEditRangeFromSelection(FALSE);
01319
01320
01321
01322
01323
01324 HandleProfileSelChangingMsg(BiasGainGadget_m, _R(IDC_BIASGAIN));
01325
01326 if (SliderDragged)
01327 {
01328
01329
01330 RestoreShadowDragData(&ShadowDataList, TRUE);
01331 SliderDragged = FALSE;
01332 }
01333
01334
01335 Range Sel(*(GetApplication()->FindSelection()));
01336 RangeControl rg = Sel.GetRangeControlFlags();
01337 rg.PromoteToParent = TRUE;
01338 Sel.SetRangeControl(rg);
01339
01340 UINT32 NumSelected = Sel.Count();
01341
01342
01343 if(NumSelected == 0)
01344 EnableGadgets(FALSE);
01345 else
01346 {
01347 EnableGadgets(TRUE);
01348
01349
01350
01351
01352
01353
01354 }
01355
01356
01357 UpdateInfoBar();
01358 }
01359 else if(MESSAGE_IS_A(Message,OptionsChangingMsg))
01360 {
01361
01362 OptionsChangingMsg* Msg = (OptionsChangingMsg*)Message;
01363
01364 if(Msg->State == OptionsChangingMsg::NEWUNITS)
01365 {
01366 pDoc = Document::GetSelected();
01367
01368
01369 UpdateInfoBar();
01370 }
01371 }
01372
01373
01374 return (InformationBarOp::Message(Message));
01375 }
01376
01377 void SoftShadowInfoBarOp::HandleShadowPosBump(DialogMsg* dmsg, INT32 incx, INT32 incy)
01378 {
01379 switch (dmsg->DlgMsg)
01380 {
01381 case DIM_LFT_BN_CLICKED:
01382 {
01383 if (!m_bBumping)
01384 {
01385 Operation::SetQuickRender(TRUE);
01386 SaveShadowDragData(&ShadowDataList);
01387 m_bBumping = TRUE;
01388 }
01389
01390 ChangeShadowPosIncremental(incx, incy);
01391
01392 }
01393 break;
01394
01395 case DIM_LFT_BN_UP:
01396 {
01397 Operation::SetQuickRender(FALSE);
01398
01399
01400 if (m_bBumping)
01401 {
01402 RestoreShadowDragData(&ShadowDataList);
01403 m_bBumping = FALSE;
01404 }
01405
01406 DoChangeShadowPosIncremental(incx, incy);
01407
01408
01409
01410 }
01411 break;
01412
01413 default:
01414 {
01415
01416 }
01417 break;
01418 }
01419 }
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434 void SoftShadowInfoBarOp::ChangeProfile(CProfileBiasGain* Profile, CGadgetID GadgetID)
01435 {
01436 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWPROFILE);
01437 if (pOpDesc != NULL)
01438 {
01439 BOOL FireOp = TRUE;
01440
01441
01442
01443
01444
01445 Operation* pLastOp = NULL;
01446
01447 if (Profile->GetGeneratesInfiniteUndo ())
01448 {
01449 pLastOp = Document::GetSelected()->GetOpHistory().FindLastOp();
01450 }
01451
01452 if (pLastOp)
01453 {
01454 if (pLastOp->GetRuntimeClass() == CC_RUNTIME_CLASS(OpChangeShadowProfile))
01455 {
01456 FireOp = FALSE;
01457 }
01458 }
01459
01460 if (FireOp == TRUE)
01461 {
01462 ShadowProfileOpParam Param(*Profile, pSoftShadowTool);
01463
01464
01465 pOpDesc->Invoke(&Param);
01466 }
01467 else
01468 {
01469
01470
01471 ChangeProfileAction Action;
01472 Action.ChangeShadowProfileWithNoUndo(*Profile, pSoftShadowTool);
01473 }
01474 }
01475 }
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492 void SoftShadowInfoBarOp::DoInputError(UINT32 GadgetID)
01493 {
01494 String_256 sErrString;
01495 String_64 sWarnString(_R(IDS_INVALID_INPUT));
01496 String_8 sAndString(_R(IDS_AND));
01497 String_16 sMaxStr(_T("0"));
01498 String_16 sMinStr(_T("0"));
01499
01500 if (GadgetID == _R(IDC_SOFTSHADOWCENTRE_EDIT_X))
01501 {
01502 sMinStr._MakeMsg(TEXT("#1%dpix"),-PositionShadowLimit);
01503 sMaxStr._MakeMsg(TEXT("#1%dpix"),PositionShadowLimit);
01504 }
01505
01506 else if (GadgetID == _R(IDC_SOFTSHADOWCENTRE_EDIT_Y))
01507 {
01508 sMinStr._MakeMsg(TEXT("#1%dpix"),-PositionShadowLimit);
01509 sMaxStr._MakeMsg(TEXT("#1%dpix"),PositionShadowLimit);
01510 }
01511
01512 else if (GadgetID == _R(IDC_PENUMBRASIZE_EDIT))
01513 {
01514 sMinStr._MakeMsg(TEXT("#1%dpix"),0);
01515 sMaxStr._MakeMsg(TEXT("#1%dpix"),PenumbraSizeLimit);
01516 }
01517
01518 else
01519 return;
01520
01521 sErrString._MakeMsg(TEXT("#1%s #2%s #3%s #4%s \n"),
01522 (TCHAR*)sWarnString,
01523 (TCHAR*)sMinStr,
01524 (TCHAR*)sAndString,
01525 (TCHAR*)sMaxStr);
01526
01527 Error::SetError(0,(TCHAR* )sErrString,0);
01528 InformError();
01529 }
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542 void SoftShadowInfoBarOp::DoChangeShadowDarkness(double dDarkness)
01543 {
01544
01545 OpDescriptor* pOpDesc = NULL;
01546
01547 NodeShadowController* pMaster = NULL;
01548 pSoftShadowTool->GetShadowEditRange(&pMaster);
01549 if (pMaster==NULL)
01550 {
01551
01552 NodeShadowParam Param;
01553 Param.m_dDarkness = dDarkness;
01554 Param.StackPosition = STACKPOS_INSERT_TOP;
01555 Param.pPPStack = GetApplication()->FindSelection()->GetEffectsStack(TRUE);
01556 Param.pShadowTool = pSoftShadowTool;
01557
01558 pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLYSHADOW);
01559
01560 if (pOpDesc)
01561 {
01562 pOpDesc->Invoke(&Param);
01563 }
01564
01565 delete Param.pPPStack;
01566
01567 return;
01568 }
01569
01570 pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWDARKNESS);
01571
01572 ShadowDarknessOpParam Param(dDarkness, pSoftShadowTool);
01573
01574 if (pOpDesc != NULL)
01575 {
01576 pOpDesc->Invoke(&Param);
01577 }
01578 }
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590 void SoftShadowInfoBarOp::SetBitmapUpdate(BOOL OnOrOff)
01591 {
01592 Range Sel(*(GetApplication()->FindSelection()));
01593 RangeControl rg = Sel.GetRangeControlFlags();
01594 rg.PromoteToParent = TRUE;
01595 Sel.SetRangeControl(rg);
01596
01597
01598 {
01599 Node* pNode = Sel.FindFirst();
01600 while (pNode != NULL)
01601 {
01602 if(IS_A(pNode,NodeShadowController))
01603 {
01604 NodeShadow* pShadow = ((NodeShadowController*)pNode)->GetShadow();
01605 pShadow->SetBitmapShadowRendering(OnOrOff);
01606 }
01607 pNode = Sel.FindNext(pNode);
01608 }
01609 }
01610 }
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625 void SoftShadowInfoBarOp::UpdateGadgetHelp()
01626 {
01627
01628 SetGadgetHelp(_R(IDC_SOFTSHADOWSLIDER), _R(IDBBL_SHADOWSLIDERBLUR), _R(IDS_SHADOWSLIDERBLURID));
01629 SetGadgetHelp(_R(IDC_SHADOW_SLIDER_EDIT), _R(IDBBL_SHADOWSLIDERBLUR), _R(IDS_SHADOWSLIDERBLURID));
01630 }
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641
01642
01643
01644 void SoftShadowInfoBarOp::DoChangePenumbra(INT32 NewPenumbra)
01645 {
01646 OpDescriptor* pOpDesc = NULL;
01647
01648
01649 NodeShadowController* pMaster = NULL;
01650 pSoftShadowTool->GetShadowEditRange(&pMaster);
01651 if (pMaster==NULL)
01652 {
01653 NodeShadowParam Param;
01654 Param.m_Blur = NewPenumbra;
01655 Param.StackPosition = STACKPOS_INSERT_TOP;
01656 Param.pPPStack = GetApplication()->FindSelection()->GetEffectsStack(TRUE);
01657 Param.pShadowTool = pSoftShadowTool;
01658
01659 pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLYSHADOW);
01660
01661 if (pOpDesc)
01662 {
01663 pOpDesc->Invoke(&Param);
01664 }
01665
01666 delete Param.pPPStack;
01667
01668 return;
01669 }
01670
01671 ShadowPenumbra Param(NewPenumbra, pSoftShadowTool);
01672
01673 pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWPENUMBRA);
01674
01675 if (pOpDesc != NULL)
01676 {
01677 pOpDesc->Invoke(&Param);
01678 }
01679
01680
01681
01682 }
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696 void SoftShadowInfoBarOp::DoChangeWidth(INT32 NewWidth)
01697 {
01698 NodeShadowParam Param;
01699 Param.m_GlowWidth = NewWidth;
01700 Param.pShadowTool = pSoftShadowTool;
01701
01702 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_GLOWWIDTH);
01703
01704 if (pOpDesc != NULL)
01705 {
01706 pOpDesc->Invoke(&Param);
01707 }
01708
01709
01710
01711 }
01712
01713
01714
01715
01716
01717
01718
01719
01720
01721
01722
01723
01724
01725 void SoftShadowInfoBarOp::HandleSliderEditChange()
01726 {
01727
01728 double Value = 0;
01729
01730 String_256 FieldContents;
01731 String_256 NumberString;
01732 BOOL Valid = FALSE;
01733
01734
01735 INT32 KValue = 0;
01736
01737 String_256 ManyString;
01738 ManyString.Load(_R(IDS_SHADOWSTRING_MANY));
01739
01740 FieldContents = GetStringGadgetValue(_R(IDC_SHADOW_SLIDER_EDIT), &Valid);
01741
01742
01743
01744
01745 BOOL bMany = FALSE;
01746
01747 if (FieldContents == ManyString)
01748 {
01749 bMany = TRUE;
01750 }
01751
01752
01753 if (ConvertStringToValue(_R(IDC_SHADOW_SLIDER_EDIT), KValue) && !bMany)
01754 {
01755 Value = KValue;
01756 if (Value >= 0 && Value <= BLURSLIDERMAX)
01757 {
01758 DoChangePenumbra((INT32)Value);
01759 }
01760 }
01761
01762 UpdateInfoBar();
01763
01764
01765
01766
01767
01768
01769 }
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783 void SoftShadowInfoBarOp::HandleSliderTranspEditChange()
01784 {
01785
01786 BOOL bOK = FALSE;
01787 BOOL bMany = FALSE;
01788 double dDarkness = 0;
01789
01790 bOK = GetDarknessEditGadget(dDarkness, bMany);
01791 if (!bOK || bMany)
01792 {
01793 UpdateGadgetTranspSlider(FALSE);
01794 return;
01795 }
01796
01797
01798 DoChangeShadowDarkness(dDarkness);
01799 UpdateInfoBar();
01800 }
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813
01814 void SoftShadowInfoBarOp::DoChangeAngle(double Angle)
01815 {
01816 NodeShadowParam Param;
01817 Param.m_FloorShadowAngle = Angle;
01818 Param.pShadowTool = pSoftShadowTool;
01819
01820 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWANGLE);
01821
01822 if (pOpDesc != NULL)
01823 {
01824 pOpDesc->Invoke(&Param);
01825 }
01826
01827
01828
01829 }
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843 void SoftShadowInfoBarOp::DoChangeHeight(double Height)
01844 {
01845 NodeShadowParam Param;
01846 Param.m_FloorShadowHeight = Height;
01847 Param.pShadowTool = pSoftShadowTool;
01848
01849 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWHEIGHT);
01850
01851 if (pOpDesc != NULL)
01852 {
01853 pOpDesc->Invoke(&Param);
01854 }
01855
01856
01857
01858 }
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872 void SoftShadowInfoBarOp::DoChangeScale(double Scale)
01873 {
01874 NodeShadowParam Param;
01875 Param.m_Scale = Scale;
01876 Param.pShadowTool = pSoftShadowTool;
01877
01878 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SHADOWSCALE);
01879
01880 if (pOpDesc != NULL)
01881 {
01882 pOpDesc->Invoke(&Param);
01883 }
01884
01885
01886
01887 }
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903 void SoftShadowInfoBarOp::ChangeShadowDarkness(double dDarkness)
01904 {
01905 if (ShadowDataList.IsEmpty())
01906 {
01907 return;
01908 }
01909
01910 ShadowDragData* pItem = (ShadowDragData*)ShadowDataList.GetHead();
01911
01912 NodeShadowController* pControl = NULL;
01913 NodeShadow* pShadow = NULL;
01914
01915 Document* pDoc = Document::GetCurrent();
01916
01917 DocRect BoundsToDraw;
01918
01919 Spread* pSpread = NULL;
01920
01921 while (pItem)
01922 {
01923 pControl = (NodeShadowController *)pItem->pNode;
01924 pShadow = pControl->GetShadow();
01925 pControl->ReleaseCached(TRUE, FALSE, FALSE, TRUE);
01926
01927 pSpread = pControl->FindParentSpread();
01928 BoundsToDraw = BoundsToDraw.Union(pControl->GetBlobBoundingRect());
01929
01930 pShadow->SetDarkness(dDarkness);
01931
01932
01933 pControl->InvalidateBoundingRect();
01934
01935
01936 if (IS_A (pControl->FindParent (), NodeBlend))
01937 {
01938 pControl->RegenerateNode(NULL);
01939 }
01940
01941 BoundsToDraw = BoundsToDraw.Union(pControl->GetBlobBoundingRect());
01942
01943 pItem = (ShadowDragData*)ShadowDataList.GetNext(pItem);
01944 }
01945
01946 if (pDoc)
01947 pDoc->ForceRedraw(pSpread, BoundsToDraw, FALSE);
01948 GetApplication()->ServiceRendering();
01949 }
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966 void SoftShadowInfoBarOp::ChangeShadowPenumbra(INT32 nBlur)
01967 {
01968 if (ShadowDataList.IsEmpty())
01969 {
01970 return;
01971 }
01972
01973 ShadowDragData* pItem = (ShadowDragData*)ShadowDataList.GetHead();
01974
01975 NodeShadowController* pControl = NULL;
01976 NodeShadow* pShadow = NULL;
01977
01978 Document* pDoc = Document::GetCurrent();
01979
01980 DocRect BoundsToDraw;
01981
01982 Spread* pSpread = NULL;
01983
01984 while (pItem)
01985 {
01986 pControl = (NodeShadowController *)pItem->pNode;
01987 pShadow = pControl->GetShadow();
01988 pControl->ReleaseCached(TRUE, FALSE, FALSE, TRUE);
01989
01990 pSpread = pControl->FindParentSpread();
01991 BoundsToDraw = BoundsToDraw.Union(pControl->GetBlobBoundingRect());
01992
01993 pControl->SetPenumbraWidth(nBlur);
01994
01995
01996 pControl->InvalidateBoundingRect();
01997
01998 pControl->RegenerateNode(NULL);
01999
02000 BoundsToDraw = BoundsToDraw.Union(pControl->GetBlobBoundingRect());
02001
02002 pItem = (ShadowDragData*)ShadowDataList.GetNext(pItem);
02003 }
02004
02005 if (pDoc)
02006 pDoc->ForceRedraw(pSpread, BoundsToDraw, FALSE);
02007 GetApplication()->ServiceRendering();
02008 }
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025 void SoftShadowInfoBarOp::SaveShadowDragData(List * pList)
02026 {
02027
02028 pList->DeleteAll();
02029
02030
02031 pList->DeleteAll();
02032
02033 ShadowDragData * pShadDragItem = NULL;
02034
02035 NodeShadowController * pController = NULL;
02036 NodeShadow *pShadow = NULL;
02037
02038 NodeShadowController* pMaster = NULL;
02039 ListRange* pEditRange = pSoftShadowTool->GetShadowEditRange(&pMaster);
02040 if (pEditRange)
02041 {
02042 Node* pNode = pEditRange->FindFirst();
02043 while (pNode)
02044 {
02045 ENSURE(pNode->IsAShadowController(), "Found unexpected node type in shadow stack level");
02046 pController = (NodeShadowController*)pNode;
02047
02048 pShadDragItem = new ShadowDragData;
02049
02050 pShadDragItem->pNode = pController;
02051 pShadow = pController->GetShadow();
02052
02053 pShadDragItem->PenumbraSize = pController->GetPenumbraWidth();
02054 pShadDragItem->PositionShadowX = pController->GetOffsetX();
02055 pShadDragItem->PositionShadowY = pController->GetOffsetY();
02056 pShadDragItem->ShadowAngle = pController->GetFloorShadowAngle();
02057 pShadDragItem->ShadowHeight = pController->GetFloorShadowHeight();
02058 pShadDragItem->ShadowScale = pController->GetWallShadowScale();
02059 pShadDragItem->GlowWidth = pController->GetGlowWidth();
02060 pShadDragItem->FeatherWidth = pController->GetFeatherWidth();
02061 pShadDragItem->ShadowTransparency = pShadow->GetTransp();
02062
02063 pList->AddTail(pShadDragItem);
02064
02065 pNode = pEditRange->FindNext(pNode);
02066 }
02067 }
02068 }
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082 void SoftShadowInfoBarOp::RestoreShadowDragData(List * pList, BOOL bRegen,
02083 BOOL bForceRegen)
02084 {
02085 if (pList->IsEmpty())
02086 {
02087 return;
02088 }
02089
02090 ShadowDragData * pItem = (ShadowDragData *)pList->GetHead();
02091
02092 NodeShadowController * pControl = NULL;
02093 NodeShadow * pShadow = NULL;
02094
02095 DocView * pView = DocView::GetCurrent();
02096
02097 while (pItem)
02098 {
02099 pControl = (NodeShadowController *)pItem->pNode;
02100
02101
02102 if (pView)
02103 {
02104 pView->ForceRedraw(pControl->FindParentSpread(), pControl->GetBoundingRect(),
02105 FALSE);
02106 }
02107
02108 pShadow = pControl->GetShadow();
02109
02110
02111 BOOL bMustIRegen = FALSE;
02112
02113 if (pControl->GetFloorShadowAngle() != pItem->ShadowAngle)
02114 {
02115 pControl->SetFloorShadowAngle(pItem->ShadowAngle);
02116 bMustIRegen = TRUE;
02117 }
02118
02119 if (pControl->GetFloorShadowHeight() != pItem->ShadowHeight)
02120 {
02121 pControl->SetFloorShadowHeight(pItem->ShadowHeight);
02122 bMustIRegen = TRUE;
02123 }
02124
02125 if (pControl->GetPenumbraWidth() != pItem->PenumbraSize)
02126 {
02127 pControl->SetPenumbraWidth(pItem->PenumbraSize);
02128 bMustIRegen = TRUE;
02129 }
02130
02131
02132 pControl->SetOffsetX(pItem->PositionShadowX);
02133 pControl->SetOffsetY(pItem->PositionShadowY);
02134
02135 if (pControl->GetWallShadowScale() != pItem->ShadowScale)
02136 {
02137 pControl->SetWallShadowScale(pItem->ShadowScale);
02138 bMustIRegen = TRUE;
02139 }
02140
02141 if (pControl->GetGlowWidth() != pItem->GlowWidth)
02142 {
02143 pControl->SetGlowWidth(pItem->GlowWidth);
02144 bMustIRegen = TRUE;
02145 }
02146
02147 if (pControl->GetFeatherWidth() != pItem->FeatherWidth)
02148 {
02149 pControl->SetFeatherWidth(pItem->FeatherWidth);
02150 bMustIRegen = TRUE;
02151 }
02152
02153 pShadow->SetTransp(pItem->ShadowTransparency);
02154
02155
02156 if (pView)
02157 {
02158 pControl->InvalidateBoundingRect();
02159 pControl->ReleaseCached(TRUE, FALSE, TRUE, TRUE);
02160
02161 if ((bRegen && bMustIRegen) || bForceRegen)
02162 {
02163 pControl->RegenerateNode(NULL);
02164 }
02165
02166 pView->ForceRedraw(pControl->FindParentSpread(), pControl->GetBoundingRect(),
02167 FALSE);
02168 }
02169
02170 pItem = (ShadowDragData *)pList->GetNext(pItem);
02171 }
02172
02173 pList->DeleteAll();
02174 ShadowDataList.DeleteAll();
02175 }
02176
02177
02178
02179
02180
02181
02182
02183
02184
02185
02186
02187
02188
02189 MILLIPOINT SoftShadowInfoBarOp::GetGlowSliderValue()
02190 {
02191 SetGadgetRange(_R(IDC_SOFTSHADOWSLIDER), 0, WIDTHSLIDERMAX);
02192 MILLIPOINT Value = GetLongGadgetValue(_R(IDC_SOFTSHADOWSLIDER), 0,
02193 WIDTHSLIDERMAX);
02194
02195
02196 if (Value > WIDTHSLIDERMAX)
02197 Value = WIDTHSLIDERMAX;
02198
02199 double dValue = Value - 0;
02200 dValue /= (double)(WIDTHSLIDERMAX - 0);
02201
02202
02203
02204 GlowSliderProfile.SetBias(-GlowSliderProfile.GetBias());
02205 double dSliderValue = GlowSliderProfile.MapZeroToOne((AFp)(dValue));
02206 GlowSliderProfile.SetBias(-GlowSliderProfile.GetBias());
02207
02208 dSliderValue *= (double)(WIDTHSLIDERMAX - 0);
02209 dSliderValue += 0;
02210
02211 return (INT32)dSliderValue;
02212 }
02213
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224
02225
02226 void SoftShadowInfoBarOp::SetGlowSliderValue(MILLIPOINT Value)
02227 {
02228
02229 if (Value > WIDTHSLIDERMAX)
02230 Value = WIDTHSLIDERMAX;
02231
02232 if (Value < 0)
02233 Value = 0;
02234
02235 double dValue = Value;
02236 dValue /= (double)(WIDTHSLIDERMAX);
02237
02238
02239 double dSliderValue = dValue;
02240
02241 dSliderValue = GlowSliderProfile.MapZeroToOne((AFp)(dValue));
02242
02243
02244 dSliderValue *= (double)WIDTHSLIDERMAX;
02245 dSliderValue += 0;
02246
02247 SetGadgetRange(_R(IDC_SOFTSHADOWSLIDER), 0, WIDTHSLIDERMAX);
02248
02249 SetLongGadgetValue(_R(IDC_SOFTSHADOWSLIDER), (INT32)dSliderValue);
02250 }
02251
02252
02253
02254
02255
02256
02257
02258
02259
02260
02261
02262
02263
02264 void SoftShadowInfoBarOp::UpdateGadgetTypeButtons()
02265 {
02266 BOOL bHasWallShadow = FALSE;
02267 BOOL bHasGlowShadow = FALSE;
02268 BOOL bHasFloorShadow = FALSE;
02269 BOOL bHasFeather = FALSE;
02270
02271 NodeShadowController* pMaster = NULL;
02272 ListRange* pEditRange = pSoftShadowTool->GetShadowEditRange(&pMaster);
02273 if (pEditRange)
02274 {
02275 Node* pNode = pEditRange->FindFirst();
02276 while (pNode)
02277 {
02278 ENSURE(pNode->IsAShadowController(), "Found unexpected node type in shadow stack level");
02279 NodeShadowController* pControl = (NodeShadowController*)pNode;
02280
02281 switch (pControl->GetShadowType())
02282 {
02283 case SHADOWTYPE_WALL:
02284 bHasWallShadow = TRUE;
02285 break;
02286 case SHADOWTYPE_FLOOR:
02287 bHasFloorShadow = TRUE;
02288 break;
02289 case SHADOWTYPE_GLOW:
02290 bHasGlowShadow = TRUE;
02291 break;
02292 case SHADOWTYPE_FEATHER:
02293 bHasFeather = TRUE;
02294 break;
02295
02296 default:
02297 {
02298
02299 }
02300 break;
02301 }
02302
02303 pNode = pEditRange->FindNext(pNode);
02304 }
02305 }
02306
02307
02308 SetBoolGadgetSelected(_R(IDC_BTN_WALLSHADOW), bHasWallShadow);
02309 SetBoolGadgetSelected(_R(IDC_BTN_FLOORSHADOW), bHasFloorShadow);
02310 SetBoolGadgetSelected(_R(IDC_BTN_GLOWSHADOW), bHasGlowShadow);
02311
02312
02313 if (!bHasWallShadow && !bHasFloorShadow && !bHasGlowShadow)
02314 {
02315 SetBoolGadgetSelected(_R(IDC_BTN_NOSHADOW), TRUE);
02316 }
02317 else
02318 {
02319 SetBoolGadgetSelected(_R(IDC_BTN_NOSHADOW), FALSE);
02320 }
02321
02322 }
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333
02334
02335
02336 void SoftShadowInfoBarOp::HandleNoShadowBtnClicked()
02337 {
02338
02339 if (!GetBoolGadgetSelected(_R(IDC_BTN_NOSHADOW)))
02340 {
02341
02342 return;
02343 }
02344
02345 HandleShadowTypeChange(SHADOWTYPE_NONE);
02346 }
02347
02348
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360 void SoftShadowInfoBarOp::HandleWallShadowBtnClicked()
02361 {
02362 HandleShadowTypeChange(SHADOWTYPE_WALL);
02363 }
02364
02365
02366
02367
02368
02369
02370
02371
02372
02373
02374
02375
02376
02377 void SoftShadowInfoBarOp::HandleFloorShadowBtnClicked()
02378 {
02379 HandleShadowTypeChange(SHADOWTYPE_FLOOR);
02380 }
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393
02394 void SoftShadowInfoBarOp::HandleGlowShadowBtnClicked()
02395 {
02396 HandleShadowTypeChange(SHADOWTYPE_GLOW);
02397 }
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411 void SoftShadowInfoBarOp::HandleShadowTypeChange(ShadowType Type)
02412 {
02413
02414
02415 NodeShadowParam Param(Type);
02416 Param.StackPosition = STACKPOS_INSERT_TOP;
02417 Param.pPPStack = GetApplication()->FindSelection()->GetEffectsStack(TRUE);
02418 Param.pShadowTool = pSoftShadowTool;
02419
02420
02421 if (Type != SHADOWTYPE_NONE)
02422 {
02423 PORTNOTE("other", "Removed use of Feather effect from SoftShadowInfoBarOp")
02424 #if !defined(EXCLUDE_FROM_XARALX)
02425 if (Type==SHADOWTYPE_FEATHER)
02426 {
02427 #ifdef FEATHER_EFFECT
02428 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLY_FEATHEREFFECT);
02429 if (pOpDesc != NULL)
02430 {
02431 OpFeatherEffectParam fxparam;
02432 fxparam.StackPosition = STACKPOS_INSERT_TOP;
02433 fxparam.strOpUnique = POSTPRO_ID_FEATHER;
02434 fxparam.FeatherSize = 2;
02435 fxparam.pPPStack = Param.pPPStack;
02436
02437 pOpDesc->Invoke(&fxparam);
02438
02439
02440
02441 }
02442
02443 delete Param.pPPStack;
02444 return;
02445 #endif
02446 }
02447 else
02448 #endif
02449 {
02450 NodeShadowController* pMaster = NULL;
02451 pSoftShadowTool->GetShadowEditRange(&pMaster);
02452 if (pMaster==NULL)
02453 {
02454
02455
02456 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLYSHADOW);
02457 if (pOpDesc != NULL)
02458 {
02459 String_256 UIDesc;
02460 OpState State = OpApplyShadow::GetState(&UIDesc, pOpDesc);
02461 if (!State.Greyed)
02462 pOpDesc->Invoke(&Param);
02463
02464
02465 UpdateInfoBar();
02466 }
02467
02468 delete Param.pPPStack;
02469 return;
02470 }
02471 else
02472 {
02473
02474
02475 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGESHADOWTYPE);
02476 if (pOpDesc != NULL)
02477 {
02478 String_256 UIDesc;
02479 OpState State = OpChangeShadowType::GetState(&UIDesc, pOpDesc);
02480 if (!State.Greyed)
02481 pOpDesc->Invoke(&Param);
02482
02483
02484 UpdateInfoBar();
02485 }
02486
02487 delete Param.pPPStack;
02488 return;
02489 }
02490 }
02491 }
02492
02493
02494 else
02495 {
02496 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_REMOVESHADOW);
02497 if (pOpDesc != NULL)
02498 {
02499 String_256 UIDesc;
02500 OpState State = OpRemoveShadow::GetState(&UIDesc, pOpDesc);
02501 if (!State.Greyed)
02502 pOpDesc->Invoke(&Param);
02503
02504
02505 UpdateInfoBar();
02506 }
02507 }
02508 }
02509
02510
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523 void SoftShadowInfoBarOp::SetDarknessEditGadget(double dDarkness)
02524 {
02525
02526 INT32 percent = (INT32)(100 - (dDarkness * 100));
02527
02528
02529 TCHAR Str[32];
02530 String_32 temp(_R(IDS_PERCENT_FORMAT));
02531 camSnprintf(Str, 32, temp, percent);
02532 String_32 PercentStr(Str);
02533 pSoftShadowInfoBar->SetStringGadgetValue(_R(IDC_SHADOWTRANSP_EDIT), PercentStr);
02534 }
02535
02536
02537
02538
02539
02540
02541
02542
02543
02544
02545
02546
02547
02548
02549 BOOL SoftShadowInfoBarOp::GetDarknessEditGadget(double& dDarkness, BOOL &bMany)
02550 {
02551 dDarkness = 0;
02552 String_256 ManyStr;
02553 ManyStr.Load(_R(IDS_SHADOWSTRING_MANY));
02554
02555 BOOL Valid = TRUE;
02556 String_256 FieldContents = pSoftShadowInfoBar->GetStringGadgetValue(_R(IDC_SHADOWTRANSP_EDIT), &Valid);
02557 if (!Valid)
02558 return FALSE;
02559
02560 bMany = (FieldContents == ManyStr);
02561 if (bMany)
02562 return TRUE;
02563
02564
02565
02566
02567
02568 INT32 Length = (INT32)FieldContents.Length();
02569 TCHAR* StrText = (TCHAR*)FieldContents;
02570
02571
02572 INT32 i = 0;
02573 while (i < Length && !StringBase::IsNumeric(StrText[i]))
02574 i++;
02575
02576 if (i>=Length)
02577 return FALSE;
02578
02579
02580 INT32 j = i;
02581 while (j < Length && StringBase::IsNumeric(StrText[j]))
02582 j++;
02583
02584 INT32 value;
02585 String_256 PercentStr;
02586 FieldContents.Mid(&PercentStr, i, (j - i));
02587 Convert::StringToLong(PercentStr, &value);
02588
02589 if (value < 0 || value > 100)
02590 return FALSE;
02591
02592 dDarkness = (100 - value)/100.0;
02593 SetDarknessEditGadget(dDarkness);
02594
02595 return TRUE;
02596 }
02597
02598 void SoftShadowInfoBarOp::SetDarknessSlider(double dDarkness)
02599 {
02600 SetLongGadgetValue(_R(IDC_SOFTSHADOWTRANSPSLIDER), (INT32)((1.0-dDarkness) * CONTRASTSLIDERMAX));
02601 }
02602
02603 double SoftShadowInfoBarOp::GetDarknessSlider(BOOL* pValid)
02604 {
02605 return 1.0-((double)GetLongGadgetValue(_R(IDC_SOFTSHADOWTRANSPSLIDER), 0, CONTRASTSLIDERMAX, 0, pValid)/(double)CONTRASTSLIDERMAX);
02606 }
02607
02608 BOOL SoftShadowInfoBarOp::SelectShadowsAlone()
02609 {
02610
02611 EffectsStack* pMyStack = GetApplication()->FindSelection()->GetEffectsStack(TRUE);
02612 if (pMyStack==NULL)
02613 {
02614 FailAndExecute();
02615 End();
02616 return FALSE;
02617 }
02618
02619 NodeRenderableInk::DeselectAll();
02620
02621 NodeShadowController* pMaster = NULL;
02622 ListRange* pShadowRange = pSoftShadowTool->GetShadowEditRange(&pMaster);
02623 if (pShadowRange)
02624 {
02625 Node* pSCNode = pShadowRange->FindFirst();
02626 while (pSCNode)
02627 {
02628 ENSURE(pSCNode->IsAShadowController(), "Found unexpected node type in shadow stack level");
02629 NodeShadowController* pControl = (NodeShadowController*)pSCNode;
02630 NodeShadow * pShadow = pControl->GetShadow();
02631
02632 pShadow->Select(TRUE);
02633
02634 pSCNode = pShadowRange->FindNext(pSCNode);
02635 }
02636 }
02637
02638
02639 if (pMyStack)
02640 {
02641 delete pMyStack;
02642 pMyStack = NULL;
02643 }
02644
02645 return TRUE;
02646 }
02647
02648
02649
02650 #endif