void XListBox::onSize(int w,int h) { XWidget::onSize(w,h); setItemWidth(); changSize(); }
void XListBox::removeItem(int item) { int top_index= list_item.indexOf(list_item.takeFirst()); int bottom_index= list_item.indexOf(list_item.takeLast() ); if(bottom_index == -1) return ; list_item.remove(index); if(top_index <= item && item <=bottom_index) { //reDraw(); } changSize(); //总长度 }
void wheel(int button, int dir, int x, int y) { if (dir<=0) { if (standPoint[2] >= 6 && standPoint[2] <30) { ++standPoint[2]; } } if (dir>0) { if (standPoint[2] > 6 && standPoint[2] <= 30) { --standPoint[2]; } } changSize(SCREEN_WIDTH, SCREEN_HEIGHT); //重新绘制 glutPostRedisplay(); }