Discussion of article "Graphical Interfaces XI: Integrating the Standard Graphics Library (build 16)" - page 4
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
Added one line in the library and it worked! Yay, mates!
What I added is highlighted in yellow. Where I added it:
void CTable::DrawImage(const int column_index,const int row_index)
{
//--- Расчёт координат
int x =m_columns[column_index].m_x+m_columns[column_index].m_image_x_offset;
int y =m_rows[row_index].m_y+m_columns[column_index].m_image_y_offset;
//--- Выбранная картинка в ячейке и её размеры
int selected_image =m_columns[column_index].m_rows[row_index].m_selected_image;
uint image_height =m_columns[column_index].m_rows[row_index].m_images[selected_image].Height();
uint image_width =m_columns[column_index].m_rows[row_index].m_images[selected_image].Width();
//--- Рисуем
for(uint ly=0,i=0; ly<image_height; ly++)
{
for(uint lx=0; lx<image_width; lx++,i++)
{
//--- Если нет цвета, перейти к следующему пикселю
if(m_columns[column_index].m_rows[row_index].m_images[selected_image].Data(i)<1)
continue;
//--- Получаем цвет нижнего слоя (фона ячейки) и цвет указанного пикселя картинки
uint background =(row_index==m_selected_item)? m_selected_row_color : m_canvas.PixelGet(x+lx,y+ly);
uint pixel_color =m_columns[column_index].m_rows[row_index].m_images[selected_image].Data(i);
//--- Смешиваем цвета
uint foreground=::ColorToARGB(m_clr.BlendColors(background,pixel_color));
//--- Рисуем пиксель наслаиваемого изображения
m_table.PixelSet(x+lx,y+ly,foreground);
}
}
m_table.Update(true);
}
I did the cells-buttons, but there was no task to change the picture....
The Update() method has the default redraw set to false. With redrawing you need to use Update(true)
So it's clear!
I'm always in favour of the truth, when I fasle I can smell it right away :)
How to change the items of a combobox after it is created?
I have such a problem, when I select a combobox item, any item on CheckBoxList is not clicked.
Hello Otto,
has the programmer commented on this in the meantime or corrected the errors?
The dilemma starts with the first chapter of Graphical Interface I.
This is all a great pity, as the programmer has done a lot of work with the many articles here.
But if the compiler is constantly throwing up error messages, then you quickly lose the desire to try again
and the learning effect is of course not given.
VG
Steffen
I would only use the latest version.
An overview is here: https://www.mql5.com/en/code/19703
I've also given up on the subject.
I know what Otto is complaining about.
But I almost always managed to get it working again - a lot of reprogramming but it always worked afterwards. Only the time is lost.
The creator should write BETA in huge letters.
Because that's all it is.
how to move to the right the inscription and the icon together:
IconXGap(...) method moves the icon separately, but the lettering I haven't found how