|
From: Emilien K. <cur...@us...> - 2005-01-14 15:36:46
|
Update of /cvsroot/wxdevcenter/StdPlugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30821/src Modified Files: SimpleTextDocView.cpp Log Message: Statistiques du texte et de la position courante dans le panneau dédié (vue) de la barre de status Index: SimpleTextDocView.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/StdPlugin/src/SimpleTextDocView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleTextDocView.cpp 19 Dec 2004 17:01:29 -0000 1.2 --- SimpleTextDocView.cpp 14 Jan 2005 15:36:34 -0000 1.3 *************** *** 773,776 **** --- 773,777 ---- EVT_STC_MARGINCLICK(ID_TEXT, SimpleTextView::OnMarginClick) + EVT_STC_UPDATEUI(ID_TEXT, SimpleTextView::OnNotifyTextChanged) END_EVENT_TABLE() *************** *** 841,844 **** --- 842,859 ---- } + + // Met à jour le status de la vue. + void SimpleTextView::UpdateStatus() + { + wxString str; + int iCurPos = m_pText->GetCurrentPos(); + + str.Printf(wxT("Ln %d/%d Col %d/%d Char %d/%d"), + m_pText->GetCurrentLine(), m_pText->GetLineCount(), + m_pText->GetColumn(iCurPos), m_pText->LineLength(m_pText->LineFromPosition(iCurPos)), + iCurPos, m_pText->GetTextLength()); + SetStatusText(str); + } + void SimpleTextView::OnSize(wxSizeEvent &event) { *************** *** 873,876 **** --- 888,892 ---- void SimpleTextView::OnUpdate(View *WXUNUSED(pSender), unsigned int WXUNUSED(nUpdateCode), void* WXUNUSED(pUpdateInfo)) { + UpdateStatus(); } *************** *** 1137,1141 **** } ! /** Retourne le texte dans le buffer de scintilla.*/ wxString SimpleTextView::GetText()const { --- 1153,1165 ---- } ! // Interception de la notification de changement de texte. ! void SimpleTextView::OnNotifyTextChanged(wxStyledTextEvent& event) ! { ! event.Skip(); ! UpdateStatus(); ! } ! ! ! // Retourne le texte dans le buffer de scintilla. wxString SimpleTextView::GetText()const { |