示例#1
0
// ----------------------------------------------------------------------------
void BrowseMarks::ImportBrowse_Marks()
// ----------------------------------------------------------------------------
{
    // rebuild BrowseMarks from scintilla browse marks

    #if defined(LOGGING)
    ///LOGIT( _T("BT ImportBrowse_Marks") );
    #endif

    //-EditorBase* eb = m_pEditorBase ;
    EditorBase* eb = m_pEdMgr->GetEditor(m_filePath);
    #if defined(LOGGING)
    LOGIT(_T("BT ImportBrowse_Marks entered with no active editor base."));
    #endif
    // This can happens when editing script for example .
    if (not eb) return;
    cbEditor* pcbEditor = Manager::Get()->GetEditorManager()->GetBuiltinEditor( eb ) ;
    if (not pcbEditor) return;
    ClearAllBrowse_Marks();
    cbStyledTextCtrl* pControl = pcbEditor->GetControl();
    //-int line = pControl->MarkerNext( 0, 1<<BROWSETRACKER_MARKER);
    int line = pControl->MarkerNext( 0, 1<<GetBrowseMarkerId());
    while( line != -1)
    {
        int posn = pControl->PositionFromLine( line );
        RecordMark(  posn );
        //-line = pControl->MarkerNext( ++line,  1<<BROWSETRACKER_MARKER);
        line = pControl->MarkerNext( ++line,  1<<GetBrowseMarkerId());
    }
}//ImportBrowse_Marks
示例#2
0
// ----------------------------------------------------------------------------
void BrowseMarks::RecordMarksFrom(BrowseMarks& otherBrowse_Marks)
// ----------------------------------------------------------------------------
{
    // get editor by filename in case the editor was close/opened again
    //-EditorBase* eb = m_pEditorBase;
    EditorBase* eb = m_pEdMgr->GetEditor(m_filePath);
    #if defined(LOGGING)
    if (not eb) asm("int3"); /*trap*/
    #endif
    if (not eb) return;
    cbEditor* cbed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(eb);
    if (not cbed) return;
    cbStyledTextCtrl* control = cbed->GetControl();
    for (int i=0; i<MaxEntries; ++i)
    {
        int posn = otherBrowse_Marks.GetMark(i);
        if ( posn != -1 )
        {
            #if defined(LOGGING)
            ///LOGIT( _T("RecordMarksFrom for[%d][%d]"),i,posn );
            #endif
            RecordMark( posn );
            int line = control->LineFromPosition(posn);
            //-control->MarkerAdd(line, BROWSETRACKER_MARKER);
            control->MarkerAdd(line, GetBrowseMarkerId());
        }
    }
}
示例#3
0
// ----------------------------------------------------------------------------
void BrowseMarks::ImportBook_Marks()
// ----------------------------------------------------------------------------
{
    // rebuild Book_Marks from scintilla browse marks

#if defined(LOGGING)
    ///LOGIT( _T("ImportBook_Marks") );
#endif

    //-EditorBase* eb = m_pEditorBase ;
    EditorBase* eb = m_pEdMgr->GetEditor(m_filePath);
#if defined(LOGGING)
    if (not eb) asm("int3"); /*trap*/
#endif
    if (not eb) return;
    cbEditor* pcbEditor = Manager::Get()->GetEditorManager()->GetBuiltinEditor( eb ) ;
    if (not pcbEditor) return;
    cbStyledTextCtrl* pControl = pcbEditor->GetControl();
    if (not pControl) return;
    ClearAllBrowse_Marks();
    int line = pControl->MarkerNext( 0, 1<<BOOKMARK_MARKER);
    while( line != -1)
    {
        int posn = pControl->PositionFromLine( line );
        RecordMark(  posn );
        line = pControl->MarkerNext( ++line,  1<<BOOKMARK_MARKER);
    }
}//ImportBook_Marks