Exemple #1
0
BOOL GuidesPropertiesTab::ShowColours()
{
	if (pColourDropDown != NULL)
	{
		IndexedColour* pIndexedColour = NULL;
		Layer* pLayer = GetGuideLayer();
		if (pLayer != NULL)
		{
			DocColour* pDocColour = pLayer->GetGuideColour();
			if (pDocColour != NULL)
			{
				pIndexedColour = pDocColour->FindParentIndexedColour();
				if (pIndexedColour->IsDeleted())
				{
					pLayer->SetGuideColour(NULL);
					pIndexedColour = NULL;
				}
			}
		}

		pColourDropDown->ClearAllSpecialEntries();

		if (pIndexedColour != NULL)
		{
			if (!pIndexedColour->IsNamed())
			{
				String_256 LocalColourText(_R(IDS_LOCALCOLOUR));
				DocColour LocalColour;
				LocalColour.MakeRefToIndexedColour(pIndexedColour);

				pColourDropDown->AddSpecialEntry(&LocalColourText,&LocalColour);
			}

			pColourDropDown->FillInColourList(pIndexedColour);
		}
		else
			pColourDropDown->FillInColourList(NULL,0);
	}
	return TRUE;
}
Exemple #2
0
void ColourGallery::ReadNewColourList(void)
{
	ColourList *Colours = ColourManager::GetColourList();

	RemoveAllItemsFromDisplay();

	if (Colours == NULL)
	{
		ForceRedrawOfList();
		return;
	}

	IndexedColour *Ptr = (IndexedColour *) Colours->GetHead();
	while (Ptr != NULL)
	{
		if (!Ptr->IsDeleted())
			AddItemToDisplay(Ptr);

		Ptr = (IndexedColour *) Colours->GetNext(Ptr);
	}

	SetSelectionFromDocument();
	ForceRedrawOfList();
}
Exemple #3
0
void PrintComponent::ImportColourPlate(CXaraFileRecord* Rec, CamelotRecordHandler *pHandler)
{
#if !defined(EXCLUDE_FROM_RALPH)
	BOOL ok = TRUE;

	PORTNOTETRACE("print","PrintComponent::ImportColourPlate - do nothing");
	TypesetInfo *TInfo = GetPrintControl()->GetTypesetInfo();
	if (TInfo == NULL)
		return;
	
	ColourPlate *NewPlate = TInfo->CreateColourPlate();
	if (NewPlate == NULL)
		return;

	BYTE Type;
	if (ok)  ok = Rec->ReadBYTE(&Type);

	ColourPlateType PlateType = COLOURPLATE_NONE;
	if (ok)
	{
		switch(Type)
		{
			case 1: PlateType = COLOURPLATE_CYAN;		break;
			case 2: PlateType = COLOURPLATE_MAGENTA;	break;
			case 3: PlateType = COLOURPLATE_YELLOW;		break;
			case 4: PlateType = COLOURPLATE_KEY;		break;
			case 5: PlateType = COLOURPLATE_SPOT;		break;
		}
	}

	IndexedColour *pCol = NULL;
	if (ok)
	{
		INT32 ColRecordNum;
		ok = Rec->ReadINT32(&ColRecordNum);
		if (ok && PlateType == COLOURPLATE_SPOT)
		{
			DocColour SpotCol;
			ok = pHandler->GetDocColour(ColRecordNum, &SpotCol);
			if (ok)
				pCol = SpotCol.FindParentIndexedColour();
		}
	}

	// If this is a spot plate, it must reference a valid spot colour
	if (PlateType == COLOURPLATE_SPOT &&
		(pCol == NULL || pCol->GetType() != COLOURTYPE_SPOT || pCol->IsDeleted()) )
	{
		// Poohs. No point in keeping this plate around
		delete NewPlate;
		return;
	}

	NewPlate->SetType(NULL, PlateType, pCol);

	if (ok)
	{
		double Angle = 0.0;
		double Frequency = 60.0;

		ok = Rec->ReadDOUBLE(&Angle);
		if (ok)  ok = Rec->ReadDOUBLE(&Frequency);
		if (ok)  NewPlate->SetScreenInfo(Angle, Frequency);
	}

	BYTE Flags;
	if (ok)  ok = Rec->ReadBYTE(&Flags);

	if (ok)
	{
		NewPlate->SetDisabled( (Flags & 0x01) == 0);		// NOTE Flag is ENabled state!
		NewPlate->SetOverprint((Flags & 0x02) != 0);
	}


	if (ok)
	{
		// Now, it'll be quite handy if we add the new plate to the plate list!
		TInfo->AddPlate(NewPlate);
	}
#endif
}