当前位置: 首页>>代码示例>>C++>>正文


C++ UpdateAllViews函数代码示例

本文整理汇总了C++中UpdateAllViews函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateAllViews函数的具体用法?C++ UpdateAllViews怎么用?C++ UpdateAllViews使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateAllViews函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: normPath

/*!
 * \brief Create a document from a specified file.
 *
 * \param path Pathname of the configuration file.
 */
bool CNutConfDoc::OnCreate(const wxString & path, long flags)
{
    bool rc = false;
    wxString normPath(path);
    CSettings *cfg = wxGetApp().GetSettings();

    normPath.Replace(wxT("\\"), wxT("/"));
    cfg->m_configname = normPath;

    wxGetApp().m_currentDoc = this;

    /*
     * The repository may refer to certain configuration values. Thus, 
     * it must be loaded before reading the repository.
     */
    cfg->Load(cfg->m_configname);
    if ((rc = ReadRepository(cfg->m_repositoryname, normPath)) == true) {

        Modify(false);
        SetDocumentSaved(false);

        rc = wxDocument::OnCreate(path, flags);
        if (rc) {
            if (flags & wxDOC_NEW) {
                wxBusyCursor wait;

                CNutConfHint hint(NULL, nutSelChanged);
                UpdateAllViews(NULL, &hint);

                SetFilename(GetFilename(), true);
            }
        }
    }

    if(!rc) {
        wxGetApp().m_currentDoc = NULL;
    }
    return rc;
}
开发者ID:niziak,项目名称:ethernut-4.9,代码行数:44,代码来源:nutconfdoc.cpp

示例2: LoadAlphaIntoSurface

