Exemplo n.º 1
0
void MainBook::GetAllTabs(clTab::Vec_t& tabs)
{
    tabs.clear();
    clTabInfo::Vec_t tabsInfo;
    m_book->GetAllTabs(tabsInfo);

    // Convert into "clTab" array
    std::for_each(tabsInfo.begin(), tabsInfo.end(), [&](clTabInfo::Ptr_t tabInfo) {
        clTab t;
        t.bitmap = tabInfo->GetBitmap();
        t.text = tabInfo->GetLabel();
        t.window = tabInfo->GetWindow();

        LEditor* editor = dynamic_cast<LEditor*>(t.window);
        if(editor) {
            t.isFile = true;
            t.isModified = editor->IsModified();
            t.filename = editor->GetFileName();
        }
        tabs.push_back(t);
    });
}
void MainBook::GetDetachedTabs(clTab::Vec_t& tabs)
{
    // Make sure that modified detached editors are also enabling the "Save" and "Save All" button
    const EditorFrame::List_t& detachedEditors = GetDetachedEditors();
    std::for_each(detachedEditors.begin(), detachedEditors.end(), [&](EditorFrame* fr) {
        clTab tabInfo;
        tabInfo.bitmap = wxNullBitmap;
        tabInfo.filename = fr->GetEditor()->GetFileName();
        tabInfo.isFile = true;
        tabInfo.isModified = fr->GetEditor()->IsModified();
        tabInfo.text = fr->GetEditor()->GetFileName().GetFullPath();
        tabInfo.window = fr->GetEditor();
        tabs.push_back(tabInfo);
    });
}
Exemplo n.º 3
0
size_t PluginManager::GetAllTabs(clTab::Vec_t& tabs)
{
    clMainFrame::Get()->GetMainBook()->GetAllTabs(tabs);
    return tabs.size();
}