コード例 #1
0
ファイル: Array.hpp プロジェクト: Maximus5/evil-programmers
 void Init(int count)
 {
   if(count<=_count)return;
   Resize(count);
   InitRange(_count,count);
   _count=count;
 }
コード例 #2
0
ファイル: Array.hpp プロジェクト: Maximus5/evil-programmers
 int Insert(int index,const Array& src)
 {
   if(index<0)index+=_count;
   if(index<0)return -1;
   if(index>_count)
   {
     Resize(index+src.Count());
     int i;
     InitRange(_count,index);
     for(i=0;i<src.Count();i++)
     {
       _data[index+i]=new T(src[i]);
     }
     _count=index+src.Count();
   }else
   {
     Resize(_count+src.Count());
     Copy(index,index+src.Count(),src.Count());
     int i;
     for(i=0;i<src.Count();i++)
     {
       _data[index+i]=new T(src[i]);
     }
     _count+=src.Count();
   }
   return _count;
 }
コード例 #3
0
ファイル: Array.hpp プロジェクト: Maximus5/evil-programmers
 int Insert(int index,const T& item)
 {
   if(index<0)index+=_count;
   if(index<0)return -1;
   if(index>_count)
   {
     Resize(index+1);
     InitRange(_count,index);
     _data[index]=new T(item);
     _count=index+1;
     return _count;
   }
   Resize(_count+1);
   Copy(index,index+1,_count-index);
   _data[index]=new T(item);
   _count++;
   return _count;
 }
コード例 #4
0
//
// ICListSlider::GetSliderValue
//
// Get the current slider value from the var
//
void ICListSlider::GetSliderValue()
{
  ListBoxWatcher *watch = listBoxes[0];

  // Setup the range 
  if (watch)
  {
    // Modify the var range
    sliderVar->GetItem().SetIntegerRange(0, Max(watch->count->GetIntegerValue() - watch->vis->GetIntegerValue(), 0L));

    // Update the first visible item index
    if (sliderVar->GetIntegerValue() != watch->top->GetIntegerValue())
    {
      sliderVar->SetIntegerValue(watch->top->GetIntegerValue());
    }

    // And call the base class method to update settings
    useRange = FALSE;
    InitRange();
  }

  // Call GetVarValue in base class
  ICSlider::GetSliderValue();
}