Пример #1
0
int main() {
    Fl_Double_Window *win = new Fl_Double_Window(720,486);
    Fl_Scroll *scroll = new Fl_Scroll(10,10,win->w()-20,win->h()-20);
    scroll->box(FL_DOWN_BOX);
    {
        const int deskw = 15000;
        const int deskh = 15000;
        Fl_OpDesk *opdesk = new Fl_OpDesk(0,0,deskw,deskh);
        opdesk->begin();
        {
            printf("Creating %d boxes\n", (deskw/200)*(deskh/200));
            for ( int x=30; x<deskw; x+=200 ) {
                for ( int y=30; y<deskh; y+=200 ) {
                    char s[80];
                    sprintf(s,"Box %d/%d",x,y);
                    Fl_OpBox *opbox = new Fl_OpBox(x,y,180,120,strdup(s));
                    opbox->begin();
                    {
                        /*Fl_OpButton *a =*/ new Fl_OpButton("A", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *b =*/ new Fl_OpButton("B", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *c =*/ new Fl_OpButton("CCC", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *d =*/ new Fl_OpButton("OUT1", FL_OP_OUTPUT_BUTTON);
                        /*Fl_OpButton *e =*/ new Fl_OpButton("OUT2", FL_OP_OUTPUT_BUTTON);
                    }
                    opbox->end();
                }
            }
        }
        opdesk->end();
    }
    scroll->end();
    win->resizable(win);
    win->show();
    return(Fl::run());
}
Пример #2
0
//==== Compute Width ======//
int GroupLayout::FitWidth( int used_w, int default_w )
{
    int w = default_w;
    if ( m_FitWidthFlag )
    {
        w = m_Group->w() -  used_w;

        Fl_Scroll* s = dynamic_cast< Fl_Scroll* >( m_Group );

        if ( s == NULL ) // Group is not a Fl_Scroll
        {
            return w;
        }

        int sw = s->scrollbar_size();

        if ( sw == 0 )  // Check size, if zero, global size is used.
        {
            sw = Fl::scrollbar_size();
        }

        w = w - sw;
    }

    return w;
}
Scheme_Object* 
spark_fltk_scroll::fl_scroll(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  int x = 0; int y = 0; int w = 0; int h = 0;
  spark::Utils::int_from_scheme_long(argv[0], x);
  spark::Utils::int_from_scheme_long(argv[1], y);
  spark::Utils::int_from_scheme_long(argv[2], w);
  spark::Utils::int_from_scheme_long(argv[3], h);
  std::string title;
  if (argv[4] != scheme_null)
    {
      Scheme_Object* str = scheme_char_string_to_byte_string(argv[4]);
      title = SCHEME_BYTE_STR_VAL(str);
    }
  Fl_Scroll* scroll = new Fl_Scroll(x, y, w, h);
  if (title.length() > 0)
    scroll->copy_label(title.c_str());
  Fltk_tag t = FL_WIDGET_TAG;
  spark_fltk::Widget* widget = new spark_fltk::Widget;
  scroll->argument(reinterpret_cast<long>(widget));
  {
    Scheme_Object* tag = 0;
    MZ_GC_DECL_REG(1);
    MZ_GC_VAR_IN_REG(0, tag);
    MZ_GC_REG();
    tag = scheme_make_integer(t);
    MZ_GC_UNREG();
    _ret_ = scheme_make_cptr(scroll, tag);
  }

  DEFAULT_RET_FINISH;
}
Scheme_Object*
spark_fltk_scroll::yposition(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Scroll* scroll = _get_fl_scroll(argc, argv, 0);
  if (scroll)
    _ret_ = scheme_make_integer(scroll->yposition());

  DEFAULT_RET_FINISH;
}
Пример #5
0
	void draw(void){
		int minx=scroll->x()-x(),miny=scroll->y()-y();
		int maxx=minx+scroll->w(),maxy=miny+scroll->h();
		Fl_Box::draw();
		//Now draw the rectangles
		for(unsigned i=0;i<rects->size();i+=4){
			if(((*rects)[i]>=minx)||((*rects)[i]<=maxx)){
				if(((*rects)[i+2]>=miny)||((*rects)[i+2]<=maxy)){
					if(!(*deleted)[i/4])
						fl_draw_box(FL_EMBOSSED_FRAME,(*rects)[i]+x(),(*rects)[i+2]+y(),(*rects)[i+1]-(*rects)[i]+1,(*rects)[i+3]-(*rects)[i+2]+1,0);
				}
			}
		}
	}
Scheme_Object*
spark_fltk_scroll::position(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Scroll* scroll = _get_fl_scroll(argc, argv, 0);
  if (scroll)
    {
      int x, y;
      spark::Utils::int_from_scheme_long(argv[1], x);
      spark::Utils::int_from_scheme_long(argv[2], y);
      scroll->position(x, y);
      _ret_ = scheme_true;
    }

  DEFAULT_RET_FINISH;
}
Пример #7
0
void gResizerBar::HandleDrag(int diff) {
	Fl_Scroll *grp = (Fl_Scroll*)parent();
	int top = y();
	int bot = y()+h();

	// First pass: find widget directly above us with common edge
	//    Possibly clamp 'diff' if widget would get too small..

	for (int t=0; t<grp->children(); t++) {
		Fl_Widget *w = grp->child(t);
		if ((w->y()+w->h()) == top) {                           // found widget directly above?
			if ((w->h()+diff) < min_h) diff = w->h() - min_h;     // clamp
			w->resize(w->x(), w->y(), w->w(), w->h()+diff);       // change height
			break;                                                // done with first pass
		}
	}

	// Second pass: find widgets below us, move based on clamped diff

	for (int t=0; t<grp->children(); t++) {
		Fl_Widget *w = grp->child(t);
		if (w->y() >= bot)                                     // found widget below us?
			w->resize(w->x(), w->y()+diff, w->w(), w->h());      // change position
	}

	// Change our position last

	resize(x(),y()+diff,w(),h());
	grp->init_sizes();
	grp->redraw();
}
Scheme_Object*
spark_fltk_scroll::type(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Scroll* scroll = _get_fl_scroll(argc, argv, 0);
  if (scroll)
    {
      int i = 0;
      if (spark::Utils::int_from_scheme_long(argv[1], i))
	{
	  scroll->type(i);
	  _ret_ = scheme_true;
	}
    }

  DEFAULT_RET_FINISH;
}
Пример #9
0
ModelerUserInterface::ModelerUserInterface() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(395, 325, "Final Project Controls");
    w = o;
    o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
    o->when(FL_WHEN_NEVER);
    { Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 395, 25);
      o->menu(menu_m_controlsMenuBar);
    }
    { Fl_Browser* o = m_controlsBrowser = new Fl_Browser(0, 25, 140, 300, "Controls");
      o->type(3);
      o->textsize(10);
      o->callback((Fl_Callback*)cb_m_controlsBrowser);
      Fl_Group::current()->resizable(o);
    }
    { Fl_Scroll* o = m_controlsScroll = new Fl_Scroll(145, 25, 250, 300);
      o->type(6);
      o->when(FL_WHEN_CHANGED);
      { Fl_Pack* o = m_controlsPack = new Fl_Pack(145, 25, 225, 300);
        o->end();
      }
      o->end();
    }
    o->end();
  }
  { Fl_Double_Window* o = m_modelerWindow = new Fl_Double_Window( 800, 800, "Assignment 2 Model");
    w = o;
    o->callback((Fl_Callback*)cb_m_modelerWindow, (void*)(this));
    o->when(FL_WHEN_NEVER);
    { ModelerView* o = m_modelerView = new ModelerView(0, 0, 800, 800, "ModelerView");
      o->box(FL_NO_BOX);
      o->color(FL_BACKGROUND_COLOR);
      o->selection_color(FL_BACKGROUND_COLOR);
      o->labeltype(FL_NORMAL_LABEL);
      o->labelfont(0);
      o->labelsize(14);
      o->labelcolor(FL_BLACK);
      o->align(FL_ALIGN_CENTER);
      o->when(FL_WHEN_RELEASE);
      Fl_Group::current()->resizable(o);
    }
    o->end();
  }
}
Пример #10
0
Scheme_Object*
spark_fltk_scroll::align(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Scroll* scroll = _get_fl_scroll(argc, argv, 0);
  if (scroll)
    {
      if (argc == 1)
	{
	  int i = scroll->align();
	  _ret_ = spark_fltk::align_to_intlist(i);	  
	}
      else
	{
	  int i = spark_fltk::intlist_to_flag(argv[1]);
	  scroll->align(i);
	  _ret_ = scheme_true;
	}
    }

  DEFAULT_RET_FINISH;
}
Пример #11
0
/*
  Called everytime we click the refresh button. This will request all participants
  and update the UI.
 */ 
