/* 
 * Thomas Pantzer: kalah.cc, v0.1b  27.1.98 22:12 
 * 
 * 
 * Copyright 1998 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@aix520.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */

/* Form definition file generated with fdesign. */

#include "forms.h"
#include <stdlib.h>
#include "kalah.h"
#include "copyright.h"

FD_kalah *create_form_kalah(void)
{
  FL_OBJECT *obj;
  FD_kalah *fdui = (FD_kalah *) fl_calloc(1, sizeof(*fdui));

  fdui->kalah = fl_bgn_form(FL_NO_BOX, 555, 250);
  obj = fl_add_box(FL_UP_BOX,0,0,555,250,"");

  fdui->move_bt[1] = obj = fl_add_checkbutton(FL_PUSH_BUTTON,95,85,20,20,"next move");
    fl_set_object_lalign(obj,FL_ALIGN_BOTTOM_LEFT);
//    fl_set_object_callback(obj,button_cb,-4);
    fl_deactivate_object(obj);
//    fl_set_button(obj,1);

  fdui->move_bt[0] = obj = fl_add_checkbutton(FL_PUSH_BUTTON,450,205,20,20,"next move");
    fl_set_object_lalign(obj,FL_ALIGN_BOTTOM);
//    fl_set_object_callback(obj,button_cb,-3);
    fl_deactivate_object(obj);
    fl_set_button(obj,1);

  fdui->reset_bt = obj = fl_add_button(FL_NORMAL_BUTTON,195,110,70,30,"Reset");
    fl_set_object_boxtype(obj,FL_ROUNDED3D_UPBOX);
    fl_set_object_color(obj,FL_SLATEBLUE,FL_COL1);
    fl_set_object_lcolor(obj,FL_WHITE);
    fl_set_object_callback(obj,button_cb,-2);

  fdui->exit_bt = obj = fl_add_button(FL_NORMAL_BUTTON,280,110,70,30,"Exit");
    fl_set_object_boxtype(obj,FL_ROUNDED3D_UPBOX);
    fl_set_object_color(obj,FL_INDIANRED,FL_COL1);
    fl_set_object_lcolor(obj,FL_WHITE);
    fl_set_object_callback(obj,button_cb,-1);

  for (int i=0; i<2; i++)
    {
     fdui->kalah_bt[i] = obj = fl_add_button(FL_NORMAL_BUTTON,10 + (i*455),10,80,230,"0");
       fl_set_object_boxtype(obj,FL_OVAL3D_DOWNBOX);
       fl_set_object_callback(obj,button_cb,(1-i)*7);
       fl_deactivate_object(obj);
       
     fdui->holder[(1-i)*7] = obj;  
     
     if (i == 0)
        {
         fl_set_object_color(obj,FL_DARKCYAN,FL_COL1);
         fl_set_object_lcolor(obj,FL_WHITE);
        } 
      else
        fl_set_object_color(obj,FL_PALEGREEN,FL_COL1);

     for (int j=0; j<6; j++)
       {
        int k;
        
        fdui->bean_bt[(i*6)+j] = obj = fl_add_button(FL_NORMAL_BUTTON,110+(j*55),10+(i*140),50,90,"6");
          fl_set_object_boxtype(obj,FL_OVAL3D_DOWNBOX);

        if (i == 0)
           {
            fl_set_object_color(obj,FL_DARKCYAN,FL_COL1);
            fl_set_object_lcolor(obj,FL_WHITE);
           } 
         else
           fl_set_object_color(obj,FL_PALEGREEN,FL_COL1);


        if (i == 0)
           {
            k = (i*7)+(5-j)+1;
            fl_deactivate_object(obj);
           } 
         else
           k = (i*7)+j+1;  
           
        fdui->holder[k] = obj;  
        fl_set_object_callback(obj,button_cb,k);
       }
    }      
          
  fl_end_form();

  fdui->kalah->fdui = fdui;

  return fdui;
}
/*---------------------------------------*/

