[MQL4] ComboBoxes - All good until item selection

 
Hey there!

Something that should be straight forward is giving me an butt-pain. I am trying to make the simplest combobox option with switchable items. And succeeded until it comes to the OnEvent part.

So here is my code:

#property copyright "me"
#property version   "1.00"
#property strict
#property indicator_chart_window

#include <Controls\ComboBox.mqh>
CComboBox comboboxTest;

enum list{pumba, tymon, mustafa};


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
  comboboxTest.Create(0,"wow",0,50,50,200,100);
  comboboxTest.AddItem(EnumToString(list(0)));
  comboboxTest.AddItem(EnumToString(list(1)));
  comboboxTest.AddItem(EnumToString(list(2)));
  comboboxTest.Select(2);
  comboboxTest.ListViewItems(2);
  return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
//--- return value of prev_calculated for next call
   return(rates_total);
  }

//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   comboboxTest.OnEvent(id,lparam,dparam,sparam);
  }
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy dialog
   comboboxTest.Destroy(reason);
  }

All actually works fine, but the OnEvent doesn't catch the item selection after the dropdown menu.
In the ComboBox.mqh we have:
EVENT_MAP_BEGIN(CComboBox)
   ON_EVENT(ON_CLICK,m_edit,OnClickEdit)
   ON_EVENT(ON_CLICK,m_drop,OnClickButton)
   ON_EVENT(ON_CHANGE,m_list,OnChangeList)
CheckListHide(id,(int)lparam,(int)dparam);
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
EVENT_MAP_END(CWndContainer)

I believe that It's those events that I am missing? But that's a wild guess, as I believe it should work correctly.

Anyone has an idea of what's wrong here?



 

If I am thinking correctly, there should be a void attached to the action, like:

void CComboBox::comboboxTest_change(void)
   {
   comboboxTest.Select(comboboxTest.Vale());
   Print(comboboxTest.Value());
   }

But missing still missing something here...

 
Kept researching and came to the conclusion, that in order to make the combobox work it needs to be in a CForm and the function Run() has to be executed.