void ColourPlate::GetDescription(StringBase *Description) { ERROR3IF(Description == NULL, "Illegal NULL param"); *Description = TEXT(""); switch(GetType()) { case COLOURPLATE_CYAN: Description->MakeMsg(_R(IDS_COLOURPLATE_CYAN)); break; case COLOURPLATE_MAGENTA: Description->MakeMsg(_R(IDS_COLOURPLATE_MAGENTA)); break; case COLOURPLATE_YELLOW: Description->MakeMsg(_R(IDS_COLOURPLATE_YELLOW)); break; case COLOURPLATE_KEY: Description->MakeMsg(_R(IDS_COLOURPLATE_BLACK)); break; case COLOURPLATE_SPOT: { IndexedColour *Col = GetSpotColour(); ERROR3IF(Col == NULL, "NULL Spot colour in spot plate"); Description->MakeMsg(_R(IDS_COLOURPLATE_SPOT), (TCHAR *) *(Col->GetName()) ); } break; default: break; } }
BOOL ColourDragInformation::GetStatusLineText(String_256 *TheText) { ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()"); String_32 LineString(_R(IDS_DRAGCOL_DRAGGING_LINE_COLOUR)); // "Dragging line colour : "); String_32 FillString(_R(IDS_DRAGCOL_DRAGGING_FILL_COLOUR)); // "Dragging fill colour : "); String_256 DragString; if(IsAdjustDrag) DragString = LineString; else DragString = FillString; if (TheColour.IsTransparent()) DragString = _R(IDS_DRAGCOL_DRAGGING_NO_COLOUR); //"Dragging 'no colour'"; else { IndexedColour *TheIxCol = GetInitiallyDraggedColour(); if (TheIxCol != NULL) DragString += *(TheIxCol->GetName()); // Document IndexedColour else DragString += ColourName; // Library colour } *TheText = DragString; return TRUE; }
BOOL ColourDragInformation::GetStatusLineText(String_256 * TheText, DragTarget* pDragTarget) { ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()"); String_256 DragString(_R(IDS_DRAGCOL_DRAGGING_COLOUR)); // "Dragging colour '"); if (TheColour.IsTransparent()) DragString = _R(IDS_DRAGCOL_DRAGGING_NO_COLOUR); // "Dragging 'no colour' : "; else { IndexedColour *TheIxCol = GetInitiallyDraggedColour(); if (TheIxCol != NULL) DragString += *(TheIxCol->GetName()); // Document IndexedColour else DragString += ColourName; // Library colour DragString += String_16(_R(IDS_DRAGCOL_DRAGGING_COLOUR_RIGHT_BIT)); // "' : "; } if (pDragTarget->IS_KIND_OF(ViewDragTarget)) { PageDropInfo PageDropInfo; ((ViewDragTarget*)pDragTarget)->GetDropInfo(&PageDropInfo); NodeRenderableInk* pObjectHit = PageDropInfo.pObjectHit; ObjectDragTarget TargetHit = PageDropInfo.TargetHit; String_256 ObjectDesc = _R(IDS_DRAGCOL_THIS_OBJECT); //" this object"; if (pObjectHit) { ObjectDesc = pObjectHit->Describe(FALSE); } ClickModifiers ClickMods = ClickModifiers::GetClickModifiers(); BOOL IsInside = ClickMods.Constrain; if (!IsInside && pObjectHit && pObjectHit->IsCompound()) { TargetHit = MANY_TARGET; } switch (TargetHit) { case FILL_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL)); // "Drop to set the fill colour of this "; DragString += ObjectDesc; if (IsInside) DragString += String_64(_R(IDS_DRAGCOL_ALONE)); // " alone"; break; case LINE_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_LINE)); //"Drop to set the line colour of this "; DragString += ObjectDesc; if (IsInside) DragString += String_64(_R(IDS_DRAGCOL_ALONE)); // " alone"; break; case STARTCOL_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_START)); //"Drop to set the fill start colour of this "; DragString += ObjectDesc; break; case ENDCOL_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END)); //"Drop to set the fill end colour of this "; DragString += ObjectDesc; break; case ENDCOL2_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END2)); //"Drop to set the fill end colour of this "; DragString += ObjectDesc; break; case ENDCOL3_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END3)); //"Drop to set the fill end colour of this "; DragString += ObjectDesc; break; case MANY_TARGET: DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL)); //"Drop to set the fill colour of this "; DragString += ObjectDesc; DragString += String_64(_R(IDS_DRAGCOL_PRESS_CONTROL)); // "; Press 'Control' to drop 'Inside'"; break; case NO_TARGET: if (IsInside) { DragString += String_256(_R(IDS_DRAGCOL_DROP_SETPAGEBACKGROUND)); // "Drop to set the fill colour of the page background"; } else { DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_CURRENT_FILL_COLOUR)); // "Drop to set the 'current fill colour' attribute"; } break; }; *TheText = DragString; return TRUE; } return FALSE; }
BOOL ColourGallery::DoRedefineItem(ListItem *ItemToRedefine) { // Bring up the colour editor on the new colour if (ItemToRedefine != NULL) DoSpecialClick(ItemToRedefine); return(TRUE); #if FALSE ColourList *ColList = ColourManager::GetColourList(); if (ColList == NULL) return(FALSE); DocColour *SourceColour = NULL; if (ColourManager::GetCurrentLineAndFillColours(NULL, &SourceColour)) SourceColour = NULL; // Sourcecolour returned was current attr - don't use if (SourceColour == NULL) { // Nothing to copy to redefine the colour. Report this to the user InformError(_R(IDE_COLGAL_NOSOURCE), _R(IDS_OK)); return(FALSE); } // We have a colour to copy... INT32 Result; IndexedColour *ParentColour = SourceColour->FindParentIndexedColour(); if (ParentColour == NULL) { Result = AskQuestion(_R(IDS_COLGAL_QREDEFINE), _R(IDS_COLGAL_YREDEFINE), _R(IDS_CANCEL)); if (Result == 1) // The user said to go ahead... { // Source is an immediate colour - generate an IndexedColour from its definition ColourGeneric Bob; SourceColour->GetSourceColour(&Bob); *((IndexedColour *)ItemToRedefine) = IndexedColour(SourceColour->GetColourModel(), &Bob); return(TRUE); } return(FALSE); // The user cancelled } if (ParentColour == (IndexedColour *) ItemToRedefine) { InformError(_R(IDE_COLGAL_SAMEITEM)); return(FALSE); } Result = 3; // Default to making a copy of the colour { IndexedColour *NewCol = (IndexedColour *)ItemToRedefine; *NewCol = *ParentColour; if (ParentColour->IsNamed()) { String_128 NewName; // Accomodate overflow- SetName clips this to String_64 NewName.MakeMsg(_R(IDS_COPYOFCOLOUR), (TCHAR *) (*ParentColour->GetName())); ((IndexedColour *)ItemToRedefine)->SetName(NewName); // If the parent was named, then remember it as the 'parent' colour, even // if it was not tint/linked. This will allow the colour editor to default // to linking to a useful colour if tint/link is turned on at a later date. NewCol->SetLinkedParent(ParentColour, NewCol->GetType()); } } if (Result != 0) // Finally, inform the world if this item has changed ColourManager::ColourHasChanged(GetGalleryDocument(), ColList, (IndexedColour *) ItemToRedefine); return(Result != 0); // if Cancelled, return FALSE (no change), else TRUE #endif }