void HelpPopup::DoInitDialog() { ToLog(LOGMSG_DEBUGTRACE,"IN:HelpPopup::DoInitDialog"); if (HelpEngine) { ui->HelpBrowserWidget->HelpEngine=HelpEngine; ui->ContentWidget->InitHelpEngine(HelpEngine); ui->FollowInterfaceCB->setChecked(*WikiFollowInterface); ui->HelpSplitter->setStretchFactor(0,1); ui->HelpSplitter->setStretchFactor(1,3); connect(ui->HelpBrowserWidget,SIGNAL(historyChanged()),SLOT(PageChanged())); connect(ui->HelpBrowserWidget,SIGNAL(sourceChanged(QUrl)),SLOT(SourceChanged(QUrl))); connect(ui->ContentWidget,SIGNAL(clicked(QModelIndex)),this,SLOT(UpdateUrl(QModelIndex))); connect(ui->ContentWidget,SIGNAL(collapsed(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex))); connect(ui->ContentWidget,SIGNAL(expanded(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex))); connect(ui->ExitBT,SIGNAL(pressed()),this,SLOT(Exit())); connect(ui->PreviousBT,SIGNAL(pressed()),this,SLOT(Back())); connect(ui->NextBT,SIGNAL(pressed()),this,SLOT(Next())); connect(ui->CCBYSABT,SIGNAL(pressed()),this,SLOT(CCBYSABT())); connect(ui->HomeBT,SIGNAL(pressed()),this,SLOT(Home())); connect(ui->WebSiteBT,SIGNAL(pressed()),this,SLOT(WebSite())); connect(ui->ForumBT,SIGNAL(pressed()),this,SLOT(Forum())); connect(ui->FollowInterfaceCB,SIGNAL(clicked()),this,SLOT(Follow())); PageChanged(); } }
void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt) { PageChanged(evt.GetOldSelection(), evt.GetSelection()); }
void CEditorRoot::OnFileSelected( KeyValues *pKV ) { KeyValues *pContext = pKV->FindKey( "FileOpenContext" ); if ( !pContext ) return; const char *__c = pContext->GetString( "context" ); bool bSaving = true; if ( !Q_stricmp( __c, "openc" ) ) bSaving = false; const char *pathIn = pKV->GetString( "fullpath" ); if ( Q_strlen( pathIn ) <= 1 ) return; bool bDoViewReset = false; if ( !bSaving ) { int iPageIndex = -1; for ( int i = 0; i < pNodeSheet->GetNumPages(); i++ ) { const char *pszShadername = ((CFlowGraphPage*)pNodeSheet->GetPage(i))->GetFlowGraph()->GetShadername(); if ( pszShadername && !Q_stricmp( pszShadername, pathIn ) ) iPageIndex = i; } bool bExists = iPageIndex >= 0; if ( bExists ) { pNodeSheet->SetActivePage( pNodeSheet->GetPage( iPageIndex ) ); //return; } else if ( ( input()->IsKeyDown( KEY_LCONTROL ) || input()->IsKeyDown( KEY_RCONTROL ) ) ) { AddNewTab(); bDoViewReset = true; } } else { Panel *p = pNodeSheet->GetActivePage(); for ( int i = 0; i < pNodeSheet->GetNumPages(); i++ ) { Panel *pCur = pNodeSheet->GetPage(i); if (pCur == p) continue; const char *pszShadername = ((CFlowGraphPage*)pCur)->GetFlowGraph()->GetShadername(); if ( pszShadername && !Q_stricmp( pszShadername, pathIn ) ) { pNodeSheet->DeletePage(pCur); i--; } } } SetCurrentShaderName( pathIn ); CNodeView *pView = GetSafeFlowgraph(); if ( bSaving ) pView->SaveToFile( pView->GetShadername() ); //m_szShaderName ); else { pView->LoadFromFile( pView->GetShadername() ); //m_szShaderName ); if ( bDoViewReset ) { pView->InvalidateLayout( true, true ); pView->ResetView_User( false ); } PageChanged(); } pView->RequestFocus(); }
void CEditorRoot::OpenShaderFlowgraph( int mode, bool bSM20, bool bForceNewTab ) { //CNodeView::FlowGraphType_t curType = GetSafeFlowgraph()->GetFlowgraphType(); CNodeView::FlowGraphType_t targetType = CNodeView::FLOWGRAPH_HLSL; switch (mode) { case CANVASINIT_PPEFFECT: targetType = CNodeView::FLOWGRAPH_POSTPROC; break; } bool bPushHistory = false; if ( bForceNewTab || input()->IsKeyDown( KEY_LCONTROL ) || input()->IsKeyDown( KEY_RCONTROL ) ) AddNewTab(targetType); else bPushHistory = true; OnNewFile(); CNodeView *pView = GetSafeFlowgraph(); pView->PurgeCanvas(); const char *FileToLoad = NULL; switch (mode) { default: case CANVASINIT_SCRATCH: { GenericShaderData *data = new GenericShaderData(); if ( bSM20 ) data->shader->iShaderModel = SM_20B; pView->InitCanvas(targetType,data); delete data; } break; case CANVASINIT_MODEL_SIMPLE: #ifdef SHADER_EDITOR_DLL_SWARM FileToLoad = "def_model_simple_swarm.def"; #else FileToLoad = "def_model_simple.def"; #endif break; case CANVASINIT_MODEL_COMPLEX: #ifdef SHADER_EDITOR_DLL_SWARM FileToLoad = "def_model_complex_swarm.def"; #else FileToLoad = "def_model_complex.def"; #endif break; case CANVASINIT_POSTPROC: FileToLoad = "def_pp.def"; break; case CANVASINIT_LIGHTMAPPED_SIMPLE: #ifdef SHADER_EDITOR_DLL_SWARM FileToLoad = "def_lightmap_simple_swarm.def"; #else FileToLoad = "def_lightmap_simple.def"; #endif break; case CANVASINIT_LIGHTMAPPED_BUMP: #ifdef SHADER_EDITOR_DLL_SWARM FileToLoad = "def_lightmap_bump_swarm.def"; #else FileToLoad = "def_lightmap_bump.def"; #endif break; case CANVASINIT_PPEFFECT: pView->InitCanvas(targetType); break; } if ( FileToLoad ) { char fPath[ MAX_PATH ]; Q_snprintf( fPath, MAX_PATH, "%s/shadereditorui/canvas_default/%s", GetGamePath(), FileToLoad ); pView->LoadFromFile( fPath ); } OnShaderNameChanged(); UpdateTabColor( pView ); pView->InvalidateLayout( true, true ); pView->ResetView_User( false ); if ( bPushHistory ) pView->MakeHistoryDirty(); PageChanged(); pView->UnDirtySave(); }
void wxGenericMDIClientWindow::OnPageChanged(wxBookCtrlEvent& event) { PageChanged(event.GetOldSelection(), event.GetSelection()); event.Skip(); }