TranspInfoBarOp Class Reference

Class for handling the gradfill tool's information bar. More...

#include <filltool.h>

Inheritance diagram for TranspInfoBarOp:

InformationBarOp DialogBarOp DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 TranspInfoBarOp (ResourceID r=_R(IDD_ZOOMTOOLBAR))
MsgResult Message (Msg *Msg)
 Transpfill info bar dialog message handler.
void InitControls ()
 Inits all the controls in the info bar. Called immediately after the bar is created when the Transpfill tool becomes the current tool.
void EnableControls ()
 Enables or disables the controls depending on the current context, i.e. the controls are disabled if there is no selection, etc. Actually more complicated than this now, cause my function calls now hide/show various controls; and dynamically reshuffle the infobar.
void ShowInfo ()
 Show Transparency Info on the current selection.
void ShowFlatInfo ()
 Show info on a flat fill.
void ShowGraduatedInfo ()
 Show info on a graduated fill.
void ShowBitmapInfo ()
 Show info on a bitmap fill.
void ShowFractalInfo ()
 Show info on a fractal transparency.
void ShowNoiseInfo ()
 Show info on a noise transparency.
void ShowCommonType (BOOL ShowDataAndNotSet=TRUE)
 Show any Common Fill Type in the selection.
void ShowCommonMapping (BOOL ShowDataAndNotSet=TRUE)
 Show any Common Fill Mapping in the selection.
void ShowCommonTranspType (BOOL ShowDataAndNotSet=TRUE)
 Show any Common Transparency type in the selection.
void ShowCommonTesselate ()
 Show any Common Fill Tesselation in the selection.
void ShowCommonBitmapName ()
 Show any Common Bitmap Name in the selection.
void ShowCommonBitmapDpi ()
 Show any Common Bitmap Dpi in the selection.
void ShowControlPointInfo ()
 Show Info about selected control points.
void ShowCommonFractalGrain ()
 Show any Common Fractal Graininess in the selection.
void ShowCommonNoiseScale ()
 Show any Common Fractal Graininess in the selection.
UINT32 GetTranspType ()

Public Attributes

SelRangeSelection
SelRange::CommonAttribResult CommonAttr
SelRange::CommonAttribResult CommonAttrMap
CBiasGainGadget m_BiasGainGadget
CBitmapGridDropDown m_oBitmapDropDown

Static Public Attributes

static INT32 CurrentGeometryIndex
static INT32 CurrentTransTypeIndex
static INT32 CurrentMappingIndex
static INT32 CurrentTypeIndex
static INT32 CurrentTesselateIndex
static INT32 CurrentBitmapIndex

Private Member Functions

void ChangeProfile (CProfileBiasGain *Profile, CGadgetID GadgetID)
 See InformationBarOp::ChangeProfile () for an explanation of this function. See Also: InformationBarOp::ChangeProfile ().
CProfileBiasGainGetProfileFromSelection (CGadgetID GadgetID, BOOL *bMany, BOOL *bAllSameType)
 See InformationBarOp::GetProfileFromSelection () for a description of this function.
void ChangeFillType ()
 Called when a new fill type is selected from the menu.
void ChangeFillMapping ()
 Called when a new fill mapping or tesselation is selected from the menu.
BOOL ChangeBitmapName ()
 Called when a new bitmap is selected from the menu.
void ChangeTranspType ()
 Called when a new fill type is selected from the menu.
void ChangeDPI ()
 Called when the dpi of a bitmap is changed by the user.
void ChangeTransparencyValue ()
 Called when the transparency value is changed by the user.
void ChangeFractalGrain (BOOL useEditbox=FALSE)
 Called when the Graininess of a fractal is changed by the user.
void ChangeNoiseScale (BOOL useEditbox=FALSE)
 Called when the scale of a transparency is changed by the user.
void SetGadgetWritable (INT32, BOOL)
BOOL GetGadgetWritable (INT32)
 Returns whether the control is writable (i.e. read only, or not). void TranspInfoBarOp::EnableControls() needs to make use of this to control its 'dynamic' toolbar correctly (both of which were also written by me).
String_64 GetSelectedPoint (AttrFillGeometry *)
 Gets a textual description of a fills contol point selection state.
UINT32 GetSelectedTransp (AttrFillGeometry *)
 Gets a textual description of a fills contol point colour.
void ScanSelectionForControlPoints (String_64 *, INT32 *)
INT32 FindCommonTranspType ()
 Tries to find a common transparency type within the selection. This now makes use of camelots new AttrPaintingMode (which I also wrote).
INT32 FindCommonTesselate ()
 Find any Common Fill Tesselation in the selection.
String_64 FindCommonBitmapName ()
 Find any Common Bitmap Name in the selection.
INT32 FindCommonBitmapDpi ()
 Find any Common Bitmap Dpi in the selection.
double FindCommonFractalGrain ()
 Find any Common Fractal Graininess in the selection.
double FindCommonNoiseScale ()
 Find any Common Noise Scale in the selection.
void SetTranspValue (UINT32, BOOL bIntermediateStep=FALSE, BOOL bFirstStep=FALSE)
 Called when a the transparency slider is changed.
AttrFillGeometryGetCurrentGeometry ()
 Gets the current Fill Geometry from the Attribute manager.
AttrTranspFillMappingGetCurrentMapping ()
 Gets the current painting mode from the Attribute manager.Gets the current Fill Geometry from the Attribute manager.
AttrFillGeometryMakeFillMutator ()
 Make a fill that will be used to Mutate another fill, changing it's type while retaining it's existing points and colours. The fill type returned depends on the fill type menu state.
BOOL SetGadgetString (CGadgetID Gadget, StringBase *StrValue)
 Set the string displayed by a Gadget. This version only updates the gadget if it has changed.
void InitMapping ()
 Initialise the Mapping Control.
void InitBitmapName ()
 Initialise the Bitmap Name Control.
void InitTesselate ()
 Initialise the Tesselation Control.
void InitTransType ()
 Initialise the Transparency Type Control.
void DisplayTransparencyPercentString (double value)
 Sorts out the transparency value that is actually displayed (as a string). It actually calculates the percentage value that has been/ is being applied. This is calculated in 0.5% intervals.
void UpdateBrushAttributes ()
 Called when a new transparency is selected. This function goes through all brush attributes in the selection and tells them to use the local transparency rather than their cached one.

Private Attributes

FillMode Mode
FillMode OldMode
BOOL BitmapListChanged
BOOL MappingDisabled
BOOL TypeDisabled
BOOL AllowForceToSimpleMapping
AttrFillGeometryCommonGeometry
AttrFillMappingCommonMapping
INT32 SelGeometryIndex
INT32 SelMappingIndex
INT32 SelTypeIndex
BOOL SliderDragged
INT32 SliderMax
INT32 LastSliderPos
OpApplyAttrInteractivem_pAttrApplyOp
AttrValueChangem_pDragTransp

Detailed Description

Class for handling the gradfill tool's information bar.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94

Definition at line 574 of file filltool.h.


Constructor & Destructor Documentation

TranspInfoBarOp::TranspInfoBarOp ResourceID  r = _R(IDD_ZOOMTOOLBAR)  )  [inline]
 

Definition at line 578 of file filltool.h.


Member Function Documentation

BOOL TranspInfoBarOp::ChangeBitmapName  )  [private]
 

Called when a new bitmap is selected from the menu.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (ported to the transparency tool by Chris Snook 12/10/99)
Date:
14/12/94

Definition at line 9168 of file filltool.cpp.

09169 {
09170     NodeAttribute *Attrib = new AttrBitmapTranspFill;
09171     if (Attrib == NULL)
09172     {
09173         InformError();
09174         return (FALSE);
09175     }
09176 
09177     Document* pDoc = Document::GetSelected();
09178 
09179     // Get the bitmap list
09180     BitmapList* Bitmaps = NULL;
09181     if (pDoc) Bitmaps = pDoc->GetBitmapList();
09182 
09183     if (Bitmaps == NULL)
09184         return (FALSE);
09185 
09186     INT32 BmpIndex = -1;
09187     ListItem* pBmp = Bitmaps->GetHead();
09188 
09189     while (pBmp != NULL)
09190     {
09191         if (!((KernelBitmap*)pBmp)->HasBeenDeleted())
09192             BmpIndex++;
09193 
09194         if (BmpIndex == CurrentBitmapIndex)
09195             break;
09196 
09197         pBmp = Bitmaps->GetNext(pBmp);
09198     }
09199 
09200     KernelBitmap* pkBmp = (KernelBitmap*) pBmp;
09201 
09202     // CGS:  check for a 32-bit bitmap being applied here as a transparency, since we convert
09203     // this permantly to 24-bit we should ask the user if they wish to continue ....
09204 
09205     if (pkBmp->ActualBitmap->GetBitmapInfoHeader()->biBitCount == 32)
09206     {
09207         // Ask the user wether or not they want to use a 24bit copy of the BMP or use the Default Bitmap?
09208         //InformWarning(_R(IDS_BFX_BMP_CONVERT_MSG),_R(IDS_OK),0,0,0,1,2);
09209 
09210         // Load and build the question text.
09211         String_256 QueryString(_R(IDS_QUERYTRANSP321));
09212                     
09213         // The only way of bringing up a box with a string in it
09214         Error::SetError(0, QueryString, 0);
09215         INT32 DlgResult = InformMessage(FALSE, _R(IDS_YES), _R(IDS_NO));
09216         Error::ClearError();
09217 
09218         switch (DlgResult)
09219         {
09220             case 1:             // YES
09221                                 // apply attribute ....
09222             break;
09223             case 2:             // NO
09224                 delete (Attrib);
09225                 Attrib = NULL;
09226                 return (FALSE);         // break out of this stuff!
09227         }
09228     }
09229 
09230     ((AttrBitmapChange*)Attrib)->AttachBitmap((KernelBitmap*)pBmp);
09231     AttributeManager::AttributeSelected(NULL, Attrib);
09232 
09233     return (TRUE);
09234 }

void TranspInfoBarOp::ChangeDPI  )  [private]
 

Called when the dpi of a bitmap is changed by the user.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/11/94

Definition at line 9348 of file filltool.cpp.

09349 {
09350     BOOL Valid;
09351     String_256 Str = GetStringGadgetValue(_R(IDC_SELPOINT), &Valid);
09352 
09353     if (Valid)
09354     {
09355         TRACEUSER( "Will", _T("String = %s\n"),(TCHAR*)Str);
09356 
09357         INT32 Length = Str.Length();
09358         TCHAR* StrText = (TCHAR*)Str;
09359 
09360         INT32 FirstNum = -1;
09361         INT32 Count = 0;
09362 
09363         for (INT32 i = 0; i < Length; ++i)
09364         {
09365             TCHAR chr = StrText[i];
09366             if (FirstNum == -1 && StringBase::IsNumeric(chr))
09367                 FirstNum = i;
09368 
09369             if (FirstNum != -1)
09370             {
09371                 if (StringBase::IsNumeric(chr))
09372                     Count++;
09373                 else
09374                     break;
09375             }
09376         }
09377 
09378         String_256 DpiStr;
09379         INT32 Dpi;
09380 
09381         if (FirstNum != -1 && Count > 0)
09382         {
09383             Str.Mid(&DpiStr, FirstNum, Count);
09384             Convert::StringToLong(DpiStr, &Dpi);
09385             TRACEUSER( "Will", _T("Dpi = %d\n"),Dpi);
09386 
09387             if (Dpi == 0)
09388                 Dpi = 1;
09389 
09390             AttrValueChange* NewDpi = new AttrBitmapDpiChange;
09391             if (NewDpi == NULL)
09392             {
09393                 InformError();
09394                 return;
09395             }
09396 
09397             NewDpi->MutateTranspFills(TRUE);
09398             ((AttrBitmapDpiChange*)NewDpi)->SetDPI(Dpi);
09399 
09400             AttributeManager::AttributeSelected(NULL, NewDpi);
09401         }
09402         else
09403         {
09404             TRACEUSER( "Will", _T("That was rubbish\n"));
09405             ShowCommonBitmapDpi();
09406         }
09407     }
09408     else
09409         TRACEUSER( "Will", _T("String was invalid\n"));
09410 }

void TranspInfoBarOp::ChangeFillMapping  )  [private]
 

Called when a new fill mapping or tesselation is selected from the menu.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/11/94

Definition at line 9069 of file filltool.cpp.

09070 {
09071     if (Mode != BITMAPFILL && 
09072         Mode != FRACTALFILL && 
09073         Mode != GRADREPEATFILL &&
09074 //Mark Howitt, 14/10/97. Exclude transparent grad fills as well
09075 #ifdef NEW_FEATURES
09076         Mode != GRADFILL &&
09077 #endif
09078         Mode != NOISEFILL)
09079     {
09080         return;
09081     }
09082 
09083     INT32 Tesselation;
09084 
09085     switch (CurrentMappingIndex)
09086     {
09087         case (FTMENU_SIMPLE):
09088             Tesselation = 1;
09089             break;
09090     
09091         case (FTMENU_REPEAT):
09092 //Mark Howitt, 14/10/97. Repeating grad fills are now 4.
09093 #ifdef NEW_FEATURES
09094             if(Mode == GRADFILL)
09095             {
09096                 Tesselation = 4;
09097             }
09098             else
09099 #endif
09100             {
09101                 Tesselation = 2;
09102             }
09103             break;
09104 
09105         case (FTMENU_REPEATINV):
09106             Tesselation = 3;
09107             break;
09108 
09109         default:
09110             Tesselation = 1;
09111             break;
09112     }
09113 
09114     AttrTranspFillMappingLinear* NewMapping = new AttrTranspFillMappingLinear;
09115     if (NewMapping == NULL)
09116     {
09117         InformError();
09118         return;
09119     }
09120 
09121     NewMapping->SetRepeat(Tesselation);
09122     AttributeManager::AttributeSelected(NewMapping, NULL);
09123 }

void TranspInfoBarOp::ChangeFillType  )  [private]
 

Called when a new fill type is selected from the menu.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94

Definition at line 9002 of file filltool.cpp.

09003 {
09004     if (CurrentGeometryIndex == FGMENU_NOTRANSP)
09005     {
09006         AttrFillGeometry* NoTransp = new AttrRemoveTransp;
09007         if (NoTransp == NULL)
09008 
09009         {
09010             InformError();
09011             return;
09012         }
09013 
09014         AttributeManager::AttributeSelected(NULL, NoTransp);
09015     }   
09016     else if (CurrentGeometryIndex == FGMENU_FLATTRANSP)
09017     {
09018         AttrFillGeometry* FlatTransp = new AttrMakeFlatTransp;
09019         if (FlatTransp == NULL)
09020         {
09021             InformError();
09022             return;
09023         }
09024 
09025         AttributeManager::AttributeSelected(NULL, FlatTransp);
09026     }   
09027     else
09028     {
09029         // Get the current fill type, and pass a new fill of that type into
09030         // the attribute manager, as a mutator.
09031         AttrFillGeometry* Mutator = MakeFillMutator();
09032         if (Mutator == NULL)
09033         {
09034             InformError();
09035             return;
09036         }
09037 
09038         // If the mutator requires a simple mapping but the current fill doesn't
09039         // then we need to set ForceToSimple to TRUE
09040 
09041         //BOOL ForceToSimple = Mutator->NeedsForceToSimpleMapping() && AllowForceToSimpleMapping;
09042 
09043         // This call deletes the Mutator so I'll set the pointer to NULL
09044         AttributeManager::AttributeSelected(NULL, Mutator);
09045         Mutator = NULL;
09046 
09047         //if (ForceToSimple)
09048         //{
09049     //      CurrentMappingIndex = FMMENU_SIMPLE;
09050     //      ChangeFillMapping ();           // we push two bits of undo here, but this is
09051                                             // unavoidable at present ....
09052         //}
09053     }
09054 
09055     if (CurrentGeometryIndex != FGMENU_NOTRANSP)
09056         UpdateBrushAttributes();
09057 }

void TranspInfoBarOp::ChangeFractalGrain BOOL  useEditbox = FALSE  )  [private]
 

Called when the Graininess of a fractal is changed by the user.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/11/94

Definition at line 9511 of file filltool.cpp.

