nav-left cat-right
cat-right
Home » Blog » 2007 » Juni

Syntaxhighlighting von LaTeX in Webseiten...

Für Wordpress existieren mehrere Pugins für den GeSHi – Generic Syntax Highlighter for php. Mit diesem lässt sich sehr einfach Quellcode in über 50 verschiedenen Sprachen farbig hervorgehoben auf Webseiten darstellen. Letztes Jahr habe ich aufbauend auf einer Vorlage von Thomas Efer eine Sprachvorgabedatei für LaTeX erstellt. In Zusammenarbeit mit dem Programmierer von GeSHi (Nigel McNie) sind weitere Verbesserungen hinzugekommen.

(weiterlesen…)

Check value of Radiobutton...

Radiobuttons in MFC are a mess. It is nevertheless possible to get its values with the following instructions. If one wants to have a group of radiobuttons the most important principle is to add them one ofter the other so that they have a ascending Resource number without any interruption. The first one in the group of radiobuttons has have the value “group=true”. For this one we add an integer Variable, lets say “m_WndRadio1″.

Next you can give all the Radiobuttons IDCs with meaning and add event handlers.

void CDlg::OnBnClickedRadio1()
{
	UpdateData(TRUE); 
	m_value=m_WndRadio1;		
}
 
void CDlg::OnBnClickedRadio2()
{
	UpdateData(TRUE); 
	m_value=m_WndRadio1;		
}

additionally one has to add the following

DDX_Radio(pDX, IDC_RADIO1, m_WndRadio1);
Thats it.

Set Radio Button at runtime...

The following code sets the value of a radio button to checked:

	CButton *pButton = reinterpret_cast<CButton*>(GetDlgItem(IDC_RADIO1));
	pButton->SetCheck(1); // Button is "checked"