当前位置: 首页>>代码示例>>C++>>正文


C++ clCodeCompletionEvent::SetTooltip方法代码示例

本文整理汇总了C++中clCodeCompletionEvent::SetTooltip方法的典型用法代码示例。如果您正苦于以下问题:C++ clCodeCompletionEvent::SetTooltip方法的具体用法?C++ clCodeCompletionEvent::SetTooltip怎么用?C++ clCodeCompletionEvent::SetTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clCodeCompletionEvent的用法示例。


在下文中一共展示了clCodeCompletionEvent::SetTooltip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnCodeCompletionGetTagComment

void PHPCodeCompletion::OnCodeCompletionGetTagComment(clCodeCompletionEvent& e)
{
    if(PHPWorkspace::Get()->IsOpen()) {

        TagEntryPtr tag = e.GetTagEntry();
        void* data = tag->GetUserData();

        if(data) {
            PHPCCUserData* userData = reinterpret_cast<PHPCCUserData*>(data);

            wxString comment, docComment;
            docComment = userData->entry->GetDocComment();
            if(docComment.IsEmpty() == false) {
                docComment.Trim().Trim(false);          // The Doc comment
                comment << docComment << wxT("\n<hr>"); // HLine
            }

            wxFileName fn(userData->entry->GetFilename());
            fn.MakeRelativeTo(PHPWorkspace::Get()->GetFilename().GetPath());
            comment << fn.GetFullName() << wxT(" : ") << userData->entry->GetLine();
            e.SetTooltip(comment);
        }

    } else {
        e.Skip();
    }
}
开发者ID:bugparty,项目名称:codelite,代码行数:27,代码来源:php_code_completion.cpp

示例2: OnTypeinfoTip

void PHPCodeCompletion::OnTypeinfoTip(clCodeCompletionEvent& e)
{
    if(PHPWorkspace::Get()->IsOpen()) {
        if(!CanCodeComplete(e)) return;

        IEditor* editor = dynamic_cast<IEditor*>(e.GetEditor());
        if(editor) {
            if(IsPHPFile(editor)) {
                PHPEntityBase::Ptr_t entity = GetPHPEntityAtPos(editor, e.GetPosition());
                if(entity) {
                    e.SetTooltip(entity->ToTooltip());
                }
                return;
            }
        }

    } else {
        e.Skip();
    }
}
开发者ID:anatooly,项目名称:codelite,代码行数:20,代码来源:php_code_completion.cpp

示例3: OnInsertDoxyBlock

void PHPCodeCompletion::OnInsertDoxyBlock(clCodeCompletionEvent& e)
{
    e.Skip();

    // Do we have a workspace open?
    CHECK_COND_RET(PHPWorkspace::Get()->IsOpen());

    // Sanity
    IEditor* editor = dynamic_cast<IEditor*>(e.GetEditor());
    CHECK_PTR_RET(editor);

    // Is this a PHP editor?
    CHECK_COND_RET(IsPHPFile(editor));

    // Get the text from the caret current position
    // until the end of file
    wxString unsavedBuffer = editor->GetTextRange(editor->GetCurrentPosition(), editor->GetLength());
    unsavedBuffer.Trim().Trim(false);
    PHPSourceFile source("<?php " + unsavedBuffer);
    source.SetParseFunctionBody(false);
    source.Parse();

    PHPEntityBase::Ptr_t ns = source.Namespace();
    if(ns) {
        const PHPEntityBase::List_t& children = ns->GetChildren();
        for(PHPEntityBase::List_t::const_iterator iter = children.begin(); iter != children.end(); ++iter) {
            PHPEntityBase::Ptr_t match = *iter;
            if(match->GetLine() == 0 && match->Is(kEntityTypeFunction)) {
                e.Skip(false); // notify codelite to stop processing this event
                wxString phpdoc = match->FormatPhpDoc();
                phpdoc.Trim();
                e.SetTooltip(phpdoc);
            }
        }
    }
}
开发者ID:anatooly,项目名称:codelite,代码行数:36,代码来源:php_code_completion.cpp


注:本文中的clCodeCompletionEvent::SetTooltip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。