09512 {
09513     if (!useEditbox)
09514     {
09515         BOOL Valid;
09516         INT32 Result = GetLongGadgetValue(_R(IDC_TRANSPSLIDE), 0, SliderMax, 0, &Valid);
09517 
09518         if (Valid)
09519         {
09520             double Grain = GetDoubleGrain(Result);  
09521 
09522             TRACEUSER( "Will", _T("Graininess = %f\n"),Grain);
09523 
09524             if (Grain < 0.1)
09525                 Grain = 0.1;
09526 
09527             if (Grain > 16384)
09528                 Grain = 16384;
09529 
09530             AttrValueChange* NewGrain = new AttrFractalGrainChange;
09531             if (NewGrain == NULL)
09532             {
09533                 InformError();
09534                 return;
09535             }
09536             
09537             NewGrain->MutateTranspFills(TRUE);
09538             ((FractalFillAttribute*)NewGrain->GetAttributeValue())->Graininess = FIXED16(Grain);
09539 
09540             AttributeManager::AttributeSelected(NULL, NewGrain);
09541         }
09542     }
09543     else
09544     {
09545         BOOL Valid;
09546         String_256 Str = GetStringGadgetValue(_R(IDC_SELCOLOUR), &Valid);
09547 
09548         if (Valid)
09549         {
09550             INT32 Length = Str.Length();
09551             TCHAR* StrText = (TCHAR*)Str;
09552 
09553             INT32 FirstNum = -1;
09554             INT32 Count = 0;
09555 
09556             BOOL FoundDp = FALSE;
09557 
09558             for (INT32 i = 0; i < Length; ++i)
09559             {
09560                 TCHAR chr = StrText[i];
09561                 if (FirstNum == -1 && StringBase::IsNumeric(chr))
09562                     FirstNum = i;
09563 
09564                 if (FirstNum != -1)
09565                 {
09566                     if (StringBase::IsNumeric(chr))
09567                     {
09568                         Count++;
09569                         
09570                         //if (FoundDp == TRUE) { break; }
09571                     }
09572                     else if ((chr == '.') && (FoundDp == FALSE))
09573                     {
09574                         FoundDp = TRUE;
09575                         Count++;
09576                     }
09577                     else
09578                         break;
09579                 }
09580             }
09581 
09582             String_256 TranspValStr;
09583             double TranspVal;
09584 
09585             if (FirstNum != -1 && Count > 0)
09586             {
09587                 Str.Mid(&TranspValStr, FirstNum, Count);
09588                 Convert::StringToDouble(TranspValStr, &TranspVal);
09589                 
09590                 // check for out of range stuff ....
09591 
09592                 if (TranspVal < 0.0) { TranspVal = 0.0; }
09593                 if (TranspVal > 128.0) { TranspVal = 128.0; }
09594                 
09595                 // convert data ....
09596 
09597                 UINT32 Rounded = (UINT32) TranspVal;
09598                 double Diff = TranspVal - Rounded;
09599 
09600                 if (Diff < 0.5)
09601                 {
09602                     if (Diff < 0.25) { TranspVal = (double) Rounded; }
09603                     else { TranspVal = (double) Rounded + 0.5; }
09604                 }
09605                 else
09606                 {
09607                     if (Diff < 0.75) { TranspVal = (double) Rounded + 0.5; }
09608                     else { TranspVal = (double) ++Rounded; }
09609                 }
09610 
09611                 //double AccurateNewVal = ((TranspVal * (double) 128) / 128.0) + 0.5;
09612                 //double AccurateNewVal = TranspVal; //+ 0.5;
09613 
09614                 //UINT32 newVal = static_cast<UINT32>(AccurateNewVal);
09615 
09616                 AttrValueChange* NewGrain = new AttrFractalGrainChange;
09617                 if (NewGrain == NULL)
09618                 {
09619                     InformError();
09620                     return;
09621                 }
09622                 
09623                 NewGrain->MutateTranspFills(TRUE);
09624                 ((FractalFillAttribute*)NewGrain->GetAttributeValue())->Graininess = FIXED16(/*(INT32)*/ TranspVal);
09625 
09626                 AttributeManager::AttributeSelected(NULL, NewGrain);
09627             }
09628             else
09629             {
09630                 ShowFractalInfo ();
09631             }       
09632         }
09633     }
09634 }

void TranspInfoBarOp::ChangeNoiseScale BOOL  useEditbox = FALSE  )  [private]
 

Called when the scale of a transparency is changed by the user.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/11/94

Definition at line 9646 of file filltool.cpp.

09647 {
09648     if (!useEditbox)
09649     {
09650         BOOL Valid;
09651         INT32 Result = GetLongGadgetValue(_R(IDC_TRANSPSLIDE), 0, SliderMax, 0, &Valid);
09652 
09653         if (Valid)
09654         {
09655             double Scale = GetDoubleScale(Result);
09656 
09657             TRACEUSER( "Mike", _T("Scale = %f\n"),Scale);
09658 
09659             if (Scale < 0)
09660                 Scale = 0;
09661 
09662             if (Scale > 100)
09663                 Scale = 100;
09664 
09665             AttrValueChange* NewScale = new AttrNoiseScaleChange;
09666             if (NewScale == NULL)
09667             {
09668                 InformError();
09669                 return;
09670             }
09671             
09672             FIXED16 Grain = FIXED16(Scale);
09673             NewScale->MutateTranspFills(TRUE);
09674             ((NoiseFillAttribute*)NewScale->GetAttributeValue())->SetGraininess(Grain);
09675 
09676             AttributeManager::AttributeSelected(NULL, NewScale);
09677         }
09678     }
09679     else
09680     {
09681         BOOL Valid;
09682         String_256 Str = GetStringGadgetValue(_R(IDC_SELCOLOUR), &Valid);
09683 
09684         if (Valid)
09685         {
09686             INT32 Length = Str.Length();
09687             TCHAR* StrText = (TCHAR*)Str;
09688 
09689             INT32 FirstNum = -1;
09690             INT32 Count = 0;
09691 
09692             BOOL FoundDp = FALSE;
09693 
09694             for (INT32 i = 0; i < Length; ++i)
09695             {
09696                 TCHAR chr = StrText[i];
09697                 if (FirstNum == -1 && StringBase::IsNumeric(chr))
09698                     FirstNum = i;
09699 
09700                 if (FirstNum != -1)
09701                 {
09702                     if (StringBase::IsNumeric(chr))
09703                     {
09704                         Count++;
09705                         
09706                         //if (FoundDp == TRUE) { break; }
09707                     }
09708                     else if ((chr == '.') && (FoundDp == FALSE))
09709                     {
09710                         FoundDp = TRUE;
09711                         Count++;
09712                     }
09713                     else
09714                         break;
09715                 }
09716             }
09717 
09718             String_256 TranspValStr;
09719             double TranspVal;
09720 
09721             if (FirstNum != -1 && Count > 0)
09722             {
09723                 Str.Mid(&TranspValStr, FirstNum, Count);
09724                 Convert::StringToDouble(TranspValStr, &TranspVal);
09725                 
09726                 // check for out of range stuff ....
09727 
09728                 if (TranspVal < 0.0) { TranspVal = 0.0; }
09729                 if (TranspVal > 100.0) { TranspVal = 100.0; }
09730                 
09731                 // convert data ....
09732 
09733                 UINT32 Rounded = (UINT32) TranspVal;
09734                 double Diff = TranspVal - Rounded;
09735 
09736                 if (Diff < 0.5)
09737                 {
09738                     if (Diff < 0.25) { TranspVal = (double) Rounded; }
09739                     else { TranspVal = (double) Rounded + 0.5; }
09740                 }
09741                 else
09742                 {
09743                     if (Diff < 0.75) { TranspVal = (double) Rounded + 0.5; }
09744                     else { TranspVal = (double) ++Rounded; }
09745                 }
09746 
09747                 double AccurateNewVal = ((TranspVal * (double) SliderMax) / 100.0) + 0.5;
09748 
09749                 UINT32 newVal = static_cast<UINT32>(AccurateNewVal);
09750                 
09751                 //  SetTranspValue (static_cast<UINT32>(AccurateNewVal));
09752 
09753                 AttrValueChange* NewScale = new AttrNoiseScaleChange;
09754                 if (NewScale == NULL)
09755                 {
09756                     InformError();
09757                     return;
09758                 }
09759                 
09760                 FIXED16 Grain = FIXED16((INT32) newVal);
09761                 NewScale->MutateTranspFills(TRUE);
09762                 ((NoiseFillAttribute*)NewScale->GetAttributeValue())->SetGraininess(Grain);
09763 
09764                 AttributeManager::AttributeSelected(NULL, NewScale);
09765             }
09766             else
09767             {
09768                 ShowNoiseInfo ();
09769             }       
09770         }
09771     }
09772 }

void TranspInfoBarOp::ChangeProfile CProfileBiasGain Profile,
CGadgetID  GadgetID
[private, virtual]
 

See InformationBarOp::ChangeProfile () for an explanation of this function. See Also: InformationBarOp::ChangeProfile ().

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/2/2000

Reimplemented from DialogOp.

Definition at line 6386 of file filltool.cpp.

06387 {
06388     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_TRANSPFILLPROFILE);
06389     if (pOpDesc != NULL)
06390     {
06391         BOOL FireOp = TRUE;
06392 
06393         // we only want to generate one bit of undo information - so decided whether
06394         // we have to fire the above op, or whether we just 'pump' the values into
06395         // our nodes (thereby nolonger generating infinite undo information) ....
06396 
06397         Operation* pLastOp = NULL;
06398 
06399         if (Profile->GetGeneratesInfiniteUndo ())   // only do if they didn't select a preset profile
06400         {
06401             pLastOp = Document::GetSelected()->GetOpHistory().FindLastOp();
06402         }
06403 
06404         if (pLastOp)
06405         {
06406             if (pLastOp->GetRuntimeClass() == CC_RUNTIME_CLASS(OpChangeTranspFillProfile))
06407             {
06408                 FireOp = FALSE;
06409             }
06410         }
06411 
06412         if (FireOp == TRUE)
06413         {
06414             TranspFillProfileOpParam Param;
06415             Param.Profile = *Profile;
06416         
06417             pOpDesc->Invoke(&Param);
06418         }
06419         else
06420         {
06421             // we don't need/want any undo information - so just change the value ....
06422             
06423             //OpChangeFillProfile Op;
06424             ChangeTranspFillProfileAction Action;
06425             Action.ChangeTranspFillProfileWithNoUndo (/*&Op,*/ *Profile);
06426         }
06427         
06428         /*AFp BiasValue = Profile->GetBias();
06429         AFp GainValue = Profile->GetGain();
06430         
06431         TranspFillProfileOpParam Param;
06432         Param.Profile.SetBias(BiasValue);
06433         Param.Profile.SetGain(GainValue);
06434         
06435         pOpDesc->Invoke(&Param);*/
06436     }
06437 }

void TranspInfoBarOp::ChangeTransparencyValue  )  [private]
 

Called when the transparency value is changed by the user.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/99

Definition at line 9422 of file filltool.cpp.

09423 {
09424     BOOL Valid;
09425     String_256 Str = GetStringGadgetValue(_R(IDC_SELCOLOUR), &Valid);
09426 
09427     if (Valid)
09428     {
09429         INT32 Length = Str.Length();
09430         TCHAR* StrText = (TCHAR*)Str;
09431 
09432         INT32 FirstNum = -1;
09433         INT32 Count = 0;
09434 
09435         BOOL FoundDp = FALSE;
09436 
09437         for (INT32 i = 0; i < Length; ++i)
09438         {
09439             TCHAR chr = StrText[i];
09440             if (FirstNum == -1 && StringBase::IsNumeric(chr))
09441                 FirstNum = i;
09442 
09443             if (FirstNum != -1)
09444             {
09445                 if (StringBase::IsNumeric(chr))
09446                 {
09447                     Count++;
09448                     
09449                     //if (FoundDp == TRUE) { break; }
09450                 }
09451                 else if ((chr == '.') && (FoundDp == FALSE))
09452                 {
09453                     FoundDp = TRUE;
09454                     Count++;
09455                 }
09456                 else
09457                     break;
09458             }
09459         }
09460 
09461         String_256 TranspValStr;
09462         double TranspVal;
09463 
09464         if (FirstNum != -1 && Count > 0)
09465         {
09466             Str.Mid(&TranspValStr, FirstNum, Count);
09467             Convert::StringToDouble(TranspValStr, &TranspVal);
09468             
09469             // check for out of range stuff ....
09470 
09471             if (TranspVal < 0.0) { TranspVal = 0.0; }
09472             if (TranspVal > 100.0) { TranspVal = 100.0; }
09473             
09474             // convert data ....
09475 
09476             UINT32 Rounded = (UINT32) TranspVal;
09477             double Diff = TranspVal - Rounded;
09478 
09479             if (Diff < 0.5)
09480             {
09481                 if (Diff < 0.25) { TranspVal = (double) Rounded; }
09482                 else { TranspVal = (double) Rounded + 0.5; }
09483             }
09484             else
09485             {
09486                 if (Diff < 0.75) { TranspVal = (double) Rounded + 0.5; }
09487                 else { TranspVal = (double) ++Rounded; }
09488             }
09489 
09490             double AccurateNewVal = ((TranspVal * (double) SliderMax) / 100.0) + 0.5;
09491 
09492             SetTranspValue (static_cast<UINT32>(AccurateNewVal));
09493         }
09494         else
09495         {
09496             ShowControlPointInfo ();
09497         }
09498     }
09499 }

void TranspInfoBarOp::ChangeTranspType  )  [private]
 

Called when a new fill type is selected from the menu.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94

Definition at line 9246 of file filltool.cpp.

09247 {
09248     // Get the current fill type, and pass a new fill of that type into
09249     // the attribute manager, as a mutator.
09250     AttrFillGeometry* TypeChange = new AttrTranspTypeChange();
09251 
09252     
09253     //AttrPaintingMode* TypeChange = new AttrPaintingMode ();
09254     //AttrTranspTypeChange* TypeChnage = new AttrTranspTypeChange ();
09255     if (TypeChange == NULL)
09256     {
09257         InformError();
09258         return;
09259     }
09260 
09261     UINT32 TType = GetTranspType() - 1;
09262     UINT32 Index = 0;
09263     
09264     switch(TType)
09265     {
09266     case FTMENU_REFLECT:
09267     case FTMENU_SUB:
09268     case FTMENU_ADD:
09269         {
09270             Index = TType + TT_Mix;
09271             break;
09272         }
09273     case FTMENU_CON:
09274         {
09275             Index = TT_CONTRAST;
09276             break;
09277         }
09278     case FTMENU_SAT:
09279         {
09280             Index = TT_SATURATION;
09281             break;
09282         }
09283     case FTMENU_DARK:
09284         {
09285             Index = TT_DARKEN;
09286             break;
09287         }
09288     case FTMENU_LIGHT:
09289         {
09290             Index = TT_LIGHTEN;
09291             break;
09292         }
09293     case FTMENU_BRI:
09294         {
09295             Index = TT_BRIGHTNESS;
09296             break;
09297         }
09298     case FTMENU_LUM:
09299         {
09300             Index = TT_LUMINOSITY;
09301             break;
09302         }
09303     case FTMENU_HUE:
09304         {
09305             Index = TT_HUE;
09306             break;
09307         }
09308     default:
09309         {
09310             Index = TT_NoTranspType;
09311         }
09312     }
09313 
09314     TypeChange->SetTranspType(Index);
09315 
09316     //TypeChange->SetValue (Index);
09317 
09318     //AttributeManager::AttributeSelected(TypeChange, NULL);
09319     AttributeManager::AttributeSelected(NULL, TypeChange);
09320 
09321 
09322 /*
09323     // And also change the line transparency type
09324     TypeChange = new AttrStrokeTranspTypeChange();
09325     if (TypeChange == NULL)
09326     {
09327         InformError();
09328         return;
09329     }
09330 
09331     TypeChange->SetTranspType(GetTranspType());
09332 
09333     AttributeManager::AttributeSelected(NULL, TypeChange);
09334 */
09335 }

void TranspInfoBarOp::DisplayTransparencyPercentString double  value  )  [private]
 

Sorts out the transparency value that is actually displayed (as a string). It actually calculates the percentage value that has been/ is being applied. This is calculated in 0.5% intervals.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/99
Parameters:
value - the (double) value that is to be converted/displayed as percent. [INPUTS] To get the correct results, the value supplied for value MUST be in the range 0-255; and NOT 0-100!
See also:
-

Definition at line 6939 of file filltool.cpp.

06940 {
06941     if (value == (double) 1) { value = 0; }         // cause of the way the slider is bodged
06942     
06943     double TranspVal = ((double) value * 100) / (double) SliderMax;
06944 
06945     UINT32 Rounded = (UINT32) TranspVal;
06946     double Diff = TranspVal - Rounded;
06947 
06948     if (Diff < 0.5)
06949     {
06950         if (Diff < 0.25) { TranspVal = (double) Rounded; }
06951         else { TranspVal = (double) Rounded + 0.5; }
06952     }
06953     else
06954     {
06955         if (Diff < 0.75) { TranspVal = (double) Rounded + 0.5; }
06956         else { TranspVal = (double) ++Rounded; }
06957     }
06958 
06959     String_64 Str;
06960 
06961     Convert::DoubleToString( TranspVal, &Str, 1 );
06962 
06963     if (Str.FindNextChar ((TCHAR) '.') == -1)
06964     {
06965         // need to wack a .0 in ....
06966 
06967         Str += _T(".0");
06968     }
06969     
06970     Str.MakePercent ((TCHAR*) Str);
06971 
06972     String_64 PercentStr(Str);
06973     SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
06974 }

void TranspInfoBarOp::EnableControls  ) 
 

Enables or disables the controls depending on the current context, i.e. the controls are disabled if there is no selection, etc. Actually more complicated than this now, cause my function calls now hide/show various controls; and dynamically reshuffle the infobar.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (rewritten by Chris Snook)
Date:
3/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 8594 of file filltool.cpp.

08595 {
08596     // DMc - check for nodes which transparency can't be applied to
08597     BOOL allowed = TRUE;
08598 
08599     SelRange * pSel = GetApplication()->FindSelection();
08600 
08601     Node * pNode = pSel->FindFirst(FALSE);
08602 
08603     while (pNode && allowed)
08604     {
08605         if (pNode->IsKindOf(CC_RUNTIME_CLASS(NodeShadow)))
08606         {
08607             allowed = FALSE;
08608         }
08609 
08610         pNode = pSel->FindNext(pNode, FALSE);
08611     }
08612     
08613     if (Document::GetSelected() == NULL || !allowed)
08614     {
08615         EnableGadget (_R(IDC_GEOMETRY),     FALSE);
08616         EnableGadget (_R(IDC_MAPPING),      FALSE);
08617         EnableGadget(_R(IDC_TRANSPTYPE),    FALSE);
08618         EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08619         EnableGadget (_R(IDC_BIASGAIN),     FALSE);
08620         EnableGadget (_R(IDC_SELPOINT),     FALSE);
08621         EnableGadget (_R(IDC_TRANSPSLIDE),  FALSE);
08622         EnableGadget (_R(IDC_SELCOLOUR),    FALSE);
08623         //EnableGadget(_R(IDC_GRADCOORDS),  FALSE);
08624     }
08625     else
08626     {
08627 
08628         EnableGadget (_R(IDC_GEOMETRY), TRUE);
08629         EnableGadget (_R(IDC_TRANSPTYPE),   TRUE);
08630         EnableGadget (_R(IDC_TRANSPSLIDE), TRUE);
08631         EnableGadget (_R(IDC_SELCOLOUR), TRUE);
08632                 
08633         switch (Mode)
08634         {
08635             case NOFILL:
08636 
08637                 EnableGadget (_R(IDC_MAPPING), FALSE);
08638                 EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08639                 EnableGadget (_R(IDC_BIASGAIN), FALSE);
08640                 EnableGadget (_R(IDC_SELPOINT), FALSE);
08641                 EnableGadget (_R(IDC_TRANSPSLIDE), TRUE);
08642                 EnableGadget (_R(IDC_SELCOLOUR), TRUE);
08643             break;
08644             
08645             case MANYFILLS:
08646             case FLATFILL:
08647                 // nothing else to enable ....
08648                 EnableGadget (_R(IDC_MAPPING), FALSE);
08649                 EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08650                 EnableGadget (_R(IDC_BIASGAIN), FALSE);
08651                 EnableGadget (_R(IDC_SELPOINT), FALSE);
08652 
08653                 if (Mode == MANYFILLS)
08654                 {
08655                     EnableGadget (_R(IDC_TRANSPSLIDE), FALSE);
08656                     EnableGadget (_R(IDC_SELCOLOUR), FALSE);
08657                 }
08658 
08659                 CloseProfileDialog (m_BiasGainGadget);      // cause fill type cannot be profiled!
08660             break;
08661 
08662             case GRADFILL:
08663             case GRADREPEATFILL:
08664                 switch (CurrentGeometryIndex)
08665                 {
08666                     case FGMENU_LINEARTRANSP:
08667                     case FGMENU_CIRCULARTRANSP:
08668                     case FGMENU_RADIALTRANSP:
08669                     // the following is really fg_diamond ....
08670                     case FGMENU_SQUARETRANSP:
08671 
08672                         EnableGadget (_R(IDC_MAPPING), TRUE);
08673                         EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08674 
08675                         //if (2 colour)
08676                         //{
08677                             EnableGadget (_R(IDC_BIASGAIN), TRUE);
08678                         //}
08679                         //else
08680                         //{
08681                         //  EnableGadget (_R(IDC_BIASGAIN), FALSE);
08682                         //}
08683 
08684                         EnableGadget (_R(IDC_SELPOINT), FALSE);
08685                     break;
08686                     
08687                     case FGMENU_CONICALTRANSP:
08688                         EnableGadget (_R(IDC_MAPPING), FALSE);
08689                         EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08690 
08691                         //if (2 colour)
08692                         //{
08693                             EnableGadget (_R(IDC_BIASGAIN), TRUE);
08694                         //}
08695                         //else
08696                         //{
08697                         //  EnableGadget (_R(IDC_BIASGAIN), FALSE);
08698                         //}
08699                         
08700                         EnableGadget (_R(IDC_SELPOINT), FALSE);
08701                     break;
08702                     
08703                     case FGMENU_THREECOLTRANSP:
08704                     case FGMENU_FOURCOLTRANSP:
08705                         EnableGadget (_R(IDC_MAPPING), TRUE);
08706                         EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08707                         EnableGadget (_R(IDC_BIASGAIN), FALSE);
08708                         EnableGadget (_R(IDC_SELPOINT), FALSE);
08709                     break;
08710                 }
08711             break;
08712 
08713             case BITMAPFILL:
08714                 EnableGadget (_R(IDC_MAPPING), TRUE);
08715                 EnableGadget (_R(IDC_BITMAPEFFECT), TRUE);
08716 
08717                 if (AttrFillGeometry::SelectionCount == 0)
08718                 {
08719                     EnableGadget (_R(IDC_TRANSPSLIDE), FALSE);
08720                     EnableGadget (_R(IDC_SELCOLOUR), FALSE);
08721                 }
08722                 
08723                 //if (2 colour)
08724                 //{
08725                     //EnableGadget (_R(IDC_BIASGAIN), TRUE);
08726                 //}
08727                 //else
08728                 //{
08729                     EnableGadget (_R(IDC_BIASGAIN), TRUE);//FALSE);
08730                 //}
08731 
08732                 //EnableGadget (_R(IDC_SELPOINT), FALSE);
08733 
08734                 if (GetGadgetWritable (_R(IDC_SELPOINT)))
08735                 {
08736                     EnableGadget (_R(IDC_SELPOINT), FALSE);
08737                 }
08738                 else
08739                 {
08740                     EnableGadget (_R(IDC_SELPOINT), TRUE);
08741                 }
08742             break;
08743 
08744             case FRACTALFILL:
08745             case NOISEFILL:
08746                 EnableGadget (_R(IDC_MAPPING), TRUE);
08747                 EnableGadget (_R(IDC_BITMAPEFFECT), FALSE);
08748 
08749                 //if (2 colour)
08750                 //{
08751                     //EnableGadget (_R(IDC_BIASGAIN), TRUE);
08752                 //}
08753                 //else
08754                 //{
08755                     EnableGadget (_R(IDC_BIASGAIN), TRUE);//FALSE);
08756                 //}
08757 
08758                 if (GetGadgetWritable (_R(IDC_SELPOINT)))
08759                 {
08760                     EnableGadget (_R(IDC_SELPOINT), FALSE);
08761                 }
08762                 else
08763                 {
08764                     EnableGadget (_R(IDC_SELPOINT), TRUE);
08765                 }
08766                 
08767                 /*if (GetGadgetWritable (_R(IDC_SELCOLOUR)))
08768                 {
08769                     EnableGadget (_R(IDC_SELCOLOUR), FALSE);
08770                 }
08771                 else
08772                 {
08773                     EnableGadget (_R(IDC_SELCOLOUR), TRUE);
08774                 }*/
08775             break;
08776 
08777             default:
08778             break;
08779         }
08780 
08781 
08782 /*      BOOL enable = TRUE;
08783         EnableGadget(_R(IDC_GEOMETRY),      enable);
08784 
08785 //      if (Mode == NOFILL)
08786 //          enable = FALSE;
08787 
08788         if (TypeDisabled == enable)
08789         {
08790             TypeDisabled = !enable;
08791             //EnableGadget(_R(IDC_TRANSPTYPE),  enable);
08792         }
08793 
08794         enable = FALSE;
08795         if (Mode == BITMAPFILL || 
08796             Mode == FRACTALFILL || 
08797             Mode == GRADREPEATFILL ||
08798 //Mark Howitt, 14/10/97. Implement repeating transparent grad fills, except conical
08799 #ifdef NEW_FEATURES
08800             (Mode == GRADFILL && CurrentGeometryIndex != FGMENU_CONICALTRANSP) ||
08801 #endif
08802             Mode == NOISEFILL)
08803         {
08804             enable = TRUE;
08805         }
08806 
08807         if (MappingDisabled == enable)
08808         {
08809             MappingDisabled = !enable;
08810             EnableGadget(_R(IDC_MAPPING),       enable);
08811         }
08812 
08813 //      if (CommonAttr != SelRange::ATTR_NONE)
08814             enable = TRUE;
08815 //      else
08816 //          enable = FALSE;
08817 
08818         EnableGadget(_R(IDC_SELPOINT),      enable);
08819         EnableGadget(_R(IDC_TRANSPSLIDE),   enable);
08820     //  EnableGadget(_R(IDC_SELPOINT2),     enable);
08821     //  EnableGadget(_R(IDC_SELCOLOUR),     enable);
08822     //  EnableGadget(_R(IDC_SELCOLOURBLOB), enable);
08823 
08824     //  enable = FALSE;
08825     //  EnableGadget(_R(IDC_GRADCOORDS),    enable);
08826     //  EnableGadget(_R(IDC_GRADCOORDS2),   enable);*/
08827     }
08828 
08829 }           

INT32 TranspInfoBarOp::FindCommonBitmapDpi  )  [private]
 

Find any Common Bitmap Dpi in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7954 of file filltool.cpp.

07955 {
07956     if (Selection->Count() == 0)
07957     {
07958         AttrFillGeometry* pCurrentFill = GetCurrentGeometry();
07959 
07960         if (pCurrentFill && pCurrentFill->IsABitmapFill())
07961         {
07962             return pCurrentFill->GetDPI();
07963         }
07964 
07965         return 0;
07966     }
07967 
07968     // Find the first Fill Attribute in the selection
07969     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07970 
07971     // Return if there aren't any
07972     if (pAttrNode == NULL)
07973         return 0;
07974 
07975     INT32 CommonDpi = 0;
07976     INT32 Dpi = 0;
07977 
07978     while (pAttrNode != NULL)
07979     {
07980         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapFill)))
07981         {
07982             if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrTextureTranspFill)) ||
07983                 pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapTranspFill))  )
07984             {
07985                 Dpi = pAttrNode->GetDPI();
07986 
07987                 if (CommonDpi == 0)
07988                     CommonDpi = Dpi;
07989 
07990                 if (Dpi != CommonDpi)
07991                 {
07992                     return -1; // Many
07993                 }
07994             }
07995         }
07996 
07997         // Check the next fill
07998         pAttrNode = AttrFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07999     }
08000 
08001     return CommonDpi;
08002 }

String_64 TranspInfoBarOp::FindCommonBitmapName  )  [private]
 

Find any Common Bitmap Name in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7784 of file filltool.cpp.

07785 {
07786     String_256 CommonName;
07787     CommonName.Load(_R(IDS_FILLTOOL_NONE));
07788 
07789     if (Selection->Count() == 0)
07790     {
07791         AttrFillGeometry* pCurrentFill = GetCurrentGeometry();
07792 
07793         //AttrTranspFillGeometry* pCurrentFill = GetCurrentGeometry();
07794 
07795         // NOTE:  we can call either IsATranspFill or IsABitmapFill here ....
07796         // BOTH return TRUE, the only difference is that IsABitmapFill is a base
07797         // class member function (AttrBitmapFill::) and IsATranspFill is a 'true'
07798         // class function (i.e.  defined and implemented in AttrBitmapTranspFill)
07799         // BUT, lets stick with IsABitmapFill (for clarity) - cause after all,
07800         // were dealing with bitmaps here ....
07801 
07802         if (pCurrentFill && pCurrentFill->/*IsATranspFill*/IsABitmapFill())
07803         {
07804             CommonName = pCurrentFill->GetBitmap()->ActualBitmap->GetName();
07805         }
07806 
07807         return CommonName;
07808     }
07809 
07810     String_256 Name;
07811     Name.Load(_R(IDS_FILLTOOL_NONE));
07812     
07813     String_256 None;
07814     None.Load(_R(IDS_FILLTOOL_NONE));
07815 
07816     String_256 Many;
07817     Many.Load(_R(IDS_FILLTOOL_MANY));
07818 
07819     // Find the first Fill Attribute in the selection (of the right type!)
07820     // (observe the CC_RUNTIME_CLASS(AttrTranspFillGeometry) 
07821     AttrFillGeometry* pAttrNode = AttrTranspFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07822 
07823     // Return if there aren't any
07824     if (pAttrNode == NULL)
07825         return None;
07826 
07827     while (pAttrNode != NULL)
07828     {
07829         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrBitmapTranspFill)))
07830         {
07831             Name = pAttrNode->GetBitmap()->ActualBitmap->GetName();
07832 
07833             if (CommonName == None)
07834                 CommonName = Name;
07835 
07836             if (Name != CommonName)
07837             {
07838                 return Many;
07839             }
07840         }
07841 
07842         // Check the next fill (of the right type!)
07843         pAttrNode = AttrTranspFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07844     }
07845 
07846     return CommonName;
07847 }

double TranspInfoBarOp::FindCommonFractalGrain  )  [private]
 

Find any Common Fractal Graininess in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 8052 of file filltool.cpp.

08053 {
08054     if (Selection->Count() == 0)
08055     {
08056         AttrFillGeometry* pCurrentFill = GetCurrentGeometry();
08057 
08058         if (pCurrentFill && pCurrentFill->IsAFractalFill())
08059         {
08060             return ((FractalTranspFillAttribute*)pCurrentFill->GetAttributeValue())->Graininess.MakeDouble();
08061         }
08062 
08063         return 0;
08064     }
08065 
08066     // Find the first Fill Attribute in the selection
08067     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08068 
08069     // Return if there aren't any
08070     if (pAttrNode == NULL)
08071         return 0;
08072 
08073     double CommonGrain = 0;
08074 
08075     while (pAttrNode != NULL)
08076     {
08077         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrFractalTranspFill)))
08078         {
08079             double Grain = ((FractalTranspFillAttribute*)pAttrNode->GetAttributeValue())->Graininess.MakeDouble();
08080 
08081             if (CommonGrain == 0)
08082                 CommonGrain = Grain;
08083 
08084             if (Grain != CommonGrain)
08085             {
08086                 return -1; // Many
08087             }
08088         }
08089 
08090         // Check the next fill
08091         pAttrNode = AttrFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08092     }
08093 
08094     return CommonGrain;
08095 }

double TranspInfoBarOp::FindCommonNoiseScale  )  [private]
 

Find any Common Noise Scale in the selection.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 8168 of file filltool.cpp.

08169 {
08170     if (Selection->Count() == 0)
08171     {
08172         AttrFillGeometry* pCurrentFill = GetCurrentGeometry();
08173 
08174         if (pCurrentFill && IS_A(pCurrentFill, AttrNoiseTranspFill))
08175         {
08176             return ((FractalTranspFillAttribute*)pCurrentFill->GetAttributeValue())->GetGraininess().MakeDouble();
08177         }
08178 
08179         return 0;
08180     }
08181 
08182     // Find the first Fill Attribute in the selection
08183     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08184 
08185     // Return if there aren't any
08186     if (pAttrNode == NULL)
08187         return 0;
08188 
08189     double CommonScale = 0;
08190 
08191     while (pAttrNode != NULL)
08192     {
08193         if (pAttrNode->IsKindOf(CC_RUNTIME_CLASS(AttrNoiseTranspFill)))
08194         {
08195             double Scale = ((FractalTranspFillAttribute*)pAttrNode->GetAttributeValue())->GetGraininess().MakeDouble();
08196 
08197             if (CommonScale == 0)
08198                 CommonScale = Scale;
08199 
08200             if (Scale != CommonScale)
08201             {
08202                 return -1; // Many
08203             }
08204         }
08205 
08206         // Check the next fill
08207         pAttrNode = AttrFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08208     }
08209 
08210     return CommonScale;
08211 }

INT32 TranspInfoBarOp::FindCommonTesselate  )  [private]
 

Find any Common Fill Tesselation in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7683 of file filltool.cpp.

07684 {
07685     INT32 CommonTess = 0;
07686     Node* pNode;
07687     NodeAttribute* pChild;
07688 
07689     if (Selection->Count() == 0)
07690     {
07691         AttrTranspFillMapping* pCurrentMapping = GetCurrentMapping();
07692 
07693         if (pCurrentMapping != NULL)
07694         {
07695             return pCurrentMapping->GetRepeat();
07696         }
07697 
07698         return 0;
07699     }
07700 
07701     // Are there any selected Objects ?
07702     if (Selection != NULL)
07703     {
07704 EffectsStack* pStack = Selection->GetEffectsStack();
07705 INT32 iStackPos = STACKPOS_TOP;
07706 Range* pLevel = pStack->GetLevelRange(&iStackPos, FALSE);       // Don't escape old controllers, apply attr to base nodes
07707         // Find the first Object
07708 /*      pNode = Selection->FindFirst();
07709         while (pNode != NULL)
07710         {
07711             BOOL FoundAttr = ((NodeRenderableInk*)pNode)->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrTranspFillMapping), &pChild);
07712             
07713             if (FoundAttr)
07714             {
07715                 INT32 Tess = ((AttrTranspFillMapping*)pChild)->GetRepeat();
07716 
07717                 if (CommonTess == 0)
07718                     CommonTess = Tess;
07719 
07720                 if (Tess != CommonTess)
07721                 {
07722                     return -1; // Many
07723                 }
07724             }
07725 
07726             pNode = Selection->FindNext(pNode);
07727         }
07728 */
07729         pNode = pLevel->FindFirst();
07730         while (pNode != NULL)
07731         {
07732             pChild = ((NodeRenderableInk*)pNode)->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrTranspFillMapping));
07733             
07734             if (pChild)
07735             {
07736                 INT32 Tess = ((AttrTranspFillMapping*)pChild)->GetRepeat();
07737 
07738                 if (CommonTess == 0)
07739                     CommonTess = Tess;
07740 
07741                 if (Tess != CommonTess)
07742                 {
07743                     return -1; // Many
07744                 }
07745             }
07746 
07747             pNode = pLevel->FindNext(pNode);
07748         }
07749 
07750     }
07751 
07752     //if (CommonTess == 0)
07753     //  return RT_Repeating;
07754 
07755     return CommonTess;
07756 }

