void Init(int count) { if(count<=_count)return; Resize(count); InitRange(_count,count); _count=count; }
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; }
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; }
// // 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(); }