title: wxWidgets: Properly making a user control that contains other controls inside itself
body: <p>I'm trying to make a user control in wxWidgets to represent a channel in an audio mixer. So, each channel has a standard set of controls inside itself (some sliders, buttons, etc..).</p>
  
  <p>So inside my class I have a sizer in which I add the various child controls I need. So far that works.</p>
  
  <p>But the problems I have are</p>
  
  <ul>
  <li><p>if I derive from wxPanel, the layout of the control works as I expect it (it gets expanded in the sizer to fit the child controls), however none of the children get any events (like EVT_LEFT_DOWN etc). I tried connecting an event for the main control that runs event.Skip() but that didn't help.</p></li>
  <li><p>If I change my class to derive from wxControl instead (or wxFrame, or possibly a number of others I tried), the child controls <em>do</em> get events, but the whole thing doesn't get expanded in the sizer it's located in, it just gets drawn as a tiny box (some 10-20 square px) even though the child controls take up much more space.</p></li>
  </ul>
  
  <p>Any ideas?</p>
  
  <p><em>Update:</em></p>
  
  <p><strong>mangoMixerStrip.cpp</strong></p>
  
  <pre><code>mangoMixerStrip::mangoMixerStrip(wxFrame* parent, HostChannel* channel) : wxPanel(parent)
  {
      myChannel = channel;
      SetBackgroundColour(wxColour(172,81,90));
  
      wxBoxSizer* s = new wxBoxSizer(wxVERTICAL);
  
      // some custom controls i made which all work fine when added like any other control, derived from wxPanel also
      faderPan = new mangoFader(parent, 200, false, 55);
      faderGain = new mangoFader(parent, 200, true, 126);    
      buttonSolo = new mangoButton(parent, false, ButtonGraphic::Solo);
  
      s-&gt;Add(faderPan);
      s-&gt;Add(buttonSolo);
      s-&gt;Add(faderGain);
  
      this-&gt;SetSizer(s);
  
      this-&gt;Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(mangoMixerStrip::mouseDown)); // this function simply contains event.Skip()
  }
  </code></pre>
  
  <p><strong>in my main wxFrame</strong></p>
  
  <pre><code>mangoFrameMain::mangoFrameMain(wxWindow* parent) : FrameMain( parent )
  {   
      HostChannel* h =  new HostChannel();
      h-&gt;setName("what up"); // these 2 lines unrelated to the UI
  
      mangoMixerStrip *test = new mangoMixerStrip(this, h);
      this-&gt;GetSizer()-&gt;Add(test, 1, wxFIXED_MINSIZE, 0);
  }
  </code></pre>
  
  <p>And to clarify: the mangoMixerStrip instance itself gets any events I connect to it, but its child controls do not.</p>