INT32 TranspInfoBarOp::FindCommonTranspType  )  [private]
 

Tries to find a common transparency type within the selection. This now makes use of camelots new AttrPaintingMode (which I also wrote).

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (ported to filltool by Chris Snook 11/10/99)
Date:
14/9/94
Returns:
0 = No Common type, >0 = Common Transparency Type

Definition at line 7517 of file filltool.cpp.

07518 {
07519     if (Selection->Count() == 0)
07520     {
07521         AttrFillGeometry* pCurrentFill = GetCurrentGeometry();
07522 
07523         if (pCurrentFill != NULL)
07524         {
07525             return pCurrentFill->GetTranspType();
07526         }
07527 
07528         return 0;
07529     }
07530 
07531     AttrFillGeometry* pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07532 
07533     // Return if there aren't any
07534     if (pAttrNode == NULL)
07535         return 0;
07536 
07537     UINT32 TType = 0;
07538     
07539     while (pAttrNode != NULL)
07540     {
07541         if (pAttrNode->GetAttributeType() == CC_RUNTIME_CLASS(AttrTranspFillGeometry))
07542         {
07543             UINT32 NodeTType = pAttrNode->GetTranspType();
07544             
07545             if (TType == 0)
07546                 TType = NodeTType;
07547 
07548             if (TType != NodeTType)
07549                 return -1;
07550         }
07551 
07552         // Check the next fill
07553         pAttrNode = AttrFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
07554     }
07555 
07556     return TType;
07557 }

AttrFillGeometry * TranspInfoBarOp::GetCurrentGeometry  )  [private]
 

Gets the current Fill Geometry from the Attribute manager.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94

Definition at line 9871 of file filltool.cpp.

09872 {
09873     CCRuntimeClass* CurrentAttribGroup = 
09874         Tool::GetCurrent()->Parent->m_ToolInfo.CurrentAttributeGroup;
09875 
09876     Document* CurrentDoc = Document::GetSelected();
09877 
09878     if (CurrentDoc == NULL)
09879         return NULL; // We are not going to be able to do anything if there is no document
09880 
09881     return (AttrFillGeometry*)CurrentDoc->GetAttributeMgr()
09882                                 .GetCurrentAttribute(CurrentAttribGroup, 
09883                                             CC_RUNTIME_CLASS(AttrTranspFillGeometry));
09884 }

AttrTranspFillMapping * TranspInfoBarOp::GetCurrentMapping  )  [private]
 

Gets the current painting mode from the Attribute manager.Gets the current Fill Geometry from the Attribute manager.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94

Definition at line 9922 of file filltool.cpp.

09923 {
09924     CCRuntimeClass* CurrentAttribGroup = 
09925         Tool::GetCurrent()->Parent->m_ToolInfo.CurrentAttributeGroup;
09926 
09927     Document* CurrentDoc = Document::GetSelected();
09928 
09929     if (CurrentDoc == NULL)
09930         return NULL; // We are not going to be able to do anything if there is no document
09931 
09932     return (AttrTranspFillMapping*)CurrentDoc->GetAttributeMgr()
09933                                 .GetCurrentAttribute(CurrentAttribGroup, 
09934                                             CC_RUNTIME_CLASS(AttrTranspFillMapping));
09935 }

BOOL TranspInfoBarOp::GetGadgetWritable INT32  id  )  [private]
 

Returns whether the control is writable (i.e. read only, or not). void TranspInfoBarOp::EnableControls() needs to make use of this to control its 'dynamic' toolbar correctly (both of which were also written by me).

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/11/99
Parameters:
id,the 'IDC_?' of the control. [INPUTS]
Returns:
TRUE if writable, FALSE otherwise

Definition at line 7918 of file filltool.cpp.

07919 {
07920     PORTNOTETRACE("other","TranspInfoBarOp::GetGadgetWritable disabled");
07921 #ifndef EXCLUDE_FROM_XARALX
07922     // Get the window handle of the gadget, from the gadget ID
07923     HWND gadget = ::GetDlgItem (WindowID, id);
07924 
07925     // See if it's got a child window (it may be a Combo Box)
07926     HWND hEdit = ::ChildWindowFromPoint (gadget, CPoint(1,1));
07927 
07928     if (hEdit)              // Was there a child window ?
07929         gadget = hEdit;     // Yes, so send the message to it
07930 
07931     if (GetWindowLong (gadget, GWL_STYLE) & ES_READONLY)
07932     {
07933         return (TRUE);
07934     }
07935     else
07936     {
07937         return (FALSE);
07938     }
07939 #else
07940     return TRUE;
07941 #endif
07942 }

CProfileBiasGain * TranspInfoBarOp::GetProfileFromSelection CGadgetID  GadgetID,
BOOL *  bMany,
BOOL *  bAllSameType
[private, virtual]
 

See InformationBarOp::GetProfileFromSelection () for a description of this function.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/2/2000
Parameters:
The GadgetID of the CBiasGainGadget that we are dealing with. [INPUTS]
bMany - returned as TRUE if we have MANY profiles selected. [OUTPUTS] bAllSameType - returned as TRUE if objects within selection are all of the same type. returns Ptr to common CProfileBiasGain, or NULL if there is NOT one.

Reimplemented from InformationBarOp.

Definition at line 6457 of file filltool.cpp.

06458 {
06459     BOOL ok = (GadgetID == _R(IDC_BIASGAIN));
06460 
06461     ERROR2IF(ok==FALSE, FALSE, "Invalid gadgetID passed");
06462     
06463     UINT32 TotalNumberSelected = (GetApplication()->FindSelection()->Count ());
06464 
06465     // get the list of all the shadows
06466 //  List ShadowList;
06467 //  FillTools::BuildListOfSelectedAttrs(&ShadowList, CC_RUNTIME_CLASS(AttrTranspFillGeometry));
06468     List AttrList;
06469     ok = FillTools::GetSelectedAttrList(&AttrList, CC_RUNTIME_CLASS(AttrTranspFillGeometry), TRUE, TRUE);
06470     if (!ok)
06471         return NULL;
06472 
06473     AttrFillGeometry* pFirstNodeShadow = NULL;
06474     FillGeometryAttribute* pFirstFillGeoAttr = NULL;
06475 
06476     CProfileBiasGain* pFirstProfile = NULL;
06477 
06478 //  NodeListItem * pItem = (NodeListItem *)ShadowList.GetHead();
06479     NodeListItem * pItem = (NodeListItem *)AttrList.GetHead();
06480 
06481     while (pItem)
06482     {
06483         if (pFirstNodeShadow == NULL)
06484         {
06485             pFirstNodeShadow = (AttrFillGeometry*) pItem->pNode;
06486             pFirstFillGeoAttr = (FillGeometryAttribute*) pFirstNodeShadow->GetAttributeValue ();
06487 
06488             pFirstProfile = pFirstFillGeoAttr->GetProfilePtr ();
06489         }
06490         else
06491         {       
06492             CProfileBiasGain* pOtherProfile = NULL;
06493             
06494             pOtherProfile = ((FillGeometryAttribute*) ((AttrFillGeometry*)pItem->pNode)->GetAttributeValue ())->GetProfilePtr ();
06495 
06496             if (pOtherProfile)
06497             {
06498                 if (*pFirstProfile == *pOtherProfile)
06499                 {
06500                     // all ok
06501                 }
06502                 else
06503                 {
06504                     *bMany = TRUE;
06505                 }
06506             }
06507         }
06508 
06509 //      pItem = (NodeListItem *)ShadowList.GetNext(pItem);
06510         pItem = (NodeListItem *)AttrList.GetNext(pItem);
06511     }
06512 
06513 //  if (TotalNumberSelected != (UINT32) ShadowList.GetCount ())
06514     if (TotalNumberSelected != (UINT32) AttrList.GetCount ())
06515     {
06516         // totals differ - so the user MUST have selected someother type of node as well
06517         
06518         if ((pFirstProfile) && (*bMany == FALSE))
06519         {
06520             // scan each node in the list, and see if they have the attribute applied ....
06521 
06522             SelRange* range = GetApplication()->FindSelection();
06523 
06524             NodeRenderableInk* pNode = (NodeRenderableInk*) range->FindFirst();
06525             NodeAttribute* pAttr;
06526 
06527             while (pNode)
06528             {
06529 //              if (pNode->FindAppliedAttribute (CC_RUNTIME_CLASS (AttrTranspFillGeometry), &pAttr))
06530                 pAttr = pNode->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
06531                 if (pAttr)
06532                 {
06533                     pNode = (NodeRenderableInk*) (range->FindNext(pNode));
06534                 }
06535                 else
06536                 {
06537                     // the node ain't got one
06538 
06539                     *bAllSameType = FALSE;
06540 //                  ShadowList.DeleteAll();
06541                     AttrList.DeleteAll();
06542                     return (NULL);
06543                 }
06544             }
06545         }
06546         else
06547         {   
06548             *bAllSameType = FALSE;
06549 //          ShadowList.DeleteAll();
06550             AttrList.DeleteAll();
06551             return (NULL);
06552         }
06553     }
06554     
06555     // I've assumed that m_BiasGainGadget.UseTranspFillProfile () has already been called ....
06556     // (which in this code it will have been).
06557     
06558     if (*bMany == TRUE)
06559     {
06560 //      ShadowList.DeleteAll();
06561         AttrList.DeleteAll();
06562         return (NULL);
06563     }
06564     else
06565     {
06566         // NOTE:  we can only be 'context' sensitive for a single fill within the
06567         // selection - so lets just choose the first one that we came accross ....
06568         
06569         if (pFirstNodeShadow)
06570         {
06571             m_BiasGainGadget.SetStartTransp (pFirstNodeShadow->GetStartTransp ());
06572             m_BiasGainGadget.SetEndTransp (pFirstNodeShadow->GetEndTransp ());
06573         }
06574 
06575 //      ShadowList.DeleteAll();
06576         AttrList.DeleteAll();
06577 
06578         return (pFirstProfile);
06579     }
06580 }

String_64 TranspInfoBarOp::GetSelectedPoint AttrFillGeometry pGeometry  )  [private]
 

Gets a textual description of a fills contol point selection state.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A String_64, "None", "Many", or "Start Colour", "End Colour" etc.

Definition at line 8427 of file filltool.cpp.

08428 {
08429     String_64 Str;
08430 
08431     // how many happen to be selected at the moment?
08432     UINT32 SelCount = pGeometry->GetSelectionCount();
08433 
08434     // if there's nothing selected then we're done
08435     if (SelCount<1)
08436     {
08437         Str.Load(_R(IDS_FILLTOOL_NONE));
08438         return Str;
08439     }
08440 
08441     // more than one?   
08442     if (SelCount>1)
08443     {
08444         Str.Load(_R(IDS_FILLTOOL_MANY));
08445         return Str;
08446     }
08447 
08448     // ramp blobs have negative indexes
08449     INT32 i = pGeometry->GetFirstSelectedIndex();
08450     if (ISA_RAMPINDEX(i))
08451     {
08452         Str.Load(_R(IDS_FILLTOOL_RAMPTRANSP));
08453         return Str;
08454     }
08455 
08456     // ok its an end blob so which one is it?
08457     switch (i)
08458     {
08459         case FILLCONTROL_STARTPOINT:
08460             Str.Load(_R(IDS_FILLTOOL_STARTTRANS));
08461             break;
08462 
08463         case FILLCONTROL_ENDPOINT:
08464         case FILLCONTROL_SECONDARYPOINT:
08465             Str.Load(_R(IDS_FILLTOOL_ENDTRANS));
08466             break;
08467 
08468         case FILLCONTROL_ENDPOINT2:
08469             Str.Load(_R(IDS_FILLTOOL_ENDTRANS2));
08470             break;
08471 
08472         case FILLCONTROL_ENDPOINT3:
08473             Str.Load(_R(IDS_FILLTOOL_ENDTRANS3));
08474             break;
08475 
08476         default:
08477             Str.Load(_R(IDS_FILLTOOL_NONE));
08478             break;
08479     }
08480 
08481     return Str;
08482 }

UINT32 TranspInfoBarOp::GetSelectedTransp AttrFillGeometry pGeometry  )  [private]
 

Gets a textual description of a fills contol point colour.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A String_64, "None", "Many", or "Colour Name".

Definition at line 8551 of file filltool.cpp.

08552 {
08553     UINT32* pStartTransp = pGeometry->GetStartTransp();
08554     if (pStartTransp == NULL)
08555         return 0;   // Not a transparency fill !
08556 
08557     UINT32* pEndTransp = pGeometry->GetEndTransp();
08558     UINT32 SelCount = pGeometry->GetSelectionCount();
08559 
08560     // if there's nothing selected then we're done
08561     if (SelCount<1)
08562         return 0;
08563 
08564     if (SelCount>1)
08565     {
08566         if (pEndTransp!=NULL && ((*pStartTransp) != (*pEndTransp)))
08567             return 0;
08568     }
08569 
08570     // ok, only one thing selected so go get it
08571     pStartTransp = pGeometry->GetFirstSelectedTransp();
08572     if (pStartTransp)
08573         return (*pStartTransp);
08574 
08575     return 0;
08576 }

UINT32 TranspInfoBarOp::GetTranspType  )  [inline]
 

Definition at line 605 of file filltool.h.

00605 { return CurrentTransTypeIndex + 1; }

void TranspInfoBarOp::InitBitmapName  )  [private]
 

Initialise the Bitmap Name Control.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (ported to transparency tool by Chris Snook 11/10/99)
Date:
8/5/95
See also:
-

Definition at line 6800 of file filltool.cpp.

06801 {
06802 //  DeleteAllValues(_R(IDC_BITMAPEFFECT));
06803     m_oBitmapDropDown.Clear();
06804     EnableGadget (_R(IDC_BITMAPEFFECT), TRUE);
06805 
06806     Document* pDoc = Document::GetSelected();
06807 
06808     // Get the bitmap list
06809     BitmapList* Bitmaps = NULL;
06810     if (pDoc) Bitmaps = pDoc->GetBitmapList();
06811 
06812     if (Bitmaps == NULL)
06813         return;
06814 
06815     String_256 Str;
06816 
06817     if (Bitmaps->GetCount() > 0)
06818     {
06819         INT32 Index = 0;
06820 
06821         ListItem* pBmp = Bitmaps->GetHead();
06822 
06823 //      DeleteAllValues ( _R(IDC_BITMAPEFFECT) );
06824 
06825         while (pBmp != NULL)
06826         {
06827             if (!((KernelBitmap*)pBmp)->HasBeenDeleted())   // Ignore deleted bitmaps
06828             {
06829                 Str = ((KernelBitmap*)pBmp)->ActualBitmap->GetName();
06830 
06831                 KernelBitmap* bitmap = ((KernelBitmap*)pBmp);
06832                 m_oBitmapDropDown.AddItem(bitmap, FALSE, Str);
06833                 
06834                 Index++;
06835             }
06836 
06837             pBmp = Bitmaps->GetNext(pBmp);
06838         }
06839 
06840 //      SetComboListLength(_R(IDC_BITMAPEFFECT));
06841     }
06842     //else
06843     //{
06844         // (not sure about this for a custom box)
06845         
06846         //Str.Load(_R(IDS_FILLTOOL_DEFAULTNAME));
06847         //SetStringGadgetValue(_R(IDC_EFFECT),&Str,TRUE, 0);
06848     //}
06849 }

void TranspInfoBarOp::InitControls void   ) 
 

Inits all the controls in the info bar. Called immediately after the bar is created when the Transpfill tool becomes the current tool.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94
See also:
- Note: WEBSTER-Martin-26/11/86 removed initiallization of things not in XWP

Definition at line 6596 of file filltool.cpp.

