Discussion of article "Graphical Interfaces X: Text Edit box, Picture Slider and simple controls (build 5)" - page 2

 
maj:

Hello

in last two articles we don't see mql4 files

I know mt4 don't support multiple charts and those things

but do you will upload an update for mql4?

I mean for latest functions like text edit and mouse and CPU peformanc

MT4 version of the library will no longer be updated.
 
Anatoli Kazharski:
MT4 version of the library will no longer be updated.

Push to switch to MQL5

 

Tol, unnecessary (or something missing instead of unnecessary) in TextEdit.mqh

//+------------------------------------------------------------------+
//| Creates a group of text input field objects |
//+------------------------------------------------------------------+
bool CTextEdit::CreateTextEdit(const long chart_id,const int subwin,const string label_text,const int x,const int y)
  {
//--- Exit if there is no pointer to the form
   if(!CElement::CheckWindowPointer(::CheckPointer(m_wnd)))
      return(false);
//--- Initialisation of variables
   m_id          =m_wnd.LastId()+1;
   m_chart_id    =chart_id;
   m_subwin      =subwin;
   m_x           =x;
   m_y           =y;
   m_x_size      =(m_x_size<1 || m_auto_xresize_mode)? (m_anchor_right_window_side)? m_wnd.X2()+m_x-m_auto_xresize_right_offset : m_wnd.X2()-m_x-m_auto_xresize_right_offset : m_x_size;
   m_y_size      =m_edit_y_size;
   m_label_text  =label_text;
   m_area_color  =(m_area_color!=clrNONE)? m_area_color : m_wnd.WindowBgColor();
//--- Indents from the end point
   CElement::XGap((m_anchor_right_window_side)? m_x : m_x-m_wnd.X());
   CElement::YGap((m_anchor_bottom_window_side)? m_y : m_y-m_wnd.Y());
//--- Creating an element
   if(!CreateArea())
      return(false);
   if(!CreateIcon())
      return(false);
   if(!CreateLabel())
      return(false);
   if(!CreateEdit())
      return(false);

   if(!CreateEdit())
      return(false);

   Print(__FUNCTION__," > CreateEdit()");
   if(!CreateTextSelectPointer())
      return(false);
//--- Hide item if the window is a dialogue box or it is minimised
   if(m_wnd.WindowType()==W_DIALOG || m_wnd.IsMinimized())
      Hide();
//---
   return(true);
  }
//+------------------------------------------------------------------+

And it is somehow strange to be able to use a text label for an input field, but not to be able to set its font and size. Maybe I'm looking in the wrong place? Or hint how to do it without getting into the code, and without adding your own methods.

 
Artyom Trishkin:

Tol, unnecessary (or something missing instead of unnecessary) in TextEdit.mqh

And it is somehow strange to be able to use a text label for an input field, but not to be able to set its font and size. Maybe I'm looking in the wrong place? Or tell me how to do it without getting into the code, and without adding your own methods.

1. unnecessary, of course. You need to delete it.

2. In the next update it will be possible for each element to set its own font and its size.

Already working on the next article. Probably will publish it next week.

 
Anatoli Kazharski:

1. It's redundant. Should be deleted.

2. In the next update it will be possible for each element to set its own font and its size.

Already working on the next article. Probably will publish next week.

1. I deleted it a long time ago - I just had time to ask - what if there was something else that should have been there instead of the deleted one....

2. Super, but I'll have to delete my methods again ..., but never mind ... ;)

3. Looking forward to it.

 
Anatoli Kazharski:

1. It's redundant. Should be deleted.

2. In the next update it will be possible for each element to set its own font and its size.

Already working on the next article. Probably next week will be published.

Tol, the text entered in the text input field when changing the timeframe is again replaced with "Enter your text here". How to get rid of it?

This construction doesn't work (I replaced your default text in the class constructor with ""):

string field_text=(m_text_edit_new_symbol.GetValue()!="" ? m_text_edit_new_symbol.GetValue() : Symbol());
 
Artyom Trishkin:

Tol, the text entered in the text input field is again replaced with "Enter your text here" when changing the timeframe. How to get rid of it?

This construction doesn't work (I replaced your default text in the class constructor with ""):

string field_text=(m_text_edit_new_symbol.GetValue()!="" ? m_text_edit_new_symbol.GetValue() : Symbol());
Yes, the default is better left blank for now.
 
Yuriy Zaytsev:

A push to switch to MQL5

Yes, it is better to listen. )

Forum on trading, automated trading systems and trading strategies testing

Unable to download MT4

Renat Fatkhullin, 2016.11.30 17:32

Gentlemen, did you think that we, being the largest distributor of MT4 platform (more installs than any broker), would continue to advertise it?

Did you think that we will continue to pump MT4 installs all over the world for free and to the delight of those who are bragging "why should I leave MT4"?

I recommend you to think about the future and move development to Metatrader 5 faster.

The changes in the ecosystem are much faster now.


 
Hello! Here's a question. In C languages there are such elements as TMemo with automatic text transfer to a new line and usual TEdit, in which you can enter more than 63 characters. Is it possible to create analogues of TMemo and TEdit with the help of your developments? I understand that 63 characters is a limitation of metatrader itself and cannot be bypassed. Is it possible to use WINAPI for this? (sorry, I don't know much about building objects using standard Windows tools).
 
Roman Podpora:
Hello! Here's a question. In C languages there are such elements as TMemo with automatic text transfer to a new line and usual TEdit, in which you can enter more than 63 characters. Is it possible to create analogues of TMemo and TEdit with the help of your developments? I understand that 63 characters is a limitation of metatrader itself and cannot be bypassed. Is it possible to use WINAPI for this? (sorry, I don't know much about building objects using standard Windows tools).
There are plans to create a separate element like CTextBox, in which there are no restrictions and you can enable multiline mode, as well as vertical and horizontal scroll bars.