示例#1
0
BOOL ContextMenu::ShowOverView(Spread* pSpread, DocCoord ClickPos, ClickModifiers ClickMods)
{
	// If there's a menu still around for some reason, get rid of it.
	if (pCurrentMenu)
	{
		pCurrentMenu->Hide();
	}

	// Preserve current ID generator state
	AutoIDStash = MenuItem::GetAutomaticIDState();

	// Make a new root item
	pRootItem = new MenuItem("CONTEXT");
	if (pRootItem)
	{
		// OK, make this menu current and try to build it's contents
		pCurrentMenu=this;
		if (BuildOverView(pSpread, ClickPos, ClickMods))
		{
			// Kernel menu built OK so create the OILy part of it...
			CreateContextMenu(pRootItem);
			return TRUE;
		}
	}

	// Failed to completely build Kernel menu structure so delete anything
	// that might have been built...
	Hide();
	return FALSE;
}
示例#2
0
bool MyMainWindow::CheckOverView(GDALDataset*pDataset)
{
  GDALRasterBand *pband=pDataset->GetRasterBand(1);
  int n=pband->GetOverviewCount();
  if (n==0)
    {
      BuildOverView(pDataset);
      QMessageBox w;
      w.setText("build over view for the image,please reopen it!");
      return false;
    }
  return true;
}