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
00108
00109
00110
00111
00112
00113
00114 #include "camtypes.h"
00115
00116
00117 DECLARE_SOURCE("$Revision: 1282 $");
00118
00119 #include "blobby.h"
00120 #include "ophist.h"
00121 #include "lineattr.h"
00122
00123 #include "page.h"
00124
00125
00126
00127
00128
00129
00130 #include <stdlib.h>
00131
00132 #include "bfxatom.h"
00133 #include "tracergn.h"
00134 #include "bubbleid.h"
00135
00136 CC_IMPLEMENT_DYNCREATE(BlobbyOp, UndoableOperation)
00137 CC_IMPLEMENT_DYNCREATE(UndoColAction, Action)
00138 CC_IMPLEMENT_DYNCREATE(RedoColAction, Action)
00139 CC_IMPLEMENT_DYNCREATE(UndoAction2, Action)
00140 CC_IMPLEMENT_DYNCREATE(UndoAction3, Action)
00141 CC_IMPLEMENT_DYNCREATE(RedoAction2, Action)
00142 CC_IMPLEMENT_DYNCREATE(RedoAction3, Action)
00143 CC_IMPLEMENT_DYNCREATE(BlobbyDlg, DialogOp)
00144 CC_IMPLEMENT_DYNCREATE(BlobbyBar, DialogOp)
00145 CC_IMPLEMENT_DYNCREATE(BlobbyTabDlg, DialogTabOp)
00146
00147 #define new CAM_DEBUG_NEW
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 BlobbyOp::BlobbyOp(): UndoableOperation()
00173 {
00174 }
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 BOOL BlobbyOp::Init()
00195 {
00196 return (UndoableOperation::RegisterOpDescriptor(
00197 0,
00198 _R(IDS_BLOBBY_OP),
00199 CC_RUNTIME_CLASS(BlobbyOp),
00200 OPTOKEN_BLOBBY,
00201 BlobbyOp::GetState,
00202 0,
00203 _R(IDBBL_BLOBBYOP),
00204 0 ));
00205 }
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222 OpState BlobbyOp::GetState(String_256*, OpDescriptor*)
00223 {
00224 OpState OpSt;
00225 return(OpSt);
00226 }
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 void BlobbyOp::Do(OpDescriptor*)
00244 {
00245 #if 1
00246 ActionCode ActCode;
00247 UndoColAction* UndoColAct;
00248
00249
00250 if ((ActCode = UndoColAction::Init(this,
00251 &UndoActions,
00252 10,
00253 (Action**)(&UndoColAct))) != AC_FAIL)
00254
00255
00256 UndoColAct->Color = Page::GetPageColour();
00257
00258 if (ActCode != AC_FAIL)
00259 {
00260 DocColour Col ((INT32)(rand()%255),
00261 (INT32)(rand()%255),
00262 (INT32)(rand()%255));
00263
00264 Page::SetPageColour(Col);
00265
00266 (DocView::GetSelected())->ForceRedraw();
00267
00268
00269
00270
00271 UndoAction2* UndoAct2;
00272
00273
00274 if (UndoAction2::Init(this,
00275 &UndoActions,
00276 10,
00277 (Action**)(&UndoAct2)) != AC_FAIL)
00278 {
00279
00280
00281
00282
00283
00284 UndoAction3* UndoAct3;
00285
00286
00287 UndoAction3::Init(this,
00288 &UndoActions,
00289 10,
00290 (Action**)(&UndoAct3));
00291 }
00292 }
00293
00294 #ifdef _DEBUG
00295
00296 Document *pDoc = GetWorkingDoc();
00297 #endif
00298
00299
00300 End();
00301
00302 #ifdef _DEBUG
00303
00304 pDoc->GetOpHistory().DebugSizeCheck();
00305 #endif
00306 #else
00307
00308 TraceRegion::Test(this);
00309
00310 End();
00311
00312 #endif
00313 }
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330 UndoColAction::UndoColAction():Action()
00331 {
00332 }
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 ActionCode UndoColAction::Init(Operation* const pOp,
00378 ActionList* pActionList,
00379 UINT32 ActionSize,
00380 Action** NewAction)
00381 {
00382
00383 return(Action::Init(pOp,
00384 pActionList,
00385 ActionSize,
00386 CC_RUNTIME_CLASS(UndoColAction),
00387 NewAction));
00388 }
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406 ActionCode UndoColAction::Execute()
00407 {
00408 RedoColAction* RedoColAct;
00409 ActionCode ActCode;
00410
00411 if ((ActCode = RedoColAction::Init(pOperation,
00412 pOperation->GetRedoActionList(),
00413 10,
00414 ((Action**)&RedoColAct))) != AC_FAIL)
00415 if (RedoColAct != NULL)
00416 RedoColAct->Color = Page::GetPageColour();
00417
00418 if (ActCode != AC_FAIL)
00419 {
00420
00421 Page::SetPageColour(Color);
00422
00423 (DocView::GetSelected())->ForceRedraw();
00424 }
00425 return (ActCode);
00426 }
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444 RedoColAction::RedoColAction():Action()
00445 {
00446 }
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492 ActionCode RedoColAction::Init(Operation* const pOp,
00493 ActionList* pActionList,
00494 UINT32 ActionSize,
00495 Action** NewAction)
00496 {
00497 return(Action::Init(pOp,
00498 pActionList,
00499 ActionSize,
00500 CC_RUNTIME_CLASS(RedoColAction),
00501 NewAction));
00502 }
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521 ActionCode RedoColAction::Execute()
00522 {
00523 UndoColAction* UndoColAct;
00524 ActionCode ActCode;
00525
00526 if ((ActCode = UndoColAction::Init(pOperation,
00527 pOperation->GetUndoActionList(),
00528 10,
00529 ((Action**)&UndoColAct))) == AC_OK)
00530 if (UndoColAct != NULL)
00531 UndoColAct->Color = Page::GetPageColour();
00532
00533 if (ActCode != AC_FAIL)
00534 {
00535
00536 Page::SetPageColour(Color);
00537
00538 (DocView::GetSelected())->ForceRedraw();
00539 }
00540 return (ActCode);
00541 }
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560 RedoAction2::RedoAction2():Action()
00561 {
00562 }
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609 ActionCode RedoAction2::Init(Operation* const pOp,
00610 ActionList* pActionList,
00611 UINT32 ActionSize,
00612 Action** NewAction)
00613 {
00614 return(Action::Init(pOp,
00615 pActionList,
00616 ActionSize,
00617 CC_RUNTIME_CLASS(RedoAction2),
00618 NewAction));
00619 }
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636 ActionCode RedoAction2::Execute()
00637 {
00638 UndoAction2* UndoAct;
00639 ActionCode ActCode;
00640 ActCode = UndoAction2::Init(pOperation,
00641 pOperation->GetUndoActionList(),
00642 10,
00643 ((Action**)&UndoAct));
00644
00645 if (ActCode != AC_FAIL)
00646 {
00647
00648
00649 }
00650 return (ActCode);
00651 }
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669 RedoAction3::RedoAction3():Action()
00670 {
00671 }
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717 ActionCode RedoAction3::Init(Operation* const pOp,
00718 ActionList* pActionList,
00719 UINT32 ActionSize,
00720 Action** NewAction)
00721 {
00722 return(Action::Init(pOp,
00723 pActionList,
00724 ActionSize,
00725 CC_RUNTIME_CLASS(RedoAction3),
00726 NewAction));
00727 }
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746 ActionCode RedoAction3::Execute()
00747 {
00748 UndoAction3* UndoAct;
00749 ActionCode ActCode;
00750 ActCode = UndoAction3::Init(pOperation,
00751 pOperation->GetUndoActionList(),
00752 10,
00753 ((Action**)&UndoAct));
00754
00755 if (ActCode != AC_FAIL)
00756 {
00757
00758
00759 }
00760 return (ActCode);
00761 }
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781 UndoAction2::UndoAction2():Action()
00782 {
00783 }
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829 ActionCode UndoAction2::Init(Operation* const pOp,
00830 ActionList* pActionList,
00831 UINT32 ActionSize,
00832 Action** NewAction)
00833 {
00834 return(Action::Init(pOp,
00835 pActionList,
00836 ActionSize,
00837 CC_RUNTIME_CLASS(UndoAction2),
00838 NewAction));
00839 }
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857 ActionCode UndoAction2::Execute()
00858 {
00859 RedoAction2* RedoAct;
00860 ActionCode ActCode;
00861 ActCode = RedoAction2::Init(pOperation,
00862 pOperation->GetRedoActionList(),
00863 10,
00864 ((Action**)&RedoAct));
00865
00866 if (ActCode != AC_FAIL)
00867 {
00868
00869
00870 }
00871 return (ActCode);
00872 }
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891 UndoAction3::UndoAction3():Action()
00892 {
00893 }
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939 ActionCode UndoAction3::Init(Operation* const pOp,
00940 ActionList* pActionList,
00941 UINT32 ActionSize,
00942 Action** NewAction)
00943 {
00944 return(Action::Init(pOp,
00945 pActionList,
00946 ActionSize,
00947 CC_RUNTIME_CLASS(UndoAction3),
00948 NewAction));
00949 }
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967 ActionCode UndoAction3::Execute()
00968 {
00969 RedoAction3* RedoAct;
00970 ActionCode ActCode;
00971 ActCode = RedoAction3::Init(pOperation,
00972 pOperation->GetRedoActionList(),
00973 10,
00974 ((Action**)&RedoAct));
00975
00976 if (ActCode != AC_FAIL)
00977 {
00978
00979
00980 }
00981 return (ActCode);
00982 }
00983
00984
00985
00986
00987 const CDlgMode BlobbyDlg::Mode = MODELESS;
00988
00989 const UINT32 BlobbyDlg::IDD = _R(IDD_BLOBBYDLG);
00990
00991 BlobbyDlg::BlobbyDlg(): DialogOp(BlobbyDlg::IDD, BlobbyDlg::Mode)
00992 {
00993 }
00994
00995
00996
00997 void InitValues(BlobbyDlg* pBlob)
00998 {
00999
01000 String_256 Wibble("WIBBLE");
01001 String_256 Wobble("WOBBLE");
01002 pBlob->SetStringGadgetValue(_R(IDC_BUTTON1),
01003 Wibble);
01004 pBlob->SetStringGadgetValue(_R(IDC_BUTTON2),
01005 Wobble);
01006
01007
01008 String_256 StrList[5*5];
01009 char a, b;
01010 INT32 i=0;
01011
01012 for(a='e'; a>='a';a--)
01013 {
01014 for (b='a'; b<='e';b++)
01015 {
01016 ((TCHAR*)StrList[i])[0] = a;
01017 ((TCHAR*)StrList[i])[1] = b;
01018 ((TCHAR*)StrList[i])[2] = 0;
01019 pBlob->SetStringGadgetValue(_R(IDC_LIST1), StrList[i],FALSE,i);
01020 i++;
01021 }
01022 }
01023
01024 pBlob->SetLongGadgetValue(_R(IDC_SCROLLBAR1), 60, 10);
01025 pBlob->SetLongGadgetValue(_R(IDC_SCROLLBAR2), 60, 10);
01026 BOOL Valid;
01027 MILLIPOINT Value = (MILLIPOINT)(pBlob->GetLongGadgetValue(_R(IDC_SCROLLBAR1),10,100,0,&Valid)*72000);
01028 pBlob->SetUnitGadgetValue(_R(IDC_XVAL), INCHES, Value);
01029 Value = (MILLIPOINT)(pBlob->GetLongGadgetValue(_R(IDC_SCROLLBAR2),10,100,0,&Valid)*72000);
01030 pBlob->SetUnitGadgetValue(_R(IDC_YVAL), INCHES, Value);
01031
01032
01033 pBlob->DefaultUnit = INCHES;
01034 pBlob->ConvUnit = MILLIMETRES;
01035
01036
01037 pBlob->SetLongGadgetValue(_R(IDC_RADIO11), TRUE);
01038 pBlob->SetLongGadgetValue(_R(IDC_RADIO12), FALSE);
01039 pBlob->SetLongGadgetValue(_R(IDC_RADIO13), FALSE);
01040
01041 pBlob->SetLongGadgetValue(_R(IDC_RADIO21), FALSE);
01042 pBlob->SetLongGadgetValue(_R(IDC_RADIO22), FALSE);
01043 pBlob->SetLongGadgetValue(_R(IDC_RADIO23), TRUE);
01044 }
01045
01046
01047
01048 void HideGadgets(BlobbyDlg* pBlob)
01049 {
01050 BOOL Valid;
01051 BOOL Hide = (BOOL)(pBlob->GetLongGadgetValue(_R(IDC_CHECK2),0,1,0,&Valid));
01052 pBlob->HideGadget(_R(IDC_STATIC1), Hide);
01053 pBlob->HideGadget(_R(IDC_STATIC2), Hide);
01054 pBlob->HideGadget(_R(IDC_STATIC3), Hide);
01055 pBlob->HideGadget(_R(IDC_STATIC4), Hide);
01056 pBlob->HideGadget(_R(IDC_BUTTON1), Hide);
01057 pBlob->HideGadget(_R(IDC_BUTTON2), Hide);
01058 pBlob->HideGadget(_R(IDC_SCROLLBAR1), Hide);
01059 pBlob->HideGadget(_R(IDC_SCROLLBAR2), Hide);
01060 pBlob->HideGadget(_R(IDOK), Hide);
01061 pBlob->HideGadget(_R(IDCANCEL), Hide);
01062 pBlob->HideGadget(_R(IDC_CHECK1), Hide);
01063 pBlob->HideGadget(_R(IDC_STATIC6), Hide);
01064 pBlob->HideGadget(_R(IDC_LIST1), Hide);
01065 pBlob->HideGadget(_R(IDC_LIST2), Hide);
01066
01067 pBlob->HideGadget(_R(IDC_RADIO11), Hide);
01068 pBlob->HideGadget(_R(IDC_RADIO12), Hide);
01069 pBlob->HideGadget(_R(IDC_RADIO13), Hide);
01070 pBlob->HideGadget(_R(IDC_RADIO21), Hide);
01071 pBlob->HideGadget(_R(IDC_RADIO22), Hide);
01072 pBlob->HideGadget(_R(IDC_RADIO23), Hide);
01073
01074 pBlob->HideGadget(_R(IDC_EDIT1), Hide);
01075 pBlob->HideGadget(_R(IDC_EDIT2), Hide);
01076 pBlob->HideGadget(_R(IDC_EDIT3), Hide);
01077
01078 pBlob->HideGadget(_R(IDC_STCONV), Hide);
01079 pBlob->HideGadget(_R(IDC_STDEF), Hide);
01080 pBlob->HideGadget(_R(IDC_STCT), Hide);
01081 pBlob->HideGadget(_R(IDC_UNITVAL), Hide);
01082 pBlob->HideGadget(_R(IDC_CONVVAL), Hide);
01083 pBlob->HideGadget(_R(IDC_STUV), Hide);
01084 pBlob->HideGadget(_R(IDC_CONV), Hide);
01085 pBlob->HideGadget(_R(IDC_BUTTON3), Hide);
01086 pBlob->HideGadget(_R(IDC_STRD), Hide);
01087
01088 pBlob->HideGadget(_R(IDC_STRD), Hide);
01089 pBlob->HideGadget(_R(IDC_YVAL), Hide);
01090 pBlob->HideGadget(_R(IDC_XVAL), Hide);
01091 pBlob->HideGadget(_R(IDC_STDEF), Hide);
01092 pBlob->HideGadget(_R(IDC_COMBO3), Hide);
01093 pBlob->HideGadget(_R(IDC_COMBO4), Hide);
01094 pBlob->HideGadget(_R(IDC_STCT), Hide);
01095 pBlob->HideGadget(_R(IDC_STUV), Hide);
01096
01097 pBlob->HideGadget(_R(IDC_VLD), Hide);
01098 pBlob->HideGadget(_R(ID_STINT), Hide);
01099 pBlob->HideGadget(_R(IDC_STRL), Hide);
01100 pBlob->HideGadget(_R(IDC_STXYZ), Hide);
01101 pBlob->HideGadget(_R(IDC_EDIT1), Hide);
01102 pBlob->HideGadget(_R(IDC_EDIT2), Hide);
01103 pBlob->HideGadget(_R(IDC_EDIT3), Hide);
01104 }
01105
01106
01107
01108 void EnableGadgets(BlobbyDlg* pBlob)
01109 {
01110 BOOL Valid;
01111 BOOL Enable = !((BOOL)(pBlob->GetLongGadgetValue(_R(IDC_CHECK1), 0,1,0,&Valid)));
01112 pBlob->EnableGadget(_R(IDC_STATIC1), Enable);
01113 pBlob->EnableGadget(_R(IDC_STATIC2), Enable);
01114 pBlob->EnableGadget(_R(IDC_STATIC3), Enable);
01115 pBlob->EnableGadget(_R(IDC_STATIC4), Enable);
01116 pBlob->EnableGadget(_R(IDC_BUTTON1), Enable);
01117 pBlob->EnableGadget(_R(IDC_BUTTON2), Enable);
01118 pBlob->EnableGadget(_R(IDC_SCROLLBAR1), Enable);
01119 pBlob->EnableGadget(_R(IDC_SCROLLBAR2), Enable);
01120 pBlob->EnableGadget(_R(IDOK), Enable);
01121 pBlob->EnableGadget(_R(IDCANCEL), Enable);
01122 pBlob->EnableGadget(_R(IDC_CHECK2), Enable);
01123 pBlob->EnableGadget(_R(IDC_STATIC6), Enable);
01124 pBlob->EnableGadget(_R(IDC_LIST1), Enable);
01125 pBlob->EnableGadget(_R(IDC_LIST2), Enable);
01126
01127 pBlob->EnableGadget(_R(IDC_RADIO11), Enable);
01128 pBlob->EnableGadget(_R(IDC_RADIO12), Enable);
01129 pBlob->EnableGadget(_R(IDC_RADIO13), Enable);
01130 pBlob->EnableGadget(_R(IDC_RADIO21), Enable);
01131 pBlob->EnableGadget(_R(IDC_RADIO22), Enable);
01132 pBlob->EnableGadget(_R(IDC_RADIO23), Enable);
01133
01134 pBlob->EnableGadget(_R(IDC_EDIT1), Enable);
01135 pBlob->EnableGadget(_R(IDC_EDIT2), Enable);
01136 pBlob->EnableGadget(_R(IDC_EDIT3), Enable);
01137
01138 pBlob->EnableGadget(_R(IDC_STCONV), Enable);
01139 pBlob->EnableGadget(_R(IDC_STDEF), Enable);
01140 pBlob->EnableGadget(_R(IDC_STCT), Enable);
01141 pBlob->EnableGadget(_R(IDC_UNITVAL), Enable);
01142 pBlob->EnableGadget(_R(IDC_CONVVAL), Enable);
01143 pBlob->EnableGadget(_R(IDC_STUV), Enable);
01144 pBlob->EnableGadget(_R(IDC_CONV), Enable);
01145 pBlob->EnableGadget(_R(IDC_BUTTON3), Enable);
01146 pBlob->EnableGadget(_R(IDC_STRD), Enable);
01147
01148 pBlob->EnableGadget(_R(IDC_STRD), Enable);
01149 pBlob->EnableGadget(_R(IDC_YVAL), Enable);
01150 pBlob->EnableGadget(_R(IDC_XVAL), Enable);
01151 pBlob->EnableGadget(_R(IDC_STDEF), Enable);
01152 pBlob->EnableGadget(_R(IDC_COMBO3), Enable);
01153 pBlob->EnableGadget(_R(IDC_COMBO4), Enable);
01154 pBlob->EnableGadget(_R(IDC_STCT), Enable);
01155 pBlob->EnableGadget(_R(IDC_STUV), Enable);
01156
01157 pBlob->EnableGadget(_R(IDC_VLD), Enable);
01158 pBlob->EnableGadget(_R(ID_STINT), Enable);
01159 pBlob->EnableGadget(_R(IDC_STRL), Enable);
01160 pBlob->EnableGadget(_R(IDC_STXYZ), Enable);
01161 pBlob->EnableGadget(_R(IDC_EDIT1), Enable);
01162 pBlob->EnableGadget(_R(IDC_EDIT2), Enable);
01163 pBlob->EnableGadget(_R(IDC_EDIT3), Enable);
01164 }
01165
01166
01167
01168 MsgResult BlobbyDlg::Message( Msg* Message)
01169 {
01170
01171 if (IS_OUR_DIALOG_MSG(Message))
01172 {
01173 DialogMsg* Msg = (DialogMsg*)Message;
01174
01175 if ((Msg->DlgMsg == DIM_COMMIT) || (Msg->DlgMsg == DIM_CANCEL))
01176 {
01177
01178 #if 0
01179 BOOL Valid=0;
01180 INT32 Value = (INT32) GetUnitGadgetValue(_R(IDC_UNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01181 BitmapEffectAtom::Test(Value);
01182 #endif
01183
01184 Close();
01185 End();
01186 }
01187 else if (Msg->DlgMsg == DIM_SOFT_COMMIT)
01188 {
01189 InitValues(this);
01190 }
01191
01192
01193 if (((Msg->GadgetID == _R(IDC_BUTTON1)) || (Msg->GadgetID == _R(IDC_BUTTON2)))
01194 && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01195 {
01196 BOOL Valid =0;
01197 String_256 Temp = GetStringGadgetValue(_R(IDC_BUTTON1), &Valid);
01198 String_256 Temp2 = GetStringGadgetValue(_R(IDC_BUTTON2), &Valid);
01199 SetStringGadgetValue(_R(IDC_BUTTON1),
01200 Temp2);
01201
01202 SetStringGadgetValue(_R(IDC_BUTTON2),
01203 Temp);
01204 SetTitlebarName(&Temp);
01205 }
01206
01207 else if ((Msg->GadgetID == _R(IDC_CHECK2)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01208 {
01209 HideGadgets(this);
01210 }
01211 else if ((Msg->GadgetID == _R(IDC_CHECK1)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01212 {
01213 EnableGadgets(this);
01214 }
01215
01216 else if ((Msg->GadgetID == _R(IDC_LIST1)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED_COMMIT))
01217 {
01218
01219 BOOL Valid =0;
01220 String_256 MoveStr = GetStringGadgetValue(_R(IDC_LIST1), &Valid);
01221 SetStringGadgetValue(_R(IDC_LIST2), MoveStr);
01222
01223 WORD Index;
01224 GetValueIndex(_R(IDC_LIST1), &Index);
01225 DeleteValue(_R(IDC_LIST1), FALSE, Index);
01226 }
01227 else if ((Msg->GadgetID == _R(IDC_LIST2)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01228 {
01229
01230 BOOL Valid =0;
01231 String_256 MoveStr = GetStringGadgetValue(_R(IDC_LIST2), &Valid);
01232 SetStringGadgetValue(_R(IDC_LIST1), MoveStr);
01233
01234 WORD Index;
01235 GetValueIndex(_R(IDC_LIST2), &Index);
01236 DeleteValue(_R(IDC_LIST2), FALSE, Index);
01237 }
01238
01239 else if (Msg->GadgetID == _R(IDC_SCROLLBAR1))
01240 {
01241 BOOL Valid=0;
01242 INT32 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_SCROLLBAR1),0,100,0,&Valid)*72000);
01243 SetUnitGadgetValue(_R(IDC_XVAL), INCHES, Value);
01244 }
01245 else if (Msg->GadgetID == _R(IDC_SCROLLBAR2))
01246 {
01247 BOOL Valid=0;
01248 INT32 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_SCROLLBAR2),0,100,0,&Valid)*72000);
01249 SetUnitGadgetValue(_R(IDC_YVAL), INCHES, Value);
01250 }
01251
01252 else if ((Msg->GadgetID == _R(IDC_COMBO3)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01253 {
01254
01255 INT32 Index;
01256 GetValueIndex(_R(IDC_COMBO3),&Index);
01257 if ((Index >= 0) && (Index <= 8))
01258 DefaultUnit = UnitList[Index];
01259 }
01260 else if ((Msg->GadgetID == _R(IDC_COMBO4)) && (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01261 {
01262
01263 INT32 Index;
01264 GetValueIndex(_R(IDC_COMBO4),&Index);
01265 if ((Index >= 0) && (Index <= 8))
01266 ConvUnit = UnitList[Index];
01267 }
01268 else if ((Msg->GadgetID == _R(IDC_BUTTON3)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01269 {
01270 BOOL Valid=0;
01271 MILLIPOINT Value = GetUnitGadgetValue(_R(IDC_UNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01272 SetUnitGadgetValue(_R(IDC_CONVVAL), ConvUnit, Value);
01273 }
01274
01275 else if ((Msg->GadgetID == _R(IDC_RADIO11)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01276 {
01277 SetLongGadgetValue(_R(IDC_RADIO23), TRUE);
01278 SetLongGadgetValue(_R(IDC_RADIO21), FALSE);
01279 SetLongGadgetValue(_R(IDC_RADIO22), FALSE);
01280
01281 }
01282 else if ((Msg->GadgetID == _R(IDC_RADIO12)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01283 {
01284 SetLongGadgetValue(_R(IDC_RADIO22), TRUE);
01285 SetLongGadgetValue(_R(IDC_RADIO21), FALSE);
01286 SetLongGadgetValue(_R(IDC_RADIO23), FALSE);
01287
01288 }
01289 else if ((Msg->GadgetID == _R(IDC_RADIO13)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01290 {
01291 SetLongGadgetValue(_R(IDC_RADIO21), TRUE);
01292 SetLongGadgetValue(_R(IDC_RADIO22), FALSE);
01293 SetLongGadgetValue(_R(IDC_RADIO23), FALSE);
01294 }
01295 else if ((Msg->GadgetID == _R(IDC_RADIO21)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01296 {
01297 SetLongGadgetValue(_R(IDC_RADIO13), TRUE);
01298 SetLongGadgetValue(_R(IDC_RADIO11), FALSE);
01299 SetLongGadgetValue(_R(IDC_RADIO12), FALSE);
01300
01301 }
01302 else if ((Msg->GadgetID == _R(IDC_RADIO22)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01303 {
01304 SetLongGadgetValue(_R(IDC_RADIO12), TRUE);
01305 SetLongGadgetValue(_R(IDC_RADIO11), FALSE);
01306 SetLongGadgetValue(_R(IDC_RADIO13), FALSE);
01307
01308 }
01309 else if ((Msg->GadgetID == _R(IDC_RADIO23)) && (Msg->DlgMsg == DIM_LFT_BN_CLICKED))
01310 {
01311 SetLongGadgetValue(_R(IDC_RADIO11), TRUE);
01312 SetLongGadgetValue(_R(IDC_RADIO12), FALSE);
01313 SetLongGadgetValue(_R(IDC_RADIO13), FALSE);
01314 }
01315
01316 return (DLG_EAT_IF_HUNGRY(Msg));
01317 }
01318 return OK;
01319 }
01320
01321
01322
01323 OpState BlobbyDlg::GetState(String_256*, OpDescriptor*)
01324 {
01325 OpState OpSt;
01326 return(OpSt);
01327 }
01328
01329
01330
01331 BOOL BlobbyDlg::Init()
01332 {
01333
01334 return (RegisterOpDescriptor(
01335 0,
01336 _R(IDS_BLOBBYDLG),
01337 CC_RUNTIME_CLASS(BlobbyDlg),
01338 OPTOKEN_BLOBBYDLG,
01339 BlobbyDlg::GetState,
01340 0,
01341 _R(IDBBL_BLOBBYDLG),
01342 0
01343 ));
01344
01345 }
01346
01347
01348
01349 BOOL BlobbyDlg::Create()
01350 {
01351 if (DialogOp::Create())
01352 {
01353 SetGadgetRange(_R(IDC_SCROLLBAR1), 0, 100, 10);
01354 SetGadgetRange(_R(IDC_SCROLLBAR2), 0, 100, 10);
01355
01356
01357 SetEditGadgetType(_R(IDC_UNITVAL), UNIT_NUMERIC);
01358 SetEditGadgetType(_R(IDC_EDIT1), INT_NUMERIC);
01359 SetEditGadgetType(_R(IDC_EDIT2), REAL_NUMERIC);
01360 SetEditGadgetType(_R(IDC_EDIT3), _R(IDS_BLOBBYXYZ));
01361
01362 UnitStrList[0] = String(TEXT("Millimetres"));
01363 UnitStrList[1] = String(TEXT("Centimetres"));
01364 UnitStrList[2] = String(TEXT("Metres"));
01365 UnitStrList[3] = String(TEXT("Inches"));
01366 UnitStrList[4] = String(TEXT("Feet"));
01367 UnitStrList[5] = String(TEXT("Yards"));
01368 UnitStrList[6] = String(TEXT("Points"));
01369 UnitStrList[7] = String(TEXT("Picas"));
01370 UnitStrList[8] = String(TEXT("Millipoints"));
01371
01372 UnitList[0] = MILLIMETRES;
01373 UnitList[1] = CENTIMETRES;
01374 UnitList[2] = METRES;
01375 UnitList[3] = INCHES;
01376 UnitList[4] = FEET;
01377 UnitList[5] = YARDS;
01378 UnitList[6] = COMP_POINTS;
01379 UnitList[7] = PICAS;
01380 UnitList[8] = MILLIPOINTS;
01381
01382 for (INT32 i=0; i<9; i++)
01383 {
01384 SetStringGadgetValue(_R(IDC_COMBO3), UnitStrList[i],FALSE,i);
01385 SetStringGadgetValue(_R(IDC_COMBO4), UnitStrList[i],FALSE,i);
01386 }
01387
01388
01389 InitValues(this);
01390
01391 return TRUE;
01392 }
01393 else return FALSE;
01394 }
01395
01396
01397
01398 void BlobbyDlg::Do(OpDescriptor*)
01399 {
01400 Create();
01401 Open();
01402 }
01403
01404
01405
01406
01407
01408
01409 const CDlgMode BlobbyTabDlg::Mode = MODAL;
01410 const UINT32 BlobbyTabDlg::IDD = _R(IDD_BLOBBYTABDLG);
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429 BlobbyTabDlg::BlobbyTabDlg(): DialogTabOp(BlobbyTabDlg::IDD, BlobbyTabDlg::Mode)
01430 {
01431
01432
01433 UnitStrList[0] = String(TEXT("Millimetres"));
01434 UnitStrList[1] = String(TEXT("Centimetres"));
01435 UnitStrList[2] = String(TEXT("Metres"));
01436 UnitStrList[3] = String(TEXT("Inches"));
01437 UnitStrList[4] = String(TEXT("Feet"));
01438 UnitStrList[5] = String(TEXT("Yards"));
01439 UnitStrList[6] = String(TEXT("Points"));
01440 UnitStrList[7] = String(TEXT("Picas"));
01441 UnitStrList[8] = String(TEXT("Millipoints"));
01442
01443 UnitList[0] = MILLIMETRES;
01444 UnitList[1] = CENTIMETRES;
01445 UnitList[2] = METRES;
01446 UnitList[3] = INCHES;
01447 UnitList[4] = FEET;
01448 UnitList[5] = YARDS;
01449 UnitList[6] = COMP_POINTS;
01450 UnitList[7] = PICAS;
01451 UnitList[8] = MILLIPOINTS;
01452
01453 }
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479 MsgResult BlobbyTabDlg::Message( Msg* Message)
01480 {
01481 if (IS_OUR_DIALOG_MSG(Message))
01482 {
01483 DialogMsg* Msg = ((DialogMsg*) Message);
01484
01485 BOOL EndDialog = FALSE;
01486 BOOL CommitValues = FALSE;
01487
01488
01489 if (Msg->PageID == _R(IDD_BLOBTAB_PG1))
01490 {
01491 HandleCoordsMsg(Msg);
01492 } else if (Msg->PageID == _R(IDD_BLOBTAB_PG2))
01493 {
01494 HandleRadioDazeMsg(Msg);
01495 } else if (Msg->PageID == _R(IDD_BLOBTAB_PG3))
01496 {
01497 HandleConvertMsg(Msg);
01498 } else if (Msg->PageID == 0)
01499 {
01500
01501 switch (Msg->DlgMsg)
01502 {
01503 case DIM_COMMIT:
01504 EndDialog = TRUE;
01505 CommitValues = TRUE;
01506 break;
01507
01508 case DIM_SOFT_COMMIT:
01509 CommitValues = TRUE;
01510 break;
01511
01512 case DIM_CANCEL:
01513 EndDialog = TRUE;
01514 break;
01515
01516 default:
01517 break;
01518 }
01519 } else
01520 {
01521 ERROR3("Message from unknown tab dialog page");
01522 }
01523
01524
01525 if (CommitValues)
01526 {
01527 TRACE( _T("BlobbyTabDlg::Message - If I wasn't blobby I would commit at this point"));
01528 }
01529
01530
01531 if (EndDialog)
01532 {
01533 Close();
01534 End();
01535 }
01536 return (DLG_EAT_IF_HUNGRY(Msg));
01537 }
01538 return OK;
01539 }
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562 void BlobbyTabDlg::HandleCoordsMsg(DialogMsg* Msg)
01563 {
01564 TalkToPage(_R(IDD_BLOBTAB_PG1));
01565 MILLIPOINT Value = 0;
01566 switch(Msg->DlgMsg)
01567 {
01568 case DIM_CREATE:
01569
01570
01571
01572 SetGadgetRange(_R(IDC_TSCROLLBAR1), 10, 100, 10);
01573 SetGadgetRange(_R(IDC_TSCROLLBAR2), 10, 100, 10);
01574
01575
01576 SetLongGadgetValue(_R(IDC_TSCROLLBAR1), 60, 10);
01577 SetLongGadgetValue(_R(IDC_TSCROLLBAR2), 60, 10);
01578
01579 BOOL Valid;
01580 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR1),10,100,0,&Valid)*72000);
01581 SetUnitGadgetValue(_R(IDC_TXVAL), INCHES, Value);
01582 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR2),10,100,0,&Valid)*72000);
01583 SetUnitGadgetValue(_R(IDC_TYVAL), INCHES, Value);
01584 break;
01585 case DIM_SELECTION_CHANGED:
01586 if (Msg->GadgetID == _R(IDC_TSCROLLBAR1))
01587 {
01588 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR1),10,100,0,&Valid)*72000);
01589 SetUnitGadgetValue(_R(IDC_TXVAL), INCHES, Value);
01590 } else if (Msg->GadgetID == _R(IDC_TSCROLLBAR2))
01591 {
01592 Value = (MILLIPOINT)(GetLongGadgetValue(_R(IDC_TSCROLLBAR2),10,100,0,&Valid)*72000);
01593 SetUnitGadgetValue(_R(IDC_TYVAL), INCHES, Value);
01594 }
01595 break;
01596 default:
01597 break;
01598 }
01599 }
01600
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618 void BlobbyTabDlg::HandleRadioDazeMsg(DialogMsg* Msg)
01619 {
01620 TalkToPage(_R(IDD_BLOBTAB_PG2));
01621 switch(Msg->DlgMsg)
01622 {
01623 case DIM_CREATE:
01624
01625 SetLongGadgetValue(_R(IDC_TRADIO11), TRUE);
01626 SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01627 SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01628
01629 SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01630 SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01631 SetLongGadgetValue(_R(IDC_TRADIO23), TRUE);
01632
01633 break;
01634 case DIM_LFT_BN_CLICKED:
01635 if (Msg->GadgetID==_R(IDC_TRADIO11))
01636 {
01637 SetLongGadgetValue(_R(IDC_TRADIO23), TRUE);
01638 SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01639 SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01640 }
01641 else if (Msg->GadgetID==_R(IDC_TRADIO12))
01642 {
01643 SetLongGadgetValue(_R(IDC_TRADIO22), TRUE);
01644 SetLongGadgetValue(_R(IDC_TRADIO21), FALSE);
01645 SetLongGadgetValue(_R(IDC_TRADIO23), FALSE);
01646 }
01647 else if (Msg->GadgetID==_R(IDC_TRADIO13))
01648 {
01649 SetLongGadgetValue(_R(IDC_TRADIO21), TRUE);
01650 SetLongGadgetValue(_R(IDC_TRADIO22), FALSE);
01651 SetLongGadgetValue(_R(IDC_TRADIO23), FALSE);
01652 }
01653 else if (Msg->GadgetID==_R(IDC_TRADIO21))
01654 {
01655 SetLongGadgetValue(_R(IDC_TRADIO13), TRUE);
01656 SetLongGadgetValue(_R(IDC_TRADIO11), FALSE);
01657 SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01658 }
01659 else if (Msg->GadgetID==_R(IDC_TRADIO22))
01660 {
01661 SetLongGadgetValue(_R(IDC_TRADIO12), TRUE);
01662 SetLongGadgetValue(_R(IDC_TRADIO11), FALSE);
01663 SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01664 }
01665 else if (Msg->GadgetID==_R(IDC_TRADIO23))
01666 {
01667 SetLongGadgetValue(_R(IDC_TRADIO11), TRUE);
01668 SetLongGadgetValue(_R(IDC_TRADIO12), FALSE);
01669 SetLongGadgetValue(_R(IDC_TRADIO13), FALSE);
01670 }
01671 break;
01672 default:
01673 break;
01674 }
01675 }
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694 void BlobbyTabDlg::HandleConvertMsg(DialogMsg* Msg)
01695 {
01696 TalkToPage(_R(IDD_BLOBTAB_PG3));
01697 switch(Msg->DlgMsg)
01698 {
01699 case DIM_CREATE:
01700 {
01701 DefaultUnit = INCHES;
01702 ConvUnit = MILLIMETRES;
01703
01704
01705 for (INT32 i=0; i<9; i++)
01706 {
01707 SetStringGadgetValue(_R(IDC_TCOMBO3), UnitStrList[i],FALSE,i);
01708 SetStringGadgetValue(_R(IDC_TCOMBO4), UnitStrList[i],FALSE,i);
01709 }
01710 }
01711 break;
01712
01713 case DIM_SELECTION_CHANGED:
01714 {
01715 if (Msg->GadgetID == _R(IDC_TCOMBO3))
01716 {
01717
01718 WORD Index;
01719 GetValueIndex(_R(IDC_TCOMBO3),&Index);
01720 if (Index <= 8)
01721 DefaultUnit = UnitList[Index];
01722
01723 }
01724 else if (Msg->GadgetID == _R(IDC_TCOMBO4))
01725 {
01726
01727 WORD Index;
01728 GetValueIndex(_R(IDC_TCOMBO4),&Index);
01729 if (Index <= 8)
01730 ConvUnit = UnitList[Index];
01731 }
01732 }
01733 break;
01734 case DIM_LFT_BN_CLICKED:
01735 {
01736 if (Msg->GadgetID == _R(IDC_TBUTTON3))
01737 {
01738 BOOL Valid=0;
01739 MILLIPOINT Value = GetUnitGadgetValue(_R(IDC_TUNITVAL),DefaultUnit,-10000000,10000000,0,&Valid);
01740 SetUnitGadgetValue(_R(IDC_TCONVVAL), ConvUnit, Value);
01741 }
01742 }
01743 break;
01744 default: break;
01745 }
01746 }
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766 OpState BlobbyTabDlg::GetState(String_256*, OpDescriptor*)
01767 {
01768 OpState OpSt;
01769 return(OpSt);
01770 }
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789 BOOL BlobbyTabDlg::Init()
01790 {
01791
01792 return (RegisterOpDescriptor(
01793 0,
01794 _R(IDS_BLOBBYTABDLG),
01795 CC_RUNTIME_CLASS(BlobbyTabDlg),
01796 OPTOKEN_BLOBBYTABDLG,
01797 BlobbyTabDlg::GetState,
01798 0,
01799 _R(IDBBL_BLOBBYDLG),
01800 0,
01801 0,
01802 SYSTEMBAR_ILLEGAL,
01803 TRUE,
01804 FALSE,
01805 TRUE,
01806 0,
01807 0,
01808 GREY_WHEN_NO_CURRENT_DOC
01809 ));
01810
01811 }
01812
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830 void BlobbyTabDlg::Do(OpDescriptor*)
01831 {
01832
01833
01834 String_256 Name(_T("Blobby tab dialog"));
01835 SetName(&Name);
01836 BOOL ok = Create();
01837 if (!ok)
01838 {
01839 ;
01840 End();
01841 }
01842 }
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870 BOOL BlobbyTabDlg::RegisterYourPagesInOrderPlease()
01871 {
01872 BOOL ok = AddAPage(_R(IDD_BLOBTAB_PG1)) &&
01873 AddAPage(_R(IDD_BLOBTAB_PG2)) &&
01874 AddAPage(_R(IDD_BLOBTAB_PG3));
01875 return (ok);
01876 }
01877
01878
01879
01880
01881
01882
01883 const CDlgMode BlobbyBar::Mode = MODELESS;
01884
01885 const UINT32 BlobbyBar::IDD = _R(IDD_SELECTORINFO);
01886
01887 BlobbyBar::BlobbyBar(): DialogOp(BlobbyBar::IDD, BlobbyBar::Mode)
01888 {
01889
01890
01891 }
01892 MsgResult BlobbyBar::Message( Msg* Message)
01893 {
01894
01895 if (IS_OUR_DIALOG_MSG(Message))
01896 {
01897 DialogMsg* Msg = (DialogMsg*)Message;
01898
01899 if ((Msg->DlgMsg == DIM_COMMIT) || (Msg->DlgMsg == DIM_CANCEL))
01900 {
01901 Close();
01902 End();
01903 }
01904
01905 if ((Msg->DlgMsg == DIM_LFT_BN_CLICKED) || (Msg->DlgMsg == DIM_SELECTION_CHANGED))
01906 {
01907 if ( (Msg->GadgetID == _R(IDC_SEL_GRID_NW) ) ||
01908 (Msg->GadgetID == _R(IDC_SEL_GRID_N) ) ||
01909 (Msg->GadgetID == _R(IDC_SEL_GRID_NE) ) ||
01910 (Msg->GadgetID == _R(IDC_SEL_GRID_W) ) ||
01911 (Msg->GadgetID == _R(IDC_SEL_GRID_CENTRE) ) ||
01912 (Msg->GadgetID == _R(IDC_SEL_GRID_E) ) ||
01913 (Msg->GadgetID == _R(IDC_SEL_GRID_SW) ) ||
01914 (Msg->GadgetID == _R(IDC_SEL_GRID_S) ) ||
01915 (Msg->GadgetID == _R(IDC_SEL_GRID_SE) )
01916 )
01917 {
01918 #define SetGrid(x) do {SetLongGadgetValue(x, (x==Msg->GadgetID)?1:0);} while(0)
01919 SetGrid(_R(IDC_SEL_GRID_NW));
01920 SetGrid(_R(IDC_SEL_GRID_N) );
01921 SetGrid(_R(IDC_SEL_GRID_NE));
01922 SetGrid(_R(IDC_SEL_GRID_W) );
01923 SetGrid(_R(IDC_SEL_GRID_CENTRE));
01924 SetGrid(_R(IDC_SEL_GRID_E) );
01925 SetGrid(_R(IDC_SEL_GRID_SW));
01926 SetGrid(_R(IDC_SEL_GRID_S) );
01927 SetGrid(_R(IDC_SEL_GRID_SE));
01928 }
01929 #define SetBump(x,y) do {SetLongGadgetValue(x, GetLongGadgetValue(x,0,100)+y);} while(0)
01930 if (Msg->GadgetID == _R(IDC_SEL_BUMP_X_MORE))
01931 SetBump(_R(IDC_SEL_EDIT_X),1);
01932 if (Msg->GadgetID == _R(IDC_SEL_BUMP_X_LESS))
01933 SetBump(_R(IDC_SEL_EDIT_X),-1);
01934 if (Msg->GadgetID == _R(IDC_SEL_BUMP_Y_MORE))
01935 SetBump(_R(IDC_SEL_EDIT_Y),1);
01936 if (Msg->GadgetID == _R(IDC_SEL_BUMP_Y_LESS))
01937 SetBump(_R(IDC_SEL_EDIT_Y),-1);
01938 if (Msg->GadgetID == _R(IDC_SEL_BUMP_H_MORE))
01939 SetBump(_R(IDC_SEL_EDIT_H),1);
01940 if (Msg->GadgetID == _R(IDC_SEL_BUMP_H_LESS))
01941 SetBump(_R(IDC_SEL_EDIT_H),-1);
01942 if (Msg->GadgetID == _R(IDC_SEL_BUMP_W_MORE))
01943 SetBump(_R(IDC_SEL_EDIT_W),1);
01944 if (Msg->GadgetID == _R(IDC_SEL_BUMP_W_LESS))
01945 SetBump(_R(IDC_SEL_EDIT_W),-1);
01946 if (Msg->GadgetID == _R(IDC_SEL_BUMP_ANGLE_MORE))
01947 SetBump(_R(IDC_SEL_EDIT_ANGLE),1);
01948 if (Msg->GadgetID == _R(IDC_SEL_BUMP_ANGLE_LESS))
01949 SetBump(_R(IDC_SEL_EDIT_ANGLE),-1);
01950 if (Msg->GadgetID == _R(IDC_SEL_BUMP_SHEAR_MORE))
01951 SetBump(_R(IDC_SEL_EDIT_SHEAR),1);
01952 if (Msg->GadgetID == _R(IDC_SEL_BUMP_SHEAR_LESS))
01953 SetBump(_R(IDC_SEL_EDIT_SHEAR),-1);
01954
01955 if (Msg->GadgetID == _R(IDC_SEL_SHOWFILLBLOBS))
01956 {
01957 BOOL Enable=!GetLongGadgetValue(_R(IDC_SEL_SHOWFILLBLOBS),0,1);
01958
01959
01960 EnableGadget(_R(IDC_SEL_BUMP_ANGLE_LESS), Enable);
01961 EnableGadget(_R(IDC_SEL_BUMP_ANGLE_MORE), Enable);
01962 EnableGadget(_R(IDC_SEL_BUMP_H_LESS), Enable);
01963 EnableGadget(_R(IDC_SEL_BUMP_H_MORE), Enable);
01964 EnableGadget(_R(IDC_SEL_BUMP_SHEAR_LESS), Enable);
01965 EnableGadget(_R(IDC_SEL_BUMP_SHEAR_MORE), Enable);
01966 EnableGadget(_R(IDC_SEL_BUMP_W_LESS), Enable);
01967 EnableGadget(_R(IDC_SEL_BUMP_W_MORE), Enable);
01968 EnableGadget(_R(IDC_SEL_BUMP_X_LESS), Enable);
01969 EnableGadget(_R(IDC_SEL_BUMP_X_MORE), Enable);
01970 EnableGadget(_R(IDC_SEL_BUMP_Y_LESS), Enable);
01971 EnableGadget(_R(IDC_SEL_BUMP_Y_MORE), Enable);
01972 EnableGadget(_R(IDC_SEL_EDIT_ANGLE), Enable);
01973 EnableGadget(_R(IDC_SEL_EDIT_H), Enable);
01974 EnableGadget(_R(IDC_SEL_EDIT_SHEAR), Enable);
01975 EnableGadget(_R(IDC_SEL_EDIT_W), Enable);
01976 EnableGadget(_R(IDC_SEL_EDIT_X), Enable);
01977 EnableGadget(_R(IDC_SEL_EDIT_XSCALE), Enable);
01978 EnableGadget(_R(IDC_SEL_EDIT_Y), Enable);
01979 EnableGadget(_R(IDC_SEL_EDIT_YSCALE), Enable);
01980 EnableGadget(_R(IDC_SEL_FLIPHORZ), Enable);
01981 EnableGadget(_R(IDC_SEL_FLIPVERT), Enable);
01982 EnableGadget(_R(IDC_SEL_GRID_CENTRE), Enable);
01983 EnableGadget(_R(IDC_SEL_GRID_E), Enable);
01984 EnableGadget(_R(IDC_SEL_GRID_N), Enable);
01985 EnableGadget(_R(IDC_SEL_GRID_NE), Enable);
01986 EnableGadget(_R(IDC_SEL_GRID_NW), Enable);
01987 EnableGadget(_R(IDC_SEL_GRID_S), Enable);
01988 EnableGadget(_R(IDC_SEL_GRID_SE), Enable);
01989 EnableGadget(_R(IDC_SEL_GRID_SW), Enable);
01990 EnableGadget(_R(IDC_SEL_GRID_W), Enable);
01991 EnableGadget(_R(IDC_SEL_PADLOCK), Enable);
01992 EnableGadget(_R(IDC_SEL_ROTATEBUTTON), Enable);
01993
01994 EnableGadget(_R(IDC_SEL_SCALELINES), Enable);
01995
01996 EnableGadget(_R(IDC_SEL_SHOWBOUNDSBLOBS), Enable);
01997
01998 EnableGadget(_R(IDC_SEL_SHOWOBJECTBLOBS), Enable);
01999
02000
02001 EnableGadget(_R(IDPB_NAMEDLG_RUN_BUTTON), Enable);
02002 }
02003 }
02004
02005
02006
02007 return (DLG_EAT_IF_HUNGRY(Msg));
02008 }
02009 return OK;
02010 }
02011
02012
02013
02014 OpState BlobbyBar::GetState(String_256*, OpDescriptor*)
02015 {
02016 OpState OpSt;
02017 return(OpSt);
02018 }
02019
02020
02021
02022 BOOL BlobbyBar::Init()
02023 {
02024 return (RegisterOpDescriptor(
02025 0,
02026 _R(IDS_BLOBBYBAR),
02027 CC_RUNTIME_CLASS(BlobbyBar),
02028 OPTOKEN_BLOBBYBAR,
02029 BlobbyBar::GetState,
02030 0,
02031 _R(IDBBL_BLOBBYBAR),
02032 0,
02033 0,
02034 SYSTEMBAR_EDIT,
02035 TRUE,
02036 FALSE,
02037 TRUE,
02038 0,
02039 _R(IDS_BLOBBYBAR_ONE),
02040 0
02041 ));
02042
02043 }
02044
02045
02046
02047 BOOL BlobbyBar::Create()
02048 {
02049 if (DialogOp::Create())
02050 {
02051
02052 SetLongGadgetValue(_R(IDC_SEL_SHOWBOUNDSBLOBS),0);
02053 SetLongGadgetValue(_R(IDC_SEL_SHOWOBJECTBLOBS),0);
02054 SetLongGadgetValue(_R(IDC_SEL_SHOWFILLBLOBS),0);
02055
02056 SetLongGadgetValue(_R(IDC_SEL_ROTATEBUTTON),0);
02057
02058 SetLongGadgetValue(_R(IDC_SEL_GRID_NW),0);
02059 SetLongGadgetValue(_R(IDC_SEL_GRID_N),0);
02060 SetLongGadgetValue(_R(IDC_SEL_GRID_NE),0);
02061 SetLongGadgetValue(_R(IDC_SEL_GRID_W),0);
02062 SetLongGadgetValue(_R(IDC_SEL_GRID_CENTRE),0);
02063 SetLongGadgetValue(_R(IDC_SEL_GRID_E),0);
02064 SetLongGadgetValue(_R(IDC_SEL_GRID_SW),0);
02065 SetLongGadgetValue(_R(IDC_SEL_GRID_S),0);
02066 SetLongGadgetValue(_R(IDC_SEL_GRID_SE),0);
02067
02068 SetLongGadgetValue(_R(IDC_SEL_EDIT_X),0);
02069 SetLongGadgetValue(_R(IDC_SEL_EDIT_Y),0);
02070
02071 SetLongGadgetValue(_R(IDC_SEL_EDIT_W),0);
02072 SetLongGadgetValue(_R(IDC_SEL_EDIT_H),0);
02073
02074 SetLongGadgetValue(_R(IDC_SEL_EDIT_XSCALE),0);
02075 SetLongGadgetValue(_R(IDC_SEL_EDIT_YSCALE),0);
02076 SetLongGadgetValue(_R(IDC_SEL_PADLOCK),0);
02077
02078 SetLongGadgetValue(_R(IDC_SEL_EDIT_ANGLE),0);
02079 SetLongGadgetValue(_R(IDC_SEL_EDIT_SHEAR),0);
02080
02081 SetLongGadgetValue(_R(IDC_SEL_SCALELINES),0);
02082
02083 return TRUE;
02084 }
02085 else return FALSE;
02086 }
02087
02088
02089
02090 void BlobbyBar::Do(OpDescriptor*)
02091 {
02092 Create();
02093 Open();
02094 }
02095
02096