Discussion of article "Graphical Interfaces X: Updates for Easy And Fast Library (Build 2)" - page 3

 
Alexey Oreshkin:
When to expect the update ?

If you need it urgently, you can add the following changes yourself:

1. In the Defines.mqh file, add a new identifier:

#define  ON_CLICK_TAB               (26) // Switch tab

//---

2. In the CTabs and CIconTabs classes (files Tabs.mqh and IconTabs.mqh), in the ShowTabElements() method, add a line as shown in the listing below:

//+------------------------------------------------------------------+
//| Shows the items of the selected tab only ||
//+------------------------------------------------------------------+
void CTabs::ShowTabElements(void)
  {
//--- Exit if the tabs are hidden
   if(!CElement::IsVisible())
      return;
//--- Checking the index of the selected tab
   CheckTabIndex();
//---
   for(int i=0; i<m_tabs_total; i++)
     {
      //--- Get the number of items attached to the tab
      int tab_elements_total=::ArraySize(m_tab[i].elements);
      //--- If this tab is highlighted
      if(i==m_selected_tab)
        {
         //--- Show tab items
         for(int j=0; j<tab_elements_total; j++)
            m_tab[i].elements[j].Show();
        }
      //--- Hide elements of inactive tabs
      else
        {
         for(int j=0; j<tab_elements_total; j++)
            m_tab[i].elements[j].Hide();
        }
     }
//--- Send a message about it
   ::EventChartCustom(m_chart_id,ON_CLICK_TAB,CElement::Id(),m_selected_tab,"");
  }

//---

3. Now the event with the identifier ON_CLICK_TAB can be accepted in the handler of the custom class.

Example:

//+------------------------------------------------------------------+
//| Graph event handler|
//+------------------------------------------------------------------+
void CProgram::OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {
//--- Tab Press Event
   if(id==CHARTEVENT_CUSTOM+ON_CLICK_TAB)
     {
      //--- If you pressed the radio button
      if(m_tabs.SelectedTab()==0)
        {
         switch(m_radio_buttons1.SelectedButtonIndex()){
            case  0:
               m_canvas_table1.Show();
               m_canvas_table11.Hide();
               m_canvas_table111.Hide();
               ModifyCanvasTable1(0);
            break;
            case  1:
               m_canvas_table1.Hide();
               m_canvas_table11.Show();
               m_canvas_table111.Hide();
               ModifyCanvasTable1(1);                
            break;
            case  2:
               m_canvas_table1.Hide();
               m_canvas_table11.Hide();
               m_canvas_table111.Show();
               ModifyCanvasTable1(2);               
            break;                        
         }       
         return;
        }
      return;
     }
  }
 
Thank you, it works.
I found one more error - we start the tool, move the panel away and start pressing the radio buttons. When the table is drawn, at first it starts to be drawn from the left edge, and then it kind of pulls up to the required coordinates.
 
Alexey Oreshkin:
Thank you, it works.
I found one more error - we start the tool, move the panel away and start pressing the radio buttons. When the table is drawn, at first it starts to be drawn from the left edge, and then it kind of pulls up to the required coordinates.

Yes, there is such a thing. Using this type of table as an example, add a line to the CCanvasTable::Show() method in the CanvasTable.mqh file as shown below:

//+------------------------------------------------------------------+
//|| Shows the element|
//+------------------------------------------------------------------+
void CCanvasTable::Show(void)
  {
//--- Exit if the item is already visible
   if(CElement::IsVisible())
      return;
//--- Make all objects visible
   m_area.Timeframes(OBJ_ALL_PERIODS);
   m_canvas.Timeframes(OBJ_ALL_PERIODS);
   m_scrollv.Show();
   m_scrollh.Show();
//--- Visibility status
   CElement::IsVisible(true);
//--- Moving an item
   Moving(m_wnd.X(),m_wnd.Y());
  }

//---

If this problem occurs with other items, add the same line to their Show() method. All element classes will have this fix in the next update.

 
Hi, i'm following yout work, and i'm realy grateful.

You already developed or see anything that can work with Tabulations or Focus on Controls in the form.

I need to change the editions after i insert one input in one CEdit or CSpinEdit and press Enter or press TAB, i want to pass to the next Edit, for better usuability in my program.

Can you help me or guide me where to look ?

Thank u so much for your contribution on the comunity.
 
RODRIGO CAMPOS FIDELIS:

You already developed or see anything that can work with Tabulations or Focus on Controls in the form.

I need to change the editions after i insert one input in one CEdit or CSpinEdit and press Enter or press TAB, i want to pass to the next Edit, for better usuability in my program.

At the moment this is not possible. I'll think about how to implement it.
 
Anatoli Kazharski:
At the moment this is not possible. I'll think about how to implement it.
Anatoli Kazharski, I'm thinking about that. There is any way so i can active the Edition mode by code, same like when they are no ReadOnly and we do a doble click on the CEdit and they turn Blue and selected.
Or, any way so i can ask an input by splash, message box or any window automaticly requested when i run the code.

I'm thinking some possibilities, and i really don't  wanna use DLL, i'm not that pro yet. But i really have will. If you have me some directions or ideas i can really improve our code.
 

Dear Anatoli, thank you very much for your effort!

I just want to point you out that there is a typo in MenuItem.mqh, line 237, that makes it not possibile to be compiled successfully:

" > The type of the menu item can be set using the CMenuItem::TypeMenuItem()") method");

should read instead

" > The type of the menu item can be set using the CMenuItem::TypeMenuItem() method");

right?

 
Is this the last version of MT4?
 

The Edit is always flickering.

https://www.mql5.com/en/forum/274301

 
How to Create Label Only ?