void SelectorGUI::update(){
  int x = 40;
  int y = 10;
  int dy = 20; 
  int i = 0;
  int len = 0;
  
  swindow->clear();
  swindow->redraw();
  swindow->begin();
  
  len = GetParticipants(pList);
  
  for(i; i < len; i ++){
    ssrcList[i] = (char*)pList[i].ssrc;
    Fl_Check_Button* b = new Fl_Check_Button(x, y, 300, 30, pList[i].name);
    b->callback(static_selectCB, (void*) pList[i].ssrc);
    b->type(102);
    y = y + dy;
  }
  swindow->end();
  swindow->redraw();
}
KeyboardPluginGUI::KeyboardPluginGUI(int w, int h,KeyboardPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
SpiralPluginGUI(w,h,o,ch),
m_Last(-1),
m_Oct(4)
{
	Fl_Scroll *Scroll = new Fl_Scroll(2,20,w-4,h-20);
	Fl_Group *Group = new Fl_Group(0,20,500,h-40);
	Group->box(FL_FLAT_BOX);
	Group->user_data(this);
	Scroll->add(Group);

	int KeyWidth=10,Note,Pos=0,Count=0;

	for (int n=0; n<NUM_KEYS; n++)
	{
		m_Num[n]=n;

		Note = n%12;
		if (Note!=1 && Note!=3 && Note!=6 && Note!=8 && Note!=10)
		{
			Pos=Count*KeyWidth;
			Count++;
			m_Key[n] = new Fl_Button(Pos,20,KeyWidth,50,"");
			m_Key[n]->box(FL_THIN_UP_BOX);
			m_Key[n]->labelsize(10);
			m_Key[n]->when(FL_WHEN_CHANGED);

			if (Note==0)
			{
				int Num=n/12;
				sprintf(m_Label[n],"%d",Num);
				m_Key[n]->label(m_Label[n]);
				m_Key[n]->align(FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE);
			}
			m_Key[n]->color(FL_WHITE);
			m_Key[n]->selection_color(FL_WHITE);
			m_Key[n]->callback((Fl_Callback*)cb_Key, &m_Num[n]);
			Group->add(m_Key[n]);
		}
	}

	Count=0;
	for (int n=0; n<NUM_KEYS; n++)
	{
		Note = n%12;
		if (Note==1 || Note==3 || Note==6 || Note==8 || Note==10)
		{
			m_Key[n] = new Fl_Button(Pos+5,20,KeyWidth,30,"");
			m_Key[n]->box(FL_THIN_UP_BOX);
			m_Key[n]->labelsize(10);
			m_Key[n]->when(FL_WHEN_CHANGED);
			m_Key[n]->color(FL_BLACK);
			m_Key[n]->selection_color(FL_BLACK);
			m_Key[n]->callback((Fl_Callback*)cb_Key, &m_Num[n]);
			Group->add(m_Key[n]);
		}
		else
		{
			Pos=Count*KeyWidth;
			Count++;
		}
	}
	Group->position(-100,20);
	Group->end();
	Scroll->end();
}
Пример #13
0
int Fl_Canvas::handle (int event) {
    if (Fl_Group::handle (event)) return 1;
    if (event==FL_PUSH) {
       ClearIncompleteWire();
       redraw();
       m_DragX=Fl::event_x();
       m_DragY=Fl::event_y();
    }
    if ((Fl::event_button() == 1) && ((Fl::event_state() & FL_SHIFT) == 0) && ((Fl::event_state() & FL_CTRL) == 0)) {
       // Left-Click  (or plain click for those who are mouse-button challenged)
       // Select / Multi-select / move devices
       // Handled below - If on a non-selected plugin, deselect and move
       // Handled below - If on a selected plugin, move selection
       // Handled Here - If on canvas - multi select
       if (event==FL_PUSH) {
          if (m_HaveSelection) {
             m_Selection.Clear();
             m_HaveSelection = false;
          }
          m_Selecting = true;
          m_StartSelectX=Fl::event_x();
          m_StartSelectY=Fl::event_y();
          m_EndSelectX=Fl::event_x();
          m_EndSelectY=Fl::event_y();
          ClearIncompleteWire();
          redraw();
          m_DragX=Fl::event_x();
          m_DragY=Fl::event_y();
       }
       if ((event==FL_DRAG) && m_Selecting) {
          m_EndSelectX = Fl::event_x();
          m_EndSelectY = Fl::event_y();
          Fl_Scroll* scroll = (Fl_Scroll *)parent();
          int newx = 0, xp = scroll->xposition();
          int newy = 0, yp = scroll->yposition();
          if ((m_EndSelectX < m_StartSelectX) && ((m_EndSelectX - x() - xp) <= 15))
             newx = 10;
          if ((m_EndSelectY < m_StartSelectY) && ((m_EndSelectY - y() - yp) <= 15))
             newy = 10;
          if ((m_EndSelectX > m_StartSelectX) && ((scroll->x() + scroll->w() - m_EndSelectX - 15) <= 15))
             newx = -10;
          if ((m_EndSelectY > m_StartSelectY) && ((scroll->y() + scroll->h() - m_EndSelectY - 15) <= 5))
             newy = -10;
          if ((newx!=0) || (newy!=0)) {
             position(x()+newx,y()+newy);
             m_StartSelectX += newx;
             m_StartSelectY += newy;
          }
          m_DragX=Fl::event_x();
          m_DragY=Fl::event_y();
          redraw();
       }
       if ((event==FL_RELEASE) && m_Selecting) {
          m_Selecting = false;
          if ((m_EndSelectX != m_StartSelectX) && (m_EndSelectY != m_StartSelectY))
             CalculateSelection();
          redraw();
       }
    }
    if ((Fl::event_button() == 2) || ((Fl::event_button() == 1) && ((Fl::event_state() & FL_SHIFT) != 0))) {
       // Middle-Click  (or shift-click for the mouse button challenged) - old left click
       // Handled Below - If on items allows selecting of individual items
       // Handled Here - If on canvas, drags canvas
       if (event==FL_PUSH) {
          ClearIncompleteWire();
          redraw();
          m_DragX=Fl::event_x();
          m_DragY=Fl::event_y();
       }
       if (event==FL_DRAG) {
          position (x() + (Fl::event_x() - m_DragX), y() + (Fl::event_y() - m_DragY));
          m_DragX=Fl::event_x();
          m_DragY=Fl::event_y();
          redraw();
       }
    }
    if ((Fl::event_button() == 3) || ((Fl::event_button() == 1) && ((Fl::event_state() & FL_CTRL) != 0))) {
       // Right-Click (or Ctrl-click for the M.B.C.)
       // Pop-up Edit/Plugins menu
       if (event==FL_PUSH) {
          m_x=Fl::event_x();
          m_y=Fl::event_y();
          PopupEditMenu (this);
       }
    }
    return 1;
}
Пример #14
0
Файл: Mixer.C Проект: imv/non
Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :
    Fl_Group( X, Y, W, H, L )
{
    Loggable::dirty_callback( &Mixer::handle_dirty, this );

    _rows = 1;
    box( FL_FLAT_BOX );
    labelsize( 96 );
    { Fl_Group *o = new Fl_Group( X, Y, W, 24 );

        { Fl_Menu_Bar *o = menubar = new Fl_Menu_Bar( X, Y, W, 24 );
            o->add( "&Project/&New" );
            o->add( "&Project/&Open" );
            o->add( "&Project/&Save", FL_CTRL + 's', 0, 0 );
            o->add( "&Project/&Quit", FL_CTRL + 'q', 0, 0 );
            o->add( "&Mixer/&Add Strip", 'a', 0, 0 );
            o->add( "&Mixer/Add &N Strips" );
            o->add( "&Mixer/&Import Strip" );
            o->add( "&Mixer/&Rows/One", '1', 0, 0 );
            o->add( "&Mixer/&Rows/Two", '2', 0, 0 );
            o->add( "&Mixer/&Rows/Three", '3', 0, 0 );
            o->add( "&View/&Theme", 0, 0, 0 );
            o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO   );
            o->add( "_&Options/&Display/&Knobs/&Burnished", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
            o->add( "_&Options/&Display/&Sliders/&Nice", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
            o->add( "_&Options/&Display/&Sliders/&Fill", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Sliders/&Simple", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO );
            o->add( "&Help/&Manual" );
            o->add( "&Help/&About" );
            o->callback( cb_menu, this );
        }
        { Fl_Box *o = project_name = new Fl_Box( X + 150, Y, W, 24 );
            o->labelfont( FL_HELVETICA_ITALIC );
            o->label( 0 );
            o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
            o->labeltype( FL_SHADOW_LABEL );
            Fl_Group::current()->resizable( o );
        }
        { sm_blinker = new Fl_Button( ( X + W) - 37, Y + 4, 35, 15, "SM");
            sm_blinker->box(FL_ROUNDED_BOX);
            sm_blinker->down_box(FL_ROUNDED_BOX);
            sm_blinker->color(FL_DARK2);
            sm_blinker->selection_color((Fl_Color)93);
            sm_blinker->labeltype(FL_NORMAL_LABEL);
            sm_blinker->labelfont(3);
            sm_blinker->labelsize(14);
            sm_blinker->labelcolor(FL_DARK3);
            sm_blinker->align(Fl_Align(FL_ALIGN_CENTER));
            sm_blinker->when(FL_WHEN_RELEASE);
            sm_blinker->deactivate();

        } // Fl_Blink_Button* sm_blinker
        o->end();
    }
    { Fl_Scroll *o = scroll = new Fl_Scroll( X, Y + 24, W, H - 24 );
        o->box( FL_FLAT_BOX );
//        o->type( Fl_Scroll::HORIZONTAL_ALWAYS );
//        o->box( Fl_Scroll::BOTH );
        {
            Fl_Flowpack *o = mixer_strips = new Fl_Flowpack( X, Y + 24, W, H - 18 - 24 );
//            label( "Non-Mixer" );
            align( (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE) );
            o->box( FL_FLAT_BOX );
            o->type( Fl_Pack::HORIZONTAL );
            o->hspacing( 2 );
            o->vspacing( 2 );
            o->end();
            Fl_Group::current()->resizable( o );
        }
        o->end();
        Fl_Group::current()->resizable( o );
    }

    end();

//    Fl::add_timeout( STATUS_UPDATE_FREQ, update_cb, this );

    update_menu();

    load_options();
}
Пример #15
0
/*     Fl_Group( X, Y, W, H, L) */
Chain::Chain ( ) : Fl_Group( 0, 0, 100, 100, "")

{
    /* not really deleting here, but reusing this variable */
    _deleting = true;

    int X = 0;
    int Y = 0;
    int W = 100;
    int H = 100;

/*     _outs = 1; */
/*     _ins = 1; */

    _configure_outputs_callback = NULL;

    _strip = NULL;

    _name = NULL;

    labelsize( 10 );
    align( FL_ALIGN_TOP );

    { Fl_Flip_Button* o  = tab_button = new Fl_Flip_Button( X, Y, W, 16, "chain/controls");
        o->type(1);
        o->labelsize( 12 );
        o->callback( cb_handle, this );
    }

    Y += 18;
    H -= 18;

    { Fl_Group *o = chain_tab = new Fl_Group( X, Y, W, H, "" );
        o->labeltype( FL_NO_LABEL );
        o->box( FL_FLAT_BOX );
//        o->color( fl_darker( FL_BACKGROUND_COLOR ) );
//        o->color( FL_BACKGROUND_COLOR );
//        o->box( FL_NO_BOX );
        { Fl_Packscroller *o = new Fl_Packscroller( X, Y, W, H );
            o->color( FL_BACKGROUND_COLOR );
//            o->box( FL_FLAT_BOX );
            o->box( FL_THIN_UP_BOX );
            o->type( Fl_Scroll::VERTICAL );
            { Fl_Pack *o = modules_pack = new Fl_Pack( X, Y, W, H );
                o->type( Fl_Pack::VERTICAL );
                o->spacing( 6 );
                o->end();
                Fl_Group::current()->resizable( o );
            }
            o->end();
        }
        o->end();
    }
    { Fl_Group *o = control_tab = new Fl_Group( X, Y, W, H, "" );
        o->box( FL_FLAT_BOX );
        o->color( FL_BACKGROUND_COLOR );
        o->labeltype( FL_NO_LABEL );
        o->hide();
        { Fl_Scroll *o = new Fl_Scroll( X, Y, W, H );
            o->color( FL_BACKGROUND_COLOR );
            o->box( FL_NO_BOX );
            o->type( Fl_Scroll::VERTICAL );
            { Fl_Pack *o = controls_pack = new Fl_Pack( X, Y, W, H );
                o->type( Fl_Pack::VERTICAL );
                o->spacing( 5 );
//            o->color( FL_RED );
                o->end();
                Fl_Group::current()->resizable( o );
            }
            o->end();
            Fl_Group::current()->resizable( o );
        }
        o->end();
        o->hide();
        Fl_Group::current()->resizable( o );
    }
    end();

    log_create();

    _deleting = false;
}
Пример #16
0
ModelerUserInterface::ModelerUserInterface() {
	// Make this instance the current one
	instance = this;

	// Initialize pointers to NULL
	m_nativeChooser = NULL;
	model = NULL;
	currentGroup = NULL;

	// Set appearance to GTK+ for a nice look
	Fl::scheme("gtk+");

	// Set the animation speed to 24 frames/second
	framesPerSecond = 24;

	// We're not animating yet.
	animating = false;

	// Set the color scheme
	Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
	Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
	Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
	Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
	Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);

	// Create all of the UI elements
	// (autogenerated by FLUID, the FLTK UI Designer)
	Fl_Double_Window* w;
	//const char* title = "CSEP457 Modeler";
	const char* title = "CSEP557 Modeler";
	{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
		w = o;
		o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
		o->when(FL_WHEN_NEVER);
		{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
		  o->menu(menu_m_controlsMenuBar);
		}

		// Contains the controls on the left
		{ leftPane = new Fl_Group(0, 25, 250, 600);
			int tabSpace = -25, controlSpace = 0;
				{ Fl_Tile* o = m_controlSplitPane = new Fl_Tile(0, 50 + tabSpace, 250, 575 - tabSpace);
					o->box(FL_FLAT_BOX);
					{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)TreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					{ Fl_Scroll* o = m_controlsScroll =
						new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
					  o->type(Fl_Scroll::VERTICAL);
					  o->when(FL_WHEN_CHANGED);
					  { Fl_Pack* o = m_controlsPack =
						  new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
						Fl_Group::current()->resizable(o);
						o->spacing(2);
						o->end();
					  }
					  o->end();
					}
					o->end();
				} // end Modeler group/tab
			leftPane->end();
		} // left pane
		{ // TODO: remove this extra brace!
			{ Fl_Group* o = m_viewPane = new Fl_Group(250, 25, 550, 600);
				o->box(FL_NO_BOX);
				o->color(FL_BACKGROUND_COLOR);
				m_modelerView = new ModelerView(250, 25, 550, 600, "");
				w->resizable(m_modelerView);
				o->end();
				Fl_Group::current()->resizable(o);
			}
		}
		o->end();
	}
}
Пример #17
0
void geResizerBar::handleDrag(int diff)
{
	Fl_Scroll* grp = static_cast<Fl_Scroll*>(parent());
	int top;
	int bot;
	if (m_type == VERTICAL) {
		top = y();
		bot = y()+h();
	}
	else {
		top = x();
		bot = x()+w();
	}

	// First pass: find widget directly above us with common edge
	//    Possibly clamp 'diff' if widget would get too small..

	for (int t=0; t<grp->children(); t++) {
		Fl_Widget* wd = grp->child(t);
		if (m_type == VERTICAL) {
			if ((wd->y()+wd->h()) == top) {                          // found widget directly above?
				if ((wd->h()+diff) < m_minSize)
					diff = wd->h() - m_minSize;                          // clamp
				wd->resize(wd->x(), wd->y(), wd->w(), wd->h()+diff);   // change height
				break;                                                 // done with first pass
			}
		}
		else {
			if ((wd->x()+wd->w()) == top) {                          // found widget directly above?
				if ((wd->w()+diff) < m_minSize)
					diff = wd->w() - m_minSize;                          // clamp
				wd->resize(wd->x(), wd->y(), wd->w()+diff, wd->h());   // change height
				break;                                                 // done with first pass
			}
		}
	}

	// Second pass: find widgets below us, move based on clamped diff

	for (int t=0; t<grp->children(); t++) {
		Fl_Widget* wd = grp->child(t);
		if (m_type == VERTICAL) {
			if (wd->y() >= bot)                                     // found widget below us?
				wd->resize(wd->x(), wd->y()+diff, wd->w(), wd->h());  // change position
		}
		else {
			if (wd->x() >= bot)
				wd->resize(wd->x()+diff, wd->y(), wd->w(), wd->h());
		}
	}

	// Change our position last

	if (m_type == VERTICAL)
		resize(x(), y()+diff, w(), h());
	else
		resize(x()+diff, y(), w(), h());

	grp->init_sizes();
	grp->redraw();
}
Пример #18
0
Fl_Double_Window* SUBnoteUI::make_window() {
  { SUBparameters = new Fl_Double_Window(735, 390, "SUBsynth Parameters");
    SUBparameters->user_data((void*)(this));
    { Fl_Scroll* o = new Fl_Scroll(5, 140, 435, 245);
      o->type(1);
      o->box(FL_THIN_UP_BOX);
      { Fl_Pack* o = harmonics = new Fl_Pack(10, 145, 425, 235);
        harmonics->type(1);
        for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars,i);}
        harmonics->end();
      } // Fl_Pack* harmonics
      o->end();
    } // Fl_Scroll* o
    { Fl_Button* o = new Fl_Button(625, 365, 105, 20, "Close");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(11);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Group* o = new Fl_Group(5, 5, 215, 135, "AMPLITUDE");
      o->box(FL_THIN_UP_FRAME);
      o->labeltype(FL_EMBOSSED_LABEL);
      o->labelfont(1);
      o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { Fl_Value_Slider* o = vol = new Fl_Value_Slider(10, 25, 140, 15, "Vol");
        vol->tooltip("Volume");
        vol->type(5);
        vol->box(FL_FLAT_BOX);
        vol->labelsize(11);
        vol->maximum(127);
        vol->step(1);
        vol->callback((Fl_Callback*)cb_vol);
        vol->align(FL_ALIGN_RIGHT);
        o->value(pars->PVolume);
      } // Fl_Value_Slider* vol
      { Fl_Value_Slider* o = vsns = new Fl_Value_Slider(10, 45, 140, 15, "V.Sns");
        vsns->tooltip("Velocity Sensing Function (rightmost to disable)");
        vsns->type(5);
        vsns->box(FL_FLAT_BOX);
        vsns->labelsize(11);
        vsns->maximum(127);
        vsns->step(1);
        vsns->callback((Fl_Callback*)cb_vsns);
        vsns->align(FL_ALIGN_RIGHT);
        o->value(pars->PAmpVelocityScaleFunction);
      } // Fl_Value_Slider* vsns
      { WidgetPDial* o = pan = new WidgetPDial(185, 20, 30, 30, "Pan");
        pan->tooltip("Panning (leftmost is Random)");
        pan->box(FL_ROUND_UP_BOX);
        pan->color(FL_BACKGROUND_COLOR);
        pan->selection_color(FL_INACTIVE_COLOR);
        pan->labeltype(FL_NORMAL_LABEL);
        pan->labelfont(0);
        pan->labelsize(10);
        pan->labelcolor(FL_FOREGROUND_COLOR);
        pan->maximum(127);
        pan->step(1);
        pan->callback((Fl_Callback*)cb_pan);
        pan->align(FL_ALIGN_BOTTOM);
        pan->when(FL_WHEN_CHANGED);
        o->value(pars->PPanning);
      } // WidgetPDial* pan
      { EnvelopeUI* o = ampenv = new EnvelopeUI(10, 65, 205, 70, "SUBsynth - Amplitude Envelope");
        ampenv->box(FL_FLAT_BOX);
        ampenv->color((Fl_Color)51);
        ampenv->selection_color(FL_BACKGROUND_COLOR);
        ampenv->labeltype(FL_NORMAL_LABEL);
        ampenv->labelfont(0);
        ampenv->labelsize(14);
        ampenv->labelcolor(FL_FOREGROUND_COLOR);
        ampenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        ampenv->when(FL_WHEN_RELEASE);
        o->init(pars->AmpEnvelope,master);
        ampenv->end();
      } // EnvelopeUI* ampenv
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(495, 325, 235, 35);
      o->box(FL_THIN_UP_FRAME);
      { Fl_Counter* o = filterstages = new Fl_Counter(515, 340, 45, 15, "Filter Stages");
        filterstages->tooltip("How many times the noise is filtered");
        filterstages->type(1);
        filterstages->labelfont(1);
        filterstages->labelsize(10);
        filterstages->minimum(1);
        filterstages->maximum(5);
        filterstages->step(1);
        filterstages->textsize(10);
        filterstages->callback((Fl_Callback*)cb_filterstages);
        filterstages->align(FL_ALIGN_TOP);
        o->value(pars->Pnumstages);
      } // Fl_Counter* filterstages
      { Fl_Choice* o = magtype = new Fl_Choice(585, 340, 65, 15, "Mag.Type");
        magtype->down_box(FL_BORDER_BOX);
        magtype->labelfont(1);
        magtype->labelsize(10);
        magtype->textsize(11);
        magtype->callback((Fl_Callback*)cb_magtype);
        magtype->align(FL_ALIGN_TOP);
        magtype->menu(menu_magtype);
        o->value(pars->Phmagtype);
      } // Fl_Choice* magtype
      { Fl_Choice* o = start = new Fl_Choice(670, 340, 50, 15, "Start");
        start->down_box(FL_BORDER_BOX);
        start->labelfont(1);
        start->labelsize(10);
        start->textsize(11);
        start->callback((Fl_Callback*)cb_start);
        start->align(FL_ALIGN_TOP);
        start->menu(menu_start);
        o->value(pars->Pstart);
      } // Fl_Choice* start
      o->end();
    } // Fl_Group* o
    { freqsettingsui = new Fl_Group(440, 5, 290, 135, "FREQUENCY");
      freqsettingsui->box(FL_THIN_UP_FRAME);
      freqsettingsui->labeltype(FL_EMBOSSED_LABEL);
      freqsettingsui->labelfont(1);
      freqsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = freqenvelopegroup = new EnvelopeUI(445, 65, 205, 70, "SUBsynth - Frequency Envelope");
        freqenvelopegroup->box(FL_FLAT_BOX);
        freqenvelopegroup->color((Fl_Color)51);
        freqenvelopegroup->selection_color(FL_BACKGROUND_COLOR);
        freqenvelopegroup->labeltype(FL_NORMAL_LABEL);
        freqenvelopegroup->labelfont(0);
        freqenvelopegroup->labelsize(14);
        freqenvelopegroup->labelcolor(FL_FOREGROUND_COLOR);
        freqenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        freqenvelopegroup->when(FL_WHEN_RELEASE);
        o->init(pars->FreqEnvelope,master);
        if (pars->PFreqEnvelopeEnabled==0) o->deactivate();
        freqenvelopegroup->end();
      } // EnvelopeUI* freqenvelopegroup
      { Fl_Check_Button* o = freqee = new Fl_Check_Button(445, 68, 55, 15, "Enabled");
        freqee->down_box(FL_DOWN_BOX);
        freqee->labelfont(1);
        freqee->labelsize(10);
        freqee->callback((Fl_Callback*)cb_freqee);
        o->value(pars->PFreqEnvelopeEnabled);
      } // Fl_Check_Button* freqee
      { Fl_Counter* o = octave = new Fl_Counter(670, 50, 45, 15, "Octave");
        octave->tooltip("Octave");
        octave->type(1);
        octave->labelsize(10);
        octave->minimum(-8);
        octave->maximum(7);
        octave->step(1);
        octave->textfont(1);
        octave->textsize(11);
        octave->callback((Fl_Callback*)cb_octave);
        octave->align(FL_ALIGN_TOP);
        int k=pars->PCoarseDetune/1024;if (k>=8) k-=16;
        o->value(k);
      } // Fl_Counter* octave
      { Fl_Counter* o = coarsedet = new Fl_Counter(655, 115, 60, 20, "Coarse Det.");
        coarsedet->tooltip("Coarse Detune");
        coarsedet->labelsize(10);
        coarsedet->minimum(-64);
        coarsedet->maximum(63);
        coarsedet->step(1);
        coarsedet->textfont(1);
        coarsedet->textsize(11);
        coarsedet->callback((Fl_Callback*)cb_coarsedet);
        coarsedet->align(FL_ALIGN_TOP);
        int k=pars->PCoarseDetune%1024;if (k>=512) k-=1024;
        o->value(k);
        o->lstep(10);
      } // Fl_Counter* coarsedet
      { Fl_Slider* o = detune = new Fl_Slider(495, 25, 230, 15);
        detune->tooltip("Fine Detune (cents)");
        detune->type(5);
        detune->box(FL_FLAT_BOX);
        detune->minimum(-8192);
        detune->maximum(8191);
        detune->step(1);
        detune->callback((Fl_Callback*)cb_detune);
        o->value(pars->PDetune-8192);
      } // Fl_Slider* detune
      { Fl_Value_Output* o = detunevalueoutput = new Fl_Value_Output(448, 25, 45, 15, "Detune");
        detunevalueoutput->labelsize(10);
        detunevalueoutput->minimum(-5000);
        detunevalueoutput->maximum(5000);
        detunevalueoutput->step(0.01);
        detunevalueoutput->textfont(1);
        detunevalueoutput->textsize(10);
        detunevalueoutput->callback((Fl_Callback*)cb_detunevalueoutput);
        detunevalueoutput->align(FL_ALIGN_TOP_LEFT);
        o->value(getdetune(pars->PDetuneType,0,pars->PDetune));
      } // Fl_Value_Output* detunevalueoutput
      { Fl_Check_Button* o = hz440 = new Fl_Check_Button(555, 45, 50, 15, "440Hz");
        hz440->tooltip("set the base frequency to 440Hz");
        hz440->down_box(FL_DOWN_BOX);
        hz440->labelfont(1);
        hz440->labelsize(10);
        hz440->callback((Fl_Callback*)cb_hz440);
        o->value(pars->Pfixedfreq);
      } // Fl_Check_Button* hz440
      { WidgetPDial* o = fixedfreqetdial = new WidgetPDial(610, 45, 15, 15, "Eq.T.");
        fixedfreqetdial->tooltip("How the frequency varies acording to the keyboard (leftmost for fixed frequen\
cy)");
        fixedfreqetdial->box(FL_ROUND_UP_BOX);
        fixedfreqetdial->color(FL_BACKGROUND_COLOR);
        fixedfreqetdial->selection_color(FL_INACTIVE_COLOR);
        fixedfreqetdial->labeltype(FL_NORMAL_LABEL);
        fixedfreqetdial->labelfont(0);
        fixedfreqetdial->labelsize(10);
        fixedfreqetdial->labelcolor(FL_FOREGROUND_COLOR);
        fixedfreqetdial->maximum(127);
        fixedfreqetdial->step(1);
        fixedfreqetdial->callback((Fl_Callback*)cb_fixedfreqetdial);
        fixedfreqetdial->align(FL_ALIGN_RIGHT);
        fixedfreqetdial->when(FL_WHEN_CHANGED);
        o->value(pars->PfixedfreqET);
        if (pars->Pfixedfreq==0) o->deactivate();
      } // WidgetPDial* fixedfreqetdial
      { Fl_Choice* o = detunetype = new Fl_Choice(655, 85, 70, 15, "Detune Type");
        detunetype->down_box(FL_BORDER_BOX);
        detunetype->labelsize(10);
        detunetype->textfont(1);
        detunetype->textsize(10);
        detunetype->callback((Fl_Callback*)cb_detunetype);
        detunetype->align(FL_ALIGN_TOP_LEFT);
        o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");
        o->value(pars->PDetuneType-1);
      } // Fl_Choice* detunetype
      freqsettingsui->end();
    } // Fl_Group* freqsettingsui
    { Fl_Check_Button* o = stereo = new Fl_Check_Button(440, 325, 55, 35, "Stereo");
      stereo->box(FL_THIN_UP_BOX);
      stereo->down_box(FL_DOWN_BOX);
      stereo->labelfont(1);
      stereo->labelsize(10);
      stereo->callback((Fl_Callback*)cb_stereo);
      o->value(pars->Pstereo);
    } // Fl_Check_Button* stereo
    { Fl_Button* o = new Fl_Button(445, 365, 70, 20, "Clear");
      o->tooltip("Clear the harmonics");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(11);
      o->callback((Fl_Callback*)cb_Clear);
    } // Fl_Button* o
    { bandwidthsettingsui = new Fl_Group(220, 5, 220, 135, "BANDWIDTH");
      bandwidthsettingsui->box(FL_THIN_UP_FRAME);
      bandwidthsettingsui->labeltype(FL_EMBOSSED_LABEL);
      bandwidthsettingsui->labelfont(1);
      bandwidthsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = bandwidthenvelopegroup = new EnvelopeUI(225, 65, 205, 70, "SUBsynth - BandWidth Envelope");
        bandwidthenvelopegroup->box(FL_FLAT_BOX);
        bandwidthenvelopegroup->color((Fl_Color)51);
        bandwidthenvelopegroup->selection_color(FL_BACKGROUND_COLOR);
        bandwidthenvelopegroup->labeltype(FL_NORMAL_LABEL);
        bandwidthenvelopegroup->labelfont(0);
        bandwidthenvelopegroup->labelsize(14);
        bandwidthenvelopegroup->labelcolor(FL_FOREGROUND_COLOR);
        bandwidthenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        bandwidthenvelopegroup->when(FL_WHEN_RELEASE);
        o->init(pars->BandWidthEnvelope,master);
        if (pars->PBandWidthEnvelopeEnabled==0) o->deactivate();
        bandwidthenvelopegroup->end();
      } // EnvelopeUI* bandwidthenvelopegroup
      { Fl_Check_Button* o = bwee = new Fl_Check_Button(225, 67, 55, 15, "Enabled");
        bwee->down_box(FL_DOWN_BOX);
        bwee->labelfont(1);
        bwee->labelsize(10);
        bwee->callback((Fl_Callback*)cb_bwee);
        o->value(pars->PBandWidthEnvelopeEnabled);
      } // Fl_Check_Button* bwee
      { Fl_Value_Slider* o = bandwidth = new Fl_Value_Slider(225, 40, 115, 15, "Band Width");
        bandwidth->type(5);
        bandwidth->box(FL_FLAT_BOX);
        bandwidth->labelsize(10);
        bandwidth->maximum(127);
        bandwidth->step(1);
        bandwidth->callback((Fl_Callback*)cb_bandwidth);
        bandwidth->align(FL_ALIGN_TOP);
        o->value(pars->Pbandwidth);
      } // Fl_Value_Slider* bandwidth
      { Fl_Value_Slider* o = bwidthscale = new Fl_Value_Slider(345, 40, 90, 15, "B.Width Scale");
        bwidthscale->tooltip("How much I increase the BandWidth according to lower/higher harmonics");
        bwidthscale->type(5);
        bwidthscale->box(FL_FLAT_BOX);
        bwidthscale->labelsize(10);
        bwidthscale->minimum(-64);
        bwidthscale->maximum(63);
        bwidthscale->step(1);
        bwidthscale->callback((Fl_Callback*)cb_bwidthscale);
        bwidthscale->align(FL_ALIGN_TOP);
        o->value(pars->Pbwscale-64);
      } // Fl_Value_Slider* bwidthscale
      bandwidthsettingsui->end();
    } // Fl_Group* bandwidthsettingsui
    { Fl_Group* o = globalfiltergroup = new Fl_Group(440, 140, 290, 185, "FILTER");
      globalfiltergroup->box(FL_THIN_UP_FRAME);
      globalfiltergroup->labeltype(FL_EMBOSSED_LABEL);
      globalfiltergroup->labelfont(1);
      globalfiltergroup->labelsize(13);
      globalfiltergroup->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = filterenv = new EnvelopeUI(445, 250, 275, 70, "SUBsynth - Filter Envelope");
        filterenv->box(FL_FLAT_BOX);
        filterenv->color((Fl_Color)51);
        filterenv->selection_color(FL_BACKGROUND_COLOR);
        filterenv->labeltype(FL_NORMAL_LABEL);
        filterenv->labelfont(0);
        filterenv->labelsize(14);
        filterenv->labelcolor(FL_FOREGROUND_COLOR);
        filterenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        filterenv->when(FL_WHEN_RELEASE);
        o->init(pars->GlobalFilterEnvelope,master);
        filterenv->end();
      } // EnvelopeUI* filterenv
      { FilterUI* o = filterui = new FilterUI(445, 170, 275, 75, "SUBsynthl - Filter");
        filterui->box(FL_FLAT_BOX);
        filterui->color(FL_LIGHT1);
        filterui->selection_color(FL_BACKGROUND_COLOR);
        filterui->labeltype(FL_NORMAL_LABEL);
        filterui->labelfont(0);
        filterui->labelsize(14);
        filterui->labelcolor(FL_FOREGROUND_COLOR);
        filterui->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        filterui->when(FL_WHEN_RELEASE);
        o->init(pars->GlobalFilter,&pars->PGlobalFilterVelocityScale,&pars->PGlobalFilterVelocityScaleFunction,master);
        filterui->end();
      } // FilterUI* filterui
      if (pars->PGlobalFilterEnabled==0) o->deactivate();
      globalfiltergroup->end();
    } // Fl_Group* globalfiltergroup
    { Fl_Check_Button* o = filtere = new Fl_Check_Button(445, 145, 85, 20, "Enabled");
      filtere->down_box(FL_DOWN_BOX);
      filtere->labelfont(1);
      filtere->labelsize(11);
      filtere->callback((Fl_Callback*)cb_filtere);
      o->value(pars->PGlobalFilterEnabled);
    } // Fl_Check_Button* filtere
    { Fl_Button* o = new Fl_Button(540, 370, 25, 15, "C");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_C);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(570, 370, 25, 15, "P");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_P);
    } // Fl_Button* o
    SUBparameters->end();
  } // Fl_Double_Window* SUBparameters
  return SUBparameters;
}
ModelerUserInterface::ModelerUserInterface() {
	// Make this instance the current one
	instance = this;

	// Initialize pointers to NULL
	m_nativeChooser = NULL;
	model = NULL;
	currentGroup = NULL;
	renderGroup = NULL;
	defaultCam = NULL;
	ps = NULL;
	movieWidth = 720;
	movieHeight = 480;

	// Set appearance to GTK+ for a nice look
	Fl::scheme("gtk+");

	// Set the animation speed to 24 frames/second
	framesPerSecond = 24;

	// We're not animating yet.
	animating = false;
	simulating = false;
	rendering = false;
	drawing = false;

	// Set the color scheme
	Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
	Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
	Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
	Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
	Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);

	// Create all of the UI elements
	// (autogenerated by FLUID, the FLTK UI Designer)
	Fl_Double_Window* w;
	const char* title = "Animator";
	{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
		w = o;
		o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
		o->when(FL_WHEN_NEVER);
		{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
		  o->menu(menu_m_controlsMenuBar);
		}

		// Contains the controls on the left
		{ leftPane = new Fl_Group(0, 25, 250, 600);
			int tabSpace = 0, controlSpace = 0;
			int controlTop = 25 + 600 - controlSpace;

			// Modeler and Curves tabs
			{ Fl_Tabs* t = new Fl_Tabs(0, 25, 250, 600 - controlSpace);
				// Make the tab area stretch.
				leftPane->resizable(t);
				t->when(FL_WHEN_CHANGED);
				t->callback((Fl_Callback*)TabsCallback, this);
				// Curves tab
				{ Fl_Group* o = new Fl_Group(0, 50, 250, 575 - controlSpace, "Curves");
					o->box(FL_FLAT_BOX);
					o->color(FL_BACKGROUND_COLOR);
					{ Fl_Tree* o = curvesTree = new Fl_Tree(0, 50, 250, 575 - controlSpace);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)CurveTreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					o->end();
				}

				// Modeler tab
				{ Fl_Tile* o = m_controlSplitPane =
					new Fl_Tile(0, 50 + tabSpace, 250, 575 + tabSpace - controlSpace, "Modeler");
					// Make only the content area of the tabs resize.
					t->resizable(o);
					o->box(FL_FLAT_BOX);
					{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)TreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					{ Fl_Scroll* o = m_controlsScroll =
						new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
					  o->type(Fl_Scroll::VERTICAL);
					  o->when(FL_WHEN_CHANGED);
					  { Fl_Pack* o = m_controlsPack =
						  new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
						Fl_Group::current()->resizable(o);
						o->spacing(2);
						o->end();
					  }
					  o->end();
					}
					o->end();
				} // end Modeler group/tab
				t->end();
			} // end tabs
			leftPane->end();
		} // left pane
		{ // TODO: remove this extra brace!
			{ Fl_Group* o = m_viewPane = new Special_Tile(250, 25, 550, 600);
				o->box(FL_NO_BOX);
				o->color(FL_BACKGROUND_COLOR);
				// show a smaller modeler view
				m_modelerView = new ModelerView(250, 25, 550, 350, "");
				m_modelerView->resizable();
				// show a curve window with animation controls underneath
				{ curvePane = new Fl_Group(250, 375, 550, 250);
					

					// Row containing the curve options
					{ Fl_Group* o = new Fl_Group(255, 380, 540, 20, "Curve Editor");
						// Put particle system label inside
						o->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						o->labelfont(FL_HELVETICA_BOLD);

						// Curve type chooser
						chooserCurveType = new Fl_Choice(445, 380, 120, 20, "Curve Type: ");
						chooserCurveType->menu(curveTypeMenu);
						chooserCurveType->callback((Fl_Callback*)chooserCurveTypeCallback, this);
						chooserCurveType->deactivate();

						// Wrap checkbox
						checkboxWrap = new Fl_Check_Button(570, 380, 60, 20, "Wrap");
						checkboxWrap->callback((Fl_Callback*)checkboxWrapCallback, this);
						checkboxWrap->deactivate();

						// Zoom All button
						buttonZoomAll = new Fl_Button(640, 380, 80, 20, "Zoom All");
						buttonZoomAll->callback((Fl_Callback*)buttonZoomAllCallback, this);
						buttonZoomAll->deactivate();

						// No resizing
						o->resizable(NULL);

						o->end();
					}

					// The graph widget
					graph = new GraphWidget(255, 405, 540, 140);
					graph->callback((Fl_Callback*)graphCallback, this);
					curvePane->resizable(graph); // stretch the graph on resize

					// Camera buttons
					{ cameraPane = new Fl_Group(255, 550, 540, 20, "Camera");
						// Put camera label inside
						cameraPane->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						cameraPane->labelfont(FL_HELVETICA_BOLD);

						// Prevent internal widgets from resizing when the group is resized.
						cameraPane->resizable(NULL);

						// Use Camera button
						checkboxUseCamera = new Fl_Check_Button(315, 550, 165, 20, "Look Through Camera");
						checkboxUseCamera->callback((Fl_Callback*)checkboxUseCameraCallback);

						// Plot Camera checkbox
						Fl_Button* buttonPlotCamera = new Fl_Button(485, 550, 120, 20, "Plot Keyframe");
						buttonPlotCamera->callback((Fl_Callback*)buttonPlotCameraCallback);

						// Clear Plot button
						Fl_Button* buttonClearPlot = new Fl_Button(610, 550, 120, 20, "Clear Keyframe");
						buttonClearPlot->callback((Fl_Callback*)buttonClearCameraCallback);
						
						// End this group
						cameraPane->end();
					}

					// Particle system buttons
					{ particlePane = new Fl_Group(255, 575, 540, 20, "Particle System");
						// Put particle system label inside
						particlePane->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						particlePane->labelfont(FL_HELVETICA_BOLD);

						// Simulate button
						checkboxSimulate = new Fl_Check_Button(375, 575, 75, 20, "Simulate");
						checkboxSimulate->callback((Fl_Callback*)checkboxSimulateCallback);

						// Clear Particles button
						buttonClearParticles = new Fl_Button(455, 575, 50, 20, "Clear");
						buttonClearParticles->callback((Fl_Callback*)buttonClearParticlesCallback);

						// Particle "bake" indicator
						particleBakeIndicator = new IndicatorWindow(510, 575, 285, 20);
						// TODO: fix this:
						particleBakeIndicator->range(0, 20);
						particleBakeIndicator->deactivate();
						particlePane->resizable(particleBakeIndicator);

						// End this group
						particlePane->end();
					}

					// The playback controls
					{ Fl_Group* o = new Fl_Group(255, 600, 540, 20, "Playback");
						// Put particle system label inside
						o->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						o->labelfont(FL_HELVETICA_BOLD);

						// Rewind button
						Fl_Button* rewind = new Fl_Button(335, 600, 20, 20, "@|<");
						rewind->labeltype(FL_SYMBOL_LABEL);
						rewind->callback((Fl_Callback*)buttonRewindCallback, this);

						// Play button
						buttonPlay = new Fl_Button(360, 600, 20, 20, "@>");
						buttonPlay->labeltype(FL_SYMBOL_LABEL);
						buttonPlay->callback((Fl_Callback*)buttonPlayCallback, this);
						buttonPlay->labelcolor(FL_GREEN);

						// Fast Forward button
						Fl_Button* fastForward = new Fl_Button(385, 600, 20, 20, "@>|");
						fastForward->labeltype(FL_SYMBOL_LABEL);
						fastForward->callback((Fl_Callback*)buttonFastForwardCallback, this);

						// Time slider
						sliderTime = new Fl_Value_Slider(455, 600, 340, 20, "Time:");
						sliderTime->type(FL_HORIZONTAL);
						sliderTime->align(FL_ALIGN_LEFT);
						sliderTime->callback((Fl_Callback*)sliderTimeCallback, this);
						sliderTime->bounds(0, 20);

						// Stretch the time slider on resize
						o->resizable(sliderTime);
						o->end();
					}
					curvePane->end();
				}
				w->resizable(m_modelerView);
				o->end();
				Fl_Group::current()->resizable(o);
			}
		}
		o->end();
	}
}