Exemplo n.º 1
0
OpState OpShowGuides::GetState(String_256* pUIDescription, OpDescriptor*)
{
	OpState OpSt;

	DocView *pDocView = DocView::GetSelected();
	if (pDocView != NULL)
		OpSt.Ticked = pDocView->GetShowGuidesState();

	Spread* pSpread = Document::GetSelectedSpread();
	if (pSpread != NULL)
	{
		// if we have a guide layer, then make the menu item available, if not, grey it 
		//	and give a reason.
		if (pSpread->FindFirstGuideLayer() != NULL)
		{
			OpSt.Greyed = FALSE;
		}
		else
		{
			OpSt.Greyed = TRUE;
			*pUIDescription = String_256 (_R(IDS_NO_GUIDES));
		}

	}	// if (pSpread != NULL)

	return OpSt;
}
Exemplo n.º 2
0
void OpShowGuides::Do(OpDescriptor*)
{
	DocView *pDocView = DocView::GetSelected();

	if (pDocView != NULL)
	{
		pDocView->SetShowGuidesState(!pDocView->GetShowGuidesState());

		Spread* pSpread = Document::GetSelectedSpread();
		Document* pDoc  = Document::GetSelected();
		if (pSpread != NULL && pDoc != NULL)
		{
			Layer* pLayer = pSpread->FindFirstGuideLayer();
			if (pLayer != NULL)
				LayerSGallery::ForceRedrawLayer(pDoc,pLayer);
		}

		BROADCAST_TO_ALL(SpreadMsg(pSpread,SpreadMsg::LAYERCHANGES));
	}

	End();
}