void CFusionTabControls::SelectTexture(int SelNum) { if(m_CurrentTab != TEXTURE_TAB) { m_CurrentTab =TEXTURE_TAB; SetCurSel (TEXTURE_TAB); UpdateTabs(); } m_pTextureDialog->SelectTexture(SelNum); }
kGUITabObj::kGUITabObj() { m_close=false; m_locked=false; m_track=false; m_hidetabs=false; /* commonly used for hiding tabs when only 1 tab */ m_curtab=0; m_numtabs=0; m_numgroups=0; m_starttabx=0; UpdateTabs(); }
void iCastleView::SetCastle(iCastle* pCastle) { m_pCastle = pCastle; m_pCastle->UpdateCnsts(); for (uint32 xx=0; xx<CVT_COUNT; ++xx) m_pChilds[xx]->SetCastle(m_pCastle); ((iCastleTitleBar*)GetChildById(VPUID_CTLVIEWTITLELBAR))->SetCastle(m_pCastle); ((iCastleToolBar*)GetChildById(VPUID_CTLVIEWTOOLBAR))->SetCastle(m_pCastle); UpdateTabs(); if (!m_pToolBar->m_pTabSwitch->IsTabEnabled(m_pToolBar->m_pTabSwitch->GetCurrentTab())) { m_pToolBar->m_pTabSwitch->SetCurrentTab(CVT_CONSTRUCT); ShowPage(CVT_CONSTRUCT); } }
void CBonfireDoc::SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU) { CDocument::SetPathName(lpszPathName, bAddToMRU); if (m_pXFile) m_pXFile->Update(lpszPathName,TRUE); // update the syntax highlighting parser this->m_fnParse = LookupParser( GetFileExtension(lpszPathName) ); UpdateAllViews(NULL); // draw icon POSITION pos = GetFirstViewPosition(); ((CChildFrame*)GetNextView(pos)->GetParentFrame())->UpdateIcon(lpszPathName); UpdateDocumentTitle(lpszPathName); // update the tab list (changes when the file extension changes) UpdateTabs(); }
void kGUITabObj::SetNumTabs(int numtabs,int numgroups) { int i,j; m_numtabs=numtabs; m_numgroups=numgroups; m_curtab=0; m_overtab=-1; SetNumGroups(numgroups); m_tabnames.Init(numtabs,0); m_tabgroups.Alloc(numtabs); m_tabx.Alloc(numtabs); m_taby.Alloc(numtabs); for(i=0;i<m_numtabs;++i) { j=i; if(j>=numgroups) j=numgroups-1; m_tabgroups.SetEntry(i,j); } UpdateTabs(); }
void iCastleView::OnBuildCnst() { UpdateTabs(); }
void WorkspacePane::CreateGUIControls() { wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); SetSizer(mainSizer); // add notebook for tabs long bookStyle = wxVB_LEFT | wxAUI_NB_WINDOWLIST_BUTTON; m_book = new Notebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, bookStyle); // Calculate the widest tab (the one with the 'Workspace' label) int xx, yy; wxFont fnt = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxWindow::GetTextExtent(_("Workspace"), &xx, &yy, NULL, NULL, &fnt); mainSizer->Add(m_book, 1, wxEXPAND | wxALL, 0); // Add the parsing progress controls m_staticText = new wxStaticText(this, wxID_ANY, _("Parsing workspace...")); mainSizer->Add(m_staticText, 0, wxEXPAND|wxALL, 2); m_parsingProgress = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxSize(-1, 15), wxGA_HORIZONTAL|wxGA_SMOOTH); mainSizer->Add(m_parsingProgress, 0, wxEXPAND|wxALL, 1); m_parsingProgress->Hide(); m_staticText->Hide(); // create tabs (possibly detached) DetachedPanesInfo dpi; EditorConfigST::Get()->ReadObject(wxT("DetachedPanesList"), &dpi); wxArrayString detachedPanes; detachedPanes = dpi.GetPanes(); // Add the workspace tab wxString name; name = _("Workspace"); if(IS_DETACHED(name)) { DockablePane *cp = new DockablePane(GetParent(), m_book, name, wxNullBitmap, wxSize(200, 200)); m_workspaceTab = new WorkspaceTab(cp, name); cp->SetChildNoReparent(m_workspaceTab); } else { m_workspaceTab = new WorkspaceTab(m_book, name); m_book->AddPage(m_workspaceTab, name, true, wxNullBitmap); } // Add the explorer tab name = _("Explorer"); if(IS_DETACHED(name)) { DockablePane *cp = new DockablePane(GetParent(), m_book, name, wxNullBitmap, wxSize(200, 200)); m_explorer = new FileExplorer(cp, name); cp->SetChildNoReparent(m_explorer); } else { m_explorer = new FileExplorer(m_book, name); m_book->AddPage(m_explorer, name, false); } // Add the Open Windows Panel (Tabs) name = _("Tabs"); if(IS_DETACHED(name)) { DockablePane *cp = new DockablePane(GetParent(), m_book, name, wxNullBitmap, wxSize(200, 200)); m_openWindowsPane = new OpenWindowsPanel(cp, name); cp->SetChildNoReparent(m_openWindowsPane); } else { m_openWindowsPane = new OpenWindowsPanel(m_book, name); m_book->AddPage(m_openWindowsPane, name, false); } // Add the Tabgroups tab name = _("Tabgroups"); if(IS_DETACHED(name)) { DockablePane *cp = new DockablePane(GetParent(), m_book, name, wxNullBitmap, wxSize(200, 200)); m_TabgroupsPane = new TabgroupsPane(cp, name); cp->SetChildNoReparent(m_TabgroupsPane); } else { m_TabgroupsPane = new TabgroupsPane(m_book, name); m_book->AddPage(m_TabgroupsPane, name, false); } if (m_book->GetPageCount() > 0) { m_book->SetSelection((size_t)0); } UpdateTabs(); m_mgr->Update(); }
void StatusBar::UpdateBarFromActiveEditor() { EditorCtrl* editorCtrl = m_parentFrame.GetEditorCtrl(); if (!editorCtrl) return; const unsigned int changeToken = editorCtrl->GetChangeToken(); const int id = editorCtrl->GetId(); const unsigned int pos = editorCtrl->GetPos(); // In rare cases a new editorCtrl may get same address as // a previous one, so we also track the window id. const bool newEditorCtrl = (editorCtrl != m_editorCtrl || id != m_editorCtrlId); // Only update if the editorCtrl has changed const bool updatePanels = newEditorCtrl || (m_changeToken != changeToken) || (m_pos != pos); if (!updatePanels) return; if (newEditorCtrl) m_changeToken = 0; // reset m_editorCtrl = editorCtrl; m_editorCtrlId = id; Freeze(); UpdateTabs(); if (editorCtrl) { // Caret position const unsigned int line = editorCtrl->GetCurrentLineNumber(); const unsigned int column = editorCtrl->GetCurrentColumnNumber(); if (line != m_line || column != m_column) { SetStatusText(wxString::Format(wxT("Line: %u Column: %u"), line, column), 0); m_line = line; m_column = column; } // Syntax SetPanelTextIfDifferent(editorCtrl->GetSyntaxName(), 1); // Only reload symbol list if doc has changed bool symbolsChanged = false; if (newEditorCtrl || m_changeToken != changeToken) { m_symbols.clear(); if (editorCtrl->GetSymbols(m_symbols)) { m_changeToken = editorCtrl->GetChangeToken(); // Track change state (so we only update on change) symbolsChanged = true; } } // Symbols if (newEditorCtrl || symbolsChanged || m_pos != pos) { SetStatusText(wxEmptyString, 3); for (std::vector<SymbolRef>::reverse_iterator p = m_symbols.rbegin(); p != m_symbols.rend(); ++p) { if (m_pos >= p->start) { const SymbolRef& sr = *p; SetStatusText(editorCtrl->GetSymbolString(sr), 3); break; } } } // Encoding wxFontEncoding enc = editorCtrl->GetEncoding(); wxTextFileType eol = editorCtrl->GetEOL(); wxString encoding = wxFontMapper::GetEncodingName(enc).Lower(); if (enc == wxFONTENCODING_DEFAULT) enc = wxLocale::GetSystemEncoding(); if (enc == wxFONTENCODING_UTF7 || enc == wxFONTENCODING_UTF8 || enc == wxFONTENCODING_UTF16LE || enc == wxFONTENCODING_UTF16BE || enc == wxFONTENCODING_UTF32LE || enc == wxFONTENCODING_UTF32BE) { if (editorCtrl->GetBOM()) encoding += wxT("+bom"); } if (eol == wxTextFileType_None) eol = wxTextBuffer::typeDefault; if (eol == wxTextFileType_Dos) encoding += wxT(" crlf"); else if (eol == wxTextFileType_Unix) encoding += wxT(" lf"); else if (eol == wxTextFileType_Mac) encoding += wxT(" cr"); SetStatusText(encoding, 4); m_pos = pos; } Thaw(); }