06597 {
06598     // Don't do anything if the Info bar isn't displayed
06599     if (!TranspTool::IsCurrentTool() || !IsVisible()) return;
06600 
06601 //  if (SliderDragged)
06602 //      return;
06603 
06604     SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax);
06605 
06606     DeleteAllValues(_R(IDC_GEOMETRY));
06607     DeleteAllValues(_R(IDC_TRANSPTYPE));
06608     DeleteAllValues(_R(IDC_MAPPING));
06609 //  DeleteAllValues(_R(IDC_BITMAPEFFECT));
06610     m_oBitmapDropDown.Init(WindowID, _R(IDC_BITMAPEFFECT));
06611     m_oBitmapDropDown.SetColumns(3);
06612     m_oBitmapDropDown.SetItemSize(wxSize(50, 50));
06613 
06614 
06615     SetGadgetHelp(_R(IDC_GEOMETRY),     _R(IDBBL_TRANSPTOOL_TRANSPSHAPE),   _R(IDS_TRANSPTOOL_TRANSPSHAPE));
06616     SetGadgetHelp(_R(IDC_TRANSPTYPE),   _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
06617     SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
06618     SetGadgetHelp(_R(IDC_BITMAPEFFECT), _R(IDBBL_FILLTOOL_BITMAPNAME),      _R(IDS_FILLTOOL_BITMAPNAME));
06619     SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
06620     SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
06621     SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
06622 
06623     String_64 Str;
06624 
06625     // Setup the Menu Item text entries
06626     for ( INT32 i=0; i<TransparencyGeometryMenuCount; i++ )
06627     {
06628         Str.Load( TransparencyGeometryMenu[i].StringID );
06629         SetStringGadgetValue( _R(IDC_GEOMETRY), Str, TRUE, TransparencyGeometryMenu[i].Geometry );
06630     }
06631 
06632     Str.Load(_R(IDS_FILLTOOL_PAINT));
06633     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,FALSE, FTMENU_REFLECT);
06634     Str.Load(_R(IDS_FILLTOOL_STAIN));
06635     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,FALSE, FTMENU_SUB);
06636     Str.Load(_R(IDS_FILLTOOL_BLEACH));
06637     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_ADD);
06638     Str.Load(_R(IDS_FILLTOOL_CONTRAST));
06639     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_CON);
06640     Str.Load(_R(IDS_FILLTOOL_SATURATE));
06641     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_SAT);
06642     Str.Load(_R(IDS_FILLTOOL_DARKEN));
06643     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_DARK);
06644     Str.Load(_R(IDS_FILLTOOL_LIGHTEN));
06645     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_LIGHT);
06646     Str.Load(_R(IDS_FILLTOOL_BRIGHTNESS));
06647     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_BRI);
06648     Str.Load(_R(IDS_FILLTOOL_LUMINOSITY));
06649     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_LUM);
06650     Str.Load(_R(IDS_FILLTOOL_HUE));
06651     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_HUE);
06652 
06653     Str.Load(_R(IDS_FILLTOOL_TESS_SIMPLE));
06654     SetStringGadgetValue(_R(IDC_MAPPING),Str,FALSE, FTMENU_SIMPLE);
06655     Str.Load(_R(IDS_FILLTOOL_TESS_REPEAT));
06656     SetStringGadgetValue(_R(IDC_MAPPING),Str,TRUE, FTMENU_REPEAT);
06657     Str.Load(_R(IDS_FILLTOOL_TESS_REPEATINV));
06658     SetStringGadgetValue(_R(IDC_MAPPING),Str,TRUE, FTMENU_REPEATINV);
06659 
06660     // Ensure the drop-downs are the correct length
06661     SetComboListLength(_R(IDC_GEOMETRY));
06662     SetComboListLength(_R(IDC_TRANSPTYPE));
06663     SetComboListLength(_R(IDC_MAPPING));
06664 
06665     SetGadgetWritable(_R(IDC_GEOMETRY), FALSE);
06666     SetGadgetWritable(_R(IDC_TRANSPTYPE), FALSE);
06667     SetGadgetWritable(_R(IDC_MAPPING), FALSE);
06668 
06669     SetGadgetWritable(_R(IDC_SELPOINT), FALSE);
06670     SetGadgetWritable(_R(IDC_SELCOLOUR), TRUE);
06671 
06672     SliderMax = 255;
06673     SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
06674     SetGadgetBitmaps(_R(IDC_TRANSPSLIDE), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
06675 
06676     // Default to the first items in each list
06677     SelGeometryIndex = FGMENU_LINEARTRANSP;
06678     SelMappingIndex = 0;
06679 
06680     CommonGeometry = NULL;
06681     CommonMapping = NULL;
06682 
06683     MappingDisabled = FALSE;
06684     AllowForceToSimpleMapping = TRUE;
06685 
06686     TypeDisabled = TRUE;
06687 
06688     LastSliderPos = -1; 
06689 
06690     Mode = NOFILL;
06691 
06692     m_BiasGainGadget.Init(this, _R(IDC_BIASGAIN), _R(IDBBL_BIASGAIN),  _R(IDS_BIASGAINDLG));
06693     m_BiasGainGadget.ToggleTranspFillProfile ();
06694 
06695     ShowInfo();
06696 }           

void TranspInfoBarOp::InitMapping  )  [private]
 

Initialise the Mapping Control.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/8/96
See also:
-

Definition at line 6773 of file filltool.cpp.

06774 {
06775     DeleteAllValues(_R(IDC_MAPPING));
06776     EnableGadget(_R(IDC_MAPPING), TRUE);
06777     MappingDisabled = FALSE;
06778 
06779     String_64 Str;
06780 
06781     Str.Load(_R(IDS_FILLTOOL_MAPSIMPLE));
06782     SetStringGadgetValue(_R(IDC_MAPPING), Str,FALSE, FMMENU_SIMPLE);
06783     Str.Load(_R(IDS_FILLTOOL_MAPREPEAT));
06784     SetStringGadgetValue(_R(IDC_MAPPING), Str,TRUE, FMMENU_REPEATING);
06785 
06786     SetComboListLength(_R(IDC_MAPPING));
06787 }

void TranspInfoBarOp::InitTesselate  )  [private]
 

Initialise the Tesselation Control.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/5/95
See also:
-

Definition at line 6905 of file filltool.cpp.

06906 {
06907     DeleteAllValues(_R(IDC_MAPPING));
06908     EnableGadget(_R(IDC_MAPPING), TRUE);
06909     MappingDisabled = FALSE;
06910 
06911     String_64 Str;
06912 
06913     Str.Load(_R(IDS_FILLTOOL_TESS_SIMPLE));
06914     SetStringGadgetValue(_R(IDC_MAPPING),Str,FALSE, FTMENU_SIMPLE);
06915     Str.Load(_R(IDS_FILLTOOL_TESS_REPEAT));
06916     SetStringGadgetValue(_R(IDC_MAPPING),Str,TRUE, FTMENU_REPEAT);
06917     Str.Load(_R(IDS_FILLTOOL_TESS_REPEATINV));
06918     SetStringGadgetValue(_R(IDC_MAPPING),Str,TRUE, FTMENU_REPEATINV);
06919 
06920     SetComboListLength(_R(IDC_MAPPING));
06921 }

void TranspInfoBarOp::InitTransType  )  [private]
 

Initialise the Transparency Type Control.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/5/95
See also:
-

Definition at line 6862 of file filltool.cpp.

06863 {
06864     DeleteAllValues (_R(IDC_TRANSPTYPE));
06865     EnableGadget (_R(IDC_TRANSPTYPE), TRUE);
06866 
06867     String_64 Str;
06868 
06869     Str.Load(_R(IDS_FILLTOOL_PAINT));
06870     SetStringGadgetValue(_R(IDC_TRANSPTYPE), Str,FALSE, FTMENU_REFLECT);
06871     Str.Load(_R(IDS_FILLTOOL_STAIN));
06872     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,FALSE, FTMENU_SUB);
06873     Str.Load(_R(IDS_FILLTOOL_BLEACH));
06874     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_ADD);
06875     Str.Load(_R(IDS_FILLTOOL_CONTRAST));
06876     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_CON);
06877     Str.Load(_R(IDS_FILLTOOL_SATURATE));
06878     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_SAT);
06879     Str.Load(_R(IDS_FILLTOOL_DARKEN));
06880     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_DARK);
06881     Str.Load(_R(IDS_FILLTOOL_LIGHTEN));
06882     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_LIGHT);
06883     Str.Load(_R(IDS_FILLTOOL_BRIGHTNESS));
06884     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_BRI);
06885     Str.Load(_R(IDS_FILLTOOL_LUMINOSITY));
06886     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_LUM);
06887     Str.Load(_R(IDS_FILLTOOL_HUE));
06888     SetStringGadgetValue(_R(IDC_TRANSPTYPE),Str,TRUE, FTMENU_HUE);
06889 
06890     SetComboListLength(_R(IDC_TRANSPTYPE));
06891 }

AttrFillGeometry * TranspInfoBarOp::MakeFillMutator  )  [private]
 

Make a fill that will be used to Mutate another fill, changing it's type while retaining it's existing points and colours. The fill type returned depends on the fill type menu state.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94

Definition at line 9786 of file filltool.cpp.

09787 {
09788     AttrFillGeometry* Fill = NULL;
09789     KernelBitmap* Default;
09790 
09791     switch (CurrentGeometryIndex)
09792     {
09793         case (FGMENU_FLATTRANSP):
09794             Fill = new AttrFlatTranspFill;
09795             break;
09796 
09797         case (FGMENU_LINEARTRANSP):
09798             Fill = new AttrLinearTranspFill;
09799             break;
09800 
09801         case (FGMENU_RADIALTRANSP):
09802             Fill = new AttrRadialTranspFill;
09803             if (Fill != NULL)
09804                 ((AttrRadialFill*)Fill)->MakeElliptical();
09805             break;
09806 
09807         case (FGMENU_CIRCULARTRANSP):
09808             Fill = new AttrRadialTranspFill;
09809             if (Fill != NULL)
09810                 ((AttrRadialFill*)Fill)->MakeCircular();
09811             break;
09812 
09813         case (FGMENU_CONICALTRANSP):
09814             Fill = new AttrConicalTranspFill;
09815             break;
09816 
09817         case (FGMENU_SQUARETRANSP):
09818             Fill = new AttrSquareTranspFill;
09819             break;
09820 
09821         case (FGMENU_THREECOLTRANSP):
09822             Fill = new AttrThreeColTranspFill;
09823             CloseProfileDialog (m_BiasGainGadget);      // cause fill type cannot be profiled!
09824             break;
09825 
09826         case (FGMENU_FOURCOLTRANSP):
09827             Fill = new AttrFourColTranspFill;
09828             CloseProfileDialog (m_BiasGainGadget);      // cause fill type cannot be profiled!
09829             break;
09830 
09831         case (FGMENU_BITMAPTRANSP):
09832             Fill = new AttrBitmapTranspFill;
09833 
09834             Default = KernelBitmap::MakeKernelBitmap();
09835             if (Default == NULL)
09836             {
09837                 delete Fill;
09838                 return NULL;
09839             }
09840 
09841             Fill->AttachBitmap(Default);
09842             break;
09843 
09844         case (FGMENU_FRACTALTRANSP):
09845             Fill = new AttrFractalTranspFill;
09846             break;
09847 
09848         case (FGMENU_NOISETRANSP):
09849             Fill = new AttrNoiseTranspFill;
09850             break;
09851 
09852         default:
09853             // Er .. Dunno what kind of fill this is ?
09854             Fill = new AttrFlatTranspFill;
09855             break;
09856     }
09857 
09858     return Fill;
09859 }

MsgResult TranspInfoBarOp::Message Msg Message  )  [virtual]
 

