int main(void){ int w=100; int box[6]={100,20,25,25,20,20}; sortBox(box,6); int result[6]={0}; loading(box,result,w,6); outputResult(result,6); return 0; }
bool ofxLiteGroup::mouseDragged(int x, int y, int button){ bool result = false; for(map<string,ofxLiteBox*>::iterator boxIt = boxes.begin(); boxIt != boxes.end(); boxIt++){ ofxLiteBox* cBox = boxIt->second; if(cBox != NULL){ if((dragBox == NULL || dragBox == cBox) && cBox->mouseDragged(x, y, button)){ dragBox = cBox; dragBox->setSelected(false); result = true; } } } if(sortable && dragBox != NULL){ int mouseIdx = getPosition(x, y); if(mouseIdx != -1){ sortBox(dragBox, mouseIdx); } } if(!result) result = ofxLiteBox::mouseDragged(x, y, button); return result; }