本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
}
}
示例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
}
示例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);
}
示例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();
}
示例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;
}
示例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 ();
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}