<?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[Fensterproblem]]></title><description><![CDATA[<p>Ja Hallo.</p>
<p>Ich habe 3 zusätzliche Formen mit je einem Image und möchte darauf malen.<br />
Ich habe auch verschiedene Mal-Routinen.</p>
<p>DrawImageRoutine1(Form2-&gt;Image1);<br />
DrawImageRoutine2(Form2-&gt;Image1);<br />
DrawImageRoutine3(Form2-&gt;Image1);</p>
<p>Jetzt wähle ich in einer Auswahl aus, auf welcher Form ich malen möchte und in einer anderen Auswahl, welche DrawImageRoutine ich benutzen möchte.</p>
<p>Das ganze klappt natürlich ohne Probleme, aber die Abfragen sind praktisch doppelt, weil ich das alles für jede zusätzliche Form machen muss.</p>
<p>Anstatt:</p>
<pre><code class="language-cpp">if (routine==2)
{
if (auswahl==2)
DrawImageRoutine2(Form2-&gt;Image1);
else if (auswahl==3)
DrawImageRoutine2(Form3-&gt;Image1);
}
</code></pre>
<p>lieber soetwas</p>
<pre><code class="language-cpp">if (routine==2)
{
AnsiString CompName = &quot;Form&quot;+IntToStr(auswahl);
TForm *Form = dynamic_cast&lt;TForm *&gt; (FindComponent(CompName));
DrawImageRoutine2(Form-&gt;Image1);
}
</code></pre>
<p>Das Problem hierbei ist nun, das dies so nicht funktioniert, da Image1 keine Komponente von TForm ist. Weiss jemand welche Klasse ich für soetwas benutzen kann oder wie anders das geht?</p>
<p>Ich habe es auch über Template probiert, aber da meckerte er weil ich muss dort TForm2 angeben.. einen Pointer davon akzeptiert er nicht. Ich kann also dort die Namen nicht wie ich gern möchte dynamisch erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173245/fensterproblem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 13:08:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173245.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Feb 2007 11:11:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fensterproblem on Tue, 13 Feb 2007 11:11:37 GMT]]></title><description><![CDATA[<p>Ja Hallo.</p>
<p>Ich habe 3 zusätzliche Formen mit je einem Image und möchte darauf malen.<br />
Ich habe auch verschiedene Mal-Routinen.</p>
<p>DrawImageRoutine1(Form2-&gt;Image1);<br />
DrawImageRoutine2(Form2-&gt;Image1);<br />
DrawImageRoutine3(Form2-&gt;Image1);</p>
<p>Jetzt wähle ich in einer Auswahl aus, auf welcher Form ich malen möchte und in einer anderen Auswahl, welche DrawImageRoutine ich benutzen möchte.</p>
<p>Das ganze klappt natürlich ohne Probleme, aber die Abfragen sind praktisch doppelt, weil ich das alles für jede zusätzliche Form machen muss.</p>
<p>Anstatt:</p>
<pre><code class="language-cpp">if (routine==2)
{
if (auswahl==2)
DrawImageRoutine2(Form2-&gt;Image1);
else if (auswahl==3)
DrawImageRoutine2(Form3-&gt;Image1);
}
</code></pre>
<p>lieber soetwas</p>
<pre><code class="language-cpp">if (routine==2)
{
AnsiString CompName = &quot;Form&quot;+IntToStr(auswahl);
TForm *Form = dynamic_cast&lt;TForm *&gt; (FindComponent(CompName));
DrawImageRoutine2(Form-&gt;Image1);
}
</code></pre>
<p>Das Problem hierbei ist nun, das dies so nicht funktioniert, da Image1 keine Komponente von TForm ist. Weiss jemand welche Klasse ich für soetwas benutzen kann oder wie anders das geht?</p>
<p>Ich habe es auch über Template probiert, aber da meckerte er weil ich muss dort TForm2 angeben.. einen Pointer davon akzeptiert er nicht. Ich kann also dort die Namen nicht wie ich gern möchte dynamisch erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228000</guid><dc:creator><![CDATA[Heuli]]></dc:creator><pubDate>Tue, 13 Feb 2007 11:11:37 GMT</pubDate></item><item><title><![CDATA[Reply to Fensterproblem on Tue, 13 Feb 2007 12:04:44 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Du brauchst ein Array von den Forms, oder besser gleich ein Array von den Images.<br />
Siehe auch die FAQ hier im Forum, Abschnitt Komponenten benutzen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228029</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 13 Feb 2007 12:04:44 GMT</pubDate></item></channel></rss>