bool NodeJSWorkspace::Create(const wxFileName& filename)
{
    if(IsOpen()) return false;
    if(filename.Exists()) return false;
    DoClear();
    m_filename = filename;

    // By default add the workspace path
    m_folders.Add(m_filename.GetPath());
    Save();

    // We dont load the workspace
    DoClear();
    return true;
}
void NodeJSWorkspace::Close()
{
    if(!IsOpen()) return;

    // Store the session
    clGetManager()->StoreWorkspaceSession(m_filename);

    Save();
    DoClear();

    // disable clang for NodeJS
    clGetManager()->EnableClangCodeCompletion(m_clangOldFlag);

    // Clear the UI
    GetView()->Clear();

    // Notify workspace closed event
    wxCommandEvent event(wxEVT_WORKSPACE_CLOSED);
    EventNotifier::Get()->ProcessEvent(event);

    m_debugger.Reset(NULL);

    // notify codelite to close the currently opened workspace
    wxCommandEvent eventClose(wxEVT_MENU, wxID_CLOSE_ALL);
    eventClose.SetEventObject(EventNotifier::Get()->TopFrame());
    EventNotifier::Get()->TopFrame()->GetEventHandler()->ProcessEvent(eventClose);
    m_showWelcomePage = true;
}
Example #3
0
void ZoomText::UpdateLexer(IEditor* editor)
{
    if(!editor) {
        editor = clGetManager()->GetActiveEditor();
    }
    if(!editor) {
        DoClear();
        return;
    }

    znConfigItem data;
    clConfig conf("zoom-navigator.conf");
    conf.ReadItem(&data);

    m_filename = editor->GetFileName().GetFullPath();
    LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexerForFile(m_filename);
    if(!lexer) {
        lexer = EditorConfigST::Get()->GetLexer("Text");
    }
    lexer->Apply(this, true);

    if(lexer->IsDark()) {
        MarkerSetAlpha(1, 10);
    } else {
        MarkerSetAlpha(1, 20);
    }

    SetZoom(m_zoomFactor);
    SetEditable(false);
    SetUseHorizontalScrollBar(false);
    SetUseVerticalScrollBar(data.IsUseScrollbar());
    HideSelection(true);
    MarkerSetBackground(1, m_colour);
}
Example #4
0
void HandleMenu(int menuItem)
{
    SetPort(gCalcWinPtr);

    switch (menuItem) {
    case cutAction:
        DoCut();
        break;

    case copyAction:
        DoCopy();
        break;

    case pasteAction:
        DoPaste();
        break;

    case clearAction:
        DoClear();
        break;

    default:
        break;
    }
}
wxListBox::~wxListBox()
{
    // call this just to free the client data -- and avoid leaking memory
    DoClear();

    delete m_strings;

    m_strings = NULL;
}
void wxListBox::Clear()
{
    DoClear();

    m_updateScrollbarY = true;

    RefreshHorzScrollbar();

    RefreshAll();
}
Example #7
0
void ZoomText::UpdateText(IEditor* editor)
{
    if(!editor) {
        DoClear();

    } else {
        SetReadOnly(false);
        SetText(editor->GetEditorText());
        SetReadOnly(true);
        SetCurrentPos(editor->GetCurrentPosition());
    }
}
Example #8
0
void wxItemContainer::Clear()
{
    if ( HasClientObjectData() )
    {
        const unsigned count = GetCount();
        for ( unsigned i = 0; i < count; ++i )
            ResetItemClientObject(i);
    }

    SetClientDataType(wxClientData_None);

    DoClear();
}
Example #9
0
void CodeLiteDiff::OnTabContextMenu(clContextMenuEvent& event)
{
    event.Skip();
    DoClear();
    IEditor* activeEditor = m_mgr->GetActiveEditor();
    CHECK_PTR_RET(activeEditor);

    m_leftFile = activeEditor->GetFileName();

    // Edit the context menu
    wxMenuItem* mi = new wxMenuItem(event.GetMenu(), XRCID("diff_compare_with"), _("Compare with..."), "");
    mi->SetBitmap(m_mgr->GetStdIcons()->LoadBitmap("diff"));
    event.GetMenu()->Append(mi);
    event.GetMenu()->Bind(wxEVT_MENU, &CodeLiteDiff::OnDiff, this, XRCID("diff_compare_with"));
}
bool NodeJSWorkspace::DoOpen(const wxFileName& filename)
{
    NodeJSWorkspaceConfiguration conf;
    conf.Load(m_filename);
    if(!conf.IsOk()) {
        DoClear();
        return false;
    }

    m_folders = conf.GetFolders();
    GetView()->Clear();
    GetView()->ShowHiddenFiles(conf.IsShowHiddenFiles());

    const wxArrayString& folders = GetFolders();
    for(size_t i = 0; i < folders.size(); ++i) {
        GetView()->AddFolder(folders.Item(i));
    }

    // Notify codelite that NodeJS workspace is opened
    clGetManager()->GetWorkspaceView()->SelectPage(GetWorkspaceType());
    clWorkspaceManager::Get().SetWorkspace(this);

    // Keep the old clang state before we disable it
    const TagsOptionsData& options = TagsManagerST::Get()->GetCtagsOptions();
    m_clangOldFlag = (options.GetClangOptions() & CC_CLANG_ENABLED);

    clGetManager()->EnableClangCodeCompletion(false);

    // Notify that the a new workspace is loaded
    wxCommandEvent event(wxEVT_WORKSPACE_LOADED);
    event.SetString(filename.GetFullPath());
    EventNotifier::Get()->AddPendingEvent(event);

    // and finally, request codelite to keep this workspace in the recently opened workspace list
    clGetManager()->AddWorkspaceToRecentlyUsedList(m_filename);

    // Load the workspace session (if any)
    CallAfter(&NodeJSWorkspace::RestoreSession);

    // Create new debugger for this workspace
    m_debugger.Reset(new NodeJSDebugger());
    return true;
}
void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
{
    DoClear();

    size_t count = items.GetCount();
    if ( !count )
        return;

    m_strings->Alloc(count);

    m_itemsClientData.Alloc(count);
    for ( size_t n = 0; n < count; n++ )
    {
        size_t index = DoAppendOnly(items[n]);

        m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index);
    }

    m_updateScrollbarY = true;

    RefreshAll();
}
Example #12
0
void wxItemContainer::Clear()
{
    if ( HasClientObjectData() )
    {
        const unsigned count = GetCount();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
        for ( unsigned i = 0; i < count; ++i )
            ResetItemClientObject(i);
    }

    SetClientDataType(wxClientData_None);

    DoClear();
}
Example #13
0
void wxOwnerDrawnComboBox::Clear()
{
    DoClear();
    SetClientDataType(wxClientData_None);
}
Example #14
0
static void GenerateCalEntries(int col)
{
    int r;
    Token tok;
    char const *s;
    Parser p;

/* Do some initialization first... */
    ClearGlobalOmits();
    DestroyOmitContexts();
    DestroyVars(0);
    NumTriggered = 0;

    r=IncludeFile(InitialFile);
    if (r) {
	fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING], InitialFile, ErrMsg[r]);
	exit(1);
    }

    while(1) {
	r = ReadLine();
	if (r == E_EOF) return;
	if (r) {
	    Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
	    exit(1);
	}
	s = FindInitialToken(&tok, CurLine);

	/* Should we ignore it? */
	if (NumIfs &&
	    tok.type != T_If &&
	    tok.type != T_Else &&
	    tok.type != T_EndIf &&
	    tok.type != T_IfTrig &&
	    ShouldIgnoreLine())
	{
	    /* DO NOTHING */
	}
	else {
	    /* Create a parser to parse the line */
	    CreateParser(s, &p);

	    switch(tok.type) {

	    case T_Empty:
	    case T_Comment:
		break;

	    case T_ErrMsg:  r=DoErrMsg(&p);  break;
	    case T_Rem:     r=DoCalRem(&p, col); break;
	    case T_If:      r=DoIf(&p);      break;
	    case T_IfTrig:  r=DoIfTrig(&p);  break;
	    case T_Else:    r=DoElse(&p);    break;
	    case T_EndIf:   r=DoEndif(&p);   break;
	    case T_Include: r=DoInclude(&p); break;
	    case T_Exit:    DoExit(&p);	     break;
	    case T_Set:     r=DoSet(&p);     break;
	    case T_Fset:    r=DoFset(&p);    break;
	    case T_UnSet:   r=DoUnset(&p);   break;
	    case T_Clr:     r=DoClear(&p);   break;
	    case T_Flush:   r=DoFlush(&p);   break;
	    case T_Debug:   break;  /* IGNORE DEBUG CMD */
	    case T_Dumpvars: break; /* IGNORE DUMPVARS CMD */
	    case T_Banner:  break;  /* IGNORE BANNER CMD */
	    case T_Omit:    r=DoOmit(&p);
		if (r == E_PARSE_AS_REM) {
		    DestroyParser(&p);
		    CreateParser(s, &p);
		    r=DoCalRem(&p, col);
		}
		break;
	    case T_Pop:     r=PopOmitContext(&p);     break;
	    case T_Push:    r=PushOmitContext(&p);    break;
	    case T_Preserve: r=DoPreserve(&p);        break;
	    case T_RemType: if (tok.val == RUN_TYPE) {
		r=DoRun(&p);
		break;
	    } else {
		CreateParser(CurLine, &p);
		r=DoCalRem(&p, col);
		break;
	    }

	    /* If we don't recognize the command, do a REM by default */
	    /* Note:  Since the parser hasn't been used yet, we don't */
	    /* need to destroy it here. */

	    default:        CreateParser(CurLine, &p);
		r=DoCalRem(&p, col);
		break;
	    }
	    if (r && (!Hush || r != E_RUN_DISABLED)) Eprint("%s", ErrMsg[r]);

	    /* Destroy the parser - free up resources it may be tying up */
	    DestroyParser(&p);
	}
    }
}
void __fastcall TStreamingDeviceFrame::ButtonClearClick(TObject * Sender)
{
  DoClear();
}
Example #16
0
void NewBuildTab::OnWorkspaceLoaded(wxCommandEvent& e)
{
    e.Skip();
    DoClear();
}
Example #17
0
void NewBuildTab::OnBuildStarted(clCommandEvent& e)
{
    e.Skip();
    if ( IS_WINDOWS ) {
        m_cygwinRoot.Clear();
        EnvSetter es;
        wxString cmd;
        cmd << "cygpath -w /";
        wxArrayString arrOut;
        ProcUtils::SafeExecuteCommand(cmd, arrOut);
        
        if ( arrOut.IsEmpty() == false ) {
            m_cygwinRoot = arrOut.Item(0);
        }
    }

    m_buildInProgress = true;
    
    // Reload the build settings data
    EditorConfigST::Get()->ReadObject ( wxT ( "build_tab_settings" ), &m_buildTabSettings );
    m_textRenderer->SetErrFgColor(  m_buildTabSettings.GetErrorColour() );
    m_textRenderer->SetWarnFgColor( m_buildTabSettings.GetWarnColour() );

    m_autoHide         = m_buildTabSettings.GetAutoHide();
    m_showMe           = (BuildTabSettingsData::ShowBuildPane)m_buildTabSettings.GetShowBuildPane();
    m_skipWarnings     = m_buildTabSettings.GetSkipWarnings();

    if ( e.GetEventType() != wxEVT_SHELL_COMMAND_STARTED_NOCLEAN) {
        DoClear();
        DoCacheRegexes();
    }

    // Show the tab if needed
    OutputPane *opane = clMainFrame::Get()->GetOutputPane();

    wxWindow *win(NULL);
    size_t sel =  opane->GetNotebook()->GetSelection();
    if(sel != Notebook::npos)
        win = opane->GetNotebook()->GetPage(sel);

    if(m_showMe == BuildTabSettingsData::ShowOnStart) {
        ManagerST::Get()->ShowOutputPane(OutputPane::BUILD_WIN, true);

    } else if (m_showMe == BuildTabSettingsData::ShowOnEnd &&
               m_autoHide &&
               ManagerST::Get()->IsPaneVisible(opane->GetCaption()) &&
               win == this
              ) {
        // user prefers to see build/errors tabs only at end of unsuccessful build
        ManagerST::Get()->HidePane(opane->GetName());
    }
    m_sw.Start();
    
    BuildEventDetails* bed = dynamic_cast<BuildEventDetails*>(e.GetClientObject());
    if ( bed ) {
        // notify the plugins that the build had started
        clBuildEvent buildEvent(wxEVT_BUILD_STARTED);
        buildEvent.SetProjectName( bed->GetProjectName() );
        buildEvent.SetConfigurationName( bed->GetConfiguration() );
        EventNotifier::Get()->AddPendingEvent( buildEvent );
    }
}
Example #18
0
void wxOwnerDrawnComboBox::Clear()
{
    DoClear();
}
Example #19
0
void NewBuildTab::OnWorkspaceClosed(wxCommandEvent& e)
{
    e.Skip();
    DoClear();
    InitView();
}
Example #20
0
LRESULT CRepositoryView::OnClear(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
    DoClear();
    return 0;
}
SFTPAttribute::~SFTPAttribute()
{
    DoClear();
}
void SFTPAttribute::Assign(SFTPAttribute_t attr)
{
    DoClear();
    m_attributes = attr;
    DoConstruct();
}
Example #23
0
wxBitmapComboBox::~wxBitmapComboBox()
{
    DoClear();
}
Example #24
0
	bool Clear()
		{ return DoClear(); }
Example #25
0
void wxSimpleHtmlListBox::Clear()
{
    DoClear();
}