Discussion of article "Graphical Interfaces V: The List View Element (Chapter 2)"

 

New article Graphical Interfaces V: The List View Element (Chapter 2) has been published:

In the previous chapter, we wrote classes for creating vertical and horizontal scrollbars. In this chapter, we will implement them. We will write a class for creating the list view element, a compound part of which will be a vertical scrollbar.

The element of the graphical interface list view gives the user a choice of several options. The total number of the list view items and the number of items in its visible part can differ when the total number is too big and does not fit the highlighted working part of the interface. In such cases a scrollbar is used. 

We will compose a list view of several primitive objects and an include element. They are:

  1. List view background.
  2. Array of the list view items.
  3. The vertical scrollbar control.



Fig. 1. Compound parts of the list view element.

 

Author: Anatoli Kazharski

 
MetaQuotes Software Corp.:

New article Graphical Interfaces V: The List View Element (Chapter 2) has been published:

Author: Anatoli Kazharski

Hi,


compiling it with current MT5 Version: 5.00 build 1340 causes compiler Errors:

'return' - cannot convert from const pointer to nonconst pointer    SplitButton.mqh    90    65
'return' - cannot convert from const pointer to nonconst pointer    ListView.mqh    67    76

 
marquez:

Hi,

compiling it with current MT5 Version: 5.00 build 1340 causes compiler Errors:

'return' - cannot convert from const pointer to nonconst pointer    SplitButton.mqh    90    65
'return' - cannot convert from const pointer to nonconst pointer    ListView.mqh    67    76

Thank.

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Обсуждение статьи "Графические интерфейсы III: Группы простых и многофункциональных кнопок (Глава 2)"

Anatoli Kazharski, 2016.05.14 18:58

Да, после последнего обновления терминала появилась такая ошибка. Правила "игры" немного изменились. Исправить можно просто удалив спецификатор const.

Перейдите к строке с ошибкой и замените эту строку:

CContextMenu     *GetContextMenuPointer(void)        const { return(::GetPointer(m_drop_menu)); }

На эту: 

CContextMenu     *GetContextMenuPointer(void)              { return(::GetPointer(m_drop_menu)); }

//---

Подобные исправления нужно будет внести во всех файлах, где будет встречаться такая ошибка. В следующих статьях серии ошибка будет устранена.

Спасибо за сообщение. 


 
The comments in the source are in Gibberish (previous times it was in English)
 

Hello,

I am playing around with the standard library, and I have a really simple question:

I have created a List with CListView. For example, i add elements to it every second. How can i update the list to show the most recent elements automatically without scrolling down with the mouse?

 
Anatoli Kazharski:

Thank.



Hi Still have problem, after delet the "const", now I get the error:  array out of range in 'Program.mqh' (753,32)

Reason: