Okey Problem solved.
I did it without pointers. I thought I need pointers for object arrays, but it worked without :)
CRadioButton m_button[]; // array of the row objects
void CRadioGroup2::Destroy(const int reason=0) { CWndContainer::Destroy(reason); ArrayFree(m_button); }
bool CRadioGroup2::CreateButton(const string text) { ArrayResize(m_button, Total()+1); int index = Total() - 1; //--- calculate coordinates int x1 = CONTROLS_BORDER_WIDTH; int x2 = Width() - CONTROLS_BORDER_WIDTH; int y1 = CONTROLS_BORDER_WIDTH + m_itemHeight*index; int y2 = y1 + m_itemHeight; //--- create if(!m_button[index].Create(m_chart_id, m_name+"Button"+IntegerToString(index), m_subwin, x1, y1, x2, y2)) { return(false); } if(!m_button[index].Text(text)) { return(false); } if(!Add(m_button[index])) { return(false); } //--- succeed return(true); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'd like to create a RadioGroup with some RadioButtons:
With the "AddItem" function i can add radiobuttons into the RadioGroup.
I use the mql4 controls classes. I know there is already an existing Radiogroup file but It's not for my use and I need to create my own.
So, if I udnerstand right, I need to use pointers right? (I really do hate pointers and won't get along with them-.-)
This was my attempt:
Hope someone who has experience with these pointers can help me out...
No joke, already got a headache from this xD