text
stringlengths 0
2.2M
|
---|
ofMouseEventArgs a = args;
|
if(collection[k]->mouseReleased(a)){
|
return true;
|
}
|
}
|
if(b.inside(ofPoint(args.x, args.y))){
|
return true;
|
}else{
|
return false;
|
}
|
}
|
return false;
|
}
|
bool ofxGuiGroup::mouseScrolled(ofMouseEventArgs & args){
|
if(!isGuiDrawing())return false;
|
ofMouseEventArgs a = args;
|
for(std::size_t i = 0; i < collection.size(); i++){
|
if(collection[i]->mouseScrolled(a)){
|
return true;
|
}
|
}
|
if(b.inside(args)){
|
return true;
|
}else{
|
return false;
|
}
|
}
|
void ofxGuiGroup::generateDraw(){
|
border.clear();
|
border.setFillColor(thisBorderColor);
|
border.setFilled(true);
|
border.rectangle(b);
|
if(bHeaderEnabled){
|
headerBg.clear();
|
headerBg.setFillColor(thisHeaderBackgroundColor);
|
headerBg.setFilled(true);
|
headerBg.rectangle(headerRect);
|
auto y = getTextVCenteredInRect(headerRect);
|
textMesh = getTextMesh(getName(), textPadding + b.x, y);
|
minimizeRect = getTextBoundingBox("+",0,0);
|
minimizeRect.x = b.width - textPadding - minimizeRect.width + b.x;
|
y = minimizeRect.y;
|
minimizeRect.y = headerRect.getCenter().y - minimizeRect.height * 0.5 ;
|
y = minimizeRect.y - y;
|
//Crop the minimizeRect, just in case it is larger than the headerRect
|
minimizeRect = headerRect.getIntersection(minimizeRect);
|
textMesh.append(getTextMesh((minimized?"+":"-"), minimizeRect.x, y));
|
}
|
}
|
void ofxGuiGroup::render(){
|
// Avoid any unnecessary rendering
|
if(!bHeaderEnabled && minimized) return;
|
border.draw();
|
if(bHeaderEnabled){
|
headerBg.draw();
|
}
|
ofBlendMode blendMode = ofGetStyle().blendingMode;
|
if(blendMode != OF_BLENDMODE_ALPHA){
|
ofEnableAlphaBlending();
|
}
|
ofColor c = ofGetStyle().color;
|
if(bHeaderEnabled){
|
ofSetColor(thisTextColor);
|
bindFontTexture();
|
textMesh.draw();
|
unbindFontTexture();
|
}
|
if(!minimized){
|
for(std::size_t i = 0; i < collection.size(); i++){
|
collection[i]->draw();
|
}
|
}
|
if(bHeaderEnabled){
|
ofSetColor(c);
|
}
|
if(blendMode != OF_BLENDMODE_ALPHA){
|
ofEnableBlendMode(blendMode);
|
}
|
}
|
vector <string> ofxGuiGroup::getControlNames() const{
|
vector <string> names;
|
for(std::size_t i = 0; i < collection.size(); i++){
|
names.push_back(collection[i]->getName());
|
}
|
return names;
|
}
|
ofxIntSlider & ofxGuiGroup::getIntSlider(const std::string& name){
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.