Transpfill info bar dialog message handler.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94
Parameters:
Message,: The message to handle [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from InformationBarOp.

Definition at line 5903 of file filltool.cpp.

05904 {
05905     if (!TranspTool::IsCurrentTool() || !IsVisible())
05906         return (InformationBarOp::Message(Message));
05907 
05908     if (IS_OUR_DIALOG_MSG(Message))
05909     {
05910         DialogMsg* Msg = (DialogMsg*)Message;
05911 
05912         // Check if the message is a CANCEL
05913         if (Msg->DlgMsg == DIM_CANCEL)
05914         {
05915             Close(); // Close the dialog 
05916         }
05917         else if (Msg->DlgMsg == DIM_CREATE)
05918         {
05919             // Initialise the controls 
05920             SliderDragged = FALSE;
05921             InitControls();
05922         }
05923         else
05924         {
05925             if (Msg->GadgetID == _R(IDC_GEOMETRY))
05926             {
05927                 switch (Msg->DlgMsg)
05928                 {
05929                     case DIM_SELECTION_CHANGED :
05930                     {
05931                         ShowCommonType (FALSE);     // specifying false means that this
05932                                                     // gets (but does not show) CurrentGeometryIndex
05933                         
05934                         // Someone selected a new Fill Geometry
05935                         INT32 Index;
05936                         GetValueIndex(_R(IDC_GEOMETRY),&Index);
05937 
05938                         // pointless doing all that work if the user has selected
05939                         // the currently applied transparency geometry ....
05940 
05941                         if (CurrentGeometryIndex != Index)
05942                         {
05943                             // Change the Fill Geometry Here
05944                             CurrentGeometryIndex = TransparencyGeometryMenu[Index].Geometry;
05945                             ChangeFillType();
05946                             EnableControls();
05947                         }
05948                     }
05949                     break;
05950 
05951                     default:
05952                         break;
05953                 }
05954             }
05955 
05956             else if (Msg->GadgetID == _R(IDC_TRANSPTYPE))
05957             {
05958                 switch (Msg->DlgMsg)
05959                 {
05960                     case DIM_SELECTION_CHANGED:
05961                     {
05962                         ShowCommonTranspType (FALSE);       // specifying false means that this
05963                                                             // gets (but does not show) CurrentTransTypeIndex
05964                         
05965                         // Someone selected a new Fill Mapping
05966                         INT32 Index;  
05967                         GetValueIndex (_R(IDC_TRANSPTYPE), &Index);
05968 
05969                         if (CurrentTransTypeIndex != Index)
05970                         {
05971                             if (Index >= 0 && Index < FTMENU_MAX)
05972                             {
05973                                 // Change the Fill Mapping Here
05974                                 CurrentTransTypeIndex = Index;
05975                                 EnableControls ();
05976                                 ChangeTranspType ();
05977                             }
05978                             else
05979                             {
05980                                 ShowInfo();
05981                             }
05982                         }
05983                     }
05984                     break;
05985 
05986                     default:
05987                         break;
05988                 }
05989             }
05990 
05991             else if (Msg->GadgetID == _R(IDC_MAPPING))
05992             {
05993                 switch (Msg->DlgMsg)
05994                 {
05995                     case DIM_SELECTION_CHANGED:
05996                     {
05997                         ShowCommonMapping (FALSE);  // specifying false means that this
05998                                                     // gets (but does not show) CurrentMappingIndex
05999                         
06000                         // Someone selected a new Fill Mapping
06001                         INT32 Index;  
06002                         GetValueIndex(_R(IDC_MAPPING),&Index);
06003 
06004                         if (CurrentMappingIndex != Index)
06005                         {
06006                             // Change the Fill Mapping Here
06007                             CurrentMappingIndex = Index;
06008                             ChangeFillMapping();
06009                         }
06010                     }
06011                     break;
06012 
06013                     default:
06014                         break;
06015                 }
06016             }
06017 
06018             else if (Msg->GadgetID == _R(IDC_BITMAPEFFECT))
06019             {
06020                 switch (Msg->DlgMsg)
06021                 {
06022                     case DIM_SELECTION_CHANGED:
06023                     {
06024                         // Someone selected a new bitmap Fill Effect
06025                         INT32 Index = m_oBitmapDropDown.GetSelected();
06026 
06027                         //if (CurrentBitmapIndex != Index)
06028                         //{
06029                             // Change the bitmap Fill Effect Here
06030                             INT32 OldBitmapIndex = CurrentBitmapIndex;
06031                         
06032                             CurrentBitmapIndex = Index;
06033                             
06034                             if (!ChangeBitmapName ())
06035                             {
06036                                 CurrentBitmapIndex = OldBitmapIndex;
06037                                 ShowInfo();
06038                             }
06039                         //}
06040                     }
06041                     break;                                                 
06042 
06043                     default:
06044                         break;
06045                 }
06046             }
06047 
06048             else if (Msg->GadgetID == _R(IDC_BIASGAIN))
06049             {
06050                 switch (Msg->DlgMsg)
06051                 {
06052                     case DIM_LFT_BN_CLICKED:
06053                         HandleProfileButtonClick (m_BiasGainGadget, _R(IDC_BIASGAIN));
06054                         break;
06055 
06056                     default:
06057                         ProfileSelectionChange( Msg, Msg->GadgetID );
06058                         break;
06059                 }
06060             }
06061 
06062             else if (Msg->GadgetID == _R(IDC_SELPOINT))
06063             {
06064                 switch (Msg->DlgMsg)
06065                 {
06066                     case DIM_SELECTION_CHANGED:
06067                     {
06068                         if (AttrFillGeometry::SelectionCount == 0)
06069                         {
06070                             if (Mode == BITMAPFILL || 
06071                                 Mode == FRACTALFILL ||
06072                                 Mode == NOISEFILL
06073                                 )
06074                             {
06075                                 ChangeDPI();
06076                             }
06077                         }
06078                     }
06079                     break;                                                 
06080 
06081                     default:
06082                         break;
06083                 }
06084             }
06085 
06086             else if (Msg->GadgetID == _R(IDC_SELCOLOUR))
06087             {
06088                 switch (Msg->DlgMsg)
06089                 {
06090                     case DIM_SELECTION_CHANGED:
06091                     {
06092                         //if (AttrFillGeometry::SelectionCount == 0)
06093                         //{
06094                         //  if (Mode == BITMAPFILL || 
06095                         //      Mode == FRACTALFILL || 
06096                         //      Mode == NOISEFILL ) 
06097                         //  {
06098                             //  ChangeTransparencyValue();
06099                         //  }
06100                         //}
06101 
06102                         if (Mode==FRACTALFILL && AttrFillGeometry::SelectionCount==0)
06103                         {
06104                             ChangeFractalGrain (TRUE);
06105                         }
06106                         else if (Mode==NOISEFILL && AttrFillGeometry::SelectionCount==0)
06107                         {
06108                             ChangeNoiseScale (TRUE);
06109                         }
06110                         else
06111                         {
06112                             ChangeTransparencyValue ();
06113                         }
06114                     }
06115                     break;
06116 
06117                     default:
06118                         break;
06119                 }
06120             }
06121 
06122             else if (Msg->GadgetID == _R(IDC_TRANSPSLIDE))
06123             {
06124                 switch (Msg->DlgMsg)
06125                 {
06126                     case DIM_SLIDER_POS_CHANGING:
06127                     {
06128                         GetApplication ()->LockOutControlHelp ();
06129                         // Find the current scrollers position
06130                         TCHAR Str[32];
06131                         BOOL Valid;
06132                         INT32 Result = GetLongGadgetValue(_R(IDC_TRANSPSLIDE), 0, SliderMax, 0, &Valid);
06133 
06134                         if (LastSliderPos == Result)
06135                             break;
06136 
06137                         double Grain = 1.0;
06138                         BOOL flag = TRUE;
06139 
06140                         if (AttrFillGeometry::SelectionCount == 0)
06141                         {
06142                             if (Mode == FRACTALFILL)
06143                             {
06144                                 Grain = GetDoubleGrain(Result); 
06145                                 flag = FALSE;
06146                             }
06147                             if (Mode == NOISEFILL)
06148                             {
06149                                 Grain = GetDoubleScale(Result);
06150                                 flag = FALSE;
06151                             }
06152 
06153                             if (!flag)
06154                             {
06155                                 if (Mode == FRACTALFILL)
06156                                 {
06157                                     camSnprintf(Str, 31, _T("%.1f"), Grain);
06158                                 }
06159                             }
06160                         }
06161 
06162                         if (flag)
06163                         {
06164                             double Transp = (double) Result;
06165                             //Result = ((SliderMax - Result) * 100) / SliderMax;
06166 
06167                             // Build the Percentage string and set it
06168                             //String_32 jcf(_R(IDS_PERCENT_FORMAT));
06169                             //wsprintf(Str, jcf, Result);
06170 
06171                             DisplayTransparencyPercentString ((double) Transp); // and display it
06172 
06173                             if (GetApplication()->FindSelection()->Count() <= 64)
06174                             {
06175                                 // Don't let transp get to Zero, or the 'Repeat'
06176                                 // op will get confused
06177                                 // if (Transp == 0) Transp = 1;
06178 
06179                                 AttributeManager::SendMessages = FALSE;
06180                                 SetTranspValue(static_cast<UINT32>(Transp), TRUE, !SliderDragged);
06181                             }
06182                         }
06183                         else
06184                         {
06185                             if (Mode == FRACTALFILL)
06186                             {
06187                                 String_32 PercentStr(Str);
06188                                 SetStringGadgetValue(_R(IDC_SELCOLOUR), PercentStr);
06189                             }
06190                             else    // MUST be NOISEFILL
06191                             {
06192                                 String_64 Str;
06193 
06194                                 Convert::DoubleToString( Grain, &Str, 1 );
06195         
06196                                 Str.MakePercent ((TCHAR*) Str);
06197 
06198                                 String_64 PercentStr(Str);
06199                                 SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
06200                             }
06201                         }
06202 
06203                         LastSliderPos = Result;
06204 
06205                         SliderDragged = TRUE;
06206                     }
06207                     break;
06208 
06209                     case DIM_SLIDER_POS_IDLE:
06210                     {
06211                         // Slider control generates an "IDLE" event after processing
06212                         // a run of WM_MOUSEWHEEL messages... Oh dear...
06213                         //if (SliderDragged)
06214                         {
06215                             GetApplication ()->LockOutControlHelp ();
06216                             // Find the current scrollers position
06217                             TCHAR Str[32];
06218                             BOOL Valid;
06219                             INT32 Result = GetLongGadgetValue(_R(IDC_TRANSPSLIDE), 0, SliderMax, 0, &Valid);
06220                             // if (LastSliderPos == Result)
06221                             //  break;
06222 
06223                             LastSliderPos = Result;
06224                         
06225                             double val = 1.0;
06226                             BOOL flag = TRUE;
06227 
06228                             if (AttrFillGeometry::SelectionCount == 0)
06229                             {
06230                                 if (Mode == FRACTALFILL)
06231                                 {
06232                                     val = GetDoubleGrain(Result);   
06233                                     flag = FALSE;
06234                                 }
06235                                 if (Mode == NOISEFILL)
06236                                 {
06237                                     val = GetDoubleScale(Result);
06238                                     flag = FALSE;
06239                                 }
06240 
06241                                 if (!flag)
06242                                 {
06243                                     if (Mode == FRACTALFILL)
06244                                     {
06245                                         camSnprintf(Str, 31, _T("%.1f"), val);
06246                                     }
06247                                 }
06248                             }
06249                             
06250                             if (flag)
06251                             {
06252                                 double Transp = (double) Result;
06253                                 //Result = ((SliderMax - Result) * 100) / SliderMax;
06254 
06255                                 // Build the Percentage string and set it
06256                                 //String_32 jcf(_R(IDS_PERCENT_FORMAT));
06257                                 //wsprintf(Str, jcf, Result);
06258 
06259                                 DisplayTransparencyPercentString ((double) Transp); // and display it
06260 
06261                                 if (GetApplication()->FindSelection()->Count() <= 64)
06262                                 {
06263                                     // Don't let transp get to Zero, or the 'Repeat'
06264                                     // op will get confused
06265                                     // if (Transp == 0) Transp = 1;
06266 
06267                                     AttributeManager::SendMessages = FALSE;
06268                                     // SetTranspValue(static_cast<UINT32>(Transp), TRUE);
06269                                     // Treat Idle events as SET events because of the way the damn Slider control handles mouse wheel events...
06270                                     SetTranspValue(static_cast<UINT32>(Transp));
06271                                     SliderDragged = FALSE;
06272                                 }
06273                             }
06274                             else
06275                             {
06276                                 if (Mode == FRACTALFILL)
06277                                 {
06278                                     String_32 PercentStr(Str);
06279                                     SetStringGadgetValue(_R(IDC_SELCOLOUR), PercentStr);
06280                                 }
06281                                 else    // MUST be NOISEFILL
06282                                 {
06283                                     String_64 Str;
06284 
06285                                     Convert::DoubleToString( val, &Str, 1 );
06286         
06287                                     Str.MakePercent ((TCHAR*) Str);
06288 
06289                                     String_64 PercentStr(Str);
06290                                     SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
06291                                 }
06292                             }
06293                         }
06294                     }
06295                     break;
06296 
06297                     case DIM_SLIDER_POS_SET:
06298                     {
06299                         // Find the current scrollers position
06300                         BOOL Valid;
06301                         INT32 Result = GetLongGadgetValue(_R(IDC_TRANSPSLIDE), 0, SliderMax, 0, &Valid);
06302                         LastSliderPos = Result;
06303 
06304                         Operation::SetQuickRender(FALSE);
06305 
06306                         // Tell the freehand tool about the new smoothness
06307                         if (Valid)
06308                         {
06309                             AttributeManager::SendMessages = TRUE;
06310 
06311                             if (Mode==FRACTALFILL && AttrFillGeometry::SelectionCount==0)
06312                                 ChangeFractalGrain();
06313                             else if (Mode==NOISEFILL && AttrFillGeometry::SelectionCount==0)
06314                                 ChangeNoiseScale();
06315                             else
06316                                 SetTranspValue(Result);
06317 
06318                             GetApplication ()->UnlockControlHelp ();
06319                         }
06320 
06321                         SliderDragged = FALSE;
06322                         break;
06323                     }
06324 
06325                     default:
06326                         break;
06327                 }
06328             }
06329     
06330         }
06331     }
06332 
06333     if (MESSAGE_IS_A(Message, SelChangingMsg) ||
06334         MESSAGE_IS_A(Message, CurrentAttrChangedMsg))
06335     {
06336         // The selection has changed in some way
06337 
06338         // Re-Count the number of selected fill control points
06339         AttrFillGeometry::SetSelectionCount(AttrFillGeometry::CountSelectionControlPoints());
06340 
06341         if (AttrFillGeometry::SelectionCount > 0)
06342         {
06343             TranspTool::EnableFillNudge();
06344         }
06345         else
06346         {
06347             TranspTool::DisableFillNudge();
06348         }
06349 
06350         HandleProfileSelChangingMsg (m_BiasGainGadget, _R(IDC_BIASGAIN));
06351 
06352         ShowInfo();
06353 /*
06354         SelChangingMsg* Msg = (SelChangingMsg*)Message;
06355         switch (Msg->State)
06356         {
06357             case SelChangingMsg::COLOURATTCHANGED:
06358                 // The colour of an attribute has changed
06359                 InitControls();
06360                 break;
06361 
06362             case SelChangingMsg::NONCOLOURATTCHANGED:
06363                 // The selection state or control points of an attribute have changed
06364                 InitControls();
06365                 break;
06366         }
06367 */
06368     }
06369     
06370     // Pass the message on
06371     return (InformationBarOp::Message(Message));
06372 }

void TranspInfoBarOp::ScanSelectionForControlPoints String_64 ,
INT32 * 
[private]
 

Definition at line 8280 of file filltool.cpp.

08281 {
08282     *PointString = _T("");
08283     *Transp = -1;
08284 
08285     // Find the first Fill Attribute in the selection
08286     AttrFillGeometry* pAttrNode;
08287     UINT32 count = Selection->Count();
08288 
08289     // Find the first Fill Attribute in the selection
08290     if (count == 0)
08291     {
08292         pAttrNode = GetCurrentGeometry();
08293     }
08294     else
08295     {
08296         pAttrNode = AttrFillGeometry::FindFirstSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08297     }
08298 
08299     AllowForceToSimpleMapping = TRUE;
08300 
08301     // Return if there aren't any
08302     if (pAttrNode == NULL)
08303     {
08304         (*PointString).Load(_R(IDS_FILLTOOL_NONE));
08305         *Transp = 0;
08306         return;
08307     }
08308     
08309     INT32 SelCount = 0;
08310     BOOL CommonTransp = TRUE;
08311     BOOL CommonPoint  = TRUE;
08312 
08313     BOOL AllFlat = TRUE;
08314     BOOL AnyNeedSimple = FALSE;
08315 
08316     while (pAttrNode != NULL)
08317     {
08318         if (AttrFillGeometry::FillSelectionCount() > 0)
08319         {
08320             if (!(pAttrNode->GetRuntimeClass() == CC_RUNTIME_CLASS(AttrFlatTranspFill)))
08321             {
08322                 // Get the selection state and colours of this fill
08323                 String_64 PointStr = GetSelectedPoint(pAttrNode);
08324                 UINT32 HandleTransp  = GetSelectedTransp(pAttrNode);
08325 
08326                 String_64 Str;
08327                 Str.Load(_R(IDS_FILLTOOL_NONE));
08328 
08329                 // Where there any points selected ?
08330                 if (PointStr != Str)
08331                 {
08332                     // Update and keep a count
08333                     *PointString = PointStr;
08334                     SelCount++;
08335 
08336                     if (*PointString == String_64(_T("")))
08337                         *PointString = PointStr;
08338 
08339                     if (*PointString != PointStr)
08340                         CommonPoint = FALSE;
08341 
08342                     if (*Transp == -1)
08343                         *Transp = HandleTransp;
08344 
08345                     if (*Transp != INT32(HandleTransp))
08346                         CommonTransp = FALSE;
08347     
08348                     AllFlat = FALSE;
08349                 }
08350             }
08351         }
08352         else 
08353         {
08354             if (pAttrNode->GetRuntimeClass() == CC_RUNTIME_CLASS(AttrFlatTranspFill))
08355             {
08356                 if ( !((pAttrNode->GetTranspType() == TT_Mix) && ((*pAttrNode->GetStartTransp()) == 0)) )
08357                 {
08358                     (*PointString).Load(_R(IDS_FILLTOOL_FLATTRANSP));
08359 
08360                     if (*Transp == -1)
08361                         *Transp = *pAttrNode->GetStartTransp();
08362 
08363                     if (*Transp != INT32(*pAttrNode->GetStartTransp()))
08364                         CommonTransp = FALSE;
08365 
08366                     SelCount++;
08367                 }
08368             }
08369             else
08370             {
08371                 if (SelCount > 0)
08372                     AllFlat = FALSE;
08373             }
08374         }
08375 
08376         // If this is a transp fill attribute and doesn't need simple mapping then set FALSE
08377         if (pAttrNode->IsATranspFill() && pAttrNode->NeedsForceToSimpleMapping())
08378             AnyNeedSimple = TRUE;
08379             
08380         // Check the next fill
08381         if (count > 0)
08382             pAttrNode = AttrFillGeometry::FindNextSelectedAttr(CC_RUNTIME_CLASS(AttrTranspFillGeometry));
08383         else
08384             pAttrNode = NULL;
08385     }
08386 
08387     if (AnyNeedSimple)
08388         AllowForceToSimpleMapping = FALSE;
08389 
08390     if (AttrFillGeometry::FillSelectionCount() == 0 && !AllFlat)
08391     {
08392         (*PointString).Load(_R(IDS_FILLTOOL_MANY));
08393     }
08394 
08395     if (SelCount == 0)
08396     {
08397         // Status indicating many points selected
08398         (*PointString).Load(_R(IDS_FILLTOOL_NONE));
08399     }
08400 
08401     // Was there more than one fill with points selected ?
08402     if (!CommonPoint)
08403     {
08404         // Status indicating many points selected
08405         (*PointString).Load(_R(IDS_FILLTOOL_MANY));
08406     }
08407 
08408     if (!CommonTransp)
08409     {
08410         *Transp = 0;
08411     }
08412 }

BOOL TranspInfoBarOp::SetGadgetString CGadgetID  Gadget,
StringBase StrValue
[private]
 

Set the string displayed by a Gadget. This version only updates the gadget if it has changed.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/5/95
See also:
-

Definition at line 6988 of file filltool.cpp.

06989 {
06990     if (Gadget == _R(IDC_EFFECT) && TypeDisabled)
06991         return TRUE;
06992 
06993     if (Gadget == _R(IDC_MAPPING) && MappingDisabled)
06994         return TRUE;
06995 
06996     if (GetStringGadgetValue(Gadget, NULL, -1) != *StrValue)
06997     {
06998         return SetStringGadgetValue(Gadget, *StrValue, FALSE, -1);
06999     }
07000 
07001     return TRUE;
07002 }

void TranspInfoBarOp::SetGadgetWritable INT32  ,
BOOL 
[private]
 

Definition at line 7886 of file filltool.cpp.

07887 {
07888     PORTNOTETRACE("other","TranspInfoBarOp::SetGadgetWritable disabled");
07889 #ifndef EXCLUDE_FROM_XARALX
07890     // Bodge code to try and make a gadget writable on the fly
07891     HWND gadget = ::GetDlgItem(WindowID, id);
07892     HWND hEdit = ::ChildWindowFromPoint(gadget, CPoint(1,1));
07893 
07894     if (hEdit)
07895         gadget = hEdit;
07896  
07897     if (enable)
07898         ::SendMessage(gadget, EM_SETREADONLY, FALSE, 0);
07899     else
07900         ::SendMessage(gadget, EM_SETREADONLY, TRUE, 0);
07901 #endif
07902 }

void TranspInfoBarOp::SetTranspValue UINT32  Transp,
BOOL  bIntermediateStep = FALSE,
BOOL  bFirstStep = FALSE
[private]
 

Called when a the transparency slider is changed.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/9/94

Definition at line 8841 of file filltool.cpp.

08842 {
08843 /*  AttrValueChange* NewTransp = new AttrTranspChange;
08844     if (NewTransp == NULL)
08845     {
08846         InformError();
08847         return;
08848     }
08849 
08850     NewTransp->SetStartTransp(&Transp);
08851 
08852     Operation::SetQuickRender(bIntermediateStep);
08853 
08854         AttributeManager::AttributeSelected(NULL, NewTransp, bIntermediateStep, bFirstStep);
08855 
08856     Operation::SetQuickRender(FALSE);
08857 */
08858 
08859     if (bFirstStep)
08860     {
08861         // ---------------------------------------------
08862         // Drag starting
08863         ERROR3IF(m_pAttrApplyOp!=NULL, "Why do we have a drag op already?\n");
08864         if (m_pAttrApplyOp==NULL)
08865         {
08866             m_pDragTransp = new AttrTranspChange;
08867             if (m_pDragTransp == NULL)
08868                 return;
08869 
08870             m_pDragTransp->SetStartTransp(&Transp);
08871 
08872             m_pAttrApplyOp = new OpApplyAttrInteractive;
08873             m_pAttrApplyOp->DoDragAttr(m_pDragTransp);              // Drag starting
08874             ERROR3IF(m_pAttrApplyOp!=Operation::GetCurrentDragOp(),
08875                      "DoDragAttr should have set itself as the current drag op");
08876         }
08877     }
08878     else if (bIntermediateStep)
08879     {
08880         // ---------------------------------------------
08881         // Drag running
08882         m_pDragTransp->SetStartTransp(&Transp);
08883 
08884         ERROR3IF(m_pAttrApplyOp==NULL, "Why don't we have a drag op yet?\n");
08885         if (m_pAttrApplyOp && m_pAttrApplyOp==Operation::GetCurrentDragOp())
08886             m_pAttrApplyOp->DragAttrChanged(m_pDragTransp);         // Drag running
08887 
08888     }
08889     else
08890     {
08891         // ---------------------------------------------
08892         // Drag ending (or single-click or too many objects to drag interactively)
08893         if (m_pAttrApplyOp==NULL)
08894         {
08895             m_pDragTransp = new AttrTranspChange;
08896             if (m_pDragTransp == NULL)
08897                 return;
08898 
08899             m_pDragTransp->SetStartTransp(&Transp);
08900 
08901             m_pAttrApplyOp = new OpApplyAttrInteractive;
08902             m_pAttrApplyOp->DoDragAttr(m_pDragTransp);              // Drag starting
08903         }
08904 
08905         m_pDragTransp->SetStartTransp(&Transp);
08906 
08907         ERROR3IF(m_pAttrApplyOp==NULL, "Why don't we have a drag op yet?\n");
08908         if (m_pAttrApplyOp)
08909             if (m_pAttrApplyOp==Operation::GetCurrentDragOp())
08910             {
08911                 m_pAttrApplyOp->DragAttrFinished(m_pDragTransp);        // Drag over
08912                 // Don't delete the op - it lives in the undo history now!
08913                 // delete m_pAttrApplyOp;
08914                 // But do release ownership so that we can start another one
08915                 m_pAttrApplyOp = NULL;
08916             }
08917             else
08918             {
08919                 // Drag op must have been cancelled and deleted already (because
08920                 // CurrentDragOp is NULL)
08921                 ShowInfo();                     // Update UI
08922                 m_pAttrApplyOp = NULL;          // Release invalid pointer
08923             }
08924 
08925         if (m_pDragTransp)
08926         {
08927             delete m_pDragTransp;
08928             m_pDragTransp = NULL;
08929         }
08930     }
08931 }

void TranspInfoBarOp::ShowBitmapInfo  ) 
 

