Discussion of article "Graphical interfaces X: New features for the Rendered table (build 9)" - page 2

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
Do it with new Build6,7,8 or 9 please.
Use MetaTrader 5. The MetaTrader 4 version is no longer supported and I cannot advise you on anything.
Is below OK?
//| Создаёт общую площадь |
//+------------------------------------------------------------------+
bool CColorPicker::CreateArea(void)
{
//--- Формирование имени объекта
string name=CElementBase::ProgramName()+"_color_picker_bg_"+(string)CElementBase::Id();
//--- Координаты
int x=CElementBase::X();
int y=CElementBase::Y();
//--- Создать объект
if(!m_area.Create(m_chart_id,name,m_subwin,x,y,m_x_size,m_y_size))
return(false);
//--- Свойства
m_area.BackColor(m_area_color);
m_area.Color(m_area_border_color);
m_area.BorderType(BORDER_FLAT);
m_area.Corner(m_corner);
m_area.Selectable(false);
m_area.Z_Order(m_area_zorder);
m_area.Tooltip("\n");
//--- Координаты
m_canvas.X(x);
m_canvas.Y(y);
//--- Размеры
m_canvas.XSize(m_x_size);
m_canvas.YSize(m_y_size);
//--- Отступы от крайней точки
m_area.XGap(CElement::CalculateXGap(x));
m_area.YGap(CElement::CalculateYGap(y));
//--- Сохраним указатель объекта
CElementBase::AddToArray(m_area);
return(true);
}
Thank yo for your answer. (n.b. I asked if it works with new build)
Is below OK?
//| Создаёт общую площадь |
//+------------------------------------------------------------------+
bool CColorPicker::CreateArea(void)
{
//--- Формирование имени объекта
string name=CElementBase::ProgramName()+"_color_picker_bg_"+(string)CElementBase::Id();
//--- Координаты
int x=CElementBase::X();
int y=CElementBase::Y();
//--- Создать объект
if(!m_area.Create(m_chart_id,name,m_subwin,x,y,m_x_size,m_y_size))
return(false);
//--- Свойства
m_area.BackColor(m_area_color);
m_area.Color(m_area_border_color);
m_area.BorderType(BORDER_FLAT);
m_area.Corner(m_corner);
m_area.Selectable(false);
m_area.Z_Order(m_area_zorder);
m_area.Tooltip("\n");
//--- Координаты
m_canvas.X(x);
m_canvas.Y(y);
//--- Размеры
m_canvas.XSize(m_x_size);
m_canvas.YSize(m_y_size);
//--- Отступы от крайней точки
m_area.XGap(CElement::CalculateXGap(x));
m_area.YGap(CElement::CalculateYGap(y));
//--- Сохраним указатель объекта
CElementBase::AddToArray(m_area);
return(true);
}
For example you need:
In WndEvents.mqh in public area create a new method:
bool CreateColorPicker(CColorPicker &color_picker, CWindow &wnd_pointer, int wnd_index,int x,int y);
//|| Creates a colour palette for selecting a colour ||
//+------------------------------------------------------------------+
bool CWndEvents::CreateColorPicker(CColorPicker &color_picker, CWindow &wnd_pointer, int wnd_index, int x, int y)
{
//--- recalculate the coordinates
int x_gap=x-wnd_pointer.X();
int y_gap=y-wnd_pointer.Y();
//--- Save the window pointer
color_picker.WindowPointer(wnd_pointer);
//--- Creating an element
if(!color_picker.CreateColorPicker(m_chart_id,m_subwin,x_gap,y_gap))
return(false);
//--- Add a pointer to the element in the base
CWndContainer::AddToElementsArray(wnd_index,color_picker);
return(true);
}
//+------------------------------------------------------------------+
And in CProgram.mqh, create your ColorPicker:
x=m_window_main.X2()+1;
y=m_window_main.Y();
if(!CreateColorPicker(m_color_picker,m_window_main,m_window_main_index,x,y))
return(false);
...
I know that You do not support MQL4 version, but I think that MQL4 is not a reason.
The latest versions of the library, object coordinate calculation was different. You need to either use the new rules specify coordinates of the object, or in their own methods to recalculate the coordinates in the usual you.
......
Could you check it in W_DIALOG window please?
ColorPicker in this library is very powerfull tool for fine tuning custom colours, but I wonder if simple colour table woud be more convenient for everyday use.
Thank you for tutorial. I checked and changed coordinate calculation. ColorPicker works well in my environment but only when displayed in main window (W_MAIN).
Could you check it in W_DIALOG window please?
ColorPicker in this library is very powerfull tool for fine tuning custom colours, but I wonder if simple colour table woud be more convenient for everyday use.
thanks for your labours!!! is sorting by column and deleting rows possible in this version?
thanks for your labours!!! is sorting by column and deleting rows possible in this version?
Good afternoon. I have the following question: there is an input field SpinEdit:
There is an event handler:
And even after the NormalizeDouble function I get such values when I click on the increment/decrement to the right of the input field:
When entering from the keyboard, everything is correct.
What can be the reason ?