<?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[Steuerelement]]></title><description><![CDATA[<p>Wie kann man ein Controll selber entickeln???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133749/steuerelement</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 15:37:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133749.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Jan 2006 13:52:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Steuerelement on Fri, 20 Jan 2006 13:52:02 GMT]]></title><description><![CDATA[<p>Wie kann man ein Controll selber entickeln???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971398</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971398</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Fri, 20 Jan 2006 13:52:02 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Fri, 20 Jan 2006 14:00:58 GMT]]></title><description><![CDATA[<p>RegisterClassEx, CreateWindowEx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971402</guid><dc:creator><![CDATA[tipp]]></dc:creator><pubDate>Fri, 20 Jan 2006 14:00:58 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Fri, 20 Jan 2006 14:08:56 GMT]]></title><description><![CDATA[<p>Jo, aber vieleicht etwas genauer?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971406</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Fri, 20 Jan 2006 14:08:56 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Fri, 20 Jan 2006 23:34:18 GMT]]></title><description><![CDATA[<p>Kann mir niemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971825</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Fri, 20 Jan 2006 23:34:18 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Fri, 20 Jan 2006 23:56:13 GMT]]></title><description><![CDATA[<p>Wo ist dein Problem dabei? Ein Steuerelement ist doch ein ganz normales Fenster was mit WS_CHILD Flag erstellt wird. Und wie man Fenster erstellt und auf Nachrichten reagiert steht nun wirklich in jedem WinAPI Tutorial.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971831</guid><dc:creator><![CDATA[hmmmmmmmmm]]></dc:creator><pubDate>Fri, 20 Jan 2006 23:56:13 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 01:32:01 GMT]]></title><description><![CDATA[<p>n Steuerelement isn ganz normales Fenster mit Wndproc wie sonst auch, da gibts nix besonderes zu zu sagen, Freund.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971839</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971839</guid><dc:creator><![CDATA[Sgt. Elias]]></dc:creator><pubDate>Sat, 21 Jan 2006 01:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 09:22:15 GMT]]></title><description><![CDATA[<p>Jo, aber ich würde ein nnues entwickeln wollen, eins, das es noch nicht gibt.</p>
<p>Ich möchte ja X Controls erzeugen und es darf ja nur eine WndProc geben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971877</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sat, 21 Jan 2006 09:22:15 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 09:24:19 GMT]]></title><description><![CDATA[<p>SetWindowLongPtr</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971878</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971878</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Sat, 21 Jan 2006 09:24:19 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 10:01:05 GMT]]></title><description><![CDATA[<blockquote>
<p>es darf ja nur eine WndProc geben.</p>
</blockquote>
<p>Lol wen du das meinst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Also du musst dann einfach bei WM_PAINT dein Ctrl zeichnen und evt. noch auf klicks usw reagieren... odg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971882</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 21 Jan 2006 10:01:05 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 13:32:32 GMT]]></title><description><![CDATA[<p><a href="http://www.codeproject.com/miscctrl/customcontrols1.asp" rel="nofollow">http://www.codeproject.com/miscctrl/customcontrols1.asp</a><br />
<a href="http://www.codeproject.com/miscctrl/customcontrol.asp" rel="nofollow">http://www.codeproject.com/miscctrl/customcontrol.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/971958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971958</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Sat, 21 Jan 2006 13:32:32 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 15:12:48 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Header

HWND gMyControl;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		case WM_PAINT:
			{
				if(hwnd==gMyControl)
				{
					PAINTSTRUCT ps;
					HDC hdc = BeginPaint(hwnd, &amp;ps);

					LineTo(hdc, 0, 0);
					LineTo(hdc, 100, 100);

					EndPaint(hwnd, &amp;ps);
					return 0;
				}

				break;
			}

		default: break;
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
	WNDCLASSEX winclass;
	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0; // extra class info space
	winclass.cbWndExtra = 0; // extra window info space
	winclass.hInstance = hInstance; // assign the application instance
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	winclass.lpszMenuName = NULL; // the name of the menu to attach
	winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	RegisterClassEx(&amp;winclass);
	HWND hwnd;
	hwnd = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenstertitel&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							200,
							200,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd==NULL)
		return -10;

	WNDCLASS wndcls;
    wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wndcls.lpfnWndProc      = WindowProc;
    wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
    wndcls.hInstance        = hInstance;
    wndcls.hIcon            = NULL;
    wndcls.hCursor          = LoadCursor(NULL, IDC_ARROW);
    wndcls.hbrBackground    = (HBRUSH) (COLOR_3DFACE + 1);
    wndcls.lpszMenuName     = NULL;
    wndcls.lpszClassName    = __T(&quot;MeinSteuerelement&quot;);
	RegisterClass(&amp;wndcls);

	gMyControl = CreateWindowEx(NULL,__T(&quot;MeinSteuerelement&quot;), __T(&quot;Meine Komponente&quot;), WS_CHILD |
	WS_VISIBLE, 20, 20, 100, 20, hwnd, NULL, hInstance,
	NULL);

	if( gMyControl==0)
		return -1;

	MSG msg;
	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		// translate any accelerator keys
		TranslateMessage(&amp;msg);
		// send the message to the window proc
		DispatchMessage(&amp;msg);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/972152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972152</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sat, 21 Jan 2006 15:12:48 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 21:18:50 GMT]]></title><description><![CDATA[<p>thx, sowas suchte ich!!!!</p>
<p>Ich brauche keine Romane, sondern nur ein kleines Sample.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972448</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sat, 21 Jan 2006 21:18:50 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 21:36:13 GMT]]></title><description><![CDATA[<p>Problem ist noch bei der ganzen Sache, dass das Control über die normale WndProc vom Fenster läuft. Aber wenn ich nun 100 Controls erzeugen würde, kann ich doch nicht immer wieder mit if frage, welche Fensterhandle grade bearbeitet wird. Gibt es da nicht noch eine bessere Lösung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972462</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sat, 21 Jan 2006 21:36:13 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 21:37:45 GMT]]></title><description><![CDATA[<p>ein steuerlement sollte seine eigene wndproc haben und die sich ned mit dem programm teilen mit globalen variablen, dasist doch frickelei wenn ich je welche gesehen habe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972463</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972463</guid><dc:creator><![CDATA[Norben]]></dc:creator><pubDate>Sat, 21 Jan 2006 21:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sat, 21 Jan 2006 22:13:49 GMT]]></title><description><![CDATA[<p>Jop, genau das meine ioch, aber wie kann ich x elemente über eine ControlProc laufen lassen??? ICh habe ja keine globalen Variablen...</p>
<pre><code class="language-cpp">case WM_PAINT:
            {
                if(hwnd==gMyControl)
                {
                    PAINTSTRUCT ps;
                    HDC hdc = BeginPaint(hwnd, &amp;ps);

                    LineTo(hdc, 0, 0);
                    LineTo(hdc, 100, 100);

                    EndPaint(hwnd, &amp;ps);
                    return 0;
                }
</code></pre>
<p>--&gt; Ist mir zu statisch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972491</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sat, 21 Jan 2006 22:13:49 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 01:28:10 GMT]]></title><description><![CDATA[<p>na registier halt eine eigene wndclass mit einer eigenen wndproc für dein steuerelement und benutz diese wndclass dann beim aufruf von CreateWindow wenn du ein steuerelement anlegen willst. die steuer element spezifischen daten kannst du per SetWindowLong/GetWindowLong mit GWL_USERDATA in die jeweilige Instanz des Steuerelements integrieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972562</guid><dc:creator><![CDATA[Norben]]></dc:creator><pubDate>Sun, 22 Jan 2006 01:28:10 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 08:10:33 GMT]]></title><description><![CDATA[<p>Wär eine Idee und wie hat es überhaupt MS mit den Controls(Buttons, Edits....) gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972583</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sun, 22 Jan 2006 08:10:33 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 08:55:14 GMT]]></title><description><![CDATA[<p>Subclassing !?<br />
Wenn Du VS hast, kannst Du doch in den Source reinschauen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972592</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 22 Jan 2006 08:55:14 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 09:59:58 GMT]]></title><description><![CDATA[<p>Ich glaube nicht das er MFC meint.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972619</guid><dc:creator><![CDATA[............]]></dc:creator><pubDate>Sun, 22 Jan 2006 09:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 10:09:31 GMT]]></title><description><![CDATA[<p>............ schrieb:</p>
<blockquote>
<p>Ich glaube nicht das er MFC meint.</p>
</blockquote>
<p>Ahhh... sorry....<br />
Windows hat es genau so gemacht... jedes Control hat eine eigene WndClass:<br />
(falls Du schon mal die Doku zu CreateWindow gelesen hast, wäre Dir das aufgefallen):<br />
<a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindow.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/972629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972629</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 22 Jan 2006 10:09:31 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 10:12:38 GMT]]></title><description><![CDATA[<p>Wenn du keine static Variablen nimmst, sondern SetWindowLongPtr/GetWindowLongPtr um Daten mit einem Fenster zu assoziieren und wieder abzurufen, gibt es überhaupt kein Problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972631</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972631</guid><dc:creator><![CDATA[static]]></dc:creator><pubDate>Sun, 22 Jan 2006 10:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 10:16:15 GMT]]></title><description><![CDATA[<p>Gibt es dazu ein Sample??? Ich habe sowas noch nie gemacht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972634</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sun, 22 Jan 2006 10:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 14:03:15 GMT]]></title><description><![CDATA[<p>ich Empfehle dir Folgendes:</p>
<p>Erstelle eine Klasse Fenster - diese beistitzt einen Behälter (z. B. stl vector) für Komponenten. Komponenten sind z. B. Buttons, Label und Textboxen</p>
<p>verpasse deiner Fenterklasse eine add Methode, so dass folgendes Möglich ist:</p>
<p>MyWindow.Add(new Label(&quot;Mein Label&quot;));</p>
<p>Jede Komponente schickt beim Auftretten eines Event eine ActionEvent Objekt an einen ActionListener - ein ActionListener ist z. B. dein Fenster - jeder ActionListener muss die Methode actionPerformed(ActionEvent e) implementieren<br />
Ein ActionEvent entählt die Methode getCallbackString() - diese liefert einen stl String - diesen CallbackString kannst du vorher zuweisen:</p>
<p>Die bei Nvidia machen das genau so wie ich meine:<br />
<a href="http://download.nvidia.com/developer/Third_Party/Nature/NatureScene.zip" rel="nofollow">http://download.nvidia.com/developer/Third_Party/Nature/NatureScene.zip</a></p>
<p>wollte das ganze mal so umprogrammieren, dass es einfach möglich ist &quot;normale&quot; Buttons, Textboxen und Labels mit Events zu versehen - soll ähnlich wie in Java funktionieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972801</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sun, 22 Jan 2006 14:03:15 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 14:17:40 GMT]]></title><description><![CDATA[<p>aus dem Nivida Nature Demo:</p>
<pre><code class="language-cpp">void SceneFrame::actionPerformed(GUIEvent &amp;evt)
{
  const String &amp;callbackString  = evt.getCallbackString();
  GUIRectangle *sourceRectangle = evt.getEventSource();
  int           widgetType      = sourceRectangle-&gt;getWidgetType();

  if(widgetType == CHECK_BOX)
  {
    GUICheckBox   *checkBox = (GUICheckBox*)sourceRectangle;
    if(checkBox-&gt;isClicked())
    {
      if(callbackString == &quot;aToCoverage&quot;) terrain.setAlphaToCoverageFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;eOcclusion&quot;)  terrain.setOcclusionCullingFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;eFrustum&quot;)    terrain.setFrustumCullingFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;rGrass&quot;)      terrain.setDrawGrassFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;rWater&quot;)      renderWater = checkBox-&gt;isChecked();
      if(callbackString == &quot;rAABB&quot;)       terrain.setRenderAABBFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;rMode&quot;)       terrain.setWireFrameFlag(checkBox-&gt;isChecked());
      if(callbackString == &quot;rTBN&quot;)        terrain.setDrawTBNFlag(checkBox-&gt;isChecked());
    }
  }

  if(widgetType == SLIDER)
  {
    GUISlider   *slider = (GUISlider*)sourceRectangle;

    if(callbackString == &quot;aReference&quot;)
    {
      terrain.setAlphaReference(slider-&gt;getProgress());
      slider-&gt;setLabelString(String(&quot;Alpha Reference: &quot;) + slider-&gt;getProgress());
    }

    if(callbackString == &quot;aBooster&quot;)
    {
      terrain.setAlphaBooster((slider-&gt;getProgress()*2.0f));
      slider-&gt;setLabelString(String(&quot;Alpha Booster: &quot;) + terrain.getAlphaBooster()); 
    }

    if(callbackString == &quot;red&quot;)
    {
      skyInfo.x = slider-&gt;getProgress();
      slider-&gt;setLabelString(String(&quot;Red Intensity: &quot;) + skyInfo.x); 
    }

    if(callbackString == &quot;blue&quot;)
    {
      skyInfo.z = slider-&gt;getProgress();
      slider-&gt;setLabelString(String(&quot;Blue Intensity: &quot;) + skyInfo.z); 
    }

    if(callbackString == &quot;green&quot;)
    {
      skyInfo.y = slider-&gt;getProgress();
      slider-&gt;setLabelString(String(&quot;Green Intensity: &quot;) + skyInfo.y); 
    }

    if(callbackString == &quot;sSpeed&quot;)
    {
      skyInfo.w = slider-&gt;getProgress()*2.0f;
      slider-&gt;setLabelString(String(&quot;Scrolling Speed: &quot;) + slider-&gt;getProgress()); 
    }
  }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/972821</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972821</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sun, 22 Jan 2006 14:17:40 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 15:11:05 GMT]]></title><description><![CDATA[<p>hab ein wenig rumüberlegt und jetzt folgendes &quot;Pseudo&quot;-Framework *g* gebastelt:</p>
<pre><code class="language-cpp">namespace GUI
{
	class Position;

	class Component
	{
	public:
		virtual void  setCallbackString(const string&amp; callback) = 0;
		virtual void  setCallbackString(const char*   callback) = 0;
		virtual const string &amp; getCallbackString() = 0;
		virtual void  setPosition(Position &amp;pos);
		virtual Postion &amp;void getPosition();
		virtual void  setWidth(int width);
		virtual void  setHeight(int height);
	};

	class Button : Component
	{
	public:
		string&amp; getText();
		void setText(string Text);
	};

	class TextBox : Component
	{
	public:
		string&amp; getText();
		void setText(string Text);
	};

	class Label : Component
	{
	public:
		Label(string Text);
		string&amp; getText();
		void setText(string Text);
	};

	class Canvas : Component
	{
		DrawLine(Postion a, Positon b);
	}

	class ActionEvent
	{
	public:
		enum Type = {Button, TextBox, Label};

	private:
		Type		m_type; // von welchem Typ wurde Event ausgeloest
		Component	source; // Quelle des Events

	public:
		Type	  getType();
		Component getEventSource();
	};

	class Window
	{
		vector&lt;Component&gt; ComponentContainer;

	public:
		void add(Component component);

		void setActionListener(ActionListener *listener);
	};

	class ActionListener
	{
		virtual void actionPerformed(ActionEvent &amp;evt);
	};

	class WindowsManager
	{
	  public:
		static bool  addWindow    (Window *windowPTR);

		static bool  removeWindow (Window *windowPTR);

		static LRESULT CALLBACK windowEventsProcessor(HWND   hWnd  , UINT   wMsg,
													  WPARAM wParam, LPARAM lParam);
	  private:
		static vector&lt;Window*&gt;  windowsList; 
	};

}

class MyApp : Window, ActionListener
{
	class MyApp
	{
		m_Label = new Label(&quot;Mein Label&quot;);
		m_Button = new Button(&quot;Mein Button&quot;);
		m_Button.setCallbackString(&quot;Mein Button&quot;);
	}

	virtual void actionPerformed(GUI::ActionEvent &amp;evt)
	{
		if(evt.getType() == GUI::ActionEvent::Type.Button)
		{
			if(m_Button.getCallbackString() == &quot;Mein Button&quot;)
			{
				MeinButton_Click();
			}
		}
	}

	void MeinButton_Click()
	{
		// was soll getan werden wenn auf Mein Button
		// geklickt wird?
	}

	GUI::Label	m_Label;
	GUI::Button m_Button;
}

int main()
{
	MyApp App = new MyApp();
}
</code></pre>
<p>muss nur noch die Klassen implementieren (dauert ca. 1. Woche - da wenig Erfahrung mit WinAPI - muss mich erst einarbeiten) dann läufts... hab aber leider keine Zeit dafür</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972881</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Sun, 22 Jan 2006 15:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to Steuerelement on Sun, 22 Jan 2006 15:13:47 GMT]]></title><description><![CDATA[<p>Ideologisch motiviertes Bastelwerk.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/972886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972886</guid><dc:creator><![CDATA[frickel-detector]]></dc:creator><pubDate>Sun, 22 Jan 2006 15:13:47 GMT</pubDate></item></channel></rss>