Discussion of article "Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)" - page 6

 
Anatoli Kazharski:

Well, you're not used to "back and forth redesigns". )

There will probably be a new article next week. I will present the first version of the multiline input field. In subsequent articles, I'll gradually add everything discussed in private and on the forum.

I would add methods ItemsSelectedTotal(); ItemsUnselectedTotal(); along with ItemsTotal();
 
Artyom Trishkin:
I would add methods ItemsSelectedTotal(); ItemsUnselectedTotal(); along with ItemsTotal();

To CListView and CCheckBoxList?

I will, but not in the next article. So it will be quite a big article.

 
Anatoli Kazharski:

To CListView and CCheckBoxList?

I will add it, but not in the next article. This is a rather large article.

Yes, in them. Okay, thank you.
 

Tol, how can I programmatically find out which checkbox of a list item is ticked. Without clicking on it.

I need to array all ticked items in the list.

I'm stumped. Please tell me in which direction to look.

 
Artyom Trishkin:

Tol, how can I programmatically find out which checkbox of a list item is ticked. Without clicking on it.

I need to array all ticked items in the list.

I'm stumped. Please tell me in which direction to look.

CCheckBoxList::GetItemState()
 
Anatoli Kazharski:
CCheckBoxList::GetItemState()

Thanks. That's what I did. I was looping from 0 to ItemsTotal(). It was my fault, that's why it was glitching.

Can you tell me if the checkboxes' states are reset when switching timeframes?

If yes, what are the ways to bypass this unpleasant moment? (They are reset for me - maybe I'm doing something wrong).

 
Artyom Trishkin:

Thank you. That's what I did. I was looping from 0 to ItemsTotal(). It was my fault, that's why it was glitching.

Could you please tell me if the checkboxes' states are reset when switching timeframes?

If yes, what are the ways to bypass this unpleasant moment? (I reset them - maybe I'm doing something wrong).

You need to write to a file. And read it when installing GUI. This is the subject of a future article and there is still a long way to go.

 
Anatoli Kazharski:

You have to write to a file. And read it when installing the GUI. This is the topic of a future article and there is still a long way to go.

I'm already doing it. Didn't wait for a quick reply ;)
 

Anatol, I'm trying to write Bid prices of characters written in table rows in column 0 to the table in the timer:

//+------------------------------------------------------------------+
//| Timer|
//+------------------------------------------------------------------+
void CProgram::OnTimerEvent(void)
  {
   CWndEvents::OnTimerEvent();
   //--- Pause between updating lists and tables
   if(m_counter1.CheckTimeCounter()) {
      uint sz=m_table_main_symbol_list.RowsTotal();
      for(uint i=1; i<sz; i++) {
         string sy=m_table_main_symbol_list.GetValue(0,i);
         MqlTick tick;
         if(sy!=NULL && sy!="") {
            if(SymbolInfoTick(sy,tick)) {
               int dg=(int)SymbolInfoInteger(sy,SYMBOL_DIGITS);
               m_table_main_symbol_list.SetValue(1,i,DoubleToString(tick.bid,dg),dg);
               m_table_main_symbol_list.TextColor(1,i,clrDimGray);
               //m_table_main_symbol_list.UpdateTable();
               }
            }
         }
      //--- Redraw the graph
      m_chart.Redraw();
      }
//--- Pause between status bar updates
   if(m_counter2.CheckTimeCounter()) {

      //--- Redraw the graph
      m_chart.Redraw();
      }
  }
//+------------------------------------------------------------------+

If done without UpdateTable(), no data appears in the table cells. If you update the table every time you get a new tick, it becomes impossible to work with the table - it blinks, the highlighted row blinks, etc....

How to get out of the situation?

 
Artyom Trishkin:

Anatole, I'm trying to write in a table in a timer to the column with index 1 the Bid prices of the characters entered in the table rows in column 0:

...

If I do it without UpdateTable(), no data appears in the table cells. If you update the table every time you receive a new tick, then it becomes impossible to work with the table - it blinks, the selected row blinks, etc....

How to get out of the situation?

Not enough data to reproduce. Attach a complete example so that I can replicate it myself.