Artyom Trishkin: Why is the empty string in the text input field not "" but " " "? For a long time I couldn't figure out why the check for an empty string didn't work....
I don't know why. It is initialised with an empty string (""). You can make sure of it yourself by looking in the constructor of CTextEdit class:
{ //--- Save the name of the element class in the base class CElementBase::ClassName(CLASS_NAME); //--- Set priorities for left mouse button pressing m_area_zorder =1; m_label_zorder =0; m_edit_zorder =2; }
I don't know why. It is initialised with an empty string (""). You can see for yourself by looking in the constructor of the CTextEdit class:
...
Yes, I did. That's why I couldn't understand why the condition of checking for "" doesn't work after initialisation. Then I noticed that when the cursor is placed inside the input field, a wide space is created there - exactly the size of a space (approximately like this: ). I checked for " " and everything worked.
Dear Anatoli, congratulations, your interface is very useful, easy and awsome. I adopted for my EAs and Indicators. Really thank you for all. Please, go on and on!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Why is the empty string in the text input field not "" but " " "? For a long time I couldn't figure out why the check for an empty string didn't work....
I don't know why. It is initialised with an empty string (""). You can make sure of it yourself by looking in the constructor of CTextEdit class:
//| Constructor|
//+------------------------------------------------------------------+
CTextEdit::CTextEdit(void) : m_edit_value(""),
m_reset_mode(false),
m_show_text_pointer_mode(false),
m_align_mode(ALIGN_LEFT),
m_text_edit_state(true),
m_area_color(clrNONE),
m_icon_x_gap(0),
m_icon_y_gap(3),
m_icon_file_on(""),
m_icon_file_off(""),
m_label_text(""),
m_label_x_gap(0),
m_label_y_gap(4),
m_label_color(clrBlack),
m_label_color_hover(C'85,170,255'),
m_label_color_locked(clrSilver),
m_edit_y_size(20),
m_edit_x_gap(50),
m_edit_y_gap(0),
m_edit_color(clrWhite),
m_edit_color_locked(clrWhiteSmoke),
m_edit_text_color(clrBlack),
m_edit_text_color_locked(clrSilver),
m_edit_text_color_highlight(clrRed),
m_edit_border_color(clrSilver),
m_edit_border_color_hover(C'85,170,255'),
m_edit_border_color_locked(clrSilver)
{
//--- Save the name of the element class in the base class
CElementBase::ClassName(CLASS_NAME);
//--- Set priorities for left mouse button pressing
m_area_zorder =1;
m_label_zorder =0;
m_edit_zorder =2;
}
I don't know why. It is initialised with an empty string (""). You can see for yourself by looking in the constructor of the CTextEdit class:
...
gives this error when connecting (it does not interfere with work)
cannot load custom indicator 'C:\MetaTrader\MT5 demo\MQL5\Experts\new_menue_fc_1.00.ex5::Indicators\SubWindow.ex5' [4802]
I'm using this version of the library, the menus are in the main graphics.
where it is connected in the files, I can't find it
In the main file of the MQL application you are testing, delete this line:
//|TestLibrary05.mq5 |
//| Copyright 2016, MetaQuotes Software Corp. | |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2016, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
//--- Connection of the indicator for the "Expert in subwindow" mode
#resource "\\Indicators\\SubWindow.ex5"
In the main file of the MQL-application you are testing, delete this line:
That's the thing, it's deleted
In the Defines.mqh file, set the EXPERT_IN_SUBWINDOW parameter to false:
//|Defines.mqh |
//| Copyright 2015, MetaQuotes Software Corp. | |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
//--- Expert in window mode
#define EXPERT_IN_SUBWINDOW false
In the Defines.mqh file, set the EXPERT_IN_SUBWINDOW parameter to false:
#define EXPERT_IN_SUBWINDOW true
This cause errors when expert is not used in sub window.
I changed to false in Defines.mqh and everything seems to work correctly until now.