Cool, useful stuff you're doing ;)
Anatol, I think there are some improvements that could be made. For example, when the cursor is over any of the lists, my hand reaches for the wheel to scroll the list, but, alas, we scroll the chart. And you have chart scrolling tracking. Maybe it would be better not to remove the list, but to scroll it, temporarily disabling the scrolling of the graph, what do you think?
And one more thing: I didn't realise, is there an option to not display the list description, which is to the left of the list button? It is not always needed.
Well, or in general cardinally - if the main window of the programme is in focus, then disable scrolling of the chart, and there already on the spot to determine whether it is necessary to scroll something from the wheel, or not to react to it....
For example, in 3D Studio MAX, for example, there is a reaction to the clamped left mouse button and its movement up and down over the form of increment/decrement of any value. Clicked on the up or down arrow and, without releasing the button lead the mouse up or down, and the value in the form window either increases or decreases depending on the direction of movement of the mouse.
Anatol, I think there are some improvements that could be made. For example, when the cursor is over any of the lists, the hand reaches for the wheel to scroll the list, but, alas, we scroll the chart. And you have chart scrolling tracking. Maybe it would be better not to remove the list, but to scroll it by temporarily disabling the chart scrolling, don't you think?
Now, as far as I know, MQL tools can track whether the middle mouse button is pressed or not. But it is still impossible to track whether it is scrolling or not.
And one more thing: I haven't realised if there is an option not to display the list description, which is to the left of the list button? It is not always necessary.
Yes, it is possible. When creating an item, pass an empty string ("") to the CComboBox::LabelText() method.
For example, in 3D Studio MAX, for example, there is a reaction to the clamped left mouse button and its movement up and down over the form of increment/decrement of some value. Clicked on the up or downarrow and, without releasing the button lead the mouse up or down, and the value in the box form either increases or decreases depending on the direction of movement of the mouse.
The next article will present a number of controls, including the "Input Field" element. There in the current implementation there is accelerated scrolling. That is, holding the left mouse button over the increment/decrement buttons and holding the cursor in the area of these buttons results in accelerated scrolling of values.
//+------------------------------------------------------------------+ //| ComboBox.mqh | //| Copyright 2015, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #include "Element.mqh" #include "Window.mqh" #include "ListView.mqh" //+------------------------------------------------------------------+ //| Êëàññ äëÿ ñîçäàíèÿ êîìáèíèðîâàííîãî ñïèñêà | //+------------------------------------------------------------------+ class CComboBox : public CElement { private: //--- Óêàçàòåëü íà ôîðìó, ê êîòîðîé ýëåìåíò ïðèñîåäèí¸í CWim_buttonndow *m_wnd; //--- Îáúåêòû äëÿ ñîçäàíèÿ êîìáî-áîêñà CRectLabel m_area;Any reason why the comments are not in English anymore?
Any reason why the comments are not in English anymore?
I have ssen the same, and think they have currently 2 things.
1. Some issues still to be needed to be fixed (especially in MT4 !)
2. Currently no Person who can translate it to english. For me it is also not clear, why the main comments are not in english. But so long the functions declared in english, and the most examples like above is available in english, it doesn´t matters.
New article Graphical Interfaces V: The Combobox Control (Chapter 3) has been published:
Author: Anatoli Kazharski
Good job with the articles. I am enjoying the next series of articles. Can you please check SplitButton.mqh line 90? I am getting error
return - cannot convert from const pointer to nonconst pointer.
[WIN7 64bits - MetaTrader5 build 1472]
Strange behavior of SplitString with ComboBox.
I create a combobox to control the sl e tp for a order, but when I tried get the selected item there is problem.
When the user click in the sell or buy buttons, the program get the selected item from combobox and calculate the sl and tp for the order.
When I run it in Debugging mode (F5) there no problem. But when I drag it from the EA list and drop to the chart, the problem appears.
Seens like the EasyAndFast library override in some way the SplitString, or PrintFormat, or StringToDouble functions, or something like that. But I not sure at all.
Here is my example:
//| Creates combobox TP:SL |
//+------------------------------------------------------------------+
bool CProgram::CreateTPSLComboBox(const int x_gap, const int y_gap, const string text) {
// Total number of the list view items
#define ITEMS_TOTAL1 4
// Pass the panel object
_tpslCombobox.WindowPointer(_mainWindow);
// Attach to the first tab
_mainTabs.AddToElementsArray(0, _tpslCombobox);
// Coordinates
int x = _mainWindow.X() + x_gap;
int y = _mainWindow.Y() + y_gap;
// Array of the item values in the list view
string items_text[ITEMS_TOTAL1] = {"2:4", "2:3", "3:4", "0:0"};
// Set properties before creation
_tpslCombobox.XSize(90);
_tpslCombobox.YSize(18);
_tpslCombobox.LabelText(text);
_tpslCombobox.ButtonXSize(45);
_tpslCombobox.ItemsTotal(ITEMS_TOTAL1);
_tpslCombobox.VisibleItemsTotal(4);
_tpslCombobox.AreaColor(clrWhite);
// Store the item values in the combobox list view
for(int i = 0; i < ITEMS_TOTAL1; i++)
_tpslCombobox.ValueToList(i, items_text[i]);
// Get the list view pointer
CListView *lv = _tpslCombobox.GetListViewPointer();
// Set the list view properties
lv.LightsHover(true);
lv.SelectedItemByIndex(lv.SelectedItemIndex() == WRONG_VALUE ? 0 : lv.SelectedItemIndex());
// Create control
if(!_tpslCombobox.CreateComboBox(m_chart_id, m_subwin, x, y))
return(false);
// Add the object to the common array of object groups
CWndContainer::AddToElementsArray(0, _tpslCombobox);
return(true);
}
...
//+------------------------------------------------------------------+
//| Sell function |
//+------------------------------------------------------------------+
void CProgram::Sell() {
string sep = ":";
ushort usep;
usep = StringGetCharacter(sep, 0);
string s[];
double tp = 0.0;
double sl = 0.0;
if(StringSplit(_tpslCombobox.ButtonText(), usep, s) == 2) {
PrintFormat("s01: %s - s02: %s", s[0], s[1]); // output: s01: 2 - s02: 4
tp = StringToDouble(s[0]);
sl = StringToDouble(s[1]);
}
PrintFormat("tp: %.2f - sl: %.2f", tp, sl); // output: tp: 2.00 - sl: 2.00
...
The output: "tp:2.00 - sl: 2.00" should be "tp:2.00 - sl: 4.00".
But again, the problem appears only when I drag and drop to the chart. When I run it in debug mode everything is ok.
Some advise?
UPDATE:
It looks like a problem in MetaTrader 5, not in the EasyAndFast library specifically.
Here is a test:
//| test.mq5 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
string sep = ":";
ushort usep;
usep = StringGetCharacter(sep, 0);
string s[];
double tp = 0.0;
double sl = 0.0;
if(StringSplit("2:4", usep, s) == 2) {
tp = StringToDouble(s[0]);
sl = StringToDouble(s[1]);
}
PrintFormat("tp: %.2f - sl: %.2f", tp, sl);
}
//+------------------------------------------------------------------+
Output: "tp: 2.00 - sl: 2.00" when you drag and drop the script to the chart.
If someone else confirm this, I will report to ServiceDesk.
Thank you.
[WIN7 64bits - MetaTrader5 build 1472]
Copied everything into mql4 folder, TestLibrary Expert Advisor is grey and does not open. It says "cannot open file" in Expert Advisors.
Does it work in test mode? Is there any sense to investigate why it does not run, as it is very important that it works in test mode.
The MT4 version of the library is no longer supported by me.
The latest version for MT5 at the moment can be downloaded in this article: GUIs X: Time Element, Checkbox List Element and Table Sorting (build 6).
Tester tests have not been performed at the current stage of development and will not be performed for a long time.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Graphical Interfaces V: The Combobox Control (Chapter 3) has been published:
In the first two chapters of the fifth part of the series, we developed classes for creating a scrollbar and a view list. In this chapter, we will speak about creating a class for the combobox control. This is also a compound control containing, among others, elements considered in the previous chapters of the fifth part.
In this article we have considered a compound control combobox. Schematic of the library for creating graphical interfaces at the current stage of development looks as shown below:
Fig. 3. Structure of the library at the current stage of development.
Author: Anatoli Kazharski