title: Assign click event to a wxPanel instance
body: <p>I have a wxPanel class. I need every instance of that class handle a click event. Is that possible in wxWidgets? So far, I always had to use window IDs to assign events to objects (eg. buttons).<br>
  However this wxPanel is about to occur multiplicatively on the screen, so I need to avoid using window ID.</p>
  
  <p>The class:</p>
  
  <h2>panel.h</h2>
  
  <pre><code>class UVStatusPanel : public wxPanel
  {
  
  public:
      UVStatusPanel(wxFrame* parent, int pos);
  
      void paintEvent(wxPaintEvent&amp; evt);
      void paintNow();
  
      //THIS is expected to be the event function
      void onClick(wxCommandEvent&amp; WXUNUSED(event));
  
      bool State(bool state);
      bool State();
  
      DECLARE_EVENT_TABLE()
  private:
      bool painting;
      bool state;
      void render(wxDC &amp;dc);
  };
  </code></pre>
  
  <h2>panel.cpp</h2>
  
  <pre><code>/**The constructor*/
  UVStatusPanel::UVStatusPanel(wxFrame* parent, int pos) :
  wxPanel(parent)
  {
   /** some align and draw rect code was there**/
   //My two attepmts to assign the click event to the panel
   Connect(this-&gt;m_windowId, wxEVT_COMMAND_LEFT_CLICK, 
            wxCommandEventHandler(UVStatusPanel::onClick));
   //EVT_COMMAND_LEFT_CLICK(this-&gt;m_windowId,UVStatusPanel::onFocus);
  }
  </code></pre>
  
  <p>Currently noc clicks are registered. Can anyone explain how click events work in wxWidgets?</p>