void wxRichTextTabsPage::OnNewTabClick( wxCommandEvent& WXUNUSED(event) ) { wxString str = m_tabEditCtrl->GetValue(); if (!str.empty() && str.IsNumber()) { wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); m_tabListCtrl->Append(s); m_tabsPresent = true; SortTabs(); } }
void CRulerBar::FillInParaFormat(PARAFORMAT& pf) { pf.dwMask = PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | PFM_TABSTOPS; pf.dxStartIndent = m_indent.GetHorzPosTwips(); pf.dxOffset = m_leftmargin.GetHorzPosTwips() - pf.dxStartIndent; pf.dxRightIndent = PrintWidth() - m_rightmargin.GetHorzPosTwips(); pf.cTabCount = 0L; SortTabs(); int i, nPos = 0; for (i=0; i<MAX_TAB_STOPS; i++) { // get rid of zeroes and multiples // i.e. if we have 0,0,0,1,2,3,4,4,5 // we will get tabs at 1,2,3,4,5 if (nPos != m_pTabItems[i].GetHorzPosTwips()) { nPos = m_pTabItems[i].GetHorzPosTwips(); pf.rgxTabs[pf.cTabCount++] = nPos; } } }
void wxSTEditorNotebook::OnSTEState(wxSTEditorEvent &event) { event.Skip(true); wxSTEditor *editor = event.GetEditor(); if ( event.HasStateChange(STE_FILENAME | STE_MODIFIED) ) { if (GetOptions().HasNotebookOption(STN_UPDATE_TITLES)) { int page = FindEditorPage(editor); if (page >= 0) // if < 0 then not in notebook (or at least yet) { SetPageText(page, FileNameToTabName(editor)); SortTabs(GetOptions().GetNotebookOptions()); } } } if (event.HasStateChange(STE_FILENAME | STE_MODIFIED | STE_CANSAVE)) { UpdateAllItems(); } }