<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Frage zu Sft Tree]]></title><description><![CDATA[<p>Hallo, ich hab ein Problem mit Sft Tree. Ich möchte in meinem SftTree-Objekt ein Picture anzeigen. Die einzelnen Spalten sind folgendermaßen definiert worden:</p>
<pre><code class="language-cpp">int w0 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w0&quot;, 100); w0 = min(max(1, w0), 400);
	int w1 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w1&quot;, 100); w1 = min(max(1, w1), 400);
	int w2 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w2&quot;, 200); w2 = min(max(1, w2), 400);
	int w3 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w3&quot;, 100); w3 = min(max(1, w3), 400);
	int w4 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w4&quot;, 100); w4 = min(max(1, w4), 400);
	int w5 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w5&quot;, 100); w5 = min(max(1, w5), 400);
	int w6 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w6&quot;, 100); w6 = min(max(1, w6), 400);
	int w7 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w7&quot;, 050); w7 = min(max(1, w7), 400);
	int w8 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w8&quot;, 100); w8 = min(max(1, w8), 400);

	HBITMAP hbm;
	CBitmap bmp;
	bmp.LoadBitmap(IDB_WARN);
	hbm = (HBITMAP) bmp;
	SFTTREE_CELLINFOPARM cip; 
	cip.version=4; 
	cip.index=-1; 
	cip.iCol=0;
	GetCellInfo(&amp;cip);
	cip.Cell.hBmp = hbm;
	SetCellInfo(&amp;cip);
	SetShowHeader(TRUE);   
	SetShowHeaderButtons(TRUE);

	// Define columns
	SFTTREE_COLUMN_EX aCol[] = {
			{ 0, 0, w7, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Warnung&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			0,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		    { 0, 0, w8, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Batch-Nr&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			1,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width

			{ 0, 0, w0, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Formularname&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			2,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width

			{ 0, 0, w1, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Brieftyp&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			3,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w2, ES_LEFT | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Beschreibung&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			4,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w3, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Sachgebiet&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			5,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w4, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;erstellt am&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			6,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w5, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;erstellt von&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			7,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w6, ES_RIGHT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Anzahl Datensätze&quot;,						// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			8,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
	};
	SetColumns(9, aCol);								// Set column attributes

	SetShowHeader(TRUE);								// Show column headers
//	SetTreeLineStyle(SFTTREE_TREELINE_NONE);			// No tree lines
	SetShowButtons(TRUE);								// No expand/collapse buttons
	SetShowGrid(TRUE);									// Show grid
	SetShowTruncated(TRUE);								// Show ... if truncated
	SetNoFocusStyle(SFTTREE_NOFOCUS_FRAME);				// No focus, show frame
	SetSelectionStyle(SFTTREE_SELECTION_ALL);			// Select all cell
	SetFlyby(FALSE);									// no Flyby highlighting
	SetScrollTips(TRUE);								// Show Scrolltips
	SetInheritBgColor(TRUE);							// Inherit background color of first cell
	SetCrossColumnResize(TRUE);							// Resize multiple columns
	SetReorderColumns(TRUE);							// Column reordering
	SetOpenEnded(TRUE);									// Last column width
	SetShowHeaderButtons(TRUE);							// Show column header as buttons
    SetShowRowHeader(SFTTREE_ROWSTYLE_NONE);			// no Row style
    SetRowHeaderStyle(ES_CENTER | SFTTREE_HEADER_UP);	// Row header style
    SetShowRowColHeaderButton(FALSE);					// Row/column header as title
    SetRowColText(&quot;?&quot;);									// Row/column header text
    SetRowColHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);	// Row/column header style
    SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);	// Consider all characters typed

	RecalcHorizontalExtent();
</code></pre>
<p>Für die Darstellung der einzelnen Zeilen benutze ich folgen Code:</p>
<pre><code class="language-cpp">void CwinEFWSplDlg::fill(const char* caller) {
	const bool dbg = false;
	if (!m_Table) return;
	iStatus = ((CButton*)GetDlgItem(IDC_Neu))-&gt;GetCheck() ? 0 : 1;

	if (!(pKate=(CListBox*)GetDlgItem(IDC_Kategorie))) return;
	if (!(pSach=(CTabCtrl*)GetDlgItem(IDC_TAB))) return;

	int iKate = pKate-&gt;GetCurSel();
	int iSach = pSach-&gt;GetCurSel();
	if (dbg) print(&quot;%s fill iStatus=%d iKate=%d iSach=%d &quot;, caller, iStatus, iKate, iSach);
	sachSel[iKate] = iSach;									// Sachgebiet zur Kategorie merken

	m_Table.ResetContent();
	if (iKate != LB_ERR &amp;&amp; iSach != -1) {
		for (int k=0; k &lt; gwiManager.arr[iStatus].GetSize(); k++) {
			Gwi* pgwi = gwiManager.arr[iStatus][k];
			if (!xmlVerfahren.sachMatch(pgwi-&gt;sachgebiet, iKate, iSach-1))// -1 wg. Kartei: 'alle Verfahren ..'
				continue;
			int i = m_Table.AddString(pgwi-&gt;batchNr);

			m_Table.SetItemData(i, (DWORD)pgwi);			//(DWORD)&amp;(*(gwis.arr[iStatus][k])))

			//m_Table.SetItemBitmap(i, bmp);

			HBITMAP hbm;
			CBitmap bmp;
			bmp.LoadBitmap(IDB_WARN);
			hbm = (HBITMAP) bmp;
			SFTTREE_CELLINFOPARM cip; 
			cip.version=4; 
			cip.index=i; 
			cip.iCol=0;
			m_Table.GetCellInfo(&amp;cip);
			cip.Cell.hBmp = hbm;
			m_Table.SetCellInfo(&amp;cip);

			m_Table.SetText(i, 0, pgwi-&gt;warnung);
			m_Table.SetText(i, 1, pgwi-&gt;batchNr);
			m_Table.SetText(i, 2, pgwi-&gt;dateiname);
			m_Table.SetText(i, 3, pgwi-&gt;dokName);
			m_Table.SetText(i, 4, pgwi-&gt;beschreibung);
			m_Table.SetText(i, 5, pgwi-&gt;sachgebiet);
			m_Table.SetText(i, 6, pgwi-&gt;erstelltAm);
			m_Table.SetText(i, 7, pgwi-&gt;erstelltVon);
			m_Table.SetText(i, 8, pgwi-&gt;anzSaetze);

		}
	}
	print(&quot;mTable.GetCount=%d\n&quot;, m_Table.GetCount());

//	m_Table.SetTreeLineStyle(SFTTREE_TREELINE_NONE);		// No tree lines
//	m_Table.MakeColumnOptimal(-1);							// Make column widths optimal 
//	m_Table.MakeRowHeaderOptimal();							// Make row header width optimal
	m_Table.RecalcHorizontalExtent();						// Update horizontal scroll bar
    m_Table.SortDependents(-1, sortCol, SortCallback);		// all items at the root level are sorted
}
</code></pre>
<p>Das komische an der Sache ist, das in den Spalten zwar entsprechend Platz für IDB_WARN vorgesehen wird, allerdings bleibt der Bereich weiss. Kennt irgendjemand dieses Problem?<br />
Vielen Dank schonmal im Vorraus.</p>
<p>Grüße, Manuel Kipke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/165861/frage-zu-sft-tree</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 06:46:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/165861.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Nov 2006 17:12:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu Sft Tree on Thu, 23 Nov 2006 17:12:58 GMT]]></title><description><![CDATA[<p>Hallo, ich hab ein Problem mit Sft Tree. Ich möchte in meinem SftTree-Objekt ein Picture anzeigen. Die einzelnen Spalten sind folgendermaßen definiert worden:</p>
<pre><code class="language-cpp">int w0 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w0&quot;, 100); w0 = min(max(1, w0), 400);
	int w1 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w1&quot;, 100); w1 = min(max(1, w1), 400);
	int w2 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w2&quot;, 200); w2 = min(max(1, w2), 400);
	int w3 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w3&quot;, 100); w3 = min(max(1, w3), 400);
	int w4 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w4&quot;, 100); w4 = min(max(1, w4), 400);
	int w5 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w5&quot;, 100); w5 = min(max(1, w5), 400);
	int w6 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w6&quot;, 100); w6 = min(max(1, w6), 400);
	int w7 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w7&quot;, 050); w7 = min(max(1, w7), 400);
	int w8 = AfxGetApp()-&gt;GetProfileInt(&quot;SpoolManager&quot;, &quot;w8&quot;, 100); w8 = min(max(1, w8), 400);

	HBITMAP hbm;
	CBitmap bmp;
	bmp.LoadBitmap(IDB_WARN);
	hbm = (HBITMAP) bmp;
	SFTTREE_CELLINFOPARM cip; 
	cip.version=4; 
	cip.index=-1; 
	cip.iCol=0;
	GetCellInfo(&amp;cip);
	cip.Cell.hBmp = hbm;
	SetCellInfo(&amp;cip);
	SetShowHeader(TRUE);   
	SetShowHeaderButtons(TRUE);

	// Define columns
	SFTTREE_COLUMN_EX aCol[] = {
			{ 0, 0, w7, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Warnung&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			0,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		    { 0, 0, w8, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Batch-Nr&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			1,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width

			{ 0, 0, w0, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Formularname&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			2,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width

			{ 0, 0, w1, ES_LEFT  | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Brieftyp&quot;,									// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			3,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w2, ES_LEFT | SFTTREE_TOOLTIP,			// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Beschreibung&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background(COLOR_BTNFACE|0x80000000L),foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			4,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w3, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Sachgebiet&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			5,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w4, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;erstellt am&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			6,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w5, ES_LEFT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;erstellt von&quot;,								// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			7,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
		{ 0, 0, w6, ES_RIGHT,							// Reserved, Reserved, Width (pixels), Cell alignment
			ES_LEFT | SFTTREE_HEADER_UP,				// Title style
			&quot;Anzahl Datensätze&quot;,						// Column header title
			NULL, NULL, SFTTREE_BMP_RIGHT,				// Reserved field and bitmap handle, bitmap alignment
			0, 0, 0,									// Reserved fields
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Cell background, foreground color
			SFTTREE_NOCOLOR, SFTTREE_NOCOLOR,			// Selected cell background, foreground color
			0,											// Real column position (set by SetColumns call)
			8,											// Display column number (display position)
			0, 0 },										// Reserved, minimum column width
	};
	SetColumns(9, aCol);								// Set column attributes

	SetShowHeader(TRUE);								// Show column headers
//	SetTreeLineStyle(SFTTREE_TREELINE_NONE);			// No tree lines
	SetShowButtons(TRUE);								// No expand/collapse buttons
	SetShowGrid(TRUE);									// Show grid
	SetShowTruncated(TRUE);								// Show ... if truncated
	SetNoFocusStyle(SFTTREE_NOFOCUS_FRAME);				// No focus, show frame
	SetSelectionStyle(SFTTREE_SELECTION_ALL);			// Select all cell
	SetFlyby(FALSE);									// no Flyby highlighting
	SetScrollTips(TRUE);								// Show Scrolltips
	SetInheritBgColor(TRUE);							// Inherit background color of first cell
	SetCrossColumnResize(TRUE);							// Resize multiple columns
	SetReorderColumns(TRUE);							// Column reordering
	SetOpenEnded(TRUE);									// Last column width
	SetShowHeaderButtons(TRUE);							// Show column header as buttons
    SetShowRowHeader(SFTTREE_ROWSTYLE_NONE);			// no Row style
    SetRowHeaderStyle(ES_CENTER | SFTTREE_HEADER_UP);	// Row header style
    SetShowRowColHeaderButton(FALSE);					// Row/column header as title
    SetRowColText(&quot;?&quot;);									// Row/column header text
    SetRowColHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);	// Row/column header style
    SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);	// Consider all characters typed

	RecalcHorizontalExtent();
</code></pre>
<p>Für die Darstellung der einzelnen Zeilen benutze ich folgen Code:</p>
<pre><code class="language-cpp">void CwinEFWSplDlg::fill(const char* caller) {
	const bool dbg = false;
	if (!m_Table) return;
	iStatus = ((CButton*)GetDlgItem(IDC_Neu))-&gt;GetCheck() ? 0 : 1;

	if (!(pKate=(CListBox*)GetDlgItem(IDC_Kategorie))) return;
	if (!(pSach=(CTabCtrl*)GetDlgItem(IDC_TAB))) return;

	int iKate = pKate-&gt;GetCurSel();
	int iSach = pSach-&gt;GetCurSel();
	if (dbg) print(&quot;%s fill iStatus=%d iKate=%d iSach=%d &quot;, caller, iStatus, iKate, iSach);
	sachSel[iKate] = iSach;									// Sachgebiet zur Kategorie merken

	m_Table.ResetContent();
	if (iKate != LB_ERR &amp;&amp; iSach != -1) {
		for (int k=0; k &lt; gwiManager.arr[iStatus].GetSize(); k++) {
			Gwi* pgwi = gwiManager.arr[iStatus][k];
			if (!xmlVerfahren.sachMatch(pgwi-&gt;sachgebiet, iKate, iSach-1))// -1 wg. Kartei: 'alle Verfahren ..'
				continue;
			int i = m_Table.AddString(pgwi-&gt;batchNr);

			m_Table.SetItemData(i, (DWORD)pgwi);			//(DWORD)&amp;(*(gwis.arr[iStatus][k])))

			//m_Table.SetItemBitmap(i, bmp);

			HBITMAP hbm;
			CBitmap bmp;
			bmp.LoadBitmap(IDB_WARN);
			hbm = (HBITMAP) bmp;
			SFTTREE_CELLINFOPARM cip; 
			cip.version=4; 
			cip.index=i; 
			cip.iCol=0;
			m_Table.GetCellInfo(&amp;cip);
			cip.Cell.hBmp = hbm;
			m_Table.SetCellInfo(&amp;cip);

			m_Table.SetText(i, 0, pgwi-&gt;warnung);
			m_Table.SetText(i, 1, pgwi-&gt;batchNr);
			m_Table.SetText(i, 2, pgwi-&gt;dateiname);
			m_Table.SetText(i, 3, pgwi-&gt;dokName);
			m_Table.SetText(i, 4, pgwi-&gt;beschreibung);
			m_Table.SetText(i, 5, pgwi-&gt;sachgebiet);
			m_Table.SetText(i, 6, pgwi-&gt;erstelltAm);
			m_Table.SetText(i, 7, pgwi-&gt;erstelltVon);
			m_Table.SetText(i, 8, pgwi-&gt;anzSaetze);

		}
	}
	print(&quot;mTable.GetCount=%d\n&quot;, m_Table.GetCount());

//	m_Table.SetTreeLineStyle(SFTTREE_TREELINE_NONE);		// No tree lines
//	m_Table.MakeColumnOptimal(-1);							// Make column widths optimal 
//	m_Table.MakeRowHeaderOptimal();							// Make row header width optimal
	m_Table.RecalcHorizontalExtent();						// Update horizontal scroll bar
    m_Table.SortDependents(-1, sortCol, SortCallback);		// all items at the root level are sorted
}
</code></pre>
<p>Das komische an der Sache ist, das in den Spalten zwar entsprechend Platz für IDB_WARN vorgesehen wird, allerdings bleibt der Bereich weiss. Kennt irgendjemand dieses Problem?<br />
Vielen Dank schonmal im Vorraus.</p>
<p>Grüße, Manuel Kipke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1180187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1180187</guid><dc:creator><![CDATA[mkipke]]></dc:creator><pubDate>Thu, 23 Nov 2006 17:12:58 GMT</pubDate></item></channel></rss>