<?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[Statusbar farbig oder Gradient]]></title><description><![CDATA[<p>kurz: suche eine beispiel für eine farbige Statusbar oder noch besser mit Gradient<br />
danke!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149401/statusbar-farbig-oder-gradient</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 17:13:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149401.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jun 2006 20:41:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 20:41:11 GMT]]></title><description><![CDATA[<p>kurz: suche eine beispiel für eine farbige Statusbar oder noch besser mit Gradient<br />
danke!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071915</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Mon, 05 Jun 2006 20:41:11 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 20:42:02 GMT]]></title><description><![CDATA[<p>Ganz einfach: OwnerDrawn!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071916</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 05 Jun 2006 20:42:02 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 21:40:58 GMT]]></title><description><![CDATA[<p>event. ist das falsch vestanden worden, ich will die ganze statusbar einfärben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071981</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Mon, 05 Jun 2006 21:40:58 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 22:18:51 GMT]]></title><description><![CDATA[<p>Schau mal hier, vielleicht passt etwas zu Deinem Geschmack:<br />
<a href="http://www.codeproject.com/statusbar/" rel="nofollow">http://www.codeproject.com/statusbar/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072013</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Mon, 05 Jun 2006 22:18:51 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 23:15:56 GMT]]></title><description><![CDATA[<p>da habe ich als erstes nachgeschaut, es gibt massig sachen wie man den inhalt der bar erweitern und verändern kann, aber nicht die statusbar selbst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072029</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Mon, 05 Jun 2006 23:15:56 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Mon, 05 Jun 2006 23:27:37 GMT]]></title><description><![CDATA[<p>Schau mal bei FooBar nach. Dort wird der Button mit &quot;Gradient&quot; ausgestattet:<br />
<a href="http://www.codeproject.com/buttonctrl/FooButton.asp" rel="nofollow">http://www.codeproject.com/buttonctrl/FooButton.asp</a></p>
<p>Vielleicht lässt sich das irgendwie übertragen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<pre><code class="language-cpp">//! Draws a gradient rectangle.
void FooButton::drawGradientRect
  (CDC *pDC, CRect r,
   COLORREF cLeft,
   COLORREF cRight, BOOL bVertical)
{
  // Use GradientFill function from MSIMG32.dll if possible
  if (m_dllGradientFillFunc != NULL) {

		  TRIVERTEX rcVertex[2];
		  rcVertex[0].x = r.left;
		  rcVertex[0].y = r.top;
		  rcVertex[0].Red = (unsigned short) (GetRValue (cLeft) &lt;&lt; 8);
		  rcVertex[0].Green = (unsigned short) (GetGValue (cLeft) &lt;&lt; 8);
		  rcVertex[0].Blue = (unsigned short) (GetBValue (cLeft) &lt;&lt; 8);
		  rcVertex[0].Alpha = 0;

		  rcVertex[1].x = r.right;
		  rcVertex[1].y = r.bottom;
		  rcVertex[1].Red = (unsigned short) (GetRValue (cRight) &lt;&lt; 8);
		  rcVertex[1].Green = (unsigned short) (GetGValue (cRight) &lt;&lt; 8);
		  rcVertex[1].Blue = (unsigned short) (GetBValue (cRight) &lt;&lt; 8);
		  rcVertex[1].Alpha = 0;

		  GRADIENT_RECT gRect;
		  gRect.UpperLeft = 0;
		  gRect.LowerRight = 1;

		  // fill the area 
		  m_dllGradientFillFunc
        (*pDC, rcVertex, 2, &amp;gRect, 1,
         bVertical ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);

      return;
  }

  // Otherwise, do a manual gradient fill
	CRect stepR;					// rectangle for color's band
	COLORREF color;				// color for the bands
	float fStep;

	if(bVertical)
		fStep = ((float)r.Height())/255.0f;	
	else
		fStep = ((float)r.Width())/255.0f;	// width of color's band

	for (int iOnBand = 0; iOnBand &lt; 255; iOnBand++) 
	{
		// set current band
		if(bVertical)
		{
			SetRect(&amp;stepR,
				r.left, 
				r.top+(int)(iOnBand * fStep),
				r.right, 
				r.top+(int)((iOnBand+1)* fStep));	
		}
		else
		{
			SetRect(&amp;stepR,
				r.left+(int)(iOnBand * fStep), 
				r.top,
				r.left+(int)((iOnBand+1)* fStep), 
				r.bottom);	
		}

		// set current color
		color = RGB((GetRValue(cRight)-GetRValue(cLeft))*((float)iOnBand)/255.0f+GetRValue(cLeft),
			(GetGValue(cRight)-GetGValue(cLeft))*((float)iOnBand)/255.0f+GetGValue(cLeft),
			(GetBValue(cRight)-GetBValue(cLeft))*((float)iOnBand)/255.0f+GetBValue(cLeft));
		// fill current band
		pDC-&gt;FillSolidRect(stepR,color);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1072033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072033</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Mon, 05 Jun 2006 23:27:37 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Tue, 06 Jun 2006 00:37:19 GMT]]></title><description><![CDATA[<p>Ich hab grad mal ein wenig rumgetestet ^^</p>
<p>Also du leitest dir eine Klasse von CStatusBar ab, und überschreibst dir die DrawItem Funktion. Dort drin wirst du alles selber zeichnen müssen, auch den Text und co, bekommst aber alle nötigen Infos über das mitgelieferte Struct.</p>
<p>Das sieht dann je nach dem vielleicht so aus:</p>
<pre><code class="language-cpp">void COwnStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
    CDC dc;
    dc.Attach(lpDrawItemStruct-&gt;hDC);
    dc.SetBkColor(RGB(255,150,0));
    dc.FillSolidRect(&amp;lpDrawItemStruct-&gt;rcItem, RGB(255,150,0));
    dc.DrawText(GetPaneText(lpDrawItemStruct-&gt;itemID), &amp;lpDrawItemStruct-&gt;rcItem, DT_SINGLELINE | DT_NOPREFIX | DT_BOTTOM | DT_RIGHT);
    dc.Detach();
}
</code></pre>
<p>Nach dem Create und dem SetInidcators in der Mainframe fügst du dann noch folgendes dazu:</p>
<pre><code class="language-cpp">for(int i = 0; i &lt; m_wndStatusBar.GetCount(); i++)
{ m_wndStatusBar.SetPaneStyle(i, GetPaneStyle(i) | SBT_OWNERDRAW); }

HBRUSH HBrush = CreateSolidBrush(RGB(255,150,0));
SetClassLong(m_wndStatusBar.m_hWnd, GCL_HBRBACKGROUND, (LONG)HBrush);
</code></pre>
<p>Das ist zwar alles noch kein Gradient aber immerhin kann man so die eigene Hintergrundfarbe hinkriegen. Geht vielleicht alles noch besser, habe ich jetzt nur so in 1 - 2 Stunden herausdividiert ^^</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072057</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 06 Jun 2006 00:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Tue, 06 Jun 2006 00:43:27 GMT]]></title><description><![CDATA[<p>Danke Erhard Henkes,<br />
die bar ist zwar jetzt Gradient gefüllt, aber nur der Hintergrund.<br />
ID_SEPARATOR ID_INDICATOR_CAPS, ID_INDICATOR_NUM und ID_INDICATOR_SCRL haben immer noch einen grauen Hintergrund. Würde die auch mal event. mit einer anderen Farbe darstellen. oder transparent machen.<br />
PS mir ist auch grade aufgefallen, dass es 2 Verschiedene StatusBars gibt, vom Layout her. bei der einen hat man rechts für die Änderung der Größe Punke, bei der anderen Striche, wodurch kommt es?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072060</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Tue, 06 Jun 2006 00:43:27 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Tue, 06 Jun 2006 01:01:21 GMT]]></title><description><![CDATA[<p>danke Dravere, ich hab das mit Gradient schon geschafft. Das mit dem Layout hat sich auch erledigt.<br />
Jetzt nur noch einen Ramen um die einzelenen einträge, dann ist es fertig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072064</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Tue, 06 Jun 2006 01:01:21 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Tue, 06 Jun 2006 14:41:51 GMT]]></title><description><![CDATA[<p>Das mit dem Rahmen und die Einträge ist schwieriger als ich dacht habe.<br />
Ich kann irgendwie die Einträge nur den einen Balken trennen, was sowieso schon drin ist, aber keine Rahmen um den Eintag machen.<br />
Hat da einer eine Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072581</guid><dc:creator><![CDATA[Smuser]]></dc:creator><pubDate>Tue, 06 Jun 2006 14:41:51 GMT</pubDate></item><item><title><![CDATA[Reply to Statusbar farbig oder Gradient on Tue, 06 Jun 2006 18:33:58 GMT]]></title><description><![CDATA[<p>Mach doch einfach die &quot;manifest&quot; Datei raus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072733</guid><dc:creator><![CDATA[manifest]]></dc:creator><pubDate>Tue, 06 Jun 2006 18:33:58 GMT</pubDate></item></channel></rss>