Ejemplo n.º 1
0
FL_FORM *
dial_create_spec_form( void )
{
    if ( dial_attrib )
        return dial_attrib->dialattrib;

    dial_attrib = create_form_dialattrib( );
    fl_addto_choice( dial_attrib->dir, dial_dir[ 0 ].name );
    fl_addto_choice( dial_attrib->dir, dial_dir[ 1 ].name );

    setup_how_return_menu( dial_attrib->returnsetting );
    fl_set_menu_item_mode( dial_attrib->returnsetting, 5,
                           FL_PUP_BOX | FL_PUP_GRAY );
    fl_set_menu_item_mode( dial_attrib->returnsetting, 6,
                           FL_PUP_BOX | FL_PUP_GRAY );
    return dial_attrib->dialattrib;
}
Ejemplo n.º 2
0
void InitDistributionChoice() {
  FL_OBJECT *cp = the_gui->DistributionChoice;

  fl_clear_choice(cp);
  fl_addto_choice(cp,CHOICES);
  fl_set_choice_fontsize(cp,FL_NORMAL_SIZE);
  fl_set_choice_fontstyle(cp,FL_BOLD_STYLE);
  fl_set_choice(cp,Normal);
  DistributionChoiceCB(cp,0);
}
Ejemplo n.º 3
0
void set_object_defaults(void) 
{
  fl_set_browser_fontsize(wad_brow,FL_NORMAL_SIZE);
  fl_set_browser_fontstyle(wad_brow,FL_FIXEDBOLD_STYLE);

  fl_set_browser_fontsize(mesg_brow,FL_NORMAL_SIZE);
  fl_set_browser_fontstyle(mesg_brow,FL_FIXEDBOLD_STYLE);

#ifdef AUDIO_DEVICE
  fl_addto_choice(snd_cho, INTERNALLY_STR );
#else
  /* just hide the revers-button if we can't play internally */
  fl_hide_object( rev_but );
#endif
  fl_addto_choice(snd_cho, EXTERNALLY_STR );

  fl_set_choice_fontsize(snd_cho,FL_NORMAL_SIZE);
  fl_set_choice_fontstyle(snd_cho,FL_BOLD_STYLE);
  
  /* luckily, ANSI allows compile-time string concatenation: */
  fl_addto_choice(img_cho, INTERNALLY_STR "|" EXTERNALLY_STR );
  fl_set_choice_fontsize(img_cho,FL_NORMAL_SIZE);
  fl_set_choice_fontstyle(img_cho,FL_BOLD_STYLE);

  if ( pPalFileSpec )  /* if the user supplied a palette... */
    fl_addto_choice(pal_type_cho, PAL_USER);
    /* (if the palette can't be loaded from file, the program 
       will die anyway...) */
  fl_addto_choice(pal_type_cho, PAL_DOOM "|" PAL_HERETIC "|" 
		  PAL_E_HERETIC "|" PAL_HEXEN "|" PAL_STRIFE );

  fl_set_choice_fontsize(pal_type_cho,FL_NORMAL_SIZE);
  fl_set_choice_fontstyle(pal_type_cho,FL_BOLD_STYLE);

  fl_addto_choice(exp_img_fmt_cho, XPM_STR "|" PCX_STR );
  fl_set_choice_fontsize(exp_img_fmt_cho,FL_NORMAL_SIZE);
  fl_set_choice_fontstyle(exp_img_fmt_cho,FL_BOLD_STYLE);

  fl_setpup_fontsize(FL_NORMAL_SIZE);
  fl_setpup_fontstyle(FL_BOLD_STYLE);
}
Ejemplo n.º 4
0
void *
superspec_to_spec( FL_OBJECT * obj )
{
    void *v = obj->spec;
    SuperSPEC *ssp = obj->u_vdata;
    int i = 0;

    if ( ! ssp )
        return v;

    if ( obj->objclass == FL_BROWSER )
    {
        FLI_BROWSER_SPEC *sp = obj->spec;

        fl_clear_browser( obj );

        sp->h_pref = ssp->h_pref;
        sp->v_pref = ssp->v_pref;

        for ( i = 1; i <= ssp->nlines; i++ )
            fl_addto_browser( obj, ssp->content[ i ] );
    }
    else if ( obj->objclass == FL_CHOICE )
    {
        fl_clear_choice( obj );

        ( ( FLI_CHOICE_SPEC * ) obj->spec)->align = ssp->align;

        for ( i = 1; i <= ssp->nlines; i++ )
        {
            fl_addto_choice( obj, ssp->content[ i ] );
            if ( ssp->shortcut[ i ] )
                fl_set_choice_item_shortcut( obj, i, ssp->shortcut[ i ] );
            fl_set_choice_item_mode( obj, i, ssp->mode[ i ] );
        }

        if ( ssp->nlines >= ssp->int_val )
            fl_set_choice( obj, ssp->int_val );
    }
    else if ( obj->objclass == FL_MENU )
    {
        fl_clear_menu( obj );

        for ( i = 1; i <= ssp->nlines; i++ )
        {
            fl_addto_menu( obj, ssp->content[ i ] );
            if ( ssp->shortcut[ i ] )
                fl_set_menu_item_shortcut( obj, i, ssp->shortcut[ i ] );
            if ( ssp->callback[ i ] )
                fl_set_menu_item_callback( obj, i,
                               ( FL_PUP_CB ) fl_strdup( ssp->callback[ i ] ) );
            fl_set_menu_item_mode( obj, i, ssp->mode[ i ] );
            if ( ssp->mval[ i ] != i )
                fl_set_menu_item_id( obj, i, ssp->mval[ i ] );
        }
    }
    else if (    obj->objclass == FL_SLIDER
              || obj->objclass == FL_VALSLIDER
              || obj->objclass == FL_THUMBWHEEL)
    {
        FLI_SLIDER_SPEC *sp = obj->spec;

        sp->val    = ssp->val;
        sp->min    = ssp->min;
        sp->max    = ssp->max;
        sp->step   = ssp->step;
        sp->prec   = ssp->prec;
        sp->ldelta = ssp->ldelta;
        sp->rdelta = ssp->rdelta;
        sp->slsize = ssp->slsize;
    }
    else if (    ISBUTTON( obj->objclass )
              || obj->objclass == FL_PIXMAP
              || obj->objclass == FL_BITMAP )
    {
        FL_BUTTON_SPEC *sp = obj->spec;

        for ( i = 0; i < 5; i++ )
            sp->react_to[ i ] = ( ssp->mbuttons & ( 1 << i ) ) != 0;
        if ( ISBUTTON( obj->objclass ) )
            fl_set_button_mouse_buttons( obj, ssp->mbuttons );

        sp->val = ssp->int_val;

        if ( ISBUTTON( obj->objclass ) )
            fl_set_button( obj, sp->val );
    }
    else if ( obj->objclass == FL_POSITIONER )
    {
        FLI_POSITIONER_SPEC *sp = obj->spec;

        sp->xstep      = ssp->xstep;
        sp->ystep      = ssp->ystep;
        sp->xmin       = ssp->xmin;
        sp->xmax       = ssp->xmax;
        sp->xval       = ssp->xval;
        sp->ymin       = ssp->ymin;
        sp->ymax       = ssp->ymax;
        sp->yval       = ssp->yval;
    }
    else if ( obj->objclass == FL_COUNTER )
    {
        FLI_COUNTER_SPEC *sp = obj->spec;

        sp->val        = ssp->val;
        sp->sstep      = ssp->sstep;
        sp->lstep      = ssp->lstep;
        sp->min        = ssp->min;
        sp->max        = ssp->max;
        sp->prec       = ssp->prec;
    }
    else if ( obj->objclass == FL_SPINNER )
    {
        FLI_SPINNER_SPEC *sp = obj->spec;

        fl_set_spinner_value( obj, ssp->val );
        fl_set_spinner_bounds( obj, ssp->min, ssp->max );
        fl_set_spinner_step( obj, ssp->step );
        fl_set_spinner_precision( obj, ssp->prec );
        sp->orient = ssp->orient;
    }
    else if ( obj->objclass == FL_DIAL )
    {
        FLI_DIAL_SPEC *sp = obj->spec;

        sp->min       = ssp->min;
        sp->max       = ssp->max;
        sp->val       = ssp->val;
        sp->step      = ssp->step;
        sp->thetai    = ssp->thetai;
        sp->thetaf    = ssp->thetaf;
        sp->direction = ssp->direction;
    }
    else if ( obj->objclass == FL_XYPLOT )
    {
        FLI_XYPLOT_SPEC *sp = obj->spec;

        sp->xmajor         = ssp->xmajor;
        sp->xminor         = ssp->xminor;
        sp->ymajor         = ssp->ymajor;
        sp->yminor         = ssp->yminor;
        sp->xscale         = ssp->xscale;
        sp->yscale         = ssp->yscale;
        sp->xgrid          = ssp->xgrid;
        sp->ygrid          = ssp->ygrid;
        sp->xbase          = ssp->xbase;
        sp->ybase          = ssp->ybase;
        sp->grid_linestyle = ssp->grid_linestyle;
        sp->mark_active    = ssp->mark_active;
    }
    else if ( obj->objclass == FL_SCROLLBAR )
    {
        FLI_SCROLLBAR_SPEC *scbsp = obj->spec;
        FLI_SLIDER_SPEC *sp = scbsp->slider->spec;

        sp->val    = ssp->val;
        sp->min    = ssp->min;
        sp->max    = ssp->max;
        sp->prec   = ssp->prec;
        sp->step   = ssp->step;
        sp->slsize = ssp->slsize;
        sp->ldelta = ssp->ldelta;
        sp->rdelta = ssp->rdelta;
    }
    else if ( obj->objclass == FL_SLIDER )
    {
        FLI_SPINNER_SPEC *sp = obj->spec;

        ssp->val = fl_get_spinner_value( obj );
        fl_get_spinner_bounds( obj, &ssp->min, &ssp->max );
        ssp->step = fl_get_spinner_step( obj );
        ssp->prec = fl_get_spinner_precision( obj );
        ssp->orient = sp->orient;
    }
    else if ( obj->objclass == FL_INPUT )
    {
        /* Simply reset some attributes of the object to the defaults -
           this makes only sense when, during testing, text was entered
           into the input field and new we need to get rid of it */

        FLI_INPUT_SPEC *sp = obj->spec;

        sp->position = -1;
        sp->endrange = -1;
        sp->lines    = sp->ypos = 1;
        *sp->str     = '\0';
    }

    return v;
}