Exemplo n.º 1
0
//--------------------------------------------------------------------------------------
//!
//--------------------------------------------------------------------------------------
void tWorkProfilesDialog::CreateActions()
{
    m_pEditAct = new tAction( tr( "Edit" ) );
    Connect( m_pEditAct, SIGNAL( triggered() ), this, SLOT( OnEdit() ) );
    m_ActionList << m_pEditAct;

    m_pDeleteAct = new tAction( tr( "Delete" ) );
    m_pDeleteAct->setEnabled(false);
    Connect( m_pDeleteAct, SIGNAL( triggered() ), this, SLOT( OnDelete() ) );
    m_ActionList << m_pDeleteAct;

    m_pSettingsAct = new tAction( tr( "Settings" )  + "..." );
    Connect( m_pSettingsAct, SIGNAL( triggered() ), this, SLOT( OnSettings() ) );
    m_ActionList << m_pSettingsAct;

    m_pDeleteAllAct = new tAction( tr( "Delete all" ), this );
    Connect( m_pDeleteAllAct, SIGNAL( triggered() ), this, SLOT( DeleteAllProfiles() ) );
    m_ActionList << m_pDeleteAllAct;

    if ( HasTitleCloseButton() == false )
    {
        m_pCloseAct = new tAction( tr( "Close" ), this );
        Connect( m_pCloseAct, SIGNAL( triggered() ), this, SLOT( accept() ) );
        m_ActionList << m_pCloseAct;
    }
}
Exemplo n.º 2
0
// ------------------------------------------------------------
void SpellCheck::OnContinousCheck(wxCommandEvent& e)
{
    IEditor* editor = m_mgr->GetActiveEditor();

    if(!editor) { // no current editor, switch continuous search off

        SetCheckContinuous(false);
        return;
    }

    if(m_pEngine != NULL) {
        if(e.GetInt() == 0) {
            SetCheckContinuous(false);
            ClearIndicatorsFromEditors();
            return;
        }

        SetCheckContinuous(true);
        wxString text = editor->GetEditorText();

        // if we don't have a dictionary yet, open settings
        if(!m_pEngine->GetDictionary()) {
            OnSettings(e);
            return;
        }

        switch(editor->GetLexerId()) {
        case 3: { // wxSCI_LEX_CPP
            if(m_mgr->IsWorkspaceOpen()) {
                m_pEngine->CheckCppSpelling(text);
            }
        } break;
        default: { // wxSCI_LEX_NULL
            m_pEngine->CheckSpelling(text);
        } break;
        }
        m_timer.Start(PARSE_TIME);
    }
}
Exemplo n.º 3
0
// ------------------------------------------------------------
void SpellCheck::OnCheck(wxCommandEvent& e)
{
    IEditor* editor = GetEditor();

    if(!editor) return;
    wxString text = editor->GetEditorText();
    text += wxT(" "); // prevents indicator flickering at end of file

    if(m_pEngine != NULL) {
        if(GetCheckContinuous()) // switch continuous search off if running
            SetCheckContinuous(false);

        // if we don't have a dictionary yet, open settings
        if(!m_pEngine->GetDictionary()) {
            OnSettings(e);
            return;
        }

        switch(editor->GetLexerId()) {
        case 3: { // wxSCI_LEX_CPP
            if(m_mgr->IsWorkspaceOpen()) {
                m_pEngine->CheckCppSpelling(text);

                if(!m_checkContinuous) {
                    editor->ClearUserIndicators();
                }
            }
        } break;
        case 1: { // wxSCI_LEX_NULL
            m_pEngine->CheckSpelling(text);
            if(!m_checkContinuous) {
                editor->ClearUserIndicators();
            }
        } break;
        }
    }
}