Example #1
0
void ShowHideVerticalExtrapolationDialogItems2(DialogPtr dialog)
{
	Boolean extrapolateVertically, okToExtrapolate = false, showVelAtBottom = GetButton(dialog, M33VELOCITYATBOTTOMCHECKBOX);
	TMap *map = sGridCurrentDialogMover -> GetMoverMap();
	
	if (map && map->IAm(TYPE_PTCURMAP))
	{
		if ((dynamic_cast<PtCurMap *>(map))->GetMaxDepth2() > 0 || ((TimeGridVelRect*) (sGridCurrentDialogMover -> timeGrid))->GetMaxDepth() > 0) okToExtrapolate = true;
	} 
	
	if (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || !okToExtrapolate)	// if model has depth data assume that is what user wants to use
	{
		extrapolateVertically = false;
		ShowHideDialogItem(dialog, M33EXTRAPOLATEVERTCHECKBOX, extrapolateVertically); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOLABEL, extrapolateVertically); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOVALUE, extrapolateVertically); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOUNITSLABEL, extrapolateVertically); 
	}
	else
	{
		extrapolateVertically = GetButton(dialog, M33EXTRAPOLATEVERTCHECKBOX);
		ShowHideDialogItem(dialog, M33EXTRAPOLATEVERTCHECKBOX, true); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOLABEL, extrapolateVertically); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOVALUE, extrapolateVertically); 
		ShowHideDialogItem(dialog, M33EXTRAPOLATETOUNITSLABEL, extrapolateVertically); 
	}
	ShowHideDialogItem(dialog, M33ARROWDEPTHAT, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate))); 
	ShowHideDialogItem(dialog, M33ARROWDEPTH, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate)) && !showVelAtBottom); 
	ShowHideDialogItem(dialog, M33ARROWDEPTHUNITS, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate)) && !showVelAtBottom); 
	ShowHideDialogItem(dialog, M33VELOCITYATBOTTOMCHECKBOX, (sGridCurrentDialogMover->timeGrid->fVar.gridType!=TWO_D || (extrapolateVertically && okToExtrapolate))); 
}