#include <brushdlg.h>
Inheritance diagram for CBrushEditDlg:
Public Member Functions | |
CBrushEditDlg () | |
Default constructor for CBrushEditDlg. | |
~CBrushEditDlg () | |
Destructor. | |
void | Do (OpDescriptor *) |
launches the brush edit dialog, this method will determine which brush it is editing from the document selection. | |
void | DoWithParam (OpDescriptor *, OpParam *OwningGadgetParams) |
launches the brush edit dialog, however this the BrushData to initialise the dialog is provided through the opparam. Note: I don't think that we use this method anymore. | |
virtual MsgResult | Message (Msg *) |
Message proc for this dialog. | |
void | CreateNewBrush () |
void | HandleBrushEditSpacingMsg (DialogMsg *Msg) |
Subhandler for messages from the spacing tab, except for the edit box and sliders, which have their own handlers. | |
void | HandleBrushEditOffsetMsg (DialogMsg *Msg) |
Subhandler for messages from the offset tab, except for the edit box and sliders, which have their own handlers. | |
void | HandleBrushEditScalingMsg (DialogMsg *Msg) |
Subhandler for messages from the scaling tab, except for the edit box and sliders, which have their own handlers. | |
void | HandleBrushEditEffectMsg (DialogMsg *Msg) |
Subhandler for messages from the rotation tab, except for the edit box and sliders, which have their own handlers. | |
void | HandleBrushEditSequenceMsg (DialogMsg *Msg) |
Subhandler for messages from the transparency tab, except for the edit box and sliders, which have their own handlers. | |
void | HandleBrushFillMsg (DialogMsg *Msg) |
Subhandler for messages from the fill tab, except for the edit box and sliders, which have their own handlers. | |
void | InvokeVia (CBrushGadget &pInvokeWith, BrushData *pInvokeOn, AttrBrushType *pBrush, BOOL &bMany) |
I'm not entirely sure what this does, perhaps Chris will be able to elaborate, I think they were once used as part of launching the dialog, but I think they are no longer used. | |
void | InvokeVia (CBrushGadget &pInvokeWith, BrushData *pInvokeOn, AttrBrushType *pBrush, AttrBrushType *pOrigBrush, BOOL &bMany) |
void | InvokeVia (CBrushGadget &pInvokeWith, BrushHandle Handle) |
virtual BOOL | RegisterYourPagesInOrderPlease () |
This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear. | |
void | ReInitialiseDialog (BrushData *pData) |
void | SetDialogTitle (String_256 Title) |
Static Public Member Functions | |
static BOOL | Init () |
the init function to register us as an Op | |
static OpState | GetState (String_256 *, OpDescriptor *) |
Determines whether or not we can launch this op. We are allowed to launch in the following circumstances:
| |
static AttrBrushType * | GetSingleSelectedBrushAttribute () |
Static Public Attributes | |
static const UINT32 | IDD = _R(IDD_BRUSHEDIT) |
static const CDlgMode | Mode = MODELESS |
Private Member Functions | |
void | HideShuffleIrrelevantButtons () |
Because CPropertySheets only let you have an OK, Apply,Cancel, and Help button, we must rename these for our own devious ends and swap their positions. | |
void | InitBrushSpacing (BOOL OnlyForUnitChange=FALSE) |
void | InitBrushOffset (BOOL OnlyForUnitChange=FALSE) |
void | InitBrushScaling (BOOL OnlyForUnitChange=FALSE) |
void | InitBrushEffects (BOOL OnlyForUnitChange=FALSE) |
void | InitBrushSequence (BOOL OnlyForUnitChange=FALSE) |
void | InitBrushFill (BOOL OnlyForUnitChange=FALSE) |
void | ReInitBrushSpacing () |
void | ReInitBrushOffset () |
void | ReInitBrushScaling () |
void | ReInitBrushEffects () |
void | ReInitBrushSequence () |
void | ReInitBrushFill () |
void | ReInitUnitDependantFields (CDlgResID ThePage) |
void | InitComboPathOffsetType () |
void | InitSequenceType () |
void | HandleCommit (DialogMsg *Msg) |
void | HandleSelectionChange (DialogMsg *Msg) |
void | HandleButtonDown (DialogMsg *Msg) |
void | HandleSliderPosChanging (DialogMsg *Msg) |
void | HandleSliderPosSet (DialogMsg *Msg) |
void | ReadButtons (DialogMsg *Msg) |
void | ReadRadios (DialogMsg *Msg) |
void | ReadEditBox (DialogMsg *Msg) |
void | ReadComboBox (DialogMsg *Msg) |
void | ReadCheckBox (DialogMsg *Msg) |
void | ReadSlider (DialogMsg *Msg) |
void | WriteSliders (DialogMsg *Msg) |
void | UpdateEditBox (CGadgetID GadgetToUpdate) |
void | LaunchOp () |
UINT32 | GetNewRandomNumber (UINT32 OldNumber) |
void | ReInitPage (CDlgResID PageID) |
BOOL | GetAttributeNodeFromDefinition () |
void | HandleDocSelectionChange () |
void | RefreshActivePage () |
void | GetSpacingRange (double *, double *) |
void | SetSpacingSlider () |
void | SetSpacingIncrSlider () |
void | SetOffsetValSlider () |
void | GetOffsetRange (double *, double *) |
MILLIPOINT | GetSideOfBoundingBox (RectSideInfo RectInfo) |
double | GetDistanceAsPercentageOfBBox (MILLIPOINT Distance, RectSideInfo RectInfo) |
MILLIPOINT | GetPercentageAsDistance (double Percent, RectSideInfo RectInfo) |
void | ChangeButtonText () |
Because CPropertySheets only let you have an OK, Apply,Cancel, and Help button, we must rename these for our own devious ends. | |
void | SetRandomRangeText (CGadgetID SliderID) |
String_32 | GetRandomRangeText (INT32 SliderVal) |
String_32 | GetRotationRandomText (INT32 SliderVal) |
String_32 | GetRandomText (INT32 Value, INT32 MaxValue) |
virtual BOOL | AddControlsToHelper () |
We need to subclass our edit box controls so we're adding them to the helper here. | |
virtual void | RemoveControlsFromHelper () |
removing the edit controls from the helper | |
Private Attributes | |
CBrushGadget * | m_pOwningGadget |
CGadgetID | Id_m |
BrushData * | OriginalData |
BrushData * | EditData |
BrushData | m_LastData |
BrushHandle | m_Handle |
AttrBrushType * | pAttrBrush_m |
AttrBrushType * | pOrigAttrBrush_m |
ChangeBrushType | ChangeType_m |
ChangeBrushOpParam | ChangeParam_m |
BOOL | FirstTime |
BOOL | EditingBrushDef |
BOOL | m_bDisableOps |
RenderPreviewType | RenderType |
DocUnitList * | pDocUnitList |
UnitType | CurrentUserUnitType |
BOOL | m_bDisableGadgets |
BOOL | m_bPreventUpdateSet |
BOOL | m_SliderStarted |
BOOL | UsingRandomSpacing |
BOOL | UsingRandomOffset |
BOOL | UsingRandomScaling |
CGadgetID | EditGadgetLostFocus |
Static Private Attributes | |
static BOOL | m_bIsOpen = FALSE |
Definition at line 112 of file brushdlg.h.
|
Default constructor for CBrushEditDlg.
Definition at line 220 of file brushdlg.cpp. 00221 : DialogTabOp/*DialogOp*/( CBrushEditDlg::IDD, CBrushEditDlg::Mode ) 00222 { 00223 FirstTime = TRUE; 00224 00225 EditingBrushDef = FALSE; 00226 00227 m_Handle = BrushHandle_NoBrush; 00228 00229 RenderType = RT_LINE; 00230 00231 pDocUnitList = NULL; 00232 CurrentUserUnitType = NOTYPE; 00233 00234 UsingRandomSpacing = FALSE; 00235 UsingRandomOffset = FALSE; 00236 UsingRandomScaling = FALSE; 00237 00238 EditGadgetLostFocus = 0; 00239 00240 pAttrBrush_m = NULL; 00241 }
|
|
Destructor.
Definition at line 260 of file brushdlg.cpp. 00261 { 00262 if (OriginalData != NULL) 00263 delete (OriginalData); 00264 if (EditData != NULL) 00265 delete (EditData); 00266 }
|
|
We need to subclass our edit box controls so we're adding them to the helper here.
Reimplemented from DialogOp. Definition at line 557 of file brushdlg.cpp. 00558 { 00559 // basically we just add 'em in one by one 00560 BOOL ok = AddDialogControlToHelper(_R(IDC_EDITBRUSHSPACING), _R(IDD_BRUSHEDITSPACING)); 00561 // if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITBRUSHSPACINGINCRCONST), _R(IDD_BRUSHEDITSPACING)); 00562 if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITPATHOFFSETVALUE), _R(IDD_BRUSHEDITOFFSET)); 00563 // if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITPATHOFFSETINCRCONST), _R(IDD_BRUSHEDITOFFSET)); 00564 // if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITSCALINGINCRCONST), _R(IDD_BRUSHEDITSCALING)); 00565 if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITROTATEANGLE), _R(IDD_BRUSHEDITEFFECTS)); 00566 if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITROTATEANGLEINCR), _R(IDD_BRUSHEDITEFFECTS)); 00567 if (ok) ok = AddDialogControlToHelper(_R(IDC_EDITBRUSHTRANSP), _R(IDD_BRUSHEDITSEQUENCE)); 00568 00569 return ok; 00570 }
|
|
Because CPropertySheets only let you have an OK, Apply,Cancel, and Help button, we must rename these for our own devious ends.
Definition at line 1276 of file brushdlg.cpp. 01277 { 01278 SetStringGadgetValue(_R(ID_CANCEL), _R(IDS_BRUSH_CLOSEDLG)); 01279 SetStringGadgetValue(_R(ID_APPLY_NOW), _R(IDS_BRUSH_SAVE)); 01280 SetStringGadgetValue(_R(IDOK), _R(IDS_BRUSH_SAVE_AS)); 01281 }
|
|
Definition at line 3417 of file brushdlg.cpp. 03418 { 03419 // as we are basically making a copy of an existing definition we can use the nodetree 03420 // of the existing definition, so we need to obtain a pointer to it. 03421 BrushHandle ThisHandle = EditData->m_BrushHandle; 03422 03423 // get the brush component from the document 03424 Document* pDoc = Document::GetCurrent(); 03425 if (pDoc == NULL) 03426 { 03427 ERROR3("Document is NULL in CBrushEditDlg::BrushEditDlgOnOK"); 03428 return; 03429 } 03430 03431 BrushComponent* pBrushComp = (BrushComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(BrushComponent)); 03432 if (pBrushComp == NULL) 03433 { 03434 ERROR3("Brush component is null in CBrushEditDlg::BrushEditDlgOnOK"); 03435 return; 03436 } 03437 03438 BrushDefinition* pBrushDef = pBrushComp->FindBrushDefinition(ThisHandle); 03439 03440 if (pBrushDef == NULL) 03441 { 03442 ERROR3("Brush definition is NULL in CBrushEditDlg::BrushEditDlgOnOK"); 03443 return; 03444 } 03445 03446 // ask the definition to copy itself 03447 BrushDefinition* pNewBrushDef = pBrushDef->Copy(); 03448 03449 if (pNewBrushDef == NULL) 03450 return; 03451 03452 // copy our brush data to the definition 03453 pNewBrushDef->SetMembersFromData(*EditData); 03454 pNewBrushDef->SetBrushScaling(1.0); 03455 // find out how many brushes there are 03456 UINT32 LastBrush = pBrushComp->GetNumberOfBrushes() - 1; 03457 03458 BrushHandle NewHandle = pBrushComp->AddNewItem(pNewBrushDef, TRUE); 03459 03460 // tell the world who we are 03461 if (NewHandle > LastBrush) 03462 BROADCAST_TO_ALL(NewBrushMsg()); 03463 else 03464 //ERROR3("Tried to make an identical brush"); 03465 TRACEUSER( "Diccon", _T("Tried to make an identical brush\n")); 03466 03467 EditData->m_BrushHandle = NewHandle; 03468 03469 03470 }
|
|
launches the brush edit dialog, this method will determine which brush it is editing from the document selection.
Reimplemented from Operation. Definition at line 376 of file brushdlg.cpp. 00377 { 00378 Document * pDocument = Document::GetSelected(); 00379 ERROR3IF(pDocument == NULL,"UnitPropertiesDlg::DoWithParam No selected document"); 00380 00381 if (pDocument) 00382 pDocUnitList = pDocument->GetDocUnitList(); 00383 ERROR3IF(pDocUnitList == NULL,"UnitPropertiesDlg::DoWithParam No doc unit list attached to this doc yet"); 00384 00385 CurrentUserUnitType = pDocUnitList->GetPageUnits (); 00386 00387 PORTNOTE("other", "Disabled CBrushGadget") 00388 #ifndef EXCLUDE_FROM_XARALX 00389 // this fn. is called from the ViewContextMenu without any params so here we must initialise it ourselves 00390 //m_pOwningGadget = FreeHandInfoBarOp::GetSpareGadget(); 00391 m_pOwningGadget = FreeHandInfoBarOp::GetBrushGadget(); 00392 if (m_pOwningGadget != NULL) 00393 m_pOwningGadget->SetBrushDialog(this); 00394 #endif 00395 00396 EditData = new BrushData; 00397 if (EditData == NULL) 00398 return; 00399 00400 OriginalData = new BrushData; 00401 m_bDisableGadgets = TRUE; 00402 // we want to see if there is a brush in the selection, in which case grab its data so we 00403 // can initialise everything ok. Otherwise keep everything disabled 00404 AttrBrushType* pAttrBrush = GetSingleSelectedBrushAttribute(); 00405 if (pAttrBrush != NULL) 00406 { 00407 *EditData = pAttrBrush->GetBrushData(); 00408 *OriginalData = *EditData; 00409 m_bDisableGadgets = FALSE; 00410 //initialise our opparam with the original data, just in case we want to do change all 00411 ChangeParam_m.SetValues(*EditData); 00412 String_256 Name = EditData->m_Name; 00413 SetName(&Name); 00414 } 00415 else 00416 { 00417 // If we are in the freehand tool then we can launch so long as the tool selected brush is not default 00418 if (Tool::GetCurrentID() == TOOLID_FREEHAND) 00419 { 00420 FreeHandTool* pTool = (FreeHandTool*)Tool::GetCurrent(); 00421 BrushHandle Handle = pTool->GetBrushHandle(); 00422 if (Handle != BrushHandle_NoBrush) 00423 { 00424 BrushDefinition* pDef = BrushComponent::FindBrushDefinition(Handle); 00425 if (pDef != NULL) 00426 { 00427 // the definition allocates a new data object for us 00428 delete EditData; 00429 EditData = pDef->GetBrushData(); 00430 EditData->m_BrushHandle = Handle; 00431 *OriginalData = *EditData; 00432 m_bDisableGadgets = FALSE; 00433 //initialise our opparam with the original data, just in case we want to do change all 00434 ChangeParam_m.SetValues(*EditData); 00435 EditingBrushDef = TRUE; 00436 String_256 Name = EditData->m_Name; 00437 SetName(&Name); 00438 } 00439 } 00440 } 00441 } 00442 00443 Create (); 00444 Open (); 00445 m_bIsOpen = TRUE; 00446 m_bPreventUpdateSet = FALSE; 00447 m_SliderStarted = FALSE; 00448 }
|
|
launches the brush edit dialog, however this the BrushData to initialise the dialog is provided through the opparam. Note: I don't think that we use this method anymore.
Reimplemented from Operation. Definition at line 468 of file brushdlg.cpp. 00469 { 00470 PORTNOTE("other", "Disabled CBrushGadget") 00471 #ifndef EXCLUDE_FROM_XARALX 00472 m_pOwningGadget = reinterpret_cast<CBrushGadget*> (OwningGadgetParams->Param1); 00473 m_pOwningGadget->SetCBrushEditDlg (this); 00474 #endif 00475 00476 // if theres already one open the don't 00477 if (WindowID != NULL && IsOpen() && IsWindowVisible()) 00478 return; 00479 00480 EditData = new BrushData (*(reinterpret_cast<BrushData*> ((void*)(OwningGadgetParams->Param2)))); 00481 // if we're editing the definition then we had to create a brush data from scratch so delete 00482 // it here 00483 if (EditingBrushDef) 00484 { 00485 BrushData* DeleteData = ((reinterpret_cast<BrushData*> ((void *)(OwningGadgetParams->Param2)))); 00486 delete DeleteData; 00487 } 00488 //EditData = reinterpret_cast<BrushData*> (OwningGadgetParams->Param2); 00489 OriginalData = new BrushData (*EditData); 00490 00491 //initialise our opparam with the original data, just in case we want to do change all 00492 ChangeParam_m.SetValues(*EditData); 00493 00494 m_bDisableGadgets = FALSE; 00495 00496 PORTNOTE("other", "Disabled CBrushGadget") 00497 #ifndef EXCLUDE_FROM_XARALX 00498 // get the ID 00499 if (m_pOwningGadget != 0) 00500 { 00501 Id_m = m_pOwningGadget->GetGadgetID (); 00502 } 00503 00504 if (m_pOwningGadget->GetEditingBrushDefinition ()) 00505 { 00506 EditingBrushDef = TRUE; 00507 GetAttributeNodeFromDefinition(); 00508 } 00509 #endif 00510 00511 Document * pDocument = Document::GetSelected(); 00512 ERROR3IF(pDocument == NULL,"UnitPropertiesDlg::DoWithParam No selected document"); 00513 00514 if (pDocument) 00515 pDocUnitList = pDocument->GetDocUnitList(); 00516 ERROR3IF(pDocUnitList == NULL,"UnitPropertiesDlg::DoWithParam No doc unit list attached to this doc yet"); 00517 00518 CurrentUserUnitType = pDocUnitList->GetPageUnits (); 00519 00520 String_256 Title (_R(IDS_BRUSHEDITDLGTITLE)); 00521 SetName (&Title); 00522 00523 Create (); 00524 Open (); 00525 00526 PORTNOTE("other", "Disabled CBrushGadget") 00527 #ifndef EXCLUDE_FROM_XARALX 00528 // tell the owning gadget that this dialog has opened 00529 if (m_pOwningGadget != 0) 00530 { 00531 m_pOwningGadget->DialogHasOpened (); 00532 } 00533 #endif 00534 00535 m_bIsOpen = TRUE; 00536 m_bPreventUpdateSet = FALSE; 00537 m_SliderStarted = FALSE; 00538 }
|
|
Definition at line 1939 of file brushdlg.cpp. 01940 { 01941 // just a quick check to see if we're in the right place 01942 if (!EditingBrushDef) 01943 return FALSE; 01944 01945 // we need to get hold of the brush component from the document 01946 Document* pDoc = Document::GetCurrent(); 01947 if (pDoc == NULL) 01948 return FALSE; 01949 01950 BrushComponent* pBrushComp = (BrushComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(BrushComponent)); 01951 if (pBrushComp == NULL) 01952 { 01953 ERROR3("No brush component in our document"); 01954 return FALSE; 01955 } 01956 01957 // wipe our existing attribute 01958 if (pAttrBrush_m != NULL) 01959 { 01960 delete pAttrBrush_m; 01961 pAttrBrush_m = NULL; 01962 } 01963 01964 // ask the component for a new one 01965 pAttrBrush_m = pBrushComp->CreateAttributeNode(m_Handle); 01966 01967 // did we get it? 01968 if (pAttrBrush_m == NULL) 01969 return FALSE; 01970 01971 return TRUE; 01972 }
|
|
Definition at line 3120 of file brushdlg.cpp. 03121 { 03122 MILLIPOINT RectSide = GetSideOfBoundingBox(Side); 03123 if (RectSide == 0) 03124 { 03125 // ERROR3("Bounding rect is empty in CBrushEditDlg::GetSpacingRange"); 03126 return 0; 03127 } 03128 03129 double Percent = (double)Distance / (double)RectSide; 03130 return Percent * 100; 03131 }
|
|
Definition at line 1975 of file brushdlg.cpp. 01976 { 01977 // seed the random number generator 01978 srand( (unsigned)time( NULL ) ); 01979 01980 UINT32 Rand = (UINT32)rand(); 01981 // make sure its not the same (unlikely) 01982 while (Rand == OldNumber) 01983 Rand = (UINT32)rand(); 01984 01985 return Rand; 01986 }
|
|
Definition at line 3092 of file brushdlg.cpp. 03093 { 03094 if (pMin == NULL || pMax == NULL) 03095 { 03096 ERROR3("Null pointers in CBrushEditDlg::GetOffsetRange"); 03097 return; 03098 } 03099 03100 *pMin = MinOffset; 03101 03102 MILLIPOINT Height = GetSideOfBoundingBox(HEIGHT); 03103 if (Height == 0) 03104 { 03105 // ERROR3("Bounding rect is empty in CBrushEditDlg::GetSpacingRange"); 03106 return; 03107 } 03108 03109 Height = Height * MAXOFFSETMULTIPLIER; 03110 03111 if (Height > MAX_BRUSH_OFFSET) 03112 Height = MAX_BRUSH_OFFSET; 03113 03114 double ExpRootHeight = pow((double)Height, 1/ExpFactor); 03115 03116 *pMax = ExpRootHeight; 03117 }
|
|
Definition at line 3170 of file brushdlg.cpp. 03171 { 03172 MILLIPOINT Side = GetSideOfBoundingBox(RectSide); 03173 03174 MILLIPOINT ReturnVal = (MILLIPOINT)(((double)Side) * (Percent / 100)); 03175 return ReturnVal; 03176 }
|
|
Definition at line 3181 of file brushdlg.cpp. 03182 { 03183 String_32 RangeText(_T(" ")); 03184 if (SliderVal < MIN_RANDOM_SLIDER || SliderVal > MAX_RANDOM_SLIDER) 03185 { 03186 ERROR3("Slider value is out of range in CBrushEditDlg::GetRandomRangeText"); 03187 return RangeText; 03188 } 03189 UINT32 BaseVal = 100; 03190 UINT32 MinVal = 100 ; 03191 UINT32 MaxVal = 100 ; 03192 03193 // the actual limits are worked out in the PPB static function 03194 PathProcessorBrush::GetRandomLimits(BaseVal, SliderVal, &MinVal, &MaxVal); 03195 03196 // annoyingly we now need to recast our values as long 03197 String_32 MinString; 03198 String_32 MaxString; 03199 String_32 MiddleString = _T(" - "); 03200 Convert::LongToString((INT32)MinVal, &MinString); 03201 Convert::LongToString((INT32)MaxVal, &MaxString); 03202 03203 03204 RangeText += MinString; 03205 RangeText += MiddleString; 03206 RangeText += MaxString; 03207 03208 return RangeText; 03209 03210 }
|
|
Definition at line 3382 of file brushdlg.cpp. 03383 { 03384 INT32 Base = 100; 03385 INT32 MinVal = Base; 03386 INT32 MaxVal = Base; 03387 03388 double RandomFactor = (double)Rand / 100; 03389 RandomFactor++; // = (RandomFactor * MaxRand); 03390 03391 if (RandomFactor != 0) 03392 { 03393 MinVal = (INT32)((double)Base / RandomFactor); 03394 MaxVal =(INT32)((double)Base * RandomFactor); 03395 } 03396 03397 03398 String_32 RangeText(_T("")); 03399 03400 // annoyingly we now need to recast our values as long 03401 String_32 MinString; 03402 String_32 MaxString; 03403 String_32 MiddleString = _T(" - "); 03404 Convert::LongToString(MinVal, &MinString); 03405 Convert::LongToString(MaxVal, &MaxString); 03406 03407 03408 RangeText += MinString; 03409 RangeText += MiddleString; 03410 RangeText += MaxString; 03411 03412 return RangeText; 03413 }
|
|
Definition at line 3213 of file brushdlg.cpp. 03214 { 03215 String_32 RangeText(_T(" ")); 03216 if (SliderVal < MIN_RANDOM_SLIDER || SliderVal > MAX_RANDOM_SLIDER) 03217 { 03218 ERROR3("Slider value is out of range in CBrushEditDlg::GetRandomRangeText"); 03219 return RangeText; 03220 } 03221 UINT32 BaseVal = 100; 03222 UINT32 MinVal = 100 ; 03223 UINT32 MaxVal = 100 ; 03224 03225 // the actual limits are worked out in the PPB static function 03226 PathProcessorBrush::GetRotationRandomLimits(BaseVal, SliderVal, &MinVal, &MaxVal); 03227 03228 //double MinValDegrees = 03229 // annoyingly we now need to recast our values as long 03230 String_32 MinString; 03231 String_32 MaxString; 03232 String_32 MiddleString = _T(" - "); 03233 Convert::LongToString((INT32)MinVal, &MinString); 03234 Convert::LongToString((INT32)MaxVal, &MaxString); 03235 03236 03237 RangeText += MinString; 03238 RangeText += MiddleString; 03239 RangeText += MaxString; 03240 03241 return RangeText; 03242 }
|
|
Definition at line 3133 of file brushdlg.cpp. 03134 { 03135 BrushDefinition* pBrushDef = BrushComponent::FindBrushDefinition(EditData->m_BrushHandle); 03136 if (pBrushDef == NULL) 03137 { 03138 // ERROR3("No brush definition in CBrushEditDlg::GetLongestSideOfBoundingBox"); 03139 return 0; 03140 } 03141 03142 DocRect BRect = pBrushDef->GetLargestBoundingBox(); 03143 if (BRect.IsEmpty()) 03144 { 03145 //ERROR3("Bounding rect is empty in CBrushEditDlg::GetSpacingRange"); 03146 return 0; 03147 } 03148 03149 MILLIPOINT Side = 0; 03150 switch (RectSide) 03151 { 03152 case WIDTH: 03153 Side = BRect.Width(); 03154 break; 03155 case HEIGHT: 03156 Side = BRect.Height(); 03157 break; 03158 case LONGEST: 03159 Side = BRect.Width() > BRect.Height() ? BRect.Width() : BRect.Height(); 03160 break; 03161 default: 03162 ERROR3("Invalid side info passed to CBrushEditDlg::GetSideOfBoundingBox"); 03163 Side = BRect.Width(); 03164 break; 03165 } 03166 03167 return Side; 03168 }
|
|
Definition at line 2903 of file brushdlg.cpp. 02904 { 02905 AttrBrushType* pAttrBrush = NULL; 02906 List NodeList; 02907 BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(AttrBrushType)); 02908 BrushData Data; // initialises to default values 02909 INT32 NumItems = NodeList.GetCount(); 02910 if (NumItems == 1) 02911 { 02912 NodeListItem* pItem = (NodeListItem*)NodeList.GetHead(); 02913 if (pItem != NULL) 02914 pAttrBrush = (AttrBrushType*)pItem->pNode; 02915 } 02916 NodeList.DeleteAll(); 02917 return pAttrBrush; 02918 }
|
|
Definition at line 3064 of file brushdlg.cpp. 03065 { 03066 if (pMinimum == NULL || pMaximum == NULL) 03067 { 03068 ERROR3("Null pointers in CBrushEditDlg::GetSpacingRange"); 03069 return; 03070 } 03071 03072 *pMinimum = MinSliderSpacing; 03073 03074 MILLIPOINT Width = GetSideOfBoundingBox(WIDTH); 03075 if (Width == 0) 03076 { 03077 ERROR3("Bounding rect is empty in CBrushEditDlg::GetSpacingRange"); 03078 return; 03079 } 03080 03081 Width = Width * MAXSPACINGMULTIPLIER; 03082 03083 if (Width> MAX_BRUSH_SPACING) 03084 Width = MAX_BRUSH_SPACING; 03085 03086 double ExpRootWidth = pow((double)Width, 1/ExpFactor); 03087 03088 *pMaximum = ExpRootWidth; 03089 }
|
|
Determines whether or not we can launch this op. We are allowed to launch in the following circumstances:
Definition at line 332 of file brushdlg.cpp. 00333 { 00334 static OpState DialogState; 00335 00336 DialogState.Greyed = TRUE; 00337 00338 // if we have a single brush in the selection then we're ok 00339 AttrBrushType* pAttrBrush = GetSingleSelectedBrushAttribute(); 00340 00341 if (pAttrBrush != NULL && pAttrBrush->GetBrushHandle() != BrushHandle_NoBrush) 00342 DialogState.Greyed = FALSE; 00343 00344 // if we're in the freehand tool and we our current brush is not default then we're also ok 00345 if (Tool::GetCurrentID() == TOOLID_FREEHAND) 00346 { 00347 FreeHandTool* pTool = (FreeHandTool*)Tool::GetCurrent(); 00348 if (pTool->GetBrushHandle() != BrushHandle_NoBrush) 00349 DialogState.Greyed = FALSE; 00350 } 00351 00352 // we only ever want one instance of the dialog so check our static member 00353 if (m_bIsOpen) 00354 DialogState.Greyed = TRUE; 00355 00356 return (DialogState); 00357 }
|
|
Subhandler for messages from the rotation tab, except for the edit box and sliders, which have their own handlers.
Definition at line 1003 of file brushdlg.cpp. 01004 { 01005 TalkToPage (_R(IDD_BRUSHEDITEFFECTS)); 01006 01007 switch(Msg->DlgMsg) 01008 { 01009 case DIM_CREATE: 01010 InitBrushEffects (); 01011 break; 01012 case DIM_COMMIT : 01013 { 01014 HandleCommit (Msg); 01015 DialogManager::DefaultKeyboardFocus (); 01016 } 01017 break; 01018 default: 01019 break; 01020 } 01021 }
|
|
Subhandler for messages from the offset tab, except for the edit box and sliders, which have their own handlers.
Definition at line 924 of file brushdlg.cpp. 00925 { 00926 TalkToPage (_R(IDD_BRUSHEDITOFFSET)); 00927 00928 switch(Msg->DlgMsg) 00929 { 00930 case DIM_CREATE: 00931 InitBrushOffset (); 00932 break; 00933 case DIM_COMMIT : 00934 { 00935 HandleCommit (Msg); 00936 DialogManager::DefaultKeyboardFocus (); 00937 } 00938 break; 00939 default: 00940 break; 00941 } 00942 }
|
|
Subhandler for messages from the scaling tab, except for the edit box and sliders, which have their own handlers.
Definition at line 963 of file brushdlg.cpp. 00964 { 00965 TalkToPage (_R(IDD_BRUSHEDITSCALING)); 00966 00967 switch(Msg->DlgMsg) 00968 { 00969 case DIM_CREATE: 00970 InitBrushScaling (); 00971 break; 00972 case DIM_COMMIT : 00973 { 00974 HandleCommit (Msg); 00975 DialogManager::DefaultKeyboardFocus (); 00976 } 00977 break; 00978 default: 00979 break; 00980 } 00981 }
|
|
Subhandler for messages from the transparency tab, except for the edit box and sliders, which have their own handlers.
Definition at line 1043 of file brushdlg.cpp. 01044 { 01045 TalkToPage (_R(IDD_BRUSHEDITSEQUENCE)); 01046 01047 switch(Msg->DlgMsg) 01048 { 01049 case DIM_CREATE: 01050 InitBrushSequence (); 01051 break; 01052 case DIM_COMMIT : 01053 { 01054 HandleCommit (Msg); 01055 DialogManager::DefaultKeyboardFocus (); 01056 } 01057 break; 01058 default: 01059 break; 01060 } 01061 }
|
|
Subhandler for messages from the spacing tab, except for the edit box and sliders, which have their own handlers.
Definition at line 884 of file brushdlg.cpp. 00885 { 00886 TalkToPage (_R(IDD_BRUSHEDITSPACING)); 00887 00888 switch(Msg->DlgMsg) 00889 { 00890 case DIM_CREATE: 00891 InitBrushSpacing (); 00892 break; 00894 case DIM_COMMIT : 00895 { 00896 HandleCommit (Msg); 00897 DialogManager::DefaultKeyboardFocus (); 00898 } 00899 break; 00900 default: 00901 break; 00902 } 00903 }
|
|
Subhandler for messages from the fill tab, except for the edit box and sliders, which have their own handlers.
Definition at line 1083 of file brushdlg.cpp. 01084 { 01085 TalkToPage (_R(IDD_BRUSHEDITFILL)); 01086 01087 switch(Msg->DlgMsg) 01088 { 01089 case DIM_CREATE: 01090 InitBrushFill (); 01091 break; 01092 case DIM_COMMIT : 01093 { 01094 HandleCommit (Msg); 01095 DialogManager::DefaultKeyboardFocus (); 01096 } 01097 break; 01098 default: 01099 break; 01100 } 01101 }
|
|
Definition at line 1850 of file brushdlg.cpp. 01851 { 01852 // try reading the checkboxes first 01853 ReadCheckBox (Msg); 01854 01855 // if it wasn't a checkbox then try the buttons 01856 if (ChangeType_m == CHANGEBRUSH_NONE) 01857 ReadButtons(Msg); 01858 01859 // still no joy, try the radio buttons 01860 if (ChangeType_m == CHANGEBRUSH_NONE) 01861 ReadRadios(Msg); 01862 01863 BROADCAST_TO_CLASS (DialogMsg (0, DIM_COMMIT/*Msg->DlgMsg*/, Id_m, (UINT_PTR) (EditData)), DialogBarOp); 01864 LaunchOp(); 01865 }
|
|
Definition at line 1824 of file brushdlg.cpp. 01825 { 01826 01827 ReadEditBox (Msg); 01828 01829 WriteSliders (Msg); 01830 01831 BROADCAST_TO_CLASS (DialogMsg (0, Msg->DlgMsg, Id_m, (UINT_PTR) (EditData)), DialogBarOp); 01832 01833 LaunchOp(); 01834 }
|
|
Definition at line 2922 of file brushdlg.cpp. 02923 { 02924 AttrBrushType* pAttrBrush = GetSingleSelectedBrushAttribute(); 02925 if (pAttrBrush == NULL) 02926 { 02927 m_bDisableGadgets = TRUE; 02928 String_32 Title = TEXT(""); 02929 SetDialogTitle(Title); 02930 02931 RefreshActivePage(); 02932 return; 02933 } 02934 02935 // lets get the data from the attribute and into our members 02936 if (EditData == NULL) 02937 EditData = new BrushData; 02938 02939 if (EditData == NULL) 02940 ERROR3("Unable to allocate brush data in CBrushEditDlg::HandleDocSelectionChange"); 02941 02942 *EditData = pAttrBrush->GetBrushData(); 02943 02944 if (OriginalData == NULL) 02945 OriginalData = new BrushData; 02946 02947 if (OriginalData == NULL) 02948 ERROR3("Unable to allocate brush data in CBrushEditDlg::HandleDocSelectionChange"); 02949 02950 *OriginalData = *EditData; 02951 m_LastData = *EditData; 02952 m_bDisableGadgets = FALSE; 02953 02954 // set the name of the new brush 02955 SetDialogTitle(EditData->m_Name); 02956 02957 //initialise our opparam with the original data, just in case we want to do change all 02958 ChangeParam_m.SetValues(*EditData); 02959 02960 EditingBrushDef = FALSE; 02961 // now refresh the page that is currently active 02962 RefreshActivePage(); 02963 02964 }
|
|
Definition at line 1836 of file brushdlg.cpp. 01837 { 01838 ReadComboBox (Msg); 01839 01840 // we are now routing edit box messages through Enter_Select so if we didn't get a result in 01841 // the combo boxes then try the edit boxes 01842 if (ChangeType_m == CHANGEBRUSH_NONE) 01843 ReadEditBox(Msg); 01844 01845 BROADCAST_TO_CLASS (DialogMsg (0, Msg->DlgMsg, Id_m, (UINT_PTR) (EditData)), DialogBarOp); 01846 // launch the changebrush op 01847 LaunchOp(); 01848 }
|
|
Definition at line 1867 of file brushdlg.cpp. 01868 { 01869 ReadSlider (Msg); 01870 01871 BROADCAST_TO_CLASS (DialogMsg (0, Msg->DlgMsg, Id_m, (UINT_PTR) (EditData)), DialogBarOp); 01872 01873 // ok, so in order to avoid generating an undoable op for each slider movement we will only 01874 // do so on the first movement, so that undo will take it back to its original position 01875 01876 if (!m_SliderStarted) // our flag that indicates if this is the first slider movement or not 01877 { 01878 TRACEUSER( "Diccon", _T("Launching Op\n")); 01879 LaunchOp(); 01880 m_SliderStarted = TRUE; 01881 } 01882 else if (ChangeType_m != CHANGEBRUSH_NONE && EditingBrushDef == FALSE) 01883 { 01884 ChangeParam_m.ChangeType = ChangeType_m; 01885 ChangeBrushAction Action; 01886 01887 Action.ChangeSelectionNoUndo(&ChangeParam_m); 01888 } 01889 }
|
|
Definition at line 1891 of file brushdlg.cpp. 01892 { 01893 ReadSlider (Msg); 01894 01895 BROADCAST_TO_CLASS (DialogMsg (0, Msg->DlgMsg, Id_m, (UINT_PTR) (EditData)), DialogBarOp); 01896 // don't launch an op, see above for comments 01897 if (ChangeType_m != CHANGEBRUSH_NONE && EditingBrushDef == FALSE) 01898 { 01899 ChangeParam_m.ChangeType = ChangeType_m; 01900 ChangeBrushAction Action; 01901 01902 Action.ChangeSelectionNoUndo(&ChangeParam_m); 01903 } 01904 m_SliderStarted = FALSE; 01905 }
|
|
Because CPropertySheets only let you have an OK, Apply,Cancel, and Help button, we must rename these for our own devious ends and swap their positions.
Definition at line 1233 of file brushdlg.cpp. 01234 { 01235 TalkToPage (0); 01236 01237 // say bye-bye to the ok button! 01238 //HideGadget (IDOK, TRUE); 01239 01240 // now swap the position of the apply and cancel buttons .... 01241 01242 TalkToPage (0); 01243 RECT rectApply; 01244 GetGadgetPosition (_R(ID_APPLY_NOW), &rectApply); // Preview 01245 RECT rectCancel; 01246 GetGadgetPosition (_R(IDCANCEL), &rectCancel); // Cancel 01247 01248 SetGadgetPosition (_R(IDCANCEL), rectApply); 01249 SetGadgetPosition (_R(ID_APPLY_NOW), rectCancel); 01250 01251 01252 ChangeButtonText(); 01253 01254 }
|
|
the init function to register us as an Op
Reimplemented from SimpleCCObject. Definition at line 285 of file brushdlg.cpp. 00286 { 00287 return ( 00288 00289 RegisterOpDescriptor 00290 ( 00291 0, // Tool ID 00292 _R(IDS_BRUSHEDITDLG), // String resource ID 00293 CC_RUNTIME_CLASS (CBrushEditDlg), // Runtime class 00294 OPTOKEN_BRUSHEDIT_DLG, // Token string 00295 CBrushEditDlg::GetState, // GetState function 00296 0, // Help ID 00297 _R(IDBBL_BRUSHEDIT), // Bubble ID 00298 _R(IDD_BARCONTROLSTORE), // Resource ID 00299 _R(IDC_BRUSHEDIT), // Control ID 00300 SYSTEMBAR_EDIT, // Bar ID 00301 TRUE, // Recieve system messages 00302 FALSE, // Smart duplicate operation 00303 TRUE, // Clean operation 00304 0, // No vertical counterpart 00305 0, // String for one copy only 00306 ( DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC ) // Auto state flags 00307 ) 00308 ); 00309 }
|
|
Definition at line 1501 of file brushdlg.cpp. 01502 { 01503 // set the random slider 01504 SetGadgetRange (_R(IDC_SLIDERROTATEANGLEMAXRAND), MIN_RANDOM_SLIDER, MAX_ROTATION_RANDOM_SLIDER); 01505 SetGadgetBitmaps (_R(IDC_SLIDERROTATEANGLEMAXRAND), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01506 SetLongGadgetValue (_R(IDC_SLIDERROTATEANGLEMAXRAND), MAX_ROTATION_RANDOM_SLIDER - (EditData->m_RotationMaxRand) + MIN_RANDOM_SLIDER); 01507 SetRandomRangeText(_R(IDC_SLIDERROTATEANGLEMAXRAND)); 01508 01509 // set the rotate angle slider and edit field 01510 SetDoubleGadgetValue (_R(IDC_EDITROTATEANGLE), EditData->m_RotateAngle); 01511 SetGadgetBitmaps (_R(IDC_SLIDERROTATEANGLE), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01512 SetGadgetRange (_R(IDC_SLIDERROTATEANGLE), MIN_ROTATION_SLIDER, MAX_ROTATION_SLIDER); 01513 SetDoubleGadgetValue (_R(IDC_SLIDERROTATEANGLE), (MAX_ROTATION_SLIDER - EditData->m_RotateAngle) + MIN_ROTATION_SLIDER); 01514 01515 // set the angle increment slider and edit field 01516 SetDoubleGadgetValue (_R(IDC_EDITROTATEANGLEINCR), EditData->m_RotAngleIncrConst); 01517 SetGadgetBitmaps (_R(IDC_SLIDERROTATEANGLEINCR), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01518 SetGadgetRange (_R(IDC_SLIDERROTATEANGLEINCR), MIN_ROTATION_INCR_SLIDER, MAX_ROTATION_INCR_SLIDER); 01519 SetDoubleGadgetValue (_R(IDC_SLIDERROTATEANGLEINCR), (MAX_ROTATION_INCR_SLIDER - EditData->m_RotAngleIncrConst) + MIN_ROTATION_INCR_SLIDER); 01520 01521 01522 if (m_bDisableGadgets) 01523 { 01524 ReInitBrushEffects(); 01525 return; 01526 } 01527 01528 01529 if (EditData->m_RotationMaxRand == 0) 01530 { 01531 EnableGadget (_R(IDC_BUTTONROTATEANGLERANDSEED), FALSE); 01532 } 01533 01534 01535 if (EditData->m_bRotate) 01536 { 01537 SetLongGadgetValue (_R(IDC_CHECKROTATE), 1); 01538 } 01539 01540 01541 01542 01543 }
|
|
Definition at line 1603 of file brushdlg.cpp. 01604 { 01605 01606 if (m_bDisableGadgets) 01607 { 01608 ReInitBrushFill(); 01609 return; 01610 } 01611 01612 // do the hue and saturation sliders 01613 SetGadgetBitmaps(_R(IDC_SLIDERSATURATIONRANDOM), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01614 SetGadgetRange(_R(IDC_SLIDERSATURATIONRANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_SAT_SLIDER); 01615 SetLongGadgetValue(_R(IDC_SLIDERSATURATIONRANDOM), (MAX_RANDOM_SAT_SLIDER - EditData->m_BrushSatMaxRand) + MIN_RANDOM_SLIDER); 01616 SetRandomRangeText(_R(IDC_SLIDERSATURATIONRANDOM)); 01617 01618 SetGadgetBitmaps(_R(IDC_SLIDERHUERANDOM), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01619 SetGadgetRange(_R(IDC_SLIDERHUERANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_HUE_SLIDER); 01620 SetLongGadgetValue(_R(IDC_SLIDERHUERANDOM), (MAX_RANDOM_HUE_SLIDER - EditData->m_BrushHueMaxRand) + MIN_RANDOM_SLIDER); 01621 SetRandomRangeText(_R(IDC_SLIDERHUERANDOM)); 01622 01623 if (EditData->m_BrushHueMaxRand > 0 || EditData->m_BrushSatMaxRand > 0) 01624 EnableGadget(_R(IDC_BUTTONBRUSHFILLRANDOM), TRUE); 01625 else 01626 EnableGadget(_R(IDC_BUTTONBRUSHFILLRANDOM), FALSE); 01627 01628 if (EditData->m_bTile) 01629 { 01630 SetLongGadgetValue (_R(IDC_CHECKTILEING), 1); 01631 } 01632 else 01633 { 01634 SetLongGadgetValue (_R(IDC_CHECKTILEING), 0); 01635 } 01636 01637 // use local options not available for the brush definitions 01638 if (!EditingBrushDef) 01639 { 01640 SetRadioGroupSelected(LocalFillRadioGadgets, _R(IDC_RADIOLOCALFILLNONE)); 01641 if (EditData->m_bUseLocalFillColour) 01642 { 01643 SetRadioGroupSelected(LocalFillRadioGadgets, _R(IDC_RADIOLOCALFILLALL)); 01644 } 01645 if (EditData->m_bUseNamedColour == FALSE) 01646 { 01647 SetRadioGroupSelected(LocalFillRadioGadgets, _R(IDC_RADIOLOCALFILLNAMED)); 01648 } 01649 01650 } 01651 else 01652 { 01653 01654 for (INT32 i = 0; i < NumberOfLocalFillRadios - 1; i++) // -1 because the last value is NULL 01655 EnableGadget(LocalFillRadioGadgets[i], FALSE); 01656 01657 } 01658 01659 }
|
|
Definition at line 1363 of file brushdlg.cpp. 01364 { 01365 SetOffsetValSlider(); 01366 01367 // do the addition slider 01368 // SetGadgetRange(_R(IDC_SLIDEROFFSETINCRCONST), MIN_SPACING_INCR, MAX_SPACING_INCR); 01369 // SetGadgetBitmaps(_R(IDC_SLIDEROFFSETINCRCONST), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01370 // double PercentVal = GetDistanceAsPercentageOfBBox(EditData->m_PathOffsetIncrConst); 01371 // SetDoubleGadgetValue (_R(IDC_SLIDEROFFSETINCRCONST), MAX_SPACING_INCR - PercentVal + MIN_SPACING_INCR); 01372 01373 // set up the random slider 01374 SetGadgetRange (_R(IDC_SLIDEROFFSETVALUEMAXRAND), MinOffsetSlider, MaxOffsetSlider); 01375 SetGadgetBitmaps (_R(IDC_SLIDEROFFSETVALUEMAXRAND), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01376 SetRandomRangeText(_R(IDC_SLIDEROFFSETVALUEMAXRAND)); 01377 01378 01379 if (m_bDisableGadgets) 01380 { 01381 ReInitBrushOffset(); 01382 return; 01383 } 01384 EnableGadget (_R(IDC_BUTTONOFFSETVALUERANDSEED), FALSE); 01385 switch (EditData->m_PathOffsetType) 01386 { 01387 case OFFSET_NONE: 01388 UsingRandomOffset = FALSE; 01389 EnableGadget (_R(IDC_STATICPATHOFFSETVALUE), FALSE); 01390 EnableGadget (_R(IDC_SPINPATHOFFSETVALUE), FALSE); 01391 EnableGadget (_R(IDC_EDITPATHOFFSETVALUE), FALSE); 01392 EnableGadget (_R(IDC_STATICPATHOFFSETINCRCONST), FALSE); 01393 EnableGadget (_R(IDC_SPINPATHOFFSETINCRCONST), FALSE); 01394 EnableGadget (_R(IDC_EDITPATHOFFSETINCRCONST), FALSE); 01395 //EnableGadget (_R(IDC_SLIDEROFFSETVALUEMAXRAND), FALSE); 01396 EnableGadget (_R(IDC_SLIDERPATHOFFSETVAL), FALSE); 01397 EnableGadget (_R(IDC_SLIDEROFFSETINCRCONST), FALSE); 01398 //EnableGadget (_R(IDC_STATICOFFSETVALUEMAXRAND), FALSE); 01399 01400 break; 01401 01402 case OFFSET_RANDOM: 01403 EnableGadget (_R(IDC_EDITPATHOFFSETVALUE), FALSE); 01404 EnableGadget (_R(IDC_SLIDERPATHOFFSETVAL), FALSE); 01405 EnableGadget (_R(IDC_STATICPATHOFFSETVALUE), FALSE); 01406 break; 01407 01408 default: 01409 01410 break; 01411 } 01412 if (EditData->m_OffsetValueMaxRand > 0) 01413 EnableGadget (_R(IDC_BUTTONOFFSETVALUERANDSEED), TRUE); 01414 01415 InitComboPathOffsetType (); 01416 01417 SetLongGadgetValue (_R(IDC_SLIDEROFFSETVALUEMAXRAND), MaxOffsetSlider - (EditData->m_OffsetValueMaxRand)); 01418 }
|
|
Definition at line 1438 of file brushdlg.cpp. 01439 { 01440 // set up the random scaling slider 01441 SetGadgetRange (_R(IDC_SLIDERBRUSHSCALINGMAXRAND), MinScalingSlider, MaxScalingSlider); 01442 SetGadgetBitmaps (_R(IDC_SLIDERBRUSHSCALINGMAXRAND), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01443 SetLongGadgetValue (_R(IDC_SLIDERBRUSHSCALINGMAXRAND), MaxScalingSlider - (EditData->m_BrushScalingMaxRand)); 01444 SetRandomRangeText(_R(IDC_SLIDERBRUSHSCALINGMAXRAND)); 01445 01446 // set up the increment slider 01448 // SetGadgetBitmaps (_R(IDC_SLIDERSCALINGINCRCONST), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01449 // SetLongGadgetValue (_R(IDC_SLIDERSCALINGINCRCONST), (MaxScalingIncrSlider - (EditData->m_BrushScalingIncrConst)) + MinScalingIncrSlider); 01450 // SetDoubleGadgetValue(_R(IDC_EDITSCALINGINCRCONST), EditData->m_BrushScalingIncrConst); 01451 01452 // setup the pressure slider 01453 SetGadgetRange (_R(IDC_SLIDERSCALINGPRESSURE), MIN_PRESSURE_SLIDER, MAX_PRESSURE_SLIDER); 01454 SetGadgetBitmaps (_R(IDC_SLIDERSCALINGPRESSURE), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01455 SetLongGadgetValue (_R(IDC_SLIDERSCALINGPRESSURE), (MAX_PRESSURE_SLIDER - EditData->m_ScalingMaxPressure) + MIN_PRESSURE_SLIDER); 01456 SetRandomRangeText(_R(IDC_SLIDERSCALINGPRESSURE)); 01457 01458 SetStringGadgetValue(_R(IDC_STATICBRUSHSCALEINFO), _R(IDS_BRUSHSCALE)); 01459 01460 if (m_bDisableGadgets) 01461 { 01462 ReInitBrushScaling(); 01463 return; 01464 } 01465 01466 if (EditData->m_BrushScalingMaxRand == 0) // no random scaling 01467 { 01468 UsingRandomScaling = FALSE; 01469 //EnableGadget (_R(IDC_SLIDERBRUSHSCALINGMAXRAND), FALSE); 01470 //EnableGadget (_R(IDC_STATICBRUSHSCALINGMAXRAND), FALSE); 01471 EnableGadget (_R(IDC_BUTTONBRUSHSCALINGRANDSEED), FALSE); 01472 } 01473 else // we have random scaling 01474 { 01475 UsingRandomScaling = TRUE; 01476 // EnableGadget (_R(IDC_STATICBRUSHSCALINGINCR), FALSE); 01477 // EnableGadget (_R(IDC_SPINBRUSHSCALINGINCR), FALSE); 01478 // EnableGadget (_R(IDC_EDITBRUSHSCALINGINCR), FALSE); 01479 } 01480 01481 01482 }
|
|
Definition at line 1560 of file brushdlg.cpp. 01561 { 01562 if (m_bDisableGadgets) 01563 { 01564 ReInitBrushSequence(); 01565 return; 01566 } 01567 01568 01569 // do the transparency sliders 01570 SetGadgetBitmaps(_R(IDC_SLIDERTRANSP), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01571 SetGadgetRange(_R(IDC_SLIDERTRANSP), MIN_TRANSP_SLIDER, MAX_TRANSP_SLIDER); 01572 SetLongGadgetValue(_R(IDC_SLIDERTRANSP), (MAX_TRANSP_SLIDER - EditData->m_BrushTransparency) + MIN_TRANSP_SLIDER); 01573 01574 SetGadgetBitmaps(_R(IDC_SLIDERTRANSPPRESSURE), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01575 SetGadgetRange(_R(IDC_SLIDERTRANSPPRESSURE), MIN_PRESSURE_SLIDER, MAX_PRESSURE_SLIDER); 01576 SetLongGadgetValue(_R(IDC_SLIDERTRANSPPRESSURE), (MAX_PRESSURE_SLIDER - EditData->m_TranspMaxPressure) + MIN_PRESSURE_SLIDER); 01577 01578 UpdateEditBox(_R(IDC_EDITBRUSHTRANSP)); 01579 SetRandomRangeText(_R(IDC_SLIDERTRANSPPRESSURE)); 01580 }
|
|
Definition at line 1305 of file brushdlg.cpp. 01306 { 01307 SetSpacingSlider(); 01308 01309 // SetSpacingIncrSlider(); 01310 01311 // Edit boxes have their own function 01312 // UpdateEditBox(_R(IDC_EDITBRUSHSPACINGINCRCONST)); 01313 UpdateEditBox (_R(IDC_EDITBRUSHSPACING)); 01314 01315 SetGadgetRange (_R(IDC_SLIDERBRUSHSPACINGMAXRAND), MIN_RANDOM_SLIDER, MAX_RANDOM_SLIDER); 01316 SetGadgetBitmaps (_R(IDC_SLIDERBRUSHSPACINGMAXRAND), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 01317 SetLongGadgetValue (_R(IDC_SLIDERBRUSHSPACINGMAXRAND), MAX_RANDOM_SLIDER - (EditData->m_BrushSpacingMaxRand) + MIN_RANDOM_SLIDER); 01318 SetRandomRangeText(_R(IDC_SLIDERBRUSHSPACINGMAXRAND)); 01319 01320 if (m_bDisableGadgets) 01321 { 01322 ReInitBrushSpacing(); 01323 return; 01324 } 01325 01326 01327 // now have to share the randomize button between spacing and sequence 01328 if (EditData->m_BrushSpacingMaxRand == 0 && EditData->m_SequenceType != SEQ_RANDOM ) // no random spacing 01329 { 01330 01331 UsingRandomSpacing = FALSE; 01332 EnableGadget (_R(IDC_BUTTONBRUSHSPACINGRANDSEED), FALSE); 01333 01334 } 01335 else // we have random spacing 01336 { 01337 UsingRandomSpacing = TRUE; 01338 EnableGadget (_R(IDC_BUTTONBRUSHSPACINGRANDSEED), TRUE); 01339 } 01340 InitSequenceType (); 01341 }
|
|
Definition at line 1677 of file brushdlg.cpp. 01678 { 01679 DeleteAllValues (_R(IDC_COMBOPATHOFFSETTYPE)); 01680 01681 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_NONE), TRUE, 0); 01682 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_ALTERNATE), TRUE, 1); 01683 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_LEFT), TRUE, 2); 01684 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_RIGHT), TRUE, 3); 01685 //SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_RANDOM), TRUE, 4); 01686 01687 switch (EditData->m_PathOffsetType) 01688 { 01689 case OFFSET_NONE: 01690 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_NONE), FALSE, -1); 01691 break; 01692 case OFFSET_ALTERNATE: 01693 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_ALTERNATE), FALSE, -1); 01694 break; 01695 case OFFSET_LEFT: 01696 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_LEFT), FALSE, -1); 01697 break; 01698 case OFFSET_RIGHT: 01699 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_RIGHT), FALSE, -1); 01700 break; 01701 // We have gotten rid of the random option but some may remain from early files, so 01702 // display the default 01703 default: 01704 SetStringGadgetValue (_R(IDC_COMBOPATHOFFSETTYPE), _R(IDS_OFFSET_NONE), FALSE, -1); 01705 break; 01706 } 01707 }
|
|
Definition at line 1709 of file brushdlg.cpp. 01710 { 01711 DeleteAllValues (_R(IDC_COMBOSEQUENCETYPE)); 01712 01713 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_FORWARD), TRUE, 0); 01714 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_BACKWARD), TRUE, 1); 01715 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_MIRROR), TRUE, 2); 01716 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_RANDOM), TRUE, 3); 01717 01718 switch (EditData->m_SequenceType) 01719 { 01720 case SEQ_FORWARD: 01721 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_FORWARD), FALSE, -1); 01722 break; 01723 case SEQ_BACKWARD: 01724 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_BACKWARD), FALSE, -1); 01725 break; 01726 case SEQ_MIRROR: 01727 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_MIRROR), FALSE, -1); 01728 break; 01729 case SEQ_RANDOM: 01730 SetStringGadgetValue (_R(IDC_COMBOSEQUENCETYPE), _R(IDS_SEQ_RANDOM), FALSE, -1); 01731 break; 01732 } 01733 01734 BrushDefinition* pDef = BrushComponent::FindBrushDefinition(EditData->m_BrushHandle); 01735 if (pDef) 01736 { 01737 UINT32 Num = pDef->GetNumBrushObjects(); 01738 if (Num == 1) 01739 EnableGadget(_R(IDC_COMBOSEQUENCETYPE), FALSE); 01740 01741 } 01742 }
|
|
Definition at line 1144 of file brushdlg.cpp. 01145 { 01146 // we need to make sure our handle is valid 01147 Document* pDoc = Document::GetCurrent(); 01148 if (pDoc == NULL) 01149 return; 01150 BrushComponent* pBrushComp = (BrushComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(BrushComponent)); 01151 if (pBrushComp == NULL) 01152 { 01153 ERROR3("No brush component in our document"); 01154 return; 01155 } 01156 BrushDefinition* pBrushDef = pBrushComp->FindBrushDefinition(Handle); 01157 if (pBrushDef == NULL) 01158 return; 01159 01160 // set the flag so we know what we're doing 01161 EditingBrushDef = TRUE; 01162 01163 //get some brush data from the definition 01164 BrushData* pInvokeOn = pBrushDef->GetBrushData(); 01165 if (pInvokeOn == NULL) 01166 return; 01167 // for various reasons we want to disable the first operation 01168 m_bDisableOps = TRUE; 01169 m_Handle = Handle; 01170 01171 OpDescriptor* pOpDescriptor = OpDescriptor::FindOpDescriptor (OPTOKEN_BRUSHEDIT_DLG); 01172 if( pOpDescriptor != 0 ) 01173 { 01174 OpParam Param( reinterpret_cast<INT32>( &pInvokeWith ), reinterpret_cast<INT32>( pInvokeOn ) ); 01175 DoWithParam( pOpDescriptor, &Param ); 01176 } 01177 }
|
|
Definition at line 1181 of file brushdlg.cpp. 01182 { 01183 if (pInvokeOn == NULL || pBrush == NULL) 01184 { 01185 ERROR3("Invalid inputs"); 01186 return; 01187 } 01188 01189 OpDescriptor* pOpDescriptor = OpDescriptor::FindOpDescriptor (OPTOKEN_BRUSHEDIT_DLG); 01190 if( pOpDescriptor != 0 ) 01191 { 01192 pAttrBrush_m = pBrush; 01193 pOrigAttrBrush_m = pOrigBrush; 01194 OpParam Param( reinterpret_cast<INT32>( &pInvokeWith ), reinterpret_cast<INT32>( pInvokeOn ) ); 01195 DoWithParam( pOpDescriptor, &Param ); 01196 } 01197 }
|
|
I'm not entirely sure what this does, perhaps Chris will be able to elaborate, I think they were once used as part of launching the dialog, but I think they are no longer used.
Definition at line 1125 of file brushdlg.cpp. 01126 { 01127 if (pInvokeOn == NULL) 01128 { 01129 ERROR3("Invalid inputs"); 01130 return; 01131 } 01132 01133 // for various reasons we want to disable the first operation 01134 m_bDisableOps = TRUE; 01135 OpDescriptor* pOpDescriptor = OpDescriptor::FindOpDescriptor (OPTOKEN_BRUSHEDIT_DLG); 01136 if( pOpDescriptor != 0 ) 01137 { 01138 OpParam Param( reinterpret_cast<INT32>( &pInvokeWith ), reinterpret_cast<INT32>( pInvokeOn ) ); 01139 DoWithParam( pOpDescriptor, &Param ); 01140 } 01141 }
|
|
Definition at line 1908 of file brushdlg.cpp. 01909 { 01910 01911 // the op we launch differs slightly depending on whether we are editing a brush from 01912 // the selection or the brush definition. If its from the selection then its easy 01913 if (ChangeType_m != CHANGEBRUSH_NONE) 01914 { 01915 if (EditingBrushDef == FALSE) 01916 { 01917 01918 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGEBRUSH); 01919 if (pOpDesc != NULL ) 01920 { 01921 ChangeParam_m.ChangeType = ChangeType_m; 01922 pOpDesc->Invoke(&ChangeParam_m); 01923 m_LastData = *EditData; 01924 } 01925 01926 } 01927 01928 } 01929 else 01930 TRACEUSER( "Diccon", _T("NOT LAUNCHING OP!!\n")); 01931 01932 // reset our member 01933 ChangeType_m = CHANGEBRUSH_NONE; 01934 01935 // enable the save button 01936 SetPropertyPageModified(TRUE); 01937 }
|
|
Message proc for this dialog.
Reimplemented from DialogTabOp. Definition at line 622 of file brushdlg.cpp. 00623 { 00624 BOOL bClose = FALSE; 00625 if (IS_OUR_DIALOG_MSG (Message)) 00626 { 00627 DialogMsg* Msg = static_cast<DialogMsg*>( Message ); 00628 00629 CDlgResID ThePage = Msg->PageID; // the current page 00630 00631 BOOL MessageAlreadyHandled = FALSE; // due to the 'multi-pass' nature of the function 00632 INT32 Test = -1; 00633 switch (Msg->DlgMsg) 00634 { 00635 // we don't want the focus .... 00636 case DIM_TITLEFOCUSWARN: 00637 { 00638 // DialogManager::DefaultKeyboardFocus(); 00639 // MessageAlreadyHandled = TRUE; 00640 00641 // this message is sent because the dialog has moved 00642 BROADCAST_TO_ALL(ScreenChangeMsg()); 00643 } 00644 break; 00645 00646 // we don't want the focus .... 00647 case DIM_CREATE: 00648 { 00649 // are we editing a brush definition? 00650 if (EditingBrushDef) 00651 { 00652 // is this the first time the dialog has been created? 00653 if (FirstTime) 00654 { 00655 HideShuffleIrrelevantButtons (); 00656 00657 //ResizeDialogAndCreateBrushPreview (); 00658 00659 FirstTime = FALSE; 00660 } 00661 } 00662 else 00663 { 00664 if (FirstTime) 00665 { 00666 HideShuffleIrrelevantButtons (); 00667 00668 FirstTime = FALSE; 00669 } 00670 } 00671 DialogManager::DefaultKeyboardFocus(); 00672 } 00673 break; 00674 00675 case DIM_SET_ACTIVE: 00676 { 00677 ReInitPage(ThePage); 00678 } 00679 break; 00680 case DIM_COMMIT: 00681 // we have renamed the OK button to be Save As New so creat 00682 // a new brush here 00683 CreateNewBrush(); 00684 00685 break; 00686 00687 00688 case DIM_SOFT_COMMIT: 00689 { 00690 // soft commit is generated by the apply button, which we have renamed 00691 // we now wish to save this brush data as the brush definition. 00692 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGEBRUSHDEF); 00693 if (pOpDesc != NULL) 00694 { 00695 // make a derived class OpParam from the member, and tell it which definition to edit 00696 ChangeBrushDefOpParam DefParam; 00697 DefParam = ChangeParam_m; 00698 DefParam.ChangeType = CHANGEBRUSH_ALL; 00699 DefParam.m_Handle = EditData->m_BrushHandle; 00700 DefParam.m_NewScaling = 1.0; 00701 pOpDesc->Invoke(&DefParam); 00702 00703 } 00704 EnableGadget(_R(ID_APPLY_NOW), TRUE); 00705 } 00706 break; 00707 // close the dialog .... 00708 case DIM_CANCEL: 00709 { 00710 TRACEUSER( "Diccon", _T("Closing dialog, EditingBD = %d\n"), EditingBrushDef); 00711 00712 if (EditingBrushDef) 00713 { 00714 00715 if (pAttrBrush_m != NULL) 00716 delete pAttrBrush_m; 00717 } 00718 m_bIsOpen = FALSE; 00719 00720 00721 Close (); 00722 bClose = TRUE; 00723 MessageAlreadyHandled = TRUE; 00724 00725 } 00726 break; 00727 00728 00729 // handle sliders: 00730 case DIM_SLIDER_POS_CHANGING : 00731 { 00732 if (!m_bPreventUpdateSet) 00733 { 00734 if (Tool::GetCurrentID() == TOOLID_FREEHAND) 00735 { 00736 FreeHandTool* pTool = (FreeHandTool*)Tool::GetCurrent(); 00737 pTool->SetBrushUpdateState(UPDATE_NEVER); 00738 } 00739 m_bPreventUpdateSet = TRUE; 00740 } 00741 00742 HandleSliderPosChanging (Msg); 00743 } 00744 break; 00745 00746 // handle sliders: 00747 case DIM_SLIDER_POS_SET: 00748 { 00749 00750 if (m_bPreventUpdateSet) 00751 { 00752 if (Tool::GetCurrentID() == TOOLID_FREEHAND) 00753 { 00754 00755 FreeHandTool* pTool = (FreeHandTool*)Tool::GetCurrent(); 00756 pTool->SetBrushUpdateState(UPDATE_ONIDLE); 00757 00758 } 00759 m_bPreventUpdateSet = FALSE; 00760 } 00761 00762 HandleSliderPosSet (Msg); 00763 00764 00765 } 00766 break; 00767 00768 // handle buttons 00769 case DIM_LFT_BN_CLICKED: 00770 { 00771 00772 HandleButtonDown(Msg); 00773 00774 } 00775 break; 00776 00777 // now that we have subclassed our edit boxes this handles both combos and edit boxes 00778 case DIM_SELECTION_CHANGED: 00779 { 00780 switch (Msg->DlgMsgParam) 00781 { 00782 case ENTER_COMMIT: 00783 Test = 3; 00784 break; 00785 case TAB_COMMIT: 00786 Test = 4; 00787 break; 00788 default: 00789 00790 break; 00791 } 00792 HandleSelectionChange (Msg); 00793 } 00794 break; 00795 00796 default: 00797 break; 00798 00799 } 00800 00801 // dispatch message to relevant page handler .... 00802 if ( ThePage && !MessageAlreadyHandled) 00803 { 00804 if (FALSE) {} 00805 else if (ThePage == _R(IDD_BRUSHEDITSPACING)) 00806 HandleBrushEditSpacingMsg (Msg); 00807 else if (ThePage == _R(IDD_BRUSHEDITOFFSET)) 00808 HandleBrushEditOffsetMsg (Msg); 00809 else if (ThePage == _R(IDD_BRUSHEDITSCALING)) 00810 HandleBrushEditScalingMsg (Msg); 00811 else if (ThePage == _R(IDD_BRUSHEDITEFFECTS)) 00812 HandleBrushEditEffectMsg (Msg); 00813 else if (ThePage == _R(IDD_BRUSHEDITSEQUENCE)) 00814 HandleBrushEditSequenceMsg (Msg); 00815 else if (ThePage == _R(IDD_BRUSHEDITFILL)) 00816 HandleBrushFillMsg(Msg); 00817 else 00818 { 00819 ERROR3("Message from unknown tab dialog page"); 00820 } 00821 } 00822 00823 } 00824 else // deal with non-dialog messages here 00825 { 00826 // this message tells us that the brushdefinition has changed so we need 00827 // to update our preview window 00828 if (Message->IsKindOf(CC_RUNTIME_CLASS(BrushDefMsg))) 00829 { 00830 00831 // only if we are editing the definition 00832 if (EditingBrushDef) 00833 { 00834 // deelete our attribute node, and ask the definition for a new one 00835 GetAttributeNodeFromDefinition(); 00836 00837 } 00838 } 00839 if (MESSAGE_IS_A(Message, SelChangingMsg)) 00840 { 00841 HandleDocSelectionChange(); 00842 } 00843 } 00844 00845 // Pass all unhandled messages to base class for default processing! 00846 MsgResult Result = DialogOp::Message (Message); 00847 00848 if (bClose) 00849 { 00850 PORTNOTE("other", "Disabled CBrushGadget") 00851 #ifndef EXCLUDE_FROM_XARALX 00852 // tell the owning gadget that this dialog has closed 00853 if (m_pOwningGadget != 0) 00854 { 00855 m_pOwningGadget->DialogHasClosed(); 00856 } 00857 #endif 00858 } 00859 00860 return Result; 00861 }
|
|
|
Definition at line 2304 of file brushdlg.cpp. 02305 { 02306 // BOOL Checked; 02307 02308 if (Msg->GadgetID == _R(IDC_CHECKTILEING)) 02309 { 02310 EditData->m_bTile = !(EditData->m_bTile); 02311 //GetBoolGadgetSelected (_R(IDC_CHECKTILEING),0, &Checked); 02312 //EditData->m_bTile = Checked; 02313 ChangeType_m = CHANGEBRUSH_TILED; 02314 ChangeParam_m.m_bNewTiled = EditData->m_bTile;//Checked; 02315 ReInitBrushFill(); 02316 } 02317 else if (Msg->GadgetID == _R(IDC_CHECKLOCALFILLCOLOUR)) 02318 { 02319 //GetBoolGadgetSelected (_R(IDC_CHECKLOCALFILLCOLOUR),0, &Checked); 02320 EditData->m_bUseLocalFillColour = !(EditData->m_bUseLocalFillColour);//Checked; 02321 ChangeType_m = CHANGEBRUSH_USELOCALFILLCOL; 02322 ChangeParam_m.m_bNewUseLocalFillColour = EditData->m_bUseLocalFillColour;//Checked; 02323 ReInitBrushFill(); 02324 } 02325 else if (Msg->GadgetID == _R(IDC_CHECKOVERRIDENAMED)) 02326 { 02327 EditData->m_bUseNamedColour = !(EditData->m_bUseNamedColour); 02328 ChangeType_m = CHANGEBRUSH_USENAMEDCOL; 02329 ChangeParam_m.m_bNewUseNamed = EditData->m_bUseNamedColour; 02330 ReInitBrushFill(); 02331 } 02332 else if (Msg->GadgetID == _R(IDC_CHECKROTATE)) 02333 { 02334 //GetBoolGadgetSelected (_R(IDC_CHECKROTATE),0, &Checked); 02335 EditData->m_bRotate = !(EditData->m_bRotate);//Checked; 02336 ChangeType_m = CHANGEBRUSH_TANGENTIAL; 02337 ChangeParam_m.m_bNewRotated = EditData->m_bRotate;//Checked; 02338 // ReInitBrushEffects (); 02339 02340 /*if (!(EditData->m_bRotate)) 02341 { 02342 EditData->m_RotateAngle = DefaultRotationAngle; 02343 }*/ 02344 } 02345 else 02346 { 02347 //ERROR3 ("Unrecognised gadget"); // not necessarily an error, as it may have been a button 02348 ChangeType_m = CHANGEBRUSH_NONE; 02349 } 02350 }
|
|
|
Definition at line 2005 of file brushdlg.cpp. 02006 { 02007 MILLIPOINT MilliPointNewVal; 02008 double DoubleNewVal; 02009 INT32 LongNewVal; 02010 BOOL Valid = FALSE; 02011 ChangeType_m = CHANGEBRUSH_NONE; 02012 // brush spacing stuff .... 02013 02014 if (FALSE) {} 02015 else if (Msg->GadgetID == _R(IDC_EDITBRUSHSPACING)) 02016 { 02017 double MinSpacingSlider = 0; 02018 double MaxSpacingSlider = 0; 02019 GetSpacingRange(&MinSpacingSlider, &MaxSpacingSlider); 02020 DoubleNewVal = GetDoubleGadgetValue (_R(IDC_EDITBRUSHSPACING), MinSpacingSlider , MaxSpacingSlider); 02021 MILLIPOINT NewVal = GetPercentageAsDistance(DoubleNewVal, WIDTH); 02022 DoubleNewVal = pow((double)NewVal, InvFactor); 02023 02024 if (DoubleNewVal >= MinSpacingSlider && DoubleNewVal <= MaxSpacingSlider) 02025 { 02026 if (EditData->m_BrushSpacing != NewVal) 02027 { 02028 02029 EditData->m_BrushSpacing = NewVal; 02030 ChangeType_m = CHANGEBRUSH_SPACING; 02031 ChangeParam_m.m_NewSpacing = NewVal; 02032 ReInitBrushSpacing(); 02033 } 02034 } 02035 else 02036 { 02037 //InformWarning(_R(IDS_BRUSHSPACING_INVALID)); 02038 UpdateEditBox(_R(IDC_EDITBRUSHSPACING)); 02039 } 02040 } 02041 else if (Msg->GadgetID == _R(IDC_EDITBRUSHSPACINGINCRCONST)) 02042 { 02043 DoubleNewVal = GetDoubleGadgetValue(_R(IDC_EDITBRUSHSPACINGINCRCONST), MIN_SPACING_INCR, MAX_SPACING_INCR, _R(IDS_BRUSHINCRINVALID), &Valid); 02044 02045 if (DoubleNewVal > MIN_SPACING_INCR && DoubleNewVal < MAX_SPACING_INCR && Valid) 02046 { 02047 // we need to convert the % value we got from the slider into millipoints 02048 MILLIPOINT Distance = GetPercentageAsDistance(DoubleNewVal, WIDTH); 02049 if (abs(Distance - EditData->m_BrushSpacingIncrConst) > 5) 02050 { 02051 EditData->m_BrushSpacingIncrConst = Distance; 02052 ChangeType_m = CHANGEBRUSH_SPACING_INCRCONST; 02053 ChangeParam_m.m_NewSpacingIncrConst = Distance; 02054 SetSpacingIncrSlider(); 02055 } 02056 } 02057 else 02058 { 02059 //InformWarning(_R(IDS_BRUSHINCRINVALID)); 02060 UpdateEditBox(_R(IDC_EDITBRUSHSPACINGINCRCONST)); 02061 } 02062 } 02063 else if (Msg->GadgetID == _R(IDC_EDITPATHOFFSETVALUE)) 02064 { 02065 DoubleNewVal = GetDoubleGadgetValue(_R(IDC_EDITPATHOFFSETVALUE), MinOffset, MaxOffset,0, &Valid ); 02066 02067 if (DoubleNewVal <= MaxOffset && DoubleNewVal >= MinOffset && Valid) 02068 { 02069 // convert the % val into millipoints 02070 MILLIPOINT Offset = GetPercentageAsDistance(DoubleNewVal, HEIGHT); 02071 if (abs(Offset - EditData->m_PathOffsetValue) > 5) 02072 { 02073 EditData->m_PathOffsetValue = Offset; 02074 ChangeType_m = CHANGEBRUSH_OFFSET_VAL; 02075 ChangeParam_m.m_NewPathOffsetVal = Offset; 02076 ReInitBrushOffset(); 02077 } 02078 } 02079 else 02080 { 02081 UpdateEditBox(_R(IDC_EDITPATHOFFSETVALUE)); 02082 } 02083 } 02084 else if (Msg->GadgetID == _R(IDC_EDITPATHOFFSETINCRCONST)) 02085 { 02086 DoubleNewVal = GetDoubleGadgetValue(_R(IDC_EDITPATHOFFSETINCRCONST), MIN_SPACING_INCR, MAX_SPACING_INCR, _R(IDS_BRUSHINCRINVALID), &Valid); 02087 if (Valid && DoubleNewVal <= MAX_SPACING_INCR && DoubleNewVal >= MIN_SPACING_INCR) 02088 { 02089 MilliPointNewVal = GetPercentageAsDistance(DoubleNewVal, HEIGHT); 02090 if (EditData->m_PathOffsetIncrConst != MilliPointNewVal) 02091 { 02092 EditData->m_PathOffsetIncrConst = MilliPointNewVal; 02093 ChangeParam_m.m_NewOffsetIncrConst = MilliPointNewVal; 02094 ChangeType_m = CHANGEBRUSH_OFFSET_INCRCONST; 02095 ReInitBrushOffset(); 02096 } 02097 } 02098 else 02099 { 02100 //InformWarning(_R(IDS_BRUSHINCRINVALID)); 02101 UpdateEditBox(_R(IDC_EDITPATHOFFSETINCRCONST)); 02102 } 02103 } 02104 else if (Msg->GadgetID == _R(IDC_EDITSCALINGINCRCONST)) 02105 { 02106 DoubleNewVal = GetDoubleGadgetValue (_R(IDC_EDITSCALINGINCRCONST), MinScalingIncrSlider, MaxScalingIncrSlider, _R(IDS_BRUSHSCALINGINCRINVALID), &Valid); 02107 02108 if (DoubleNewVal <= MaxScalingIncrSlider && DoubleNewVal >= MinScalingIncrSlider && Valid) 02109 { 02110 // we need to convert the % value we got from the slider into millipoints 02111 if (EditData->m_BrushScalingIncrConst != DoubleNewVal) 02112 { 02113 EditData->m_BrushScalingIncrConst = DoubleNewVal; 02114 ReInitBrushScaling(); 02115 ChangeType_m = CHANGEBRUSH_SCALING_INCRCONST; 02116 ChangeParam_m.m_NewScalingIncrConst = EditData->m_BrushScalingIncrConst; 02117 } 02118 } 02119 else 02120 { 02121 //InformWarning(_R(IDS_BRUSHSCALINGINCRINVALID)); 02122 UpdateEditBox(_R(IDC_EDITSCALINGINCRCONST)); 02123 } 02124 } 02125 else if (Msg->GadgetID == _R(IDC_EDITBRUSHSCALINGINCR)) 02126 { 02127 DoubleNewVal = GetDoubleGadgetValue (_R(IDC_EDITBRUSHSCALINGINCR), MinMultiSlider, MaxMultiSlider, _R(IDS_INCRPROP_INVALID), &Valid); 02128 if (! Valid || DoubleNewVal < MinMultiSlider || DoubleNewVal > MaxMultiSlider) 02129 { 02130 //InformWarning(_R(IDS_INCRPROP_INVALID)); 02131 UpdateEditBox(_R(IDC_EDITBRUSHSCALINGINCR)); 02132 } 02133 else 02134 { 02135 if (EditData->m_BrushScalingIncr != DoubleNewVal / 100) 02136 { 02137 EditData->m_BrushScalingIncr = DoubleNewVal / 100; 02138 ChangeType_m = CHANGEBRUSH_SCALING_INCR; 02139 ChangeParam_m.m_NewScalingIncr = DoubleNewVal / 100; 02140 ReInitBrushScaling(); 02141 } 02142 } 02143 } 02144 else if (Msg->GadgetID == _R(IDC_EDITROTATEANGLE)) 02145 { 02146 DoubleNewVal = GetDoubleGadgetValue(_R(IDC_EDITROTATEANGLE), 0, MAX_ANGLE_DEG, _R(IDS_BRUSHANGLE_INVALID), &Valid ); 02147 if (! Valid || DoubleNewVal < 0 || DoubleNewVal > MAX_ANGLE_DEG) 02148 { 02149 //InformWarning(_R(IDS_BRUSHANGLE_INVALID)); 02150 UpdateEditBox(_R(IDC_EDITROTATEANGLE)); 02151 } 02152 else 02153 { 02154 if (EditData->m_RotateAngle != DoubleNewVal) 02155 { 02156 EditData->m_RotateAngle = DoubleNewVal; 02157 ChangeType_m = CHANGEBRUSH_ROTATE_ANGLE; 02158 ChangeParam_m.m_NewRotateAngle = DoubleNewVal; 02159 ReInitBrushEffects(); 02160 } 02161 } 02162 } 02163 else if (Msg->GadgetID == _R(IDC_EDITROTATEANGLEINCR)) 02164 { 02165 DoubleNewVal = GetDoubleGadgetValue(_R(IDC_EDITROTATEANGLEINCR), MIN_ANGLE_DEG , MAX_ANGLE_DEG, _R(IDS_BRUSHANGLE_INVALID), &Valid); 02166 if (!Valid || DoubleNewVal < MIN_ANGLE_DEG || DoubleNewVal > MAX_ANGLE_DEG) 02167 { 02168 //InformWarning(_R(IDS_BRUSHANGLE_INVALID)); 02169 UpdateEditBox(_R(IDC_EDITROTATEANGLEINCR)); 02170 } 02171 else 02172 { 02173 if (EditData->m_RotAngleIncrConst != DoubleNewVal) 02174 { 02175 EditData->m_RotAngleIncrConst = DoubleNewVal ; 02176 ChangeType_m = CHANGEBRUSH_ROTATE_INCRCONST; 02177 ChangeParam_m.m_NewRotationIncrConst = DoubleNewVal ; 02178 ReInitBrushEffects(); 02179 } 02180 } 02181 } 02182 else if (Msg->GadgetID == _R(IDC_EDITBRUSHTRANSP)) 02183 { 02184 LongNewVal = GetLongGadgetValue(_R(IDC_EDITBRUSHTRANSP), MIN_TRANSP_SLIDER-100 , MAX_TRANSP_SLIDER-100, _R(IDS_BRUSHTRANSP_INVALID), &Valid); 02185 if (Valid) 02186 { 02187 if (EditData->m_BrushTransparency != LongNewVal + 100) 02188 { 02189 EditData->m_BrushTransparency = LongNewVal + 100; 02190 ChangeType_m = CHANGEBRUSH_TRANSP; 02191 ChangeParam_m.m_NewTransp = EditData->m_BrushTransparency; 02192 ReInitBrushSequence(); 02193 } 02194 02195 02196 } 02197 UpdateEditBox(_R(IDC_EDITBRUSHTRANSP)); 02198 } 02199 }
|
|
Definition at line 2352 of file brushdlg.cpp. 02353 { 02354 if (Msg == NULL) 02355 return; 02356 02357 if (Msg->GadgetID == _R(IDC_RADIOLOCALFILLALL)) 02358 { 02359 if (EditData->m_bUseLocalFillColour == FALSE) 02360 { 02361 EditData->m_bUseLocalFillColour = TRUE; 02362 // we need to set this to true to indicate that we are not overriding only named 02363 // colours, the semantics are a little off i'm afraid 02364 EditData->m_bUseNamedColour = TRUE; 02365 ChangeParam_m.m_bNewUseLocalFillColour = TRUE; 02366 ChangeType_m = CHANGEBRUSH_USELOCALFILLCOL; 02367 } 02368 } 02369 else if (Msg->GadgetID == _R(IDC_RADIOLOCALFILLNAMED)) 02370 { 02371 // potentially a bit confusing this: if UseNamed == TRUE then we do not use 02372 // any of the local colours, if UseNamed == FALSE then we do 02373 if (EditData->m_bUseNamedColour == TRUE) 02374 { 02375 EditData->m_bUseNamedColour = FALSE; 02376 EditData->m_bUseLocalFillColour = FALSE; 02377 ChangeParam_m.m_bNewUseNamed = FALSE; 02378 ChangeType_m = CHANGEBRUSH_USENAMEDCOL; 02379 } 02380 } 02381 else if (Msg->GadgetID == _R(IDC_RADIOLOCALFILLNONE)) 02382 { 02383 // find out which local option was selected and turn it off 02384 if (EditData->m_bUseLocalFillColour) 02385 { 02386 EditData->m_bUseLocalFillColour = FALSE; 02387 ChangeParam_m.m_bNewUseLocalFillColour = FALSE; 02388 ChangeType_m = CHANGEBRUSH_USELOCALFILLCOL; 02389 } 02390 02391 if (EditData->m_bUseNamedColour == FALSE) 02392 { 02393 EditData->m_bUseNamedColour = TRUE; 02394 ChangeParam_m.m_bNewUseNamed = TRUE; 02395 ChangeType_m = CHANGEBRUSH_USENAMEDCOL; 02396 } 02397 02398 } 02399 }
|
|
Definition at line 2401 of file brushdlg.cpp. 02402 { 02403 BOOL Valid; 02404 INT32 Result; 02405 02406 ChangeType_m = CHANGEBRUSH_NONE; // initialise our op type to none 02407 02408 if (Msg->GadgetID == _R(IDC_SLIDERBRUSHSPACING1)) 02409 { 02410 double MinSpacingSlider = 0; 02411 double MaxSpacingSlider = 0; 02412 02413 GetSpacingRange(&MinSpacingSlider, &MaxSpacingSlider); 02414 02415 INT32 IntMin = (INT32)(MinSpacingSlider); 02416 INT32 IntMax = (INT32)(MaxSpacingSlider); 02417 02418 Result = GetLongGadgetValue (_R(IDC_SLIDERBRUSHSPACING1), IntMin, IntMax, 0, &Valid); 02419 Result = (IntMax - Result) + IntMin; 02420 02421 if (Valid) 02422 { 02423 double ExpVal = pow(Result, ExpFactor); 02424 MILLIPOINT NewSpacing = (MILLIPOINT)ExpVal; 02425 02426 EditData->m_BrushSpacing = NewSpacing; 02427 ChangeParam_m.m_NewSpacing = NewSpacing; 02428 ChangeType_m = CHANGEBRUSH_SPACING; 02429 SetSpacingSlider(); 02430 02431 02432 } 02433 } 02434 else if (Msg->GadgetID == _R(IDC_SLIDERBRUSHSPACINGINCR)) 02435 { 02436 double dblResult = GetDoubleGadgetValue(_R(IDC_SLIDERBRUSHSPACINGINCR), MIN_SPACING_INCR, MAX_SPACING_INCR, 0, &Valid); 02437 dblResult = (MAX_SPACING_INCR - dblResult) + MIN_SPACING_INCR; 02438 if (Valid) 02439 { 02440 // we need to convert the % value we got from the slider into millipoints 02441 MILLIPOINT Distance = GetPercentageAsDistance(dblResult, WIDTH); 02442 02443 EditData->m_BrushSpacingIncrConst = Distance; 02444 ChangeParam_m.m_NewSpacingIncrConst = Distance; 02445 ChangeType_m = CHANGEBRUSH_SPACING_INCRCONST; 02446 UpdateEditBox(_R(IDC_EDITBRUSHSPACINGINCRCONST)); 02447 02448 } 02449 } 02450 else if (Msg->GadgetID == _R(IDC_SLIDERBRUSHSPACINGMAXRAND)) 02451 { 02452 Result = GetLongGadgetValue (_R(IDC_SLIDERBRUSHSPACINGMAXRAND), MIN_RANDOM_SLIDER, MAX_RANDOM_SLIDER, 0, &Valid); 02453 Result = MAX_RANDOM_SLIDER - Result; 02454 02455 if (Valid) 02456 { 02457 EditData->m_BrushSpacingMaxRand = Result; 02458 02459 if (!UsingRandomSpacing) 02460 { 02461 if (Result != MIN_RANDOM_SLIDER) 02462 { 02463 ReInitBrushSpacing (); 02464 } 02465 } 02466 else if (Result == MIN_RANDOM_SLIDER) 02467 { 02468 ReInitBrushSpacing (); 02469 } 02470 ChangeType_m = CHANGEBRUSH_SPACING_MAXRAND; 02471 ChangeParam_m.m_NewSpacingMaxRand = Result; 02472 SetRandomRangeText(_R(IDC_SLIDERBRUSHSPACINGMAXRAND)); 02473 } 02474 } 02475 else if (Msg->GadgetID == _R(IDC_SLIDERPATHOFFSETVAL)) 02476 { 02477 double MinOffset = 0; 02478 double MaxOffset = 0; 02479 02480 GetOffsetRange(&MinOffset, &MaxOffset); 02481 02482 INT32 lMinOffset = (INT32)MinOffset; 02483 INT32 lMaxOffset = (INT32)MaxOffset; 02484 02485 Result = GetLongGadgetValue(_R(IDC_SLIDERPATHOFFSETVAL), lMinOffset, lMaxOffset, 0, &Valid); 02486 Result = (lMaxOffset - Result) + lMinOffset; 02487 02488 if (Valid) 02489 { 02490 double ExpVal = pow(Result, ExpFactor); 02491 MILLIPOINT NewOffset = (MILLIPOINT)ExpVal; 02492 02493 EditData->m_PathOffsetValue = NewOffset; 02494 ChangeParam_m.m_NewPathOffsetVal = NewOffset; 02495 ChangeType_m = CHANGEBRUSH_OFFSET_VAL; 02496 ReInitBrushOffset(); 02497 02498 } 02499 02500 } 02501 else if (Msg->GadgetID == _R(IDC_SLIDEROFFSETINCRCONST)) 02502 { 02503 double NewIncr = GetDoubleGadgetValue(_R(IDC_SLIDEROFFSETINCRCONST), MIN_SPACING_INCR, MAX_SPACING_INCR, 0, &Valid); 02504 02505 if (Valid) 02506 { 02507 NewIncr = (MAX_SPACING_INCR - NewIncr) + MIN_SPACING_INCR; 02508 MILLIPOINT Incr = GetPercentageAsDistance(NewIncr, HEIGHT); 02509 if (abs(EditData->m_PathOffsetIncrConst - Incr) > 20) 02510 { 02511 EditData->m_PathOffsetIncrConst = Incr; 02512 ChangeParam_m.m_NewOffsetIncrConst = Incr; 02513 ChangeType_m = CHANGEBRUSH_OFFSET_INCRCONST; 02514 UpdateEditBox(_R(IDC_EDITPATHOFFSETINCRCONST)); 02515 } 02516 } 02517 } 02518 else if (Msg->GadgetID == _R(IDC_SLIDEROFFSETVALUEMAXRAND)) 02519 { 02520 Result = GetLongGadgetValue (_R(IDC_SLIDEROFFSETVALUEMAXRAND), MinOffsetSlider, MaxOffsetSlider, 0, &Valid); 02521 Result = MaxOffsetSlider - Result; 02522 02523 if (Valid) 02524 { 02525 EditData->m_OffsetValueMaxRand = Result; 02526 02527 // if this is the first movement of the slider and our offset type is offset_none then 02528 // surreptitiously change this to offset_random 02529 if (EditData->m_PathOffsetType == OFFSET_NONE) 02530 { 02531 EditData->m_PathOffsetType = OFFSET_RANDOM; 02532 ChangeParam_m.m_NewPathOffsetType = OFFSET_RANDOM; 02533 ChangeType_m = CHANGEBRUSH_ALL; 02534 } 02535 else 02536 ChangeType_m = CHANGEBRUSH_OFFSET_MAXRAND; 02537 02538 ChangeParam_m.m_NewOffsetValMaxRand = Result; 02539 } 02540 ReInitBrushOffset(); 02541 } 02542 else if (Msg->GadgetID == _R(IDC_SLIDERBRUSHSCALINGMAXRAND)) 02543 { 02544 Result = GetLongGadgetValue (_R(IDC_SLIDERBRUSHSCALINGMAXRAND), MinScalingSlider, MaxScalingSlider, 0, &Valid); 02545 Result = MaxScalingSlider - Result; 02546 02547 if (Valid) 02548 { 02549 EditData->m_BrushScalingMaxRand = Result; 02550 02551 if (!UsingRandomScaling) 02552 { 02553 if (Result != MinScalingSlider) 02554 { 02555 ReInitBrushScaling (); 02556 } 02557 } 02558 else if (Result == MinScalingSlider) 02559 { 02560 ReInitBrushScaling (); 02561 } 02562 SetRandomRangeText(_R(IDC_SLIDERBRUSHSCALINGMAXRAND)); 02563 ChangeType_m = CHANGEBRUSH_SCALING_MAXRAND; 02564 ChangeParam_m.m_NewScalingMaxRand = Result; 02565 } 02566 } 02567 else if (Msg->GadgetID == _R(IDC_SLIDERROTATEANGLE)) 02568 { 02569 double NewAngle = GetDoubleGadgetValue(_R(IDC_SLIDERROTATEANGLE), MIN_ROTATION_SLIDER, MAX_ROTATION_SLIDER, 0, &Valid); 02570 if (Valid) 02571 { 02572 NewAngle = (MAX_ROTATION_SLIDER - NewAngle) + MIN_ROTATION_SLIDER; 02573 02574 // make it a whole number 02575 INT32 AngleRounded = (INT32)NewAngle; 02576 ChangeParam_m.m_NewRotateAngle = (double)AngleRounded; 02577 ChangeType_m = CHANGEBRUSH_ROTATE_ANGLE; 02578 EditData->m_RotateAngle = ChangeParam_m.m_NewRotateAngle; 02579 ReInitBrushEffects(); 02580 02581 02582 } 02583 } 02584 else if (Msg->GadgetID == _R(IDC_SLIDERROTATEANGLEINCR)) 02585 { 02586 double NewIncr = GetDoubleGadgetValue(_R(IDC_SLIDERROTATEANGLEINCR), MIN_ROTATION_INCR_SLIDER, MAX_ROTATION_INCR_SLIDER, 02587 0, &Valid); 02588 if (Valid) 02589 { 02590 NewIncr = (MAX_ROTATION_INCR_SLIDER - NewIncr) + MIN_ROTATION_INCR_SLIDER; 02591 02592 INT32 IncrRounded = (INT32)NewIncr; 02593 EditData->m_RotAngleIncrConst =(double)IncrRounded; 02594 ChangeParam_m.m_NewRotationIncrConst = EditData->m_RotAngleIncrConst; 02595 ChangeType_m = CHANGEBRUSH_ROTATE_INCRCONST; 02596 ReInitBrushEffects(); 02597 02598 } 02599 } 02600 else if (Msg->GadgetID == _R(IDC_SLIDERROTATEANGLEMAXRAND)) 02601 { 02602 Result = GetLongGadgetValue (_R(IDC_SLIDERROTATEANGLEMAXRAND), MIN_RANDOM_SLIDER, MAX_ROTATION_RANDOM_SLIDER, 0, &Valid); 02603 Result = (MAX_ROTATION_RANDOM_SLIDER - Result) + MIN_RANDOM_SLIDER; 02604 //TRACEUSER( "Diccon", _T("Rotation max rand = %d\n"), Result); 02605 if (Valid) 02606 { 02607 EditData->m_RotationMaxRand = Result; 02608 ReInitBrushEffects (); 02609 02610 ChangeType_m = CHANGEBRUSH_ROTATE_MAXRAND; 02611 ChangeParam_m.m_NewRotateMaxRand = Result; 02612 SetRandomRangeText(_R(IDC_SLIDERROTATEANGLEMAXRAND)); 02613 } 02614 } 02615 else if (Msg->GadgetID == _R(IDC_SLIDERROTATEINCR)) 02616 { 02617 Result = GetLongGadgetValue(_R(IDC_SLIDERROTATEINCR), MinMultiSlider, MaxMultiSlider, 0, &Valid); 02618 Result = (MaxMultiSlider - Result) + MinMultiSlider; 02619 if (Valid) 02620 { 02621 02622 EditData->m_RotAngleIncrProp = (double)((double)Result / 100); 02623 ReInitBrushEffects(); 02624 ChangeType_m = CHANGEBRUSH_ROTATE_INCRPROP; 02625 ChangeParam_m.m_NewRotationIncrProp = EditData->m_RotAngleIncrProp; 02626 02627 } 02628 } 02629 else if (Msg->GadgetID == _R(IDC_SLIDERBRUSHSCALINGINCR)) 02630 { 02631 Result = GetLongGadgetValue (_R(IDC_SLIDERBRUSHSCALINGINCR), MinMultiSlider, MaxMultiSlider, 0, &Valid); 02632 Result = (MaxMultiSlider - Result) + MinMultiSlider; 02633 if (Valid) 02634 { 02635 02636 EditData->m_BrushScalingIncr = (double)Result / 100; 02637 ReInitBrushScaling(); 02638 ChangeType_m = CHANGEBRUSH_SCALING_INCR; 02639 ChangeParam_m.m_NewScalingIncr = EditData->m_BrushScalingIncr; 02640 02641 } 02642 } 02643 else if (Msg->GadgetID == _R(IDC_SLIDERSCALINGINCRCONST)) 02644 { 02645 Result = GetLongGadgetValue(_R(IDC_SLIDERSCALINGINCRCONST), MinScalingIncrSlider, MaxScalingIncrSlider, 0, &Valid); 02646 Result = (MaxScalingIncrSlider - Result) + MinScalingIncrSlider; 02647 if (Valid) 02648 { 02649 if (EditData->m_BrushScalingIncrConst != Result) 02650 { 02651 EditData->m_BrushScalingIncrConst = (double)Result; 02652 ReInitBrushScaling(); 02653 ChangeType_m = CHANGEBRUSH_SCALING_INCRCONST; 02654 ChangeParam_m.m_NewScalingIncrConst = (double)Result; 02655 } 02656 } 02657 } 02658 else if (Msg->GadgetID == _R(IDC_SLIDERSCALINGPRESSURE)) 02659 { 02660 Result = GetLongGadgetValue(_R(IDC_SLIDERSCALINGPRESSURE), MIN_PRESSURE_SLIDER, MAX_PRESSURE_SLIDER, 0, &Valid); 02661 if (Valid) 02662 { 02663 Result = (MAX_PRESSURE_SLIDER - Result) + MIN_PRESSURE_SLIDER; 02664 02665 EditData->m_ScalingMaxPressure = Result; 02666 ReInitBrushScaling(); 02667 ChangeType_m = CHANGEBRUSH_SCALING_PRESSURE; 02668 ChangeParam_m.m_NewScalingMaxPressure = Result; 02669 SetRandomRangeText(_R(IDC_SLIDERSCALINGPRESSURE)); 02670 02671 } 02672 } 02673 else if (Msg->GadgetID == _R(IDC_SLIDERSATURATIONRANDOM)) 02674 { 02675 Result = GetLongGadgetValue(_R(IDC_SLIDERSATURATIONRANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_SAT_SLIDER, 0, &Valid); 02676 if (Valid) 02677 { 02678 Result = (MAX_RANDOM_SAT_SLIDER - Result) + MIN_RANDOM_SLIDER; 02679 02680 EditData->m_BrushSatMaxRand = Result; 02681 ChangeType_m = CHANGEBRUSH_SAT_MAXRAND; 02682 ChangeParam_m.m_NewSatMaxRand = Result; 02683 SetRandomRangeText(_R(IDC_SLIDERSATURATIONRANDOM)); 02684 02685 ReInitBrushFill(); 02686 } 02687 } 02688 else if (Msg->GadgetID == _R(IDC_SLIDERHUERANDOM)) 02689 { 02690 Result = GetLongGadgetValue(_R(IDC_SLIDERHUERANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_HUE_SLIDER, 0, &Valid); 02691 if (Valid) 02692 { 02693 Result = (MAX_RANDOM_HUE_SLIDER - Result) + MIN_RANDOM_SLIDER; 02694 02695 EditData->m_BrushHueMaxRand = Result; 02696 ChangeType_m = CHANGEBRUSH_HUE_MAXRAND; 02697 ChangeParam_m.m_NewHueMaxRand = Result; 02698 SetRandomRangeText(_R(IDC_SLIDERHUERANDOM)); 02699 02700 ReInitBrushFill(); 02701 } 02702 } 02703 else if (Msg->GadgetID == _R(IDC_SLIDERTRANSP)) 02704 { 02705 Result = GetLongGadgetValue(_R(IDC_SLIDERTRANSP), MIN_TRANSP_SLIDER, MAX_TRANSP_SLIDER, 0, &Valid); 02706 if (Valid) 02707 { 02708 Result = (MAX_TRANSP_SLIDER - Result) + MIN_TRANSP_SLIDER; 02709 02710 EditData->m_BrushTransparency = Result; 02711 ChangeType_m = CHANGEBRUSH_TRANSP; 02712 ChangeParam_m.m_NewTransp = Result; 02713 UpdateEditBox(_R(IDC_EDITBRUSHTRANSP)); 02714 02715 } 02716 } 02717 else if (Msg->GadgetID == _R(IDC_SLIDERTRANSPPRESSURE)) 02718 { 02719 Result = GetLongGadgetValue(_R(IDC_SLIDERTRANSPPRESSURE), MIN_PRESSURE_SLIDER, MAX_PRESSURE_SLIDER, 0, &Valid); 02720 if (Valid) 02721 { 02722 Result = (MAX_PRESSURE_SLIDER - Result) + MIN_PRESSURE_SLIDER; 02723 02724 EditData->m_TranspMaxPressure = Result; 02725 ChangeType_m = CHANGEBRUSH_TRANSP_PRESSURE; 02726 ChangeParam_m.m_NewTranspPressure = Result; 02727 ReInitBrushSequence(); 02728 02729 } 02730 } 02731 }
|
|
Definition at line 2967 of file brushdlg.cpp. 02968 { 02969 CDlgResID ActivePageID = GetCurrentPageID(); 02970 02971 if (ActivePageID == _R(IDD_BRUSHEDITSPACING)) 02972 { 02973 ReInitBrushSpacing(); 02974 } 02975 else if (ActivePageID == _R(IDD_BRUSHEDITOFFSET)) 02976 { 02977 ReInitBrushOffset(); 02978 } 02979 else if (ActivePageID == _R(IDD_BRUSHEDITSCALING)) 02980 { 02981 ReInitBrushScaling(); 02982 } 02983 else if (ActivePageID == _R(IDD_BRUSHEDITEFFECTS)) 02984 { 02985 ReInitBrushEffects(); 02986 } 02987 else if (ActivePageID == _R(IDD_BRUSHEDITSEQUENCE)) 02988 { 02989 ReInitBrushSequence(); 02990 } 02991 else if (ActivePageID == _R(IDD_BRUSHEDITFILL)) 02992 { 02993 ReInitBrushFill(); 02994 } 02995 02996 }
|
|
This virtual function will get called to give you a chance to add pages to your DialogTabOp. This function will usually make multiple calls to AddAPage to register the initial set of pages to be contained in the tab dialog. The pages should all be the same size and be registered in the left to right order in which you wish them to appear.
Reimplemented from DialogTabOp. Definition at line 1200 of file brushdlg.cpp. 01201 { 01202 BOOL ok = ( AddAPage (_R(IDD_BRUSHEDITSPACING)) && 01203 AddAPage (_R(IDD_BRUSHEDITOFFSET)) && 01204 AddAPage (_R(IDD_BRUSHEDITSCALING)) && 01205 AddAPage (_R(IDD_BRUSHEDITEFFECTS)) && 01206 AddAPage (_R(IDD_BRUSHEDITSEQUENCE)) && 01207 AddAPage (_R(IDD_BRUSHEDITFILL)) 01208 ); 01209 01210 return (ok); 01211 }
|
|
Definition at line 1779 of file brushdlg.cpp. 01780 { 01781 BOOL Enable = !m_bDisableGadgets; 01782 for (INT32 i = 0; i < NumberOfBrushEffectsGadgets; i++) 01783 { 01784 EnableGadget (BrushEffectsGadgetIDs [i], Enable); 01785 } 01786 01787 if (Enable) 01788 InitBrushEffects (); 01789 }
|
|
Definition at line 1662 of file brushdlg.cpp. 01663 { 01664 BOOL Enable = !m_bDisableGadgets; 01665 01666 for (INT32 i = 0; i < NumberOfBrushFillGadgets; i++) 01667 { 01668 EnableGadget (BrushSequenceGadgetIDs [i], Enable); 01669 } 01670 01671 if (Enable) 01672 InitBrushFill (); 01673 01674 }
|
|
Definition at line 1755 of file brushdlg.cpp. 01756 { 01757 BOOL Enable = !m_bDisableGadgets; 01758 for (INT32 i = 0; i < NumberOfBrushOffsetGadgets; i++) 01759 { 01760 EnableGadget (BrushOffsetGadgetIDs [i], Enable); 01761 } 01762 01763 if (Enable) 01764 InitBrushOffset (); 01765 }
|
|
Definition at line 1767 of file brushdlg.cpp. 01768 { 01769 BOOL Enable = !m_bDisableGadgets; 01770 for (INT32 i = 0; i < NumberOfBrushScalingGadgets; i++) 01771 { 01772 EnableGadget (BrushScalingGadgetIDs [i], Enable); 01773 } 01774 01775 if (Enable) 01776 InitBrushScaling (); 01777 }
|
|
Definition at line 1791 of file brushdlg.cpp. 01792 { 01793 BOOL Enable = !m_bDisableGadgets; 01794 01795 for (INT32 i = 0; i < NumberOfBrushSequenceGadgets; i++) 01796 { 01797 EnableGadget (BrushSequenceGadgetIDs [i], Enable); 01798 } 01799 01800 if (Enable) 01801 InitBrushSequence (); 01802 }
|
|
Definition at line 1744 of file brushdlg.cpp. 01745 { 01746 BOOL Enable = !m_bDisableGadgets; 01747 for (INT32 i = 0; i < NumberOfBrushSpacingGadgets; i++) 01748 { 01749 EnableGadget (BrushSpacingGadgetIDs [i], Enable); 01750 } 01751 if (Enable) 01752 InitBrushSpacing (); 01753 }
|
|
Definition at line 2853 of file brushdlg.cpp. 02854 { 02855 if (pData != NULL) 02856 { 02857 if (EditData != NULL) 02858 delete EditData; 02859 EditData = new BrushData(*pData); 02860 if (EditData == NULL) 02861 { 02862 ERROR3("Argh we failed to allocate new brush data"); 02863 return; 02864 } 02865 02866 // we have to reinit all the pages one by one 02867 ReInitPage(_R(IDD_BRUSHEDITSPACING)); 02868 ReInitPage(_R(IDD_BRUSHEDITOFFSET)); 02869 ReInitPage(_R(IDD_BRUSHEDITSCALING)); 02870 ReInitPage(_R(IDD_BRUSHEDITEFFECTS)); 02871 ReInitPage(_R(IDD_BRUSHEDITSEQUENCE)); 02872 02873 } // end if data 02874 }
|
|
Definition at line 2876 of file brushdlg.cpp. 02877 { 02878 // tell the page we're talking to it 02879 TalkToPage(PageID); 02880 // reinit our active page 02881 if (PageID == _R(IDD_BRUSHEDITSPACING)) 02882 ReInitBrushSpacing(); 02883 else if (PageID == _R(IDD_BRUSHEDITOFFSET)) 02884 ReInitBrushOffset(); 02885 else if (PageID == _R(IDD_BRUSHEDITSCALING)) 02886 ReInitBrushScaling(); 02887 else if (PageID == _R(IDD_BRUSHEDITEFFECTS)) 02888 ReInitBrushEffects(); 02889 else if (PageID == _R(IDD_BRUSHEDITSEQUENCE)) 02890 ReInitBrushSequence(); 02891 else if (PageID == _R(IDD_BRUSHEDITFILL)) 02892 { 02893 } 02894 else 02895 { 02896 ERROR3("Message from unknown tab dialog page"); 02897 } 02898 02899 }
|
|
Definition at line 1804 of file brushdlg.cpp. 01805 { 01806 if (ThePage == _R(IDD_BRUSHEDITSPACING)) 01807 InitBrushSpacing (TRUE); 01808 else if (ThePage == _R(IDD_BRUSHEDITOFFSET)) 01809 InitBrushOffset (TRUE); 01810 else if (ThePage == _R(IDD_BRUSHEDITSCALING)) 01811 InitBrushScaling (TRUE); 01812 else if (ThePage == _R(IDD_BRUSHEDITEFFECTS)) 01813 InitBrushEffects (TRUE); 01814 else if (ThePage == _R(IDD_BRUSHEDITSEQUENCE)) 01815 InitBrushSequence (TRUE); 01816 else if (ThePage == _R(IDD_BRUSHEDITFILL)) 01817 InitBrushFill (TRUE); 01818 else 01819 { 01820 ERROR3("Unknown tab dialog page"); 01821 } 01822 }
|
|
removing the edit controls from the helper
Reimplemented from DialogOp. Definition at line 589 of file brushdlg.cpp. 00590 { 00591 BOOL ok = RemoveDialogControlFromHelper(_R(IDC_EDITBRUSHSPACING), _R(IDD_BRUSHEDITSPACING)); 00592 // if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITBRUSHSPACINGINCRCONST), _R(IDD_BRUSHEDITSPACING)); 00593 if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITPATHOFFSETVALUE), _R(IDD_BRUSHEDITOFFSET)); 00594 // if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITPATHOFFSETINCRCONST), _R(IDD_BRUSHEDITOFFSET)); 00595 // if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITSCALINGINCRCONST), _R(IDD_BRUSHEDITSCALING)); 00596 if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITROTATEANGLE), _R(IDD_BRUSHEDITEFFECTS)); 00597 if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITROTATEANGLEINCR), _R(IDD_BRUSHEDITEFFECTS)); 00598 if (ok) ok = RemoveDialogControlFromHelper(_R(IDC_EDITBRUSHTRANSP), _R(IDD_BRUSHEDITSEQUENCE)); 00599 00600 00601 return; 00602 }
|
|
Definition at line 3000 of file brushdlg.cpp. 03001 { 03002 SetTitlebarName(&Title); 03003 }
|
|
Definition at line 3039 of file brushdlg.cpp. 03040 { 03041 double MinSlider = 0; double MaxSlider = 0; 03042 03043 GetOffsetRange(&MinSlider, &MaxSlider); 03044 03045 INT32 IntMin = (INT32)MinSlider; 03046 INT32 IntMax = (INT32)MaxSlider; 03047 03048 SetGadgetRange(_R(IDC_SLIDERPATHOFFSETVAL), IntMin, IntMax); 03049 SetGadgetBitmaps (_R(IDC_SLIDERPATHOFFSETVAL), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 03050 03051 double dOffsetVal = pow((double)EditData->m_PathOffsetValue, InvFactor); 03052 INT32 iOffsetVal = (INT32)dOffsetVal; 03053 03054 SetLongGadgetValue(_R(IDC_SLIDERPATHOFFSETVAL), (IntMax - iOffsetVal) + IntMin); 03055 03056 UpdateEditBox(_R(IDC_EDITPATHOFFSETVALUE)); 03057 }
|
|
Definition at line 3246 of file brushdlg.cpp. 03247 { 03248 BOOL Valid = FALSE; 03249 INT32 SliderVal = 0; 03250 if (SliderID == _R(IDC_SLIDERBRUSHSPACINGMAXRAND)) 03251 { 03252 SliderVal = GetLongGadgetValue (_R(IDC_SLIDERBRUSHSPACINGMAXRAND), MIN_RANDOM_SLIDER, MAX_RANDOM_SLIDER, 0, &Valid); 03253 if (Valid) 03254 { 03255 SliderVal = (MAX_RANDOM_SLIDER - SliderVal) + MIN_RANDOM_SLIDER; 03256 String_32 RangeText = GetRandomRangeText(SliderVal); 03257 SetStringGadgetValue(_R(IDC_STATICBRUSHSPACINGRAND1), RangeText); 03258 } 03259 } 03260 else if (SliderID == _R(IDC_SLIDEROFFSETVALUEMAXRAND)) 03261 { 03262 SliderVal = GetLongGadgetValue(_R(IDC_SLIDEROFFSETVALUEMAXRAND), MIN_RANDOM_SLIDER, MAX_RANDOM_SLIDER, 0, &Valid); 03263 if (Valid) 03264 { 03265 SliderVal = (MAX_RANDOM_SLIDER - SliderVal) + MIN_RANDOM_SLIDER; 03266 String_32 RangeText = TEXT(""); //GetRandomRangeText(SliderVal); 03267 03268 String_32 MinString = TEXT("0 - "); 03269 String_32 MaxString = TEXT("");; 03270 Convert::LongToString((INT32)SliderVal, &MaxString); 03271 03272 RangeText += MinString; 03273 RangeText += MaxString; 03274 SetStringGadgetValue(_R(IDC_STATICOFFSETRAND), RangeText); 03275 } 03276 } 03277 else if (SliderID == _R(IDC_SLIDERBRUSHSCALINGMAXRAND)) 03278 { 03279 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERBRUSHSCALINGMAXRAND), MinScalingSlider, MaxScalingSlider, 0, &Valid); 03280 if (Valid) 03281 { 03282 SliderVal = (MaxScalingSlider - SliderVal) + MinScalingSlider; 03283 String_32 RangeText = GetRandomRangeText(SliderVal); 03284 SetStringGadgetValue(_R(IDC_STATICSCALINGRAND), RangeText); 03285 } 03286 } 03287 else if (SliderID == _R(IDC_SLIDERROTATEANGLEMAXRAND)) 03288 { 03289 // This is a little different as we go from 0 - Max degrees, where Max is determined by 03290 // SliderVal * 360 03291 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERROTATEANGLEMAXRAND), MIN_RANDOM_SLIDER, MAX_ROTATION_RANDOM_SLIDER, 0, &Valid); 03292 if (Valid) 03293 { 03294 SliderVal = (MAX_ROTATION_RANDOM_SLIDER - SliderVal) + MIN_RANDOM_SLIDER; 03295 //SliderVal = (SliderVal * 2) + 100; 03296 double MaxAngle = double(SliderVal); // * 360; 03297 //MaxAngle = (MaxAngle * 0.01) - 360; 03298 03299 String_32 RangeText(_T("")); 03300 String_32 MinString; 03301 String_32 MaxString; 03302 String_32 MiddleString = _T(" - "); 03303 Convert::LongToString(0, &MinString); 03304 Convert::LongToString(INT32(MaxAngle), &MaxString); 03305 03306 RangeText = MinString; 03307 RangeText += MiddleString; 03308 RangeText += MaxString; 03309 03310 SetStringGadgetValue(_R(IDC_STATICROTATIONRAND), RangeText); 03311 } 03312 } 03313 else if (SliderID == _R(IDC_SLIDERSCALINGPRESSURE)) 03314 { 03315 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERSCALINGPRESSURE), MIN_PRESSURE_SLIDER, MAX_PRESSURE_SLIDER, 0, &Valid); 03316 if (Valid) 03317 { 03318 // INT32 lSlider = MAX_PRESSURE_SLIDER - (INT32)SliderVal; 03319 03320 String_32 MinString = TEXT(""); 03321 Convert::LongToString((INT32)SliderVal, &MinString); 03322 03323 // our maximum is always 100% 03324 String_32 MaxString = TEXT(" - 100"); 03325 03326 MinString += MaxString; 03327 SetStringGadgetValue(_R(IDC_STATICSCALINGPRESS), MinString); 03328 } 03329 } 03330 else if (SliderID == _R(IDC_SLIDERSATURATIONRANDOM)) 03331 { 03332 // this is a little different as it only goes from 0 - SliderVal; 03333 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERSATURATIONRANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_SAT_SLIDER, 0, &Valid); 03334 if (Valid) 03335 { 03336 SliderVal = MAX_RANDOM_SAT_SLIDER - SliderVal; 03337 String_32 RangeText(_T("")); 03338 String_32 MinString; 03339 String_32 MaxString; 03340 String_32 MiddleString = _T(" - "); 03341 Convert::LongToString(0, &MinString); 03342 Convert::LongToString(SliderVal, &MaxString); 03343 03344 RangeText = MinString; 03345 RangeText += MiddleString; 03346 RangeText += MaxString; 03347 03348 SetStringGadgetValue(_R(IDC_STATICSATRAND), RangeText); 03349 } 03350 } 03351 else if (SliderID == _R(IDC_SLIDERHUERANDOM)) 03352 { 03353 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERHUERANDOM), MIN_RANDOM_SLIDER, MAX_RANDOM_HUE_SLIDER, 0, &Valid); 03354 if (Valid) 03355 { 03356 SliderVal = MAX_RANDOM_HUE_SLIDER - SliderVal; 03357 // String_32 RangeText = GetRandomText(SliderVal, MAX_RANDOM_HUE_SLIDER); 03358 // SetStringGadgetValue(_R(IDC_STATICHUERAND), &RangeText); 03359 03360 03361 String_32 MinString = TEXT("0 - "); 03362 String_32 MaxString = TEXT(""); 03363 Convert::LongToString((INT32)SliderVal, &MaxString); 03364 03365 MinString += MaxString; 03366 SetStringGadgetValue(_R(IDC_STATICSCALINGPRESS), MinString); 03367 03368 } 03369 } 03370 else if (SliderID == _R(IDC_SLIDERTRANSPPRESSURE)) 03371 { 03372 SliderVal = GetLongGadgetValue(_R(IDC_SLIDERTRANSPPRESSURE), MIN_RANDOM_SLIDER, MAX_RANDOM_SLIDER, 0, &Valid); 03373 if (Valid) 03374 { 03375 SliderVal = MAX_RANDOM_SLIDER - SliderVal; 03376 String_32 RangeText = GetRandomText(SliderVal, MAX_RANDOM_SLIDER); 03377 SetStringGadgetValue(_R(IDC_STATICTRANSPPRESSURE), RangeText); 03378 } 03379 } 03380 }
|
|
Definition at line 3029 of file brushdlg.cpp. 03030 { 03031 SetGadgetRange(_R(IDC_SLIDERBRUSHSPACINGINCR), MIN_SPACING_INCR, MAX_SPACING_INCR); 03032 SetGadgetBitmaps (_R(IDC_SLIDERBRUSHSPACINGINCR), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 03033 03034 double PercentVal = GetDistanceAsPercentageOfBBox(EditData->m_BrushSpacingIncrConst, WIDTH); 03035 SetDoubleGadgetValue(_R(IDC_SLIDERBRUSHSPACINGINCR), (MAX_SPACING_INCR - PercentVal) + MIN_SPACING_INCR); 03036 }
|
|
Definition at line 3006 of file brushdlg.cpp. 03007 { 03008 // first work out the maximum and minimum values for the spacing slider 03009 double MinSpacingSlider = 0; double MaxSpacingSlider = 0; 03010 03011 GetSpacingRange(&MinSpacingSlider, &MaxSpacingSlider); 03012 03013 INT32 IntMin = (INT32)(MinSpacingSlider); 03014 INT32 IntMax = (INT32)(MaxSpacingSlider); 03015 03016 // set the range 03017 SetGadgetRange (_R(IDC_SLIDERBRUSHSPACING1), IntMin, IntMax); 03018 SetGadgetBitmaps( _R(IDC_SLIDERBRUSHSPACING1), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER)); 03019 03020 // work out the current actual spacing value 03021 double dSpacingValue = (double)EditData->m_BrushSpacing; // * EditData->m_BrushScaling; 03022 dSpacingValue = pow(dSpacingValue, 1/ExpFactor); 03023 INT32 iSpacingValue = (INT32)dSpacingValue; 03024 SetLongGadgetValue (_R(IDC_SLIDERBRUSHSPACING1), (IntMax - iSpacingValue) + IntMin); 03025 03026 UpdateEditBox(_R(IDC_EDITBRUSHSPACING)); 03027 }
|
|
Definition at line 2790 of file brushdlg.cpp. 02791 { 02792 if (GadgetToUpdate == _R(IDC_EDITBRUSHSPACING)) 02793 { 02794 // work out the current actual spacing value 02795 double dSpacingValue = (double)EditData->m_BrushSpacing; // * EditData->m_BrushScaling; 02796 MILLIPOINT lSpacingValue = (MILLIPOINT)dSpacingValue; 02797 dSpacingValue = pow(dSpacingValue, 1/ExpFactor); 02798 // INT32 iSpacingValue = (INT32)dSpacingValue; 02799 02800 // get the spacing value as a % and set that in the edit field 02801 double SpacingAsPercent = GetDistanceAsPercentageOfBBox(lSpacingValue, WIDTH); 02802 SetDoubleGadgetValue (_R(IDC_EDITBRUSHSPACING), SpacingAsPercent); 02803 02804 } 02805 /* 02806 else if (GadgetToUpdate == _R(IDC_EDITBRUSHSPACINGINCRCONST)) 02807 { 02808 // for the edit box we need to set it as a percentage 02809 double PercentVal = GetDistanceAsPercentageOfBBox(EditData->m_BrushSpacingIncrConst); 02810 SetDoubleGadgetValue(_R(IDC_EDITBRUSHSPACINGINCRCONST), PercentVal); 02811 } 02812 */ 02813 else if (GadgetToUpdate == _R(IDC_EDITPATHOFFSETVALUE)) 02814 { 02815 double PercentVal = GetDistanceAsPercentageOfBBox(EditData->m_PathOffsetValue, HEIGHT); 02816 SetDoubleGadgetValue(_R(IDC_EDITPATHOFFSETVALUE), PercentVal); 02817 } 02818 /* 02819 else if (GadgetToUpdate == _R(IDC_EDITPATHOFFSETINCRCONST)) 02820 { 02821 double PercentVal = GetDistanceAsPercentageOfBBox(EditData->m_PathOffsetIncrConst); 02822 SetDoubleGadgetValue(_R(IDC_EDITPATHOFFSETINCRCONST), PercentVal); 02823 } 02824 */ 02825 else if (GadgetToUpdate == _R(IDC_EDITBRUSHSCALING)) 02826 { 02827 SetDoubleGadgetValue (_R(IDC_EDITBRUSHSCALING), EditData->m_BrushScaling); 02828 } 02829 else if (GadgetToUpdate == _R(IDC_EDITBRUSHSCALINGINCR)) 02830 { 02831 SetDoubleGadgetValue (_R(IDC_EDITBRUSHSCALINGINCR), EditData->m_BrushScalingIncr*100); 02832 } 02833 /* 02834 else if (GadgetToUpdate == _R(IDC_EDITSCALINGINCRCONST)) 02835 { 02836 SetDoubleGadgetValue (_R(IDC_EDITSCALINGINCRCONST), EditData->m_BrushScalingIncrConst); 02837 } 02838 */ 02839 else if (GadgetToUpdate == _R(IDC_EDITROTATEANGLEINCR)) 02840 { 02841 SetDoubleGadgetValue (_R(IDC_EDITROTATEANGLEINCR), EditData->m_RotAngleIncrConst); 02842 } 02843 else if (GadgetToUpdate == _R(IDC_EDITROTATEANGLE)) 02844 { 02845 SetDoubleGadgetValue (_R(IDC_EDITROTATEANGLE), EditData->m_RotAngleIncrConst); 02846 } 02847 else if (GadgetToUpdate == _R(IDC_EDITBRUSHTRANSP)) 02848 { 02849 SetLongGadgetValue(_R(IDC_EDITBRUSHTRANSP), EditData->m_BrushTransparency - 100); 02850 } 02851 }
|
|
Definition at line 2785 of file brushdlg.cpp.
|
|
Definition at line 138 of file brushdlg.h. |
|
Definition at line 137 of file brushdlg.h. |
|
Definition at line 149 of file brushdlg.h. |
|
Definition at line 129 of file brushdlg.h. |
|
Definition at line 196 of file brushdlg.h. |
|
Definition at line 144 of file brushdlg.h. |
|
Definition at line 140 of file brushdlg.h. |
|
Definition at line 125 of file brushdlg.h. |
|
Definition at line 238 of file brushdlg.h. |
|
Definition at line 151 of file brushdlg.h. |
|
Definition at line 145 of file brushdlg.h. |
|
Definition at line 156 of file brushdlg.h. |
|
Definition at line 153 of file brushdlg.h. |
|
Definition at line 132 of file brushdlg.h. |
|
Definition at line 131 of file brushdlg.h. |
|
Definition at line 121 of file brushdlg.h. |
|
Definition at line 154 of file brushdlg.h. |
|
Definition at line 239 of file brushdlg.h. |
|
Definition at line 128 of file brushdlg.h. |
|
Definition at line 134 of file brushdlg.h. |
|
Definition at line 148 of file brushdlg.h. |
|
Definition at line 135 of file brushdlg.h. |
|
Definition at line 146 of file brushdlg.h. |
|
Definition at line 193 of file brushdlg.h. |
|
Definition at line 194 of file brushdlg.h. |
|
Definition at line 192 of file brushdlg.h. |