Show info on a bitmap fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/94

Definition at line 7087 of file filltool.cpp.

07088 {
07089     if (OldMode != BITMAPFILL)
07090     {
07091         InitTesselate();
07092         InitTransType ();
07093 //      InitType();
07094         InitBitmapName();
07095 
07096         SetGadgetHelp(_R(IDC_TRANSPTYPE),   _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
07097         SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
07098         SetGadgetHelp(_R(IDC_BITMAPEFFECT), _R(IDBBL_FILLTOOL_BITMAPNAME),      _R(IDS_FILLTOOL_BITMAPNAME));
07099     }
07100 
07101     if (AttrFillGeometry::SelectionCount == 0)
07102     {
07103         SetGadgetWritable(_R(IDC_SELPOINT), TRUE);
07104         
07105         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_FILLTOOL_FRACTALRES),      _R(IDS_FILLTOOL_FRACTALRES));
07106         //SetGadgetHelp(_R(IDC_TRANSPSLIDE),    _R(IDBBL_TRANSPTOOL_GRAININESS),    _R(IDS_TRANSPTOOL_GRAININESS));
07107         //SetGadgetHelp(_R(IDC_SELCOLOUR),      _R(IDBBL_TRANSPTOOL_GRAININESS),    _R(IDS_TRANSPTOOL_GRAININESS));
07108         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07109         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07110 
07111         //EnableGadget (_R(IDC_TRANSPSLIDE), FALSE);
07112         //EnableGadget (_R(IDC_SELCOLOUR), FALSE);
07113     }
07114     else
07115     {
07116         SetGadgetWritable(_R(IDC_SELPOINT), FALSE);
07117         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
07118 
07119         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07120         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07121 
07122         SliderMax = 255;
07123     }
07124 
07125     SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
07126 
07127     ShowCommonTesselate();
07128     ShowCommonTranspType();
07129     ShowCommonBitmapName();
07130 
07131     if (AttrFillGeometry::SelectionCount == 0)
07132         ShowCommonBitmapDpi();
07133 
07134     ShowControlPointInfo();
07135 }

void TranspInfoBarOp::ShowCommonBitmapDpi  ) 
 

Show any Common Bitmap Dpi in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7859 of file filltool.cpp.

07860 {
07861     INT32 dpi = FindCommonBitmapDpi();
07862 
07863     TCHAR Str[16];
07864     String_64 DpiStr;
07865 
07866     if (dpi == 0)
07867     {
07868         DpiStr.Load(_R(IDS_FILLTOOL_NODPI));
07869     }
07870 
07871     else if (dpi == -1)
07872     {
07873         DpiStr.Load(_R(IDS_FILLTOOL_MANYDPI));
07874     }
07875 
07876     else if (dpi > 0)
07877     {
07878         String_256 jcf(_R(IDS_FILLTOOL_DPI_FORMAT));
07879         camSnprintf(Str, 15, jcf, (INT32) dpi);
07880         DpiStr = Str;
07881     }
07882 
07883     SetGadgetString(_R(IDC_SELPOINT), &DpiStr);
07884 }

void TranspInfoBarOp::ShowCommonBitmapName  ) 
 

Show any Common Bitmap Name in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7768 of file filltool.cpp.

07769 {
07770     String_64 strName = FindCommonBitmapName();
07771     m_oBitmapDropDown.SelectByLabel(strName);
07772 }

void TranspInfoBarOp::ShowCommonFractalGrain  ) 
 

Show any Common Fractal Graininess in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 8014 of file filltool.cpp.

08015 {
08016     double Grain = FindCommonFractalGrain();
08017 
08018     TCHAR Str[16];
08019     String_64 GrainStr;
08020 
08021     if (Grain == 0)
08022         GrainStr.Load(_R(IDS_FILLTOOL_NOGRAIN));
08023     if (Grain == -1)
08024         GrainStr.Load(_R(IDS_FILLTOOL_MANYGRAIN));
08025     if (Grain > 0)
08026     {
08027         camSnprintf(Str, 15, _T("%.1f"), Grain);
08028         GrainStr = Str;
08029     }
08030 
08031     INT32 GrainPos = GetGrainPos(Grain);
08032 
08033     SetGadgetString(_R(IDC_SELCOLOUR),&GrainStr);
08034     SetLongGadgetValue(_R(IDC_TRANSPSLIDE), GrainPos);
08035 
08036     // Build the Percentage string and set it
08037     camSnprintf(Str, 15, _T("%.1f"), Grain);
08038     String_8 PercentStr(Str);
08039     SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
08040 }

void TranspInfoBarOp::ShowCommonMapping BOOL  ShowDataAndNotSet = TRUE  ) 
 

Show any Common Fill Mapping in the selection.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com> (altered by Chris Snook)
Date:
22/8/96
Parameters:
if ShowDataAndNotSet is FALSE, then data members will be set (for controlling [INPUTS] menu selection logic) and data will not be shown in the relevant control.

Definition at line 7572 of file filltool.cpp.

07573 {
07574     String_64 Str;
07575 
07576     INT32 CommTess = FindCommonTesselate();
07577 
07578     switch (CommTess)
07579     {
07580         case -1:
07581             Str.Load(_R(IDS_FILLTOOL_MANY));
07582             CurrentMappingIndex = -2;//FMMENU_REPEATING;
07583             break;
07584 
07585         case 0:
07586             Str.Load(_R(IDS_FILLTOOL_NONE));
07587             CurrentMappingIndex = -1;//FMMENU_REPEATING;
07588             break;
07589 
07590         case 1:
07591             Str.Load(_R(IDS_FILLTOOL_MAPSIMPLE));
07592             CurrentMappingIndex = FMMENU_SIMPLE;
07593             break;
07594 
07595         case 2:
07596 //Mark Howitt, 14/10/97. Lets make sure repeating trans grad fills when set to 2 are actually simple!
07597 #ifdef NEW_FEATURES
07598             if(Mode == GRADFILL)
07599             {
07600                 Str.Load(_R(IDS_FILLTOOL_MAPSIMPLE));
07601                 CurrentMappingIndex = FMMENU_SIMPLE;
07602                 break;
07603             }
07604             else
07605             {
07606                 Str.Load(_R(IDS_FILLTOOL_MAPREPEAT));
07607                 CurrentMappingIndex = FMMENU_REPEATING;
07608                 break;
07609             }
07610         case 4:     // Must be a repeating trans grad fill!
07611 #endif
07612         case 3:
07613             Str.Load(_R(IDS_FILLTOOL_MAPREPEAT));
07614             CurrentMappingIndex = 2;//FMMENU_REPEATING;
07615             break;
07616     }
07617 
07618     if (ShowDataAndNotSet)
07619     {
07620         SetGadgetString(_R(IDC_MAPPING),&Str);
07621     }
07622 }

void TranspInfoBarOp::ShowCommonNoiseScale  ) 
 

Show any Common Fractal Graininess in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 8107 of file filltool.cpp.

08108 {
08109     double Scale = FindCommonNoiseScale();
08110 
08111     BOOL convert = FALSE;
08112 
08113     TCHAR Str[16];
08114     String_64 ScaleStr;
08115 
08116     if (Scale == 0)
08117     {
08118         ScaleStr.Load(_R(IDS_FILLTOOL_NOGRAIN));
08119     }
08120     if (Scale == -1)
08121     {
08122         ScaleStr.Load(_R(IDS_FILLTOOL_MANYGRAIN));
08123     }
08124     if (Scale > 0)
08125     {   
08126         camSnprintf(Str, 15, _T("%.1f"), Scale);
08127         ScaleStr = Str;
08128         convert = TRUE;
08129     }
08130 
08131     INT32 ScalePos = GetScalePos(Scale);
08132 
08133     SetGadgetString(_R(IDC_SELCOLOUR),&ScaleStr);
08134     SetLongGadgetValue(_R(IDC_TRANSPSLIDE), ScalePos);
08135 
08136     // Build the Percentage string and set it
08137 
08138     if (convert)
08139     {
08140         String_64 Str;
08141 
08142         Convert::DoubleToString( Scale, &Str, 1 );
08143         
08144         Str.MakePercent ((TCHAR*) Str);
08145 
08146         String_64 PercentStr(Str);
08147         SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
08148     }
08149     else
08150     {
08151     
08152         camSnprintf(Str, 15, _T("%.1f"), Scale);
08153         String_8 PercentStr(Str);
08154         SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);
08155     }
08156 }

void TranspInfoBarOp::ShowCommonTesselate  ) 
 

Show any Common Fill Tesselation in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/8/94

Definition at line 7634 of file filltool.cpp.

07635 {
07636     String_64 Str;
07637 
07638     INT32 CommTess = FindCommonTesselate();
07639 
07640     switch (CommTess)
07641     {
07642         case -1:
07643             Str.Load(_R(IDS_FILLTOOL_MANY));
07644             CurrentMappingIndex = FTMENU_REPEAT;
07645             break;
07646 
07647         case 0:
07648             Str.Load(_R(IDS_FILLTOOL_NONE));
07649             CurrentMappingIndex = FTMENU_REPEAT;
07650             break;
07651 
07652         case 1:
07653             Str.Load(_R(IDS_FILLTOOL_TESS_SIMPLE));
07654             CurrentMappingIndex = FTMENU_SIMPLE;
07655             break;
07656 
07657         case 2:
07658             Str.Load(_R(IDS_FILLTOOL_TESS_REPEAT));
07659             CurrentMappingIndex = FTMENU_REPEAT;
07660             break;
07661 
07662         case 3:
07663             Str.Load(_R(IDS_FILLTOOL_TESS_REPEATINV));
07664             CurrentMappingIndex = FTMENU_REPEATINV;
07665             break;
07666     }
07667 
07668     SetGadgetString(_R(IDC_MAPPING),&Str);
07669 //  SetStringGadgetValue(_R(IDC_MAPPING),&Str, FALSE, -1);
07670     EnableGadget(_R(IDC_MAPPING), TRUE);
07671 }

void TranspInfoBarOp::ShowCommonTranspType BOOL  ShowDataAndNotSet = TRUE  ) 
 

Show any Common Transparency type in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (ported to filltool by Chris Snook 11/10/99)
Date:
25/8/94
Parameters:
if ShowDataAndNotSet is FALSE, then data members will be set (for controlling [INPUTS] menu selection logic) and data will not be shown in the relevant control.

Definition at line 7430 of file filltool.cpp.

07431 {
07432     String_64 TStr;
07433     TStr.Load (_R(IDS_FILLTOOL_NONE));
07434 
07435     INT32 TType = FindCommonTranspType ();
07436     switch (TType)
07437     {
07438         case -1:
07439             TStr.Load(_R(IDS_FILLTOOL_MANY));
07440             CurrentTransTypeIndex = -2;
07441             break;
07442 
07443         case 0:
07444             TStr.Load(_R(IDS_FILLTOOL_NONE));
07445             CurrentTransTypeIndex = -1;
07446             break;
07447 
07448         case 1:
07449             TStr.Load(_R(IDS_FILLTOOL_PAINT));
07450             CurrentTransTypeIndex = FTMENU_REFLECT;
07451             break;
07452 
07453         case 2:
07454             TStr.Load(_R(IDS_FILLTOOL_STAIN));
07455             CurrentTransTypeIndex = FTMENU_SUB;
07456             break;
07457 
07458         case 3:
07459             TStr.Load(_R(IDS_FILLTOOL_BLEACH));
07460             CurrentTransTypeIndex = FTMENU_ADD;
07461             break;
07462 
07463         case 13:
07464             TStr.Load(_R(IDS_FILLTOOL_CONTRAST));
07465             CurrentTransTypeIndex = FTMENU_CON;
07466             break;
07467 
07468         case 16:
07469             TStr.Load(_R(IDS_FILLTOOL_SATURATE));
07470             CurrentTransTypeIndex = FTMENU_SAT;
07471             break;
07472 
07473         case 19:
07474             TStr.Load(_R(IDS_FILLTOOL_DARKEN));
07475             CurrentTransTypeIndex = FTMENU_DARK;
07476             break;
07477         
07478         case 22:
07479             TStr.Load(_R(IDS_FILLTOOL_LIGHTEN));
07480             CurrentTransTypeIndex = FTMENU_LIGHT;
07481             break;
07482 
07483         case 25:
07484             TStr.Load(_R(IDS_FILLTOOL_BRIGHTNESS));
07485             CurrentTransTypeIndex = FTMENU_BRI;
07486             break;
07487 
07488         case 28:
07489             TStr.Load(_R(IDS_FILLTOOL_LUMINOSITY));
07490             CurrentTransTypeIndex = FTMENU_LUM;
07491             break;
07492 
07493         case 31:
07494             TStr.Load(_R(IDS_FILLTOOL_HUE));
07495             CurrentTransTypeIndex = FTMENU_HUE;
07496             break;
07497     }
07498 
07499     if (ShowDataAndNotSet)
07500     {
07501         SetGadgetString(_R(IDC_TRANSPTYPE),&TStr);
07502     }
07503 }

void TranspInfoBarOp::ShowCommonType BOOL  ShowDataAndNotSet = TRUE  ) 
 

Show any Common Fill Type in the selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com> (altered by Chris Snook)
Date:
25/8/94
Parameters:
if ShowDataAndNotSet is FALSE, then data members will be set (for controlling [INPUTS] menu selection logic) and data will not be shown in the relevant control.

Definition at line 7264 of file filltool.cpp.

07265 {
07266     CommonAttr = SelRange::ATTR_NONE;
07267     String_64 Str;
07268     Str.Load(_R(IDS_FILLTOOL_NONE));
07269     String_64 TStr;
07270     TStr.Load(_R(IDS_FILLTOOL_NONE));
07271 
07272     if (Selection != NULL)
07273     {
07274         Document* pCurrentDoc = Document::GetCurrent();
07275         if (Document::GetSelected())
07276             Document::GetSelected()->SetCurrent();
07277 
07278 EffectsStack* pStack = Selection->GetEffectsStack();
07279 INT32 iStackPos = STACKPOS_TOP;
07280 Range* pLevel = pStack->GetLevelRange(&iStackPos, FALSE);       // Don't escape old controllers, apply attr to base nodes
07281         
07282         // Try and find a common Attribute within the selection.
07283         // All objects in the selection must have an Identical fill for this
07284         // to find anything.
07285 //      CommonAttr = Selection->FindCommonAttribute(CC_RUNTIME_CLASS(AttrTranspFillGeometry), 
07286 //                                                  (NodeAttribute**)&CommonGeometry);
07287         CommonAttr = pLevel->FindCommonAttribute(CC_RUNTIME_CLASS(AttrTranspFillGeometry), 
07288                                                     (NodeAttribute**)&CommonGeometry,
07289                                                     TRUE);
07290         CCRuntimeClass* GeometryType;
07291 
07292         // Try and find a common Attribute Type within the selection.
07293         // The fills need not be identical. Just of the same type.
07294 //      SelRange::CommonAttribResult CommonType = 
07295 //              Selection->FindCommonAttributeType(CC_RUNTIME_CLASS(AttrTranspFillGeometry), 
07296 //                                                  &GeometryType);
07297         SelRange::CommonAttribResult CommonType = 
07298                 pLevel->FindCommonAttributeType(CC_RUNTIME_CLASS(AttrTranspFillGeometry), 
07299                                                     &GeometryType,
07300                                                     FALSE,
07301                                                     TRUE);
07302 
07303         if (CommonAttr == SelRange::ATTR_NONE &&
07304             CommonGeometry != NULL)
07305         {
07306             CommonAttr = SelRange::ATTR_COMMON;
07307         }
07308 
07309         if (CommonType == SelRange::ATTR_NONE &&
07310             GeometryType != NULL)
07311         {
07312             CommonType = SelRange::ATTR_COMMON;
07313         }
07314     
07315         // Make the menu show any Common Fill Type
07316         // or failing that, 'None' or 'Many'.
07317         if (CommonType == SelRange::ATTR_COMMON)
07318         {   
07319             if (GeometryType == CC_RUNTIME_CLASS(AttrFlatTranspFill))
07320             {
07321                 Str.Load(_R(IDS_FILLTOOL_FLATTRANSP));
07322                 Mode = FLATFILL;
07323                 CurrentGeometryIndex = FGMENU_FLATTRANSP;
07324 
07325                 if (CommonAttr == SelRange::ATTR_COMMON)
07326                 {
07327                     if ( (CommonGeometry->GetTranspType() == TT_Mix) && ((*CommonGeometry->GetStartTransp()) == 0) )
07328                     {
07329                         Str.Load(_R(IDS_FILLTOOL_NONE));
07330                         Mode = NOFILL;
07331                         CurrentGeometryIndex = 0;
07332                     }
07333                 }
07334             }
07335             else if (GeometryType == CC_RUNTIME_CLASS(AttrLinearTranspFill))
07336             {
07337                 Str.Load(_R(IDS_FILLTOOL_LINEAR));
07338                 Mode = GRADFILL;
07339                 CurrentGeometryIndex = FGMENU_LINEARTRANSP;
07340             }
07341             else if (GeometryType == CC_RUNTIME_CLASS(AttrCircularTranspFill))
07342             {
07343                 Str.Load(_R(IDS_FILLTOOL_CIRCULAR));
07344                 Mode = GRADFILL;
07345                 CurrentGeometryIndex = FGMENU_CIRCULARTRANSP;
07346             }
07347             else if (GeometryType == CC_RUNTIME_CLASS(AttrRadialTranspFill))
07348             {
07349                 Str.Load(_R(IDS_FILLTOOL_ELLIPTICAL));
07350                 Mode = GRADFILL;
07351                 CurrentGeometryIndex = FGMENU_RADIALTRANSP;
07352             }
07353             else if (GeometryType == CC_RUNTIME_CLASS(AttrConicalTranspFill))
07354             {
07355                 Str.Load(_R(IDS_FILLTOOL_CONICAL));
07356                 Mode = GRADFILL;
07357                 CurrentGeometryIndex = FGMENU_CONICALTRANSP;
07358             }
07359             else if (GeometryType == CC_RUNTIME_CLASS(AttrSquareTranspFill))
07360             {
07361                 Str.Load(_R(IDS_FILLTOOL_SQUARE));
07362                 Mode = GRADFILL;
07363                 CurrentGeometryIndex = FGMENU_SQUARETRANSP;
07364             }
07365             else if (GeometryType == CC_RUNTIME_CLASS(AttrThreeColTranspFill))
07366             {
07367                 Str.Load(_R(IDS_FILLTOOL_THREECOLTRANS));
07368                 Mode = GRADREPEATFILL;
07369                 CurrentGeometryIndex = FGMENU_THREECOLTRANSP;
07370             }
07371             else if (GeometryType == CC_RUNTIME_CLASS(AttrFourColTranspFill))
07372             {
07373                 Str.Load(_R(IDS_FILLTOOL_FOURCOLTRANS));
07374                 Mode = GRADREPEATFILL;
07375                 CurrentGeometryIndex = FGMENU_FOURCOLTRANSP;
07376             }
07377             else if (GeometryType == CC_RUNTIME_CLASS(AttrBitmapTranspFill))
07378             {
07379                 Str.Load(_R(IDS_FILLTOOL_TEXTURE));
07380                 Mode = BITMAPFILL;
07381                 CurrentGeometryIndex = FGMENU_BITMAPTRANSP;
07382             }
07383             else if (GeometryType == CC_RUNTIME_CLASS(AttrFractalTranspFill))
07384             {
07385                 Str.Load(_R(IDS_FILLTOOL_FRACTAL));
07386                 Mode = FRACTALFILL;
07387                 CurrentGeometryIndex = FGMENU_FRACTALTRANSP;
07388             }
07389             else if (GeometryType == CC_RUNTIME_CLASS(AttrNoiseTranspFill))
07390             {
07391                 Str.Load(_R(IDS_FILLTOOL_NOISE));
07392                 Mode = NOISEFILL;
07393                 CurrentGeometryIndex = FGMENU_NOISETRANSP;
07394             }
07395         }
07396         else
07397         {
07398             if (CommonAttr == SelRange::ATTR_MANY)
07399             {
07400                 // There are many different types of fill selected
07401                 Str.Load(_R(IDS_FILLTOOL_MANY));
07402                 Mode = MANYFILLS;
07403                 CurrentGeometryIndex = FGMENU_MANYTRANSP;
07404             }
07405         }
07406 
07407         if (pCurrentDoc)
07408             pCurrentDoc->SetCurrent();
07409     }
07410 
07411     // Update the Menus
07412     if (ShowDataAndNotSet)
07413     {
07414         SetGadgetString(_R(IDC_GEOMETRY),&Str);
07415     }
07416 }

void TranspInfoBarOp::ShowControlPointInfo  ) 
 

Show Info about selected control points.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/94

Definition at line 8223 of file filltool.cpp.

08224 {   
08225     String_64 PointStr;
08226     INT32 Transp;
08227 
08228     // Look though the selection for any selected control points
08229     ScanSelectionForControlPoints(&PointStr, &Transp);
08230 
08231     // PointStr and ColourStr will be updated if we find any
08232 
08233     if (Transp > 255) Transp = 255;
08234     if (Transp < 0)   Transp = 0;
08235 
08236     // Show the selected control points state
08237     if ((Mode != BITMAPFILL && 
08238          Mode != FRACTALFILL &&
08239          Mode != NOISEFILL) ||  AttrFillGeometry::SelectionCount > 0)
08240     {   
08241         SetGadgetString(_R(IDC_SELPOINT), &PointStr);
08242     }
08243 
08244     //TRACEUSER( "Chris", _T("Set slider to Trans = %d\n"), Transp);
08245     SetLongGadgetValue(_R(IDC_TRANSPSLIDE), Transp);
08246     //double TempNewVal = ((double) Transp * 100) / (double) SliderMax;
08247     DisplayTransparencyPercentString ((double) Transp); // and display it
08248 
08249     //INT32 Percent = (Transp * 100) / SliderMax;
08250     //String_64 Str;
08251 
08252     /*double TempNewVal = ((double) Transp * 100) / (double) SliderMax;
08253     String_64 Str;
08254 
08255     Convert::DoubleToString( TempNewVal, &Str, 1 );
08256 
08257     if (Str.FindNextChar ((TCHAR) '.') == -1)
08258     {
08259         // need to wack a .0 in ....
08260 
08261         Str += ".0";
08262     }
08263     
08264     Str.MakePercent ((TCHAR*) Str);
08265 
08266     String_64 PercentStr(Str);
08267     SetGadgetString(_R(IDC_SELCOLOUR), &PercentStr);*/
08268 }

void TranspInfoBarOp::ShowFlatInfo  ) 
 

Show info on a flat fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/94

Definition at line 7014 of file filltool.cpp.

07015 {
07016     if (OldMode != FLATFILL && OldMode != NOFILL)
07017     {
07018         InitTransType ();
07019         InitTesselate();
07020 //      InitType();
07021 
07022         SetGadgetHelp(_R(IDC_TRANSPTYPE),   _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
07023         SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
07024         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
07025         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07026         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07027 
07028         // Reset the slider back to its proper range as if we have been using the fractal fill
07029         // the the slider range will be large and we will always set 0 tranasparency i.e.
07030         // dragging the slider always gives 0
07031         SliderMax = 255;
07032         SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
07033     }
07034 
07035     ShowCommonTesselate();
07036     ShowCommonTranspType();
07037     ShowControlPointInfo();
07038 }

void TranspInfoBarOp::ShowFractalInfo  ) 
 

Show info on a fractal transparency.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/94

Definition at line 7205 of file filltool.cpp.

07206 {
07207     if (OldMode != FRACTALFILL)
07208     {
07209         InitTransType ();
07210         InitTesselate();
07211 //      InitType();
07212 
07213         //SetGadgetHelp(_R(IDC_TRANSPTYPE),     _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
07214         SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
07215     }
07216 
07217     if (AttrFillGeometry::SelectionCount == 0)
07218     {
07219         SetGadgetWritable(_R(IDC_SELPOINT), TRUE);
07220         
07221         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_FILLTOOL_FRACTALRES),      _R(IDS_FILLTOOL_FRACTALRES));
07222         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_GRAININESS),    _R(IDS_TRANSPTOOL_GRAININESS));
07223         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_GRAININESS),    _R(IDS_TRANSPTOOL_GRAININESS));
07224 
07225         SliderMax = GetGrainPosMax();
07226     }
07227     else
07228     {
07229         SetGadgetWritable(_R(IDC_SELPOINT), FALSE);
07230 
07231         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
07232         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07233         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07234 
07235         SliderMax = 255;
07236     }
07237 
07238     SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
07239 
07240     ShowCommonTesselate();
07241     ShowCommonTranspType();
07242 
07243     if (AttrFillGeometry::SelectionCount == 0)
07244     {
07245         ShowCommonBitmapDpi();
07246         ShowCommonFractalGrain();
07247     }
07248     else
07249         ShowControlPointInfo();
07250 }

void TranspInfoBarOp::ShowGraduatedInfo  ) 
 

Show info on a graduated fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/94

Definition at line 7050 of file filltool.cpp.

07051 {
07052     if (OldMode != GRADFILL && OldMode != GRADREPEATFILL)
07053     {
07054         InitTransType ();
07055         InitMapping();
07056 //      InitType();
07057 
07058         SetGadgetHelp(_R(IDC_TRANSPTYPE),   _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
07059         SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
07060         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
07061         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07062         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07063 
07064         // Reset the slider back to its proper range as if we have been using the fractal fill
07065         // the the slider range will be large and we will always set 0 tranasparency i.e.
07066         // dragging the slider always gives 0
07067         SliderMax = 255;
07068         SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
07069     }
07070 
07071     ShowCommonMapping();
07072     ShowCommonTranspType();
07073     ShowControlPointInfo();
07074 }

void TranspInfoBarOp::ShowInfo  ) 
 

Show Transparency Info on the current selection.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/5/95
See also:
-

Definition at line 6709 of file filltool.cpp.

06710 {
06711     // Don't do anything if the Info bar isn't displayed
06712     if (!TranspTool::IsCurrentTool() || !IsVisible()) return;
06713 
06714     // Now have a look at the selected objects
06715     Selection = GetApplication()->FindSelection();
06716 
06717     // Re-Count the number of selected fill control points
06718     AttrFillGeometry::SetSelectionCount(AttrFillGeometry::CountSelectionControlPoints());
06719 
06720     OldMode = Mode;
06721 
06722     ShowCommonType();
06723 
06724     // Now show different info depending on the type ...
06725     // (Well we will do eventually)
06726 
06727     switch (Mode)
06728     {
06729         case NOFILL:
06730             ShowFlatInfo();
06731             break;
06732 
06733         case FLATFILL:
06734             ShowFlatInfo();
06735             break;
06736 
06737         case GRADFILL:
06738         case GRADREPEATFILL:
06739             ShowGraduatedInfo();
06740             break;
06741 
06742         case BITMAPFILL:
06743             ShowBitmapInfo();
06744             break;
06745 
06746         case FRACTALFILL:
06747             ShowFractalInfo();
06748             break;
06749 
06750         case NOISEFILL:
06751             ShowNoiseInfo();
06752             break;
06753 
06754         default:
06755             ShowGraduatedInfo();
06756             break;
06757     }
06758 
06759     EnableControls();
06760 }

void TranspInfoBarOp::ShowNoiseInfo  ) 
 

Show info on a noise transparency.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/10/94

Definition at line 7148 of file filltool.cpp.

07149 {
07150     if (OldMode != NOISEFILL)
07151     {
07152         InitTransType ();
07153         InitTesselate();
07154         //InitType();
07155 
07156         SetGadgetHelp(_R(IDC_TRANSPTYPE),   _R(IDBBL_TRANSPTOOL_TRANSPTYPE),    _R(IDS_TRANSPTOOL_TRANSPTYPE));
07157         SetGadgetHelp(_R(IDC_MAPPING),      _R(IDBBL_TRANSPTOOL_TRANSPTILING),  _R(IDS_TRANSPTOOL_TRANSPTILING));
07158     }
07159 
07160     if (AttrFillGeometry::SelectionCount == 0)
07161     {
07162         SetGadgetWritable(_R(IDC_SELPOINT), TRUE);
07163 
07164         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_FILLTOOL_FRACTALRES),      _R(IDS_FILLTOOL_FRACTALRES));
07165         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_NOISESCALE),    _R(IDS_TRANSPTOOL_NOISESCALE));
07166         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_NOISESCALE),    _R(IDS_TRANSPTOOL_NOISESCALE));
07167 
07168         SliderMax = GetScalePosMax();
07169     }
07170     else
07171     {
07172         SetGadgetWritable(_R(IDC_SELPOINT), FALSE);
07173 
07174         SetGadgetHelp(_R(IDC_SELPOINT),     _R(IDBBL_TRANSPTOOL_TRANSPHANDLE),  _R(IDS_TRANSPTOOL_TRANSPHANDLE));
07175         SetGadgetHelp(_R(IDC_TRANSPSLIDE),  _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07176         SetGadgetHelp(_R(IDC_SELCOLOUR),    _R(IDBBL_TRANSPTOOL_TRANSP),        _R(IDS_TRANSPTOOL_TRANSP));
07177         
07178         SliderMax = 255;
07179     }
07180 
07181     SetGadgetRange(_R(IDC_TRANSPSLIDE), 0, SliderMax, 1);
07182 
07183     ShowCommonTesselate();
07184     ShowCommonTranspType();
07185 
07186     if (AttrFillGeometry::SelectionCount == 0)
07187     {
07188         ShowCommonBitmapDpi();
07189         ShowCommonNoiseScale();
07190     }
07191     else
07192         ShowControlPointInfo();
07193 }

void TranspInfoBarOp::UpdateBrushAttributes  )  [private]
 

Called when a new transparency is selected. This function goes through all brush attributes in the selection and tells them to use the local transparency rather than their cached one.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/2000

Definition at line 9138 of file filltool.cpp.

09139 {
09140     List BrushList;
09141 //  BevelTools::BuildListOfSelectedNodes(&BrushList, CC_RUNTIME_CLASS(AttrBrushType));
09142     FillTools::GetSelectedAttrList(&BrushList, CC_RUNTIME_CLASS(AttrBrushType), FALSE, FALSE);
09143 
09144     NodeListItem* pItem = (NodeListItem*)BrushList.GetHead();
09145     AttrBrushType* pAttrBrush = NULL;
09146     while (pItem != NULL)
09147     {
09148         pAttrBrush = (AttrBrushType*)(pItem->pNode);
09149         if (pAttrBrush != NULL)
09150             pAttrBrush->SetUseLocalTransp(TRUE);
09151 
09152         pItem = (NodeListItem*)BrushList.GetNext(pItem);
09153     }
09154 
09155     BrushList.DeleteAll();
09156 }


Member Data Documentation

BOOL TranspInfoBarOp::AllowForceToSimpleMapping [private]
 

Definition at line 676 of file filltool.h.

BOOL TranspInfoBarOp::BitmapListChanged [private]
 

Definition at line 672 of file filltool.h.

SelRange::CommonAttribResult TranspInfoBarOp::CommonAttr
 

Definition at line 665 of file filltool.h.

SelRange::CommonAttribResult TranspInfoBarOp::CommonAttrMap
 

Definition at line 666 of file filltool.h.

AttrFillGeometry* TranspInfoBarOp::CommonGeometry [private]
 

Definition at line 678 of file filltool.h.

AttrFillMapping* TranspInfoBarOp::CommonMapping [private]
 

Definition at line 679 of file filltool.h.

INT32 TranspInfoBarOp::CurrentBitmapIndex [static]
 

Definition at line 662 of file filltool.h.

INT32 TranspInfoBarOp::CurrentGeometryIndex [static]
 

Definition at line 656 of file filltool.h.

INT32 TranspInfoBarOp::CurrentMappingIndex [static]
 

Definition at line 658 of file filltool.h.

INT32 TranspInfoBarOp::CurrentTesselateIndex [static]
 

Definition at line 661 of file filltool.h.

INT32 TranspInfoBarOp::CurrentTransTypeIndex [static]
 

Definition at line 657 of file filltool.h.

INT32 TranspInfoBarOp::CurrentTypeIndex [static]
 

Definition at line 659 of file filltool.h.

INT32 TranspInfoBarOp::LastSliderPos [private]
 

Definition at line 688 of file filltool.h.

CBiasGainGadget TranspInfoBarOp::m_BiasGainGadget
 

Definition at line 694 of file filltool.h.

CBitmapGridDropDown TranspInfoBarOp::m_oBitmapDropDown
 

Definition at line 695 of file filltool.h.

OpApplyAttrInteractive* TranspInfoBarOp::m_pAttrApplyOp [private]
 

Definition at line 690 of file filltool.h.

AttrValueChange* TranspInfoBarOp::m_pDragTransp [private]
 

Definition at line 691 of file filltool.h.

BOOL TranspInfoBarOp::MappingDisabled [private]
 

Definition at line 674 of file filltool.h.

FillMode TranspInfoBarOp::Mode [private]
 

Definition at line 669 of file filltool.h.

FillMode TranspInfoBarOp::OldMode [private]
 

Definition at line 670 of file filltool.h.

SelRange* TranspInfoBarOp::Selection
 

Definition at line 664 of file filltool.h.

INT32 TranspInfoBarOp::SelGeometryIndex [private]
 

Definition at line 681 of file filltool.h.

INT32 TranspInfoBarOp::SelMappingIndex [private]
 

Definition at line 682 of file filltool.h.

INT32 TranspInfoBarOp::SelTypeIndex [private]
 

Definition at line 683 of file filltool.h.

BOOL TranspInfoBarOp::SliderDragged [private]
 

Definition at line 685 of file filltool.h.

INT32 TranspInfoBarOp::SliderMax [private]
 

Definition at line 686 of file filltool.h.

BOOL TranspInfoBarOp::TypeDisabled [private]
 

Definition at line 675 of file filltool.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:26 2007 for Camelot by  doxygen 1.4.4