コード例 #1
0
void SyntaxHighlightDlg::SaveChanges()
{
    int max = m_lexersBook->GetPageCount();
    for (int i=0; i<max; i++) {
        wxWindow *win = m_lexersBook->GetPage((size_t)i);
        LexerPage *page = dynamic_cast<LexerPage*>( win );
        if ( page ) {
            page->SaveSettings();
        }
    }

    // Save all lexers once
    EditorConfigST::Get()->SaveLexers();

    wxString oldFg = EditorConfigST::Get()->GetCurrentOutputviewFgColour();
    wxString oldBg = EditorConfigST::Get()->GetCurrentOutputviewBgColour();

    wxString newFg = m_colourPickerOutputPanesFgColour->GetColour().GetAsString(wxC2S_HTML_SYNTAX);
    EditorConfigST::Get()->SetCurrentOutputviewFgColour(newFg);

    wxString newBg = m_colourPickerOutputPanesBgColour->GetColour().GetAsString(wxC2S_HTML_SYNTAX);
    EditorConfigST::Get()->SetCurrentOutputviewBgColour(newBg);

    // Check for conditions for sending the THEME_CHANGED event
    wxString curSelTheme = m_themes->GetStringSelection().IsEmpty() ? wxT("Default") : m_themes->GetStringSelection();

    if ( (oldBg != newBg) || (oldFg != newFg) || (m_startingTheme != curSelTheme) ) {
        wxCommandEvent evtThemeChanged(wxEVT_CL_THEME_CHANGED);
        EventNotifier::Get()->AddPendingEvent(evtThemeChanged);
    }
}
コード例 #2
0
void OptionsDlg::SaveChanges()
{
	int max = m_lexersBook->GetPageCount();
	for(int i=0; i<max; i++){
		wxWindow *win = m_lexersBook->GetPage((size_t)i);
		LexerPage *page = dynamic_cast<LexerPage*>( win );
		if( page ){
			page->SaveSettings();
		}
	}

	// construct an OptionsConfig object and update the configuration
	OptionsConfigPtr options(new OptionsConfig(NULL));
	options->SetDisplayFoldMargin( m_checkBoxDisplayFoldMargin->IsChecked() );
	options->SetUnderlineFoldLine( m_checkBoxMarkFoldedLine->IsChecked() );
	options->SetFoldStyle(m_foldStyleChoice->GetStringSelection());
	options->SetDisplayBookmarkMargin(m_displayBookmarkMargin->IsChecked());
	options->SetBookmarkShape( m_bookmarkShape->GetStringSelection());
	options->SetBookmarkBgColour( m_bgColourPicker->GetColour() );
	options->SetBookmarkFgColour( m_fgColourPicker->GetColour() );
	options->SetHighlightCaretLine( m_highlighyCaretLine->IsChecked() );
	options->SetDisplayLineNumbers( m_displayLineNumbers->IsChecked() );
	options->SetShowIndentationGuidelines( m_showIndentationGuideLines->IsChecked() );
	
	EditorConfigST::Get()->SetOptions(options);
	ManagerST::Get()->ApplySettingsChanges();
}
コード例 #3
0
void SyntaxHighlightDlg::OnTextSelApplyToAll(wxCommandEvent& event)
{
    wxUnusedVar(event);

    LexerPage* page;
    wxWindow* win = m_lexersBook->GetCurrentPage();
    if (!win || (page = dynamic_cast<LexerPage*>(win)) == NULL) {
        return;
    }

    // Get the text-selection values for the current page, then apply them to all pages
    wxString colourstring;
    int alpha;
    page->GetTextSelectionValues(colourstring, alpha);

    for (size_t i=0; i < m_lexersBook->GetPageCount(); ++i) {
        wxWindow* win = m_lexersBook->GetPage(i);
        LexerPage* page = dynamic_cast<LexerPage*>(win);
        if (page) {
            page->SetTextSelectionValues(colourstring, alpha);
            page->SetModified();
        }
    }
}