Demo app for GEL 9-Aug-2011 2:44 PM
Edit FancyEdit New New Blog Upload All Recent Home Logout

// Gel Test
//
// CC 2011 Scott Lawrence
//    yorgle@gmail.com
//
//  Using some code from 2006, a demo of some gui stuff

GelList gl; int angle = 0;

void setup() { size( 320, 240 );

gl = new GelList(); gl.setupFont( "narrow", 16 ); // do this so we don't have to include the data.

Gel g1, g;

gl.add( "dummy", g = g1 = new Gel( 1, 2, -5, 21 ));

gl.add( "Play", g= new IconButtonGel( g.nextHpos(), g.y(), 40, 40, 0 )); gl.add( "Stop", g= new IconButtonGel( g.nextHpos(), g.y(), 40, 40, 1 )); gl.add( "Pause", g= new IconButtonGel( g.nextHpos(), g.y(), 40, 40, 2 )); gl.add( "Rewind", g= new IconButtonGel( g.nextHpos(), g.y(), 40, 40, 3 )); gl.add( "FastForward", g= new IconButtonGel( g.nextHpos(), g.y(), 40, 40, 4 ));

gl.add( "Status", g= new IndicatorGel( g1.x(), g.nextVpos(), -1, 21, "Indicator", color( 128, 255, 128 ))); gl.add( "Press", g= new ButtonGel( g.nextHpos(), g.y(), -1, 21, "Button" )); gl.add( "Toggle", g= new ToggleButtonGel( g.nextHpos(), g.y(), 50, 21, "Toggle" ));

gl.add( "Slider", g= new SliderGel( g1.x(), g.nextVpos(), 100, 21, "Slider!", 0, 100, 25));

gl.add( "CB", g= new ColorButtonGel( g.nextHpos(), g.y(), 50, 21, "CBG" ));

gl.add( "IBG", g= new InfoBoxGel( g.nextHpos(), g.y(), 80, 100, 4, true ));

gl.add( "Angle", g= new AngleGel( -1, g.nextVpos(), 60 ));

gl.add( "SliderV", g= new SliderGel( g1.x(), 100, 21, 100, "", 0, 100, 25 ));

gl.setColor( "Status", color( 100, 255, 100 ), color( 255, 0, 0 ));

gl.set( "IBG", 0, "Info Box" ); gl.set( "IBG", 1, "Drag" ); gl.set( "IBG", 2, "Me" ); gl.set( "IBG", 3, "Around!" ); gl.setSnap( "Slider", 25, 5 ); gl.setSnap( "SliderV", 50, 25 );

smooth(); }

void draw() { background( 128 ); gl.set( "Angle", angle++ ); gl.draw(); }

void mouseDragged() { if( gl.mouseDragged()) { return; } }

void mouseReleased() { // if( gl.over( "fooButton" )) { /* do something */ return; }

if( gl.mouseReleased()) { return; } }

void mousePressed() { if( gl.mousePressed()) { return; } }