<?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[Komponente erstellen: TEdit &amp;amp; TButton]]></title><description><![CDATA[<p>Mit dem Borland Tutorial habe ich einen groben Eindruck bekommen, wie man eine Komponente selber entwickelt.</p>
<p>Im Beispiel wird aber nur eine visuelle Komponente verwendet.</p>
<p>Ich möchte nun wissen, wie man vorgeht, wenn man 2 Verwendet. Z.B. ein TEdit und einen TButton daneben.</p>
<p>Wäre echt supi lieb, wenn mir das mal einer erklären könnte!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/189408/komponente-erstellen-tedit-amp-tbutton</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 06:40:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/189408.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Aug 2007 17:34:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 17:34:28 GMT]]></title><description><![CDATA[<p>Mit dem Borland Tutorial habe ich einen groben Eindruck bekommen, wie man eine Komponente selber entwickelt.</p>
<p>Im Beispiel wird aber nur eine visuelle Komponente verwendet.</p>
<p>Ich möchte nun wissen, wie man vorgeht, wenn man 2 Verwendet. Z.B. ein TEdit und einen TButton daneben.</p>
<p>Wäre echt supi lieb, wenn mir das mal einer erklären könnte!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343265</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 17:34:28 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 18:09:42 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wenn du solche zwei Komponenten zusammensetzen willst nimmst du TControl oder TPanel als Basis, je nachdem wie viel du vom Container selbst machen willst.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343282</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Aug 2007 18:09:42 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 18:49:07 GMT]]></title><description><![CDATA[<p>Wie sieht denn dann der Konstruktor aus ... ich habe sowas noch nie gemacht.</p>
<pre><code class="language-cpp">__fastcall TMyComp::TMyComp(TComponent* Owner)
        : TControl(Owner)
{
   IVEdit = new TEdit(this);
   IVEdit-&gt;Parent = (TWinControl)*this;
   IVEdit-&gt;Show();
}
//---------------------------------------------------------------------------
</code></pre>
<p>--&gt; so??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343292</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 18:49:07 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 18:57:37 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Um nicht in TWinControl casten zu müßen nimm gleich TWinControl anstelle von TContrl als Basis.<br />
Das Show brauchst du aber gar nicht.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343297</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Aug 2007 18:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 19:10:24 GMT]]></title><description><![CDATA[<p>Danke jetzt gehts ...</p>
<p>Wie bekomme ich so ein plus mit Unteroptionen im Objectinspektor hin? (wie z.B. bei Font)</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343300</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 19:10:24 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 19:34:46 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Das Plus bekommst du nur bei Bestimmten Properties mit dem Objektinspektor bekannten Typen. Im allgemeinen Set. Möglicherweise geht auch eine Property mit Zeiger auf ein struct/class, das ebenfalls wieder aus Properties besteht.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343311</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Aug 2007 19:34:46 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 19:56:56 GMT]]></title><description><![CDATA[<p>Eine letzte Frage hab ich noch ... wenn ich eine Komponete erstelle und diese ein TEdit bekommt --- wie kann ich ein Ereignis OnEditChange &quot;bauen&quot;, dass das OnChange Ereignis von TEdit sozusagen Weiterreicht. Im Objektinspektor soll das Ereignis OnEditChange sichtbar sein.</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343327</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 19:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 20:14:10 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Zuerst must du in deiner neuen Komponente manuell den Event abfangen.<br />
Dann verpasst du deiner Komponente eine Property von gleichen Eventtyp (TNotifyEvent wenn ich mich nicht irre) und setzt diese im Konstruktor erstmal auf NULL. Dann must du nur noch in deiner manuellen Behandlung den Event ausführen wenn eine Eventmethode hinterlegt wurde.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343341</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Aug 2007 20:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 20:18:44 GMT]]></title><description><![CDATA[<p>So kommt nen Fehler &quot;Kein zulässiger Typ&quot;</p>
<pre><code class="language-cpp">struct TMyStruct
{
   public:
      int IVval1;
      int IVval2;

      __property int val1 = {read=IVval1, write=IVval1};
      __property int val2 = {read=IVval2, write=IVval2};
};

class PACKAGE TMyComp : public TWinControl
{
private:
   TMyStruct IVMyStruct;
protected:
public:
        __fastcall TMyComp(TComponent* Owner);
__published:
   __property TMyStruct MyStruct = {read=IVMyStruct, write=IVMyStruct};
};
</code></pre>
<p>Habe Ich was falsch gemacht???</p>
<blockquote>
<p>Zuerst must du in deiner neuen Komponente manuell den Event abfangen.</p>
</blockquote>
<p>--&gt; Wie mach ich das genau?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343345</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 20:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 20:29:53 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>- Wie schon gesagt muß die Property einen Zeiger auf das struct rausgeben. Und dann darf es auch kein set für die Property geben</p>
<pre><code class="language-cpp">__property TMyStruct* MyStruct = {read=&amp;IVMyStruct};
</code></pre>
<p>- Wie du es im OI machen würdest, nur das du jetzt eben manuell die Eventmethode hinschreiben und mit dem TEdit verbinden must.</p>
<pre><code class="language-cpp">class TMyComp
{
  ...
  private :
    void __fastcall OnChange(TObject* Sender); // Deine neue Methonde
    TNotifyEvent iMyChange; // Interne Speichervariable für den Event
  ...
__published:
    property TNotifyEvent OnMyChange = {read = iMyChange, write = iMyChange,    
     default = NULL}; // Property für den Event nach außen
}

void __fastcall TMyComp::OnChange(TObject* Sender);
{
  if (iMyChange) // Wenn Event zugewiesen
    iMyChange(this); // ausführen
}
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343350</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343350</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 12 Aug 2007 20:29:53 GMT</pubDate></item><item><title><![CDATA[Reply to Komponente erstellen: TEdit &amp;amp; TButton on Sun, 12 Aug 2007 20:59:33 GMT]]></title><description><![CDATA[<p>Danke für deine Antwort <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Ich habe es jetzt so probiert:</p>
<pre><code class="language-cpp">class PACKAGE TMyComp : public TWinControl
{
private:
   struct TMyStruct
   {
      public:
         int IVval1;
         int IVval2;

         __property int val1 = {read=IVval1, write=IVval1};
         __property int val2 = {read=IVval2, write=IVval2};
   } IVMyStruct;

protected:
public:
        __fastcall TMyComp(TComponent* Owner);
__published:
   __property TMyStruct *MyStruct = {read=&amp;IVMyStruct,write=&amp;IVMyStruct};
};
</code></pre>
<p>Leider funktioniert das nicht ... der Compiler sagt: Bezeichner erwartet ...<br />
Wie mache ich das richtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1343364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1343364</guid><dc:creator><![CDATA[Boto]]></dc:creator><pubDate>Sun, 12 Aug 2007 20:59:33 GMT</pubDate></item></channel></rss>