HRESULT CDxtexDoc::LoadAlphaBmp(CString& strPath)
{
    HRESULT hr;
    LPDIRECT3DTEXTURE9 pmiptex;
    LPDIRECT3DSURFACE9 psurf;

    if (IsCubeMap())
        return E_FAIL;

    pmiptex = (LPDIRECT3DTEXTURE9)m_ptexOrig;
    hr = pmiptex->GetSurfaceLevel(0, &psurf);
    if (FAILED(hr))
        return hr;

    hr = LoadAlphaIntoSurface(strPath, psurf);
    ReleasePpo(&psurf);
    if (FAILED(hr))
        return hr;
    
    UpdateAllViews(NULL, 1); // tell CView to pick up new surface pointers
    return S_OK;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:22,代码来源:dxtexdoc.cpp

示例3: CTString

void CModelerDoc::OnFileAddTexture() 
{
  CModelerView *pModelerView = CModelerView::GetActiveView();
  if( pModelerView == NULL)
    return;

  // call file requester for adding textures
  CDynamicArray<CTFileName> afnTextures;
  CTFileName fnDocName = CTString(GetPathName());
  theApp.WriteProfileString( "Scape", "Add texture directory", fnDocName.FileDir());
  _EngineGUI.FileRequester( "Choose textures to add", FILTER_TEX FILTER_END,
    "Add texture directory", "Textures\\", fnDocName.FileName()+".tex", &afnTextures);
  MEX mexWidth, mexHeight;
  m_emEditModel.edm_md.GetTextureDimensions( mexWidth, mexHeight);
  // add selected textures
  FOREACHINDYNAMICARRAY( afnTextures, CTFileName, itTexture)
  {
    CTextureDataInfo *pNewTDI;
    // add texture
    CTFileName fnTexName = itTexture.Current();
    try
    {
      pNewTDI =m_emEditModel.AddTexture_t( fnTexName, mexWidth, mexHeight);
    }
    catch( char *err_str)
    {
      pNewTDI = NULL;
      AfxMessageBox( err_str);
    }
    if( pNewTDI != NULL)
    {
      SetModifiedFlag();
      pModelerView->m_ptdiTextureDataInfo = pNewTDI;
      // switch to texture mode
      pModelerView->OnRendUseTexture();
      UpdateAllViews( NULL);
    }
  }
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:38,代码来源:ModelerDoc.cpp

示例4: CZoneView

	CZoneView* CSimPetriDoc::AddZone(Point& firstPoint, Point& lastPoint)
	{
		Rect rectangle;
		if(gridMode)
			Rect::Union(rectangle,
			CElement::GridCellRect(firstPoint),
			CElement::GridCellRect(lastPoint));
		else
			rectangle = CElement::RectangleFromPoints(firstPoint, lastPoint);

		CZoneView* zoneView = new CZoneView(rectangle);
		auto rit = drawingElements.rbegin();
		while(rit!= drawingElements.rend() && (*rit)->Type() == CElement::ZONE)
			++rit;
		drawingElements.insert(rit.base(), zoneView);

		//Notifier le changement
		SetModifiedFlag();
		UpdateAllViews(NULL);
		RefreshIDs();

		return zoneView;
	}
开发者ID:hlobit,项目名称:SimPetri,代码行数:23,代码来源:SimPetriDoc.cpp

示例5: UpdateAllViews

void CCreepingLineDoc::OnOptions() 
{
	CLinePropertySheet propSheet;

	propSheet.m_line = m_line;

	int res = propSheet.DoModal();
	if( res == IDOK )
	{
		m_line = propSheet.m_line;

		BOOL bChanged = !(m_line_orig == m_line);
		this->SetModifiedFlag( bChanged );

		UpdateAllViews( NULL );

		if(m_CrippingLinePreview.IsPlay())
		{
			OnStopCreepingLine();
			OnRunCreepingLine();
		}
	}
}
开发者ID:ror13,项目名称:diplom,代码行数:23,代码来源:CreepingLineDoc.cpp

示例6: InitializeInstrument

// Try to set up a new instrument that is linked to a given plugin
INSTRUMENTINDEX CModDoc::InsertInstrumentForPlugin(PLUGINDEX plug)
//----------------------------------------------------------------
{
#ifndef NO_PLUGINS
	const bool first = (GetNumInstruments() == 0);
	if(first && !ConvertSamplesToInstruments()) return INSTRUMENTINDEX_INVALID;

	INSTRUMENTINDEX instr = m_SndFile.GetNextFreeInstrument();
	if(instr == INSTRUMENTINDEX_INVALID) return INSTRUMENTINDEX_INVALID;

	ModInstrument *ins = m_SndFile.AllocateInstrument(instr, 0);
	if(ins == nullptr) return INSTRUMENTINDEX_INVALID;
	InitializeInstrument(ins);

	_snprintf(ins->name, CountOf(ins->name) - 1, _T("%u: %s"), plug + 1, m_SndFile.m_MixPlugins[plug].GetName());
	mpt::String::Copy(ins->filename, mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, m_SndFile.m_MixPlugins[plug].GetLibraryName()));
	ins->nMixPlug = plug + 1;
	ins->nMidiChannel = 1;
	// People will forget to change this anyway, so the following lines can lead to some bad surprises after re-opening the module.
	//pIns->wMidiBank = (WORD)((m_pVstPlugin->GetCurrentProgram() >> 7) + 1);
	//pIns->nMidiProgram = (BYTE)((m_pVstPlugin->GetCurrentProgram() & 0x7F) + 1);

	if(instr > m_SndFile.m_nInstruments) m_SndFile.m_nInstruments = instr;

	InstrumentHint hint = InstrumentHint(instr).Info().Envelope().Names();
	if(first) hint.ModType();
	UpdateAllViews(nullptr, hint);
	if(m_SndFile.GetModSpecifications().supportsPlugins)
	{
		SetModified();
	}

	return instr;
#else
	return INSTRUMENTINDEX_INVALID;
#endif
}
开发者ID:Sappharad,项目名称:modizer,代码行数:38,代码来源:Modedit.cpp

示例7: _T

void CSubdivisionDoc::OnImport()
{
	CString lpszFilter = _T("Obj files (*.obj)|*.obj|Off files (*.off)|*.off||");
	CFileDialog dlg(true, NULL, NULL, OFN_READONLY, lpszFilter);
	dlg.m_ofn.lpstrTitle = _T("Import 3D model");		////
	dlg.m_ofn.lpstrDefExt = _T("obj");		

	if(dlg.DoModal() == IDOK)
	{
		CString		strFile = dlg.GetPathName();

		//	delete  m_pmesh, m_pmesh = NULL;
		if (m_pmesh==NULL) {
			m_pmesh = new Mesh3D;
		}

		CString extension = strFile;
		extension = extension.Right(extension.GetLength()-extension.ReverseFind('.'));
		extension.MakeLower();

		if (extension == ".off")
		{
			CStringA   ss(strFile);
			m_pmesh->load_off((LPCSTR)(ss));
		}
		else if (extension == ".obj")
		{
			//const char * ss = CString2constchar(strFile);
			CStringA  ss(strFile);
			m_pmesh->load_obj((LPCSTR)(ss));
		}

		m_pmesh->update_mesh();

	}
	UpdateAllViews(NULL);
}
开发者ID:Anstarc,项目名称:OpenGL,代码行数:37,代码来源:SubdivisionDoc.cpp

示例8: wxGetApp

/*!
 * \brief Create all configuration items.
 */
void CNutConfDoc::AddAllItems()
{
    CConfigTree *treeCtrl = wxGetApp().GetMainFrame()->GetTreeCtrl();

    wxGetApp().GetMainFrame()->GetPropertyListWindow()->Fill(NULL);

    treeCtrl->DeleteAllItems();

    CConfigItem *item = new CConfigItem();
    wxTreeItemId rootId = treeCtrl->AddRoot(wxT(""), -1, -1, new CTreeItemData(item));

    item->SetTreeItem(rootId);
    item->UpdateTreeItem(*treeCtrl);
    m_items.Append(item);

    AddChildItems(m_root, rootId);

    UpdateAllViews();

    if (GetItems().GetCount() > 0) {
        wxGetApp().GetMainFrame()->GetTreeCtrl()->Expand(rootId);
    }
    wxGetApp().GetMainFrame()->GetTreeCtrl()->SetFocus();
}
开发者ID:niziak,项目名称:ethernut-4.9,代码行数:27,代码来源:nutconfdoc.cpp

示例9: RefreshMemoryComboBox

	CTransView* CSimPetriDoc::AddTransition(Point& center, pm::Transition* transitionModel)
	{
		//Modèle
		if(!transitionModel)
			transitionModel = skeleton.addTransition();

		//Les mémoires ont été supprimées
		RefreshMemoryComboBox();

		//Vue transition
		CTransView* transitionView = new CTransView(center, transitionModel);
		if(gridMode) transitionView->AdjustOnGrid();
		drawingElements.push_front(transitionView);

		//Ajout dans la map des transitions
		transitions[transitionView] = transitionModel;

		//Notifier le chagement
		SetModifiedFlag();
		UpdateAllViews(NULL);
		RefreshIDs();

		return transitionView;
	}
开发者ID:hlobit,项目名称:SimPetri,代码行数:24,代码来源:SimPetriDoc.cpp

示例10: ASSERT

// **************************************************************************
// AddServer ()
//
// Description:
//	Adds a server that was created during document load from disk or during a
//	cut and paste operation to the document.  
//
// Parameters:
//	CKServer	*pServer		Pointer to server object to add.
//	bool		bConnect		Set to true to connect to server after add.
//
// Returns:
//  void
// **************************************************************************
void CKDocument::AddServer (CKServer *pServer, bool bConnect /* = false */)
	{
	// Check that pointer to server is not NULL (for debug only):
	ASSERT (pServer != NULL);

	// Add the server to head of linked list list.

	// Next item will be previous head of linked list:
	pServer->SetNext (m_pServerHead);

	// If we had a head to the linked list, it's previous item will be
	// new server:
	if (m_pServerHead)	
		m_pServerHead->SetPrev (pServer);
		
	// New server is now the head of the linked list:
	m_pServerHead = pServer;

	// Increment the server count:
	++m_cdwServers;			
				
	// Connect to the OPC Server if asked:
	if (bConnect)
		{
		// Start the server:
		pServer->Start ();

		// Update views to indicate new server connection status.
		// Architecture will assue that new server will get added
		// to views if we don't connect at this point.
		UpdateAllViews (NULL, HINT_ADD_SERVER_AND_GROUPS, pServer);

		// Set document modified flag:
		SetModified ();
		}
	}
开发者ID:wfmdyh,项目名称:wecan,代码行数:50,代码来源:document.cpp

示例11: DoOpen

// Open the document
bool ctConfigToolDoc::OnOpenDocument(const wxString& filename)
{
    wxBusyCursor cursor;

    bool opened = DoOpen(filename);

    if (opened)
    {
        SetFilename(filename);
        wxGetApp().GetSettings().m_lastFilename = filename;

        ((ctConfigToolView*)GetFirstView())->OnChangeFilename();

        RefreshDependencies();

        // ctConfigToolHint hint(NULL, ctFilenameChanged);
        ctConfigToolHint hint(NULL, ctInitialUpdate);
        UpdateAllViews (NULL, & hint);
    }

    SetDocumentSaved(true); // Necessary or it will pop up the Save As dialog

    return opened;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:25,代码来源:configtooldoc.cpp

示例12: dlg

// --------------------------------------------------------------------------
void CFabAtHomeDoc::OnModelScale()
// --------------------------------------------------------------------------
{
    CString action;
    action.Format("Rescale Model");
    CAxesDlg dlg(NULL, action);

    dlg.m_xax = "1.0";
    dlg.m_yax = "1.0";
    dlg.m_zax = "1.0";

    if (dlg.DoModal() == IDOK)
    {
        //check for zero scale factor
        CVec s(atof(dlg.m_xax),atof(dlg.m_yax),atof(dlg.m_zax));
        if(s.x==0 || s.y==0 || s.z==0)
        {
            ((CFabAtHomeApp *)AfxGetApp())->Log("Scale factor of zero is not allowed.");
            return;
        }
        double pi = atan(1.0)*4;
        for (int i=0; i<model.chunk.GetSize(); i++)
        {
            if (model.chunk[i].IsSelected())
            {
                model.chunk[i].geometry.Scale(s);
            }
        }

        model.Flush();
        model.MoveToOrigin();
        SetModifiedFlag();
        UpdateAllViews(0);
    }

}
开发者ID:idle-git,项目名称:fabathome,代码行数:37,代码来源:FabAtHomeDoc.cpp

示例13: wxString

bool csDiagramDocument::OnOpenDocument(const wxString& file)
{
  if (!OnSaveModified())
    return false;

  wxString msgTitle;
  if (wxTheApp->GetAppName() != wxEmptyString)
    msgTitle = wxTheApp->GetAppName();
  else
    msgTitle = wxString(_T("File error"));

  m_diagram.DeleteAllShapes();
  if (!m_diagram.LoadFile(file))
  {
    (void)wxMessageBox(_T("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
     GetDocumentWindow());
    return false;
  }
  SetFilename(file, true);
  Modify(false);
  UpdateAllViews();

  return true;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:24,代码来源:doc.cpp

示例14: hint

/// Open the settings file
bool ctConfigToolDoc::DoOpen(const wxString& filename)
{
    wxSimpleHtmlParser parser;
    if (parser.ParseFile(filename))
    {
        ctConfigToolHint hint(NULL, ctClear);
        UpdateAllViews (NULL, & hint);
        m_topItem = NULL;

        if (parser.GetTopLevelTag()->GetChildren())
        {
            wxSimpleHtmlTag* settingsTag = parser.GetTopLevelTag()->GetChildren()->FindTag(wxT("settings"));
            if (settingsTag && settingsTag->GetChildren())
            {
                wxSimpleHtmlTag* firstSettingTag = settingsTag->GetChildren();
                if (firstSettingTag)
                    DoOpen(firstSettingTag, NULL);
                return true;
            }
            return true;
        }
    }
    return false;
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:25,代码来源:configtooldoc.cpp

示例15: SetModifiedFlag

// --------------------------------------------------------------------------
void CFabAtHomeDoc::OnModelDelete()
// --------------------------------------------------------------------------
{
    int cnt = 0;

    for (int i=0; i<model.chunk.GetSize(); i++) {
        if (model.chunk[i].IsSelected()) {
            model.chunk.RemoveAt(i);
            i--;
            cnt++;
        }
    }

    if (cnt > 0) {
        model.FocusCentroid();
        model.fab.layer.RemoveAll();
        model.fab.SetCurrentLayer(0);
        SetModifiedFlag();
    }
    model.Flush();

    UpdateAllViews(0);

}
开发者ID:idle-git,项目名称:fabathome,代码行数:25,代码来源:FabAtHomeDoc.cpp


注:本文中的UpdateAllViews函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。