Exemplo n.º 1
0
SvnCommitDialog::SvnCommitDialog(wxWindow* parent, const wxArrayString &paths, const wxString &url, Subversion2 *plugin, const wxString &repoPath)
    : SvnCommitDialogBaseClass(parent)
    , m_plugin(plugin)
    , m_url(url)
    , m_repoPath(repoPath)
    , m_process(NULL)
{
    m_stcDiff->SetReadOnly(true);
    wxString title = GetTitle();
    title << wxT(" - ") << url;
    SetTitle(title);

    for (size_t i=0; i<paths.GetCount(); i++) {
        int index = m_checkListFiles->Append(paths.Item(i));
        m_checkListFiles->Check((unsigned int)index);
    }

    wxArrayString lastMessages, previews;
    m_plugin->GetCommitMessagesCache().GetMessages(lastMessages, previews);

    for(size_t i=0; i<previews.GetCount(); i++) {
        m_choiceMessages->Append(previews.Item(i), new CommitMessageStringData(lastMessages.Item(i)));
    }
    
    if ( !paths.IsEmpty() ) {
        m_checkListFiles->Select(0);
        DoShowDiff(0);
    }
    
    WindowAttrManager::Load(this, wxT("SvnCommitDialog"), m_plugin->GetManager()->GetConfigTool());
    int sashPos = m_plugin->GetSettings().GetCommitDlgSashPos();
    if ( sashPos != wxNOT_FOUND ) {
        m_splitterH->SetSashPosition(sashPos);
    }
    
    int sashHPos = m_plugin->GetSettings().GetCommitDlgHSashPos();
    if ( sashHPos != wxNOT_FOUND ) {
        m_splitterV->SetSashPosition(sashHPos);
    }
    
    LexerConfPtr diffLexer = EditorConfigST::Get()->GetLexer("Diff");
    if ( diffLexer ) {
        m_stcDiff->SetLexer(wxSTC_LEX_DIFF);
        diffLexer->Apply( m_stcDiff );
    }
    
    LexerConfPtr textLexer = EditorConfigST::Get()->GetLexer("text");
    if ( textLexer ) {
        textLexer->Apply( m_stcMessage );
    }
}
Exemplo n.º 2
0
void DbViewerPanel::InitStyledTextCtrl(wxStyledTextCtrl *sci)
{
    LexerConfPtr lexer = EditorConfigST::Get()->GetLexer("SQL");
    if ( lexer ) {
        lexer->Apply( sci, true );
    }
}
Exemplo n.º 3
0
AddIncludeFileDlg::AddIncludeFileDlg( wxWindow* parent, const wxString &fullpath, const wxString &text, int lineNo )
    :
    AddIncludeFileDlgBase( parent )
    , m_fullpath(fullpath)
    , m_text(text)
    , m_line(lineNo)
{
    UpdateLineToAdd();
    
    // Initialise the preview window
    LexerConfPtr cppLex = EditorConfigST::Get()->GetLexer("C++");
    cppLex->Apply( m_textCtrlPreview, true );
    
    //---------------------------------------------------------
    m_textCtrlPreview->MarkerDefine(0x7, wxSTC_MARK_ARROW);
    m_textCtrlPreview->MarkerSetBackground(0x7, wxT("YELLOW GREEN"));

    // Set the initial text
    m_textCtrlPreview->SetReadOnly(false);
    m_textCtrlPreview->AddText(m_text);
    m_textCtrlPreview->EmptyUndoBuffer();
    SetAndMarkLine();
    Centre();
    m_textCtrlLineToAdd->SetFocus();
    WindowAttrManager::Load(this, "AddIncludeFileDlg", NULL);
}
Exemplo n.º 4
0
SQLCommandPanel::SQLCommandPanel(wxWindow *parent,IDbAdapter* dbAdapter,  const wxString& dbName, const wxString& dbTable)
    : _SqlCommandPanel(parent)
{
    LexerConfPtr lexerSQL = EditorConfigST::Get()->GetLexer("SQL");
    if ( lexerSQL ) {
        lexerSQL->Apply(m_scintillaSQL, true);

    } else {
        DbViewerPanel::InitStyledTextCtrl( m_scintillaSQL );

    }
    m_pDbAdapter = dbAdapter;
    m_dbName = dbName;
    m_dbTable = dbTable;

    wxTheApp->Connect(wxID_SELECTALL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);
    wxTheApp->Connect(wxID_COPY,      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);
    wxTheApp->Connect(wxID_PASTE,     wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);
    wxTheApp->Connect(wxID_CUT,       wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);
    wxTheApp->Connect(wxID_UNDO,      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);
    wxTheApp->Connect(wxID_REDO,      wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SQLCommandPanel::OnEdit),   NULL, this);

    m_scintillaSQL->AddText(wxString::Format(wxT(" -- selected database %s\n"), m_dbName.c_str()));
    if (!dbTable.IsEmpty()) {
        m_scintillaSQL->AddText(m_pDbAdapter->GetDefaultSelect(m_dbName, m_dbTable));
        wxCommandEvent event(wxEVT_EXECUTE_SQL);
        GetEventHandler()->AddPendingEvent(event);
    }

