Esempio n. 1
0
void ArrangeAlignment::UpdateState()
{
	// update target
	CGadgetID Target = ReadRadioGroup(TargetArea,TargetArea[0]);
	if (Target == _R(IDC_ALIGNDIALOG_TOSELECTION))
	{
		Align.target=ToSelection;
	}
	else if (Target == _R(IDC_ALIGNDIALOG_TOPAGE))
	{
		Align.target=ToPage;
	}
	//	WEBSTER-ranbirr-13/11/96
	#ifndef WEBSTER
	else if (Target == _R(IDC_ALIGNDIALOG_TOSPREAD))
	{
		Align.target=ToSpread;
	}
	#endif //webster
	else
	{
		ERROR3("ArrangeAlignment::UpdateState() - unknown target");
	}

	// read alignments from horizontal and vertical combo boxes
	Align.h = (AlignType)GetSelectedValueIndex(_R(IDC_ALIGNDIALOG_HORIZONTAL));
	Align.v = (AlignType)GetSelectedValueIndex(_R(IDC_ALIGNDIALOG_VERTICAL));
	
	// force the diagram to redraw
	InvalidateGadget(_R(IDC_ALIGNDIALOG_DIAGRAM));

	// set state of Apply button
	INT32 NumObjs = 0;
	if (Document::GetSelected())
		NumObjs = GetApplication()->FindSelection()->Count();
	BOOL ApplyButtonState = (NumObjs>0);
	if (NumObjs==1 && Target==_R(IDC_ALIGNDIALOG_TOSELECTION)) ApplyButtonState = FALSE;
	if (Align.h==AlignNone && Align.v==AlignNone)          ApplyButtonState = FALSE;
	EnableGadget(_R(IDOK),ApplyButtonState);
}
Esempio n. 2
0
ImagemapFilterOptions ImagemapDlg::GetOptions()
{	
	//This variable will hold the imagemap filter options to return. Base these options
	//on the options we were given
	ImagemapFilterOptions ifoGet=ms_Options;

	//Get the map name
	ifoGet.m_strName=GetStringGadgetValue(_R(IDC_IMAGEMAP_MAPNAME));

	//Get the "Approximate curves with lines" drop down box
	switch (GetSelectedValueIndex(_R(IDC_IMAGEMAP_APPROX)))
	{
	case 0:
		ifoGet.m_ffApprox=FF_VERYCLOSELY;
		break;

	case 1:
		ifoGet.m_ffApprox=FF_CLOSELY;
		break;

	case 2:
		ifoGet.m_ffApprox=FF_APPROXIMATELY;
		break;

	default:
		ERROR3("ImagemapDlg::GetOptions - invalid flattening factor");

	case 3:
		ifoGet.m_ffApprox=FF_NOTATALL;
		break;

	}

	//Get the Area For Imagemap radio buttons
	if (GetLongGadgetValue(_R(IDC_IMAGEMAP_AREA_SELECTION), 0, 1)==1)
		ifoGet.m_stExportArea=SELECTION;
	else
		ifoGet.m_stExportArea=DRAWING;
													
	//Get the DPI from the Width and Height and the Area For Imagemap
	ifoGet.m_dDPI=GetDPI(ifoGet.m_stExportArea);

	//Get the "save clickable areas as rectangles"
	ifoGet.m_fAllRectangles=(GetLongGadgetValue(_R(IDC_IMAGEMAP_ALLRECTANGLES), 0, 1)==1);

	//Get the "copy imagemap to clipboard"
	ifoGet.m_fClipboard=(GetLongGadgetValue(_R(IDC_IMAGEMAP_CLIPBOARD), 0 ,1)==1);

	//And return our new set of imagemap options
	return ifoGet;
}