Scrollbar works, but content does not move

 
Hello Folks,

Does anybuddy can tell me, how the CScrollV works?

I have a CScrollV in my Panel, an the CScrollV Element packt with dummys. One is allway overlapping down there, but most confusing is:
  • I can not tell, how to get the Entrys move, while scrolling (I can move the ThumbBar)
  • I can not put the scrollbar on the right side
Here is a Screeshot:


And here is the Code:
void AddScrollPanel(int x, int y, int width, int height, int num_entries)
{
   CScroll *scroll = new CScroll();
   CScrollV *scrollv = new CScrollV();   
   if(!scrollv.Create(ChartID(), "Scrollrtest", 0, x, y, width, height)) // Scrollbar an rechter Seite
   {
      Print("Fehler beim Erstellen der Scrollbar");
      delete scrollv;
      return;
   }
   
   scrollv.MinPos(0);
   scrollv.MaxPos(10);

   // 100 Dummys
   datetime now = TimeCurrent();
   int y_offset = 0;
   for(int i = 0; i < num_entries; i++)
   {      
      CLabel *lbl_start_time = new CLabel();
      lbl_start_time.Create(ChartID(), "testStart_"+i, 0,    50, y_offset, 100, 20);
      lbl_start_time.Text(TimeToString(now + i * 3600, TIME_DATE | TIME_MINUTES));
      scrollv.Add(lbl_start_time);

      y_offset += 20; // yGap     
   }
   scrollv.Right();     //does not work
   MP.Add(scrollv);     //Adding the Scrollv to the mainpanel
}

What did I not understand? What is missig? Everything else works (Spinner, Combobox, ...)

I studdyed the internet for 2 Days... nothing.

A Big thank you in advance!!!
 
Hi, none has any ideas? What is the secret of the scroll bars? ;)

Thanks in advance
 
Snow5345 #:
Hi, none has any ideas? What is the secret of the scroll bars? ;)

Thanks in advance

There is no secret. Look at the example in Indicators/Examples/Panels/SimplePanel. There is used a list view, which implements methods for scrolling. If ListView does not suit you need look at how scroll bars is used in the class CListView and implement your own scrolling methods.

 
Samuel Manoel De Souza #:

There is no secret. Look at the example in Indicators/Examples/Panels/SimplePanel. There is used a list view, which implements methods for scrolling. If ListView does not suit you need look at how scroll bars is used in the class CListView and implement your own scrolling methods.

Thank you for your reply... Ahhh, ListView is that part, that does the actual scrolling and CScroll ist just the visual scrollbar?