#if CL_USE_NATIVEBOOK
    gtk_widget_show_all(this->m_widget);
#endif
}
Exemplo n.º 5
0
GitCommitDlg::GitCommitDlg(wxWindow* parent, const wxString& repoDir)
    : GitCommitDlgBase(parent)
    , m_workingDir(repoDir)
{
    // read the configuration
    clConfig conf("git.conf");
    GitEntry data;
    conf.ReadItem( &data );
    
    m_splitterInner->SetSashPosition(data.GetGitCommitDlgHSashPos());
    m_splitterMain->SetSashPosition(data.GetGitCommitDlgVSashPos());
    
    WindowAttrManager::Load(this, wxT("GitCommitDlg"), NULL);
    LexerConfPtr lex = EditorConfigST::Get()->GetLexer("text");
    lex->Apply(m_stcCommitMessage);
}
Exemplo n.º 6
0
SvnCommitDialog::SvnCommitDialog(wxWindow* parent, Subversion2* plugin)
    : SvnCommitDialogBaseClass(parent)
    , m_plugin(plugin)
    , m_process(NULL)
{
    m_stcDiff->SetReadOnly(true);
    m_checkListFiles->Clear();

    // Hide the bug tracker ID
    m_textCtrlBugID->Clear();
    m_textCtrlBugID->Hide();
    m_staticTextBugID->Hide();

    m_textCtrlFrID->Clear();
    m_staticText32->Hide();
    m_textCtrlFrID->Hide();

    m_checkListFiles->Disable();
    m_panel1->Disable();
    wxArrayString lastMessages, previews;
    m_plugin->GetCommitMessagesCache().GetMessages(lastMessages, previews);

    for(size_t i=0; i<previews.GetCount(); i++) {
        m_choiceMessages->Append(previews.Item(i), new CommitMessageStringData(lastMessages.Item(i)));
    }

    WindowAttrManager::Load(this, wxT("SvnCommitDialog"), m_plugin->GetManager()->GetConfigTool());
    int sashPos = m_plugin->GetSettings().GetCommitDlgSashPos();
    if ( sashPos != wxNOT_FOUND ) {
        m_splitterH->SetSashPosition(sashPos);
    }
    
    LexerConfPtr textLexer = EditorConfigST::Get()->GetLexer("text");
    if ( textLexer ) {
        textLexer->Apply( m_stcMessage );
    }

}
Exemplo n.º 7
0
void CodeFormatterDlg::InitDialog()
{
    UpdateCheckBox(m_checkBoxFormatBreakBlocks,AS_BREAK_BLOCKS);
    UpdateCheckBox(m_checkBoxFormatBreakBlocksAll,AS_BREAK_BLOCKS_ALL);
    UpdateCheckBox(m_checkBoxFormatBreakElseif,AS_BREAK_ELSEIF);
    UpdateCheckBox(m_checkBoxFormatFillEmptyLines,AS_FILL_EMPTY_LINES);
    UpdateCheckBox(m_checkBoxFormatOneLineKeepBlocks,AS_ONE_LINE_KEEP_BLOCKS);
    UpdateCheckBox(m_checkBoxFormatOneLineKeepStmnt,AS_ONE_LINE_KEEP_STATEMENT);
    UpdateCheckBox(m_checkBoxFormatPadOperators,AS_PAD_OPER);
    UpdateCheckBox(m_checkBoxFormatPadParenth,AS_PAD_PARENTHESIS);
    UpdateCheckBox(m_checkBoxFormatPadParentIn,AS_PAD_PARENTHESIS_IN);
    UpdateCheckBox(m_checkBoxFormatPadParentOut,AS_PAD_PARENTHESIS_OUT);
    UpdateCheckBox(m_checkBoxFormatUnPadParent,AS_UNPAD_PARENTHESIS);
    UpdateCheckBox(m_checkBoxIndentBrackets,AS_INDENT_BRACKETS);
    UpdateCheckBox(m_checkBoxIndentLabels,AS_INDENT_LABELS);
    UpdateCheckBox(m_checkBoxIndentMaxInst,AS_MAX_INSTATEMENT_INDENT);
    UpdateCheckBox(m_checkBoxIndentMinCond,AS_MIN_COND_INDENT);
    UpdateCheckBox(m_checkBoxIndentNamespaces,AS_INDENT_NAMESPACES);
    UpdateCheckBox(m_checkBoxIndentPreprocessors,AS_INDENT_PREPROCESSORS);
    UpdateCheckBox(m_checkBoxIndetBlocks,AS_INDENT_BLOCKS);
    UpdateCheckBox(m_checkBoxIndetCase,AS_INDENT_CASE);
    UpdateCheckBox(m_checkBoxIndetClass,AS_INDENT_CLASS);
    UpdateCheckBox(m_checkBoxIndetSwitch,AS_INDENT_SWITCHES);

    //update the two radio box controls
    int selection(3);	//AS_LINUX
    if (m_options.GetOptions() & AS_LINUX) {
        selection = 3;
    } else if (m_options.GetOptions() & AS_GNU) {
        selection =0;
    } else if (m_options.GetOptions() & AS_ANSI) {
        selection = 4;
    } else if (m_options.GetOptions() & AS_JAVA) {
        selection = 1;
    } else if (m_options.GetOptions() & AS_KR) {
        selection = 2;
    }

    m_radioBoxPredefinedStyle->SetSelection(selection);

    selection = 4; // None
    if (m_options.GetOptions() & AS_BRACKETS_BREAK_CLOSING) {
        selection = 0;
    } else if (m_options.GetOptions() & AS_BRACKETS_ATTACH) {
        selection = 1;
    } else if (m_options.GetOptions() & AS_BRACKETS_LINUX) {
        selection = 2;
    } else if (m_options.GetOptions() & AS_BRACKETS_BREAK) {
        selection = 3;
    }
    
    m_textCtrlPreview->SetLexer(wxSTC_LEX_CPP);
    LexerConfPtr lexer = EditorConfigST::Get()->GetLexer("C++");
    if ( lexer ) {
        lexer->Apply( m_textCtrlPreview, true );
    }
    
    m_radioBoxBrackets->SetSelection(selection);
    m_textCtrlUserFlags->SetValue(m_options.GetCustomFlags());

    m_splitterSettingsPreview->Connect( wxEVT_IDLE, wxIdleEventHandler( CodeFormatterDlg::OnSplitterIdle), NULL, this );
}