Libraries: EasyAndFastGUI library for creating graphical interfaces - page 16

 
Alexander Fedosov:

Recompiled the library, but it says that the class is not found

class 'CWindow' is undefined Element.mqh

Compile projects from the main program file (*.mq5).

 


Can you please tell me how to fix it when the panels are all messed up at high DPI?

 
A very good library, with which you can create a table showing market data in the ontick or ontime event using logic made by users based on data analysis. In my example, the only thing missing is the possibility of including an edit object to allow you to enter the number of orders you want to execute in the market.Market data being displayed in a table
 
Can you tell me, plz, how can I make the alignment on the right edge in the input field of TextEdit? In earlier versions in SpinEdit there was a possibility of alignment, but in TextEdit there is no such possibility.
 
lovaK:
Can you tell me, plz, how can I make the alignment on the right edge in the input field of TextEdit? In earlier versions in SpinEdit there was a possibility of alignment, but in TextEdit there is no such possibility.

Any text is drawn using the CElement::DrawText(void) method, it only has either left or centre.

It is necessary to add it yourself. Something like this:

   if(m_is_center_text)
     {
      x =m_x_size>>1;
      y =m_y_size>>1;
      m_canvas.TextOut(x,y,m_label_text,::ColorToARGB(clr),TA_CENTER|TA_VCENTER);
     }
   else
     {
      switch(m_text_align)
        {
         case 0: m_canvas.TextOut(x+m_hor_space,         y+m_ver_space,         m_label_text,::ColorToARGB(clr),TA_LEFT|TA_TOP);       break;  // AT_LEFT_TOP
         case 1: m_canvas.TextOut((int)round(m_x_size/2),y+m_ver_space,         m_label_text,::ColorToARGB(clr),TA_CENTER|TA_TOP);     break;  // AT_CENTER_TOP
         case 2: m_canvas.TextOut(m_x_size-m_hor_space,  y+m_ver_space,         m_label_text,::ColorToARGB(clr),TA_RIGHT|TA_TOP);      break;  // AT_RIGHT_TOP
         case 3: m_canvas.TextOut(x+m_hor_space,         (int)round(m_y_size/2),m_label_text,::ColorToARGB(clr),TA_LEFT|TA_VCENTER);   break;  // AT_LEFT_CENTER
         case 4: m_canvas.TextOut(m_x_size>>1,           m_y_size>>1,           m_label_text,::ColorToARGB(clr),TA_CENTER|TA_VCENTER); break;  // AT_CENTER_CENTER
         case 5: m_canvas.TextOut(m_x_size-m_hor_space,  (int)round(m_y_size/2),m_label_text,::ColorToARGB(clr),TA_RIGHT|TA_VCENTER);  break;  // AT_RIGHT_CENTER
         case 6: m_canvas.TextOut(x+m_hor_space,         m_y_size-m_ver_space,  m_label_text,::ColorToARGB(clr),TA_LEFT|TA_BOTTOM);    break;  // AT_LEFT_BOTTOM
         case 7: m_canvas.TextOut((int)round(m_x_size/2),m_y_size-m_ver_space,  m_label_text,::ColorToARGB(clr),TA_CENTER|TA_BOTTOM);  break;  // AT_CENTER_BOTTOM
         case 8: m_canvas.TextOut(m_x_size-m_hor_space,  m_y_size-m_ver_space,  m_label_text,::ColorToARGB(clr),TA_RIGHT|TA_BOTTOM);   break;  // AT_RIGHT_BOTTOM
         default: m_canvas.TextOut(x,y,m_label_text,::ColorToARGB(clr),TA_LEFT); break;
        }
     }
 
Oleksii Chepurnyi:

You have to write it yourself. Something like this:

Thanks, I saw this code of yours on page 7 and picked it up at the time. The problem is that with your addition perfectly aligned text, for example, in the field combo-box, but in the input field TextEdit text is not aligned by this method, and remains aligned on the left edge.
 
lovaK:
Thanks, I saw this code on page 7 and picked it up at the time. The problem is that with your add-on the text is aligned fine, for example, in the combo box field, but in the TextEdit input field the text is not aligned using this method, it remains aligned to the left edge.

Yes, TextEdit did not have to align :)

The text itself draws TextBox (m_edit), it should be rotated. There is its own method of drawing text and, as far as I understand, the text is drawn asymbolically.

The first thing that comes to mind is to change x-coordinate in CTextBox::TextOut(void) :)

 

I keep wondering what's missing. And these are the templates :) Super!

Had a glimpse, I have a question: why can't we get rid of window_index in parameters? We have a pointer to the main element, let it say window index :)

 
Oleksii Chepurnyi:

...

Had a quick look, there is a question: why can't we get rid of window_index in the parameters? I mean, we have a pointer to the main element, let it say window index :)

I don't remember why. We should try it again.