Exemplo n.º 1
0
static int
j_textbox(JUMPARGS)
{
    *offset_add = 4;
    return dialog_textbox(t,
			  av[1],
			  numeric_arg(av, 2),
			  numeric_arg(av, 3));
}
Exemplo n.º 2
0
static int
j_infobox(JUMPARGS)
{
    *offset_add = 4;
    return dialog_msgbox(t,
			 av[1],
			 numeric_arg(av, 2),
			 numeric_arg(av, 3), 0);
}
Exemplo n.º 3
0
static int
j_fselect(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return show_result(dialog_fselect(t,
				      av[1],
				      numeric_arg(av, 2),
				      numeric_arg(av, 3)));
}
Exemplo n.º 4
0
static int
j_yesno(JUMPARGS)
{
    *offset_add = 4;
    return dialog_yesno(t,
			av[1],
			numeric_arg(av, 2),
			numeric_arg(av, 3), defaultno);
}
Exemplo n.º 5
0
static int
j_tailboxbg(JUMPARGS)
{
    *offset_add = 4;
    return dialog_tailbox(t,
			  av[1],
			  numeric_arg(av, 2),
			  numeric_arg(av, 3),
			  TRUE);
}
Exemplo n.º 6
0
static int
j_gauge(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return dialog_gauge(t,
			av[1],
			numeric_arg(av, 2),
			numeric_arg(av, 3),
			optional_num(av, 4, 0));
}
Exemplo n.º 7
0
static int
j_passwordbox(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return show_result(dialog_inputbox(t,
				       av[1],
				       numeric_arg(av, 2),
				       numeric_arg(av, 3),
				       optional_str(av, 4, 0), 1));
}
Exemplo n.º 8
0
static int
j_radiolist(JUMPARGS)
{
    int tags = howmany_tags(av + 5, CHECKBOX_TAGS);
    *offset_add = 5 + tags * CHECKBOX_TAGS;
    return dialog_checklist(t,
			    av[1],
			    numeric_arg(av, 2),
			    numeric_arg(av, 3),
			    numeric_arg(av, 4),
			    tags, av + 5, FLAG_RADIO, dialog_vars.separate_output);
}
Exemplo n.º 9
0
static int
j_calendar(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return show_result(dialog_calendar(t,
				       av[1],
				       numeric_arg(av, 2),
				       numeric_arg(av, 3),
				       numeric_arg(av, 4),
				       numeric_arg(av, 5),
				       numeric_arg(av, 6)));
}
Exemplo n.º 10
0
static int
j_timebox(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return show_result(dialog_timebox(t,
				      av[1],
				      numeric_arg(av, 2),
				      numeric_arg(av, 3),
				      optional_num(av, 4, -1),
				      optional_num(av, 5, -1),
				      optional_num(av, 6, -1)));
}
Exemplo n.º 11
0
int kill_to_end_of_line( void )
{
    int nd;
    int count = arg;
    bool merge = last_proc == kill_to_end_of_line;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg (1);

    do
    {
        arg = 1;
        nd = dot;
        end_of_line ();
        nd = dot - nd;
        if( nd <= 0 )
            nd = -1;
        if( !merge )
            replace_to_buf (-nd, kill_buffer_str);
        else
            append_to_buf (-nd, kill_buffer_str);
        merge = true;
        count--;
    }
    while( count > 0 );

    return 0;
}
Exemplo n.º 12
0
static int
optional_num(char **av, int n, int dft)
{
    int ret = dft;
    if (arg_rest(av) > n)
	ret = numeric_arg(av, n);
    return ret;
}
Exemplo n.º 13
0
static int
j_menu(JUMPARGS)
{
    int ret;
    int tags = howmany_tags(av + 5, MENUBOX_TAGS);
    *offset_add = 5 + tags * MENUBOX_TAGS;
    ret = dialog_menu(t,
		      av[1],
		      numeric_arg(av, 2),
		      numeric_arg(av, 3),
		      numeric_arg(av, 4),
		      tags, av + 5);
    if (ret >= 0) {
	fprintf(dialog_vars.output, av[5 + ret * MENUBOX_TAGS]);
	return 0;
    } else if (ret == -2)
	return 1;		/* CANCEL */
    return ret;			/* ESC pressed, ret == -1 */
}
Exemplo n.º 14
0
int previous_line( void )
{
    int count = arg;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg (1);

    line_move( 1, count );
    return 0;
}
Exemplo n.º 15
0
//
// Compare two chars according to case-fold
//
int char_compare_command( void )
{
    if( check_args( 2, 2 ) )
        return 0;

    int a = numeric_arg( 1 );
    int b = numeric_arg( 2 );

    if( a < 0 || b < 0 )
    {
        error( "c= expects its arguments to be character values" );
        return 0;
    }

    if( bf_cur->b_mode.md_foldcase )
        ml_value = unicode_casefold( a ) == unicode_casefold( b );
    else
        ml_value = a == b;

    return 0;
}
Exemplo n.º 16
0
int yank_from_kill_buffer( void )
{
    int count = arg;
    int i;

    if( input_mode == 1 ) gui_input_mode_before_insert();

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg( 1 );

    for( i=1; i<=count ; ++i )
        insert_buffer( kill_buffer_str );
    return 0;
}
Exemplo n.º 17
0
int delete_previous_character( void )
{
    int count = arg;

    if( input_mode == 1 && gui_input_mode_before_delete() )
        return 0;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg (1);

    del_chars_in_buffer (dot, count, 0);
    dot_left (count);

    return 0;
}
Exemplo n.º 18
0
int backward_character( void )
{
    int count = arg;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
    count = count * numeric_arg (1);

    dot_left (count);
    if( dot < bf_cur->first_character() )
    {
        set_dot( bf_cur->first_character() );
        error( "You are at the beginning of the buffer");
    }
    return 0;
}
Exemplo n.º 19
0
int forward_character( void )
{
    int count = arg;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg (1);

    dot_right (count);

    if( dot > bf_cur->num_characters() + 1 )
    {
        set_dot (bf_cur->num_characters() + 1);
        error( "You are at the end of the buffer.");
    }
    return 0;
}
Exemplo n.º 20
0
int delete_next_character( void )
{
    int repeat_count;
    int count = arg;

    if( input_mode == 1 && gui_input_mode_before_delete() )
        return 0;

    if( cur_exec != 0 && cur_exec->p_nargs >  0 )
        count = count * numeric_arg (1);

    if( (repeat_count = del_chars_in_buffer (dot, count, 1)) != 0 )
        dot_right (repeat_count);

    return 0;
}
Exemplo n.º 21
0
int set_mark_command( void )
{
    bool gui_input_mode = false;
    ProgramNode *p = cur_exec;
    if( p != NULL && p->p_nargs == 1 )
        gui_input_mode = numeric_arg( 1 ) != 0;

    bf_cur->set_mark( dot, 0, gui_input_mode );
    if( gui_input_mode )
        gui_input_shift_state( true );

    if( interactive() )
        message( "Mark set." );
    cant_1line_opt = 1;

    return 0;
}
Exemplo n.º 22
0
 NODE *lshowturtle(NODE *args) {
-    prepare_to_draw;
+    prepare_to_draw2(UNBOUND);
     if (!turtle_shown) {
 	turtle_shown = TRUE;
 	draw_turtle();
@@ -545,7 +545,7 @@ NODE *lshowturtle(NODE *args) {
 }
 
 NODE *lhideturtle(NODE *args) {
-    prepare_to_draw;
+    prepare_to_draw2(UNBOUND);
     if (turtle_shown) {
 	draw_turtle();
 	turtle_shown = FALSE;
@@ -874,7 +874,7 @@ NODE *llabel(NODE *arg) {
     *print_stringptr = '\0';
 	
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	draw_turtle();
 	theLength = strlen(textbuf);
 #ifdef mac
@@ -983,7 +983,7 @@ NODE *lsetpencolor(NODE *arg) {
     NODE *val = pos_int_arg(arg);
 
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	set_pen_color(getint(val));
 	save_color();
 	done_drawing;
@@ -995,7 +995,7 @@ NODE *lsetbackground(NODE *arg) {
     NODE *val = pos_int_arg(arg);
 
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	set_back_ground(getint(val));
 	done_drawing;
     }
@@ -1008,7 +1008,7 @@ NODE *lsetpalette(NODE *args) {
 	int slotnum = (int)getint(slot);
 
 	if (NOT_THROWING && (slotnum > 7)) {
-		prepare_to_draw;
+		prepare_to_draw2(UNBOUND);
 		set_palette(slotnum,
 			    (unsigned int)getint(car(arg)),
 			    (unsigned int)getint(cadr(arg)),
@@ -1057,7 +1057,7 @@ NODE *lsetpensize(NODE *args) {
     NODE *arg = pos_int_vector_arg(args);
 
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	set_pen_width((int)getint(car(arg)));
 	set_pen_height((int)getint(cadr(arg)));
 	save_size();
@@ -1074,7 +1074,7 @@ NODE *lsetpenpattern(NODE *args) {    
 	arg = err_logo(BAD_DATA, arg);
 	
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	set_list_pen_pattern(arg);
 	save_pattern();
 	done_drawing;
@@ -1090,7 +1090,7 @@ NODE *lsetscrunch(NODE *args) {
     ynode = numeric_arg(cdr(args));
 
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	draw_turtle();
 	x_scale = (nodetype(xnode) == FLOATT) ? getfloat(xnode) :
 			       (FLONUM)getint(xnode);
@@ -1227,7 +1227,7 @@ NODE *larc(NODE *arg) {
 	else
 	    radius = getfloat(val2);
 
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	draw_turtle();
 
 	/* save and force turtle state */
@@ -1582,7 +1582,7 @@ NODE *lloadpict(NODE *args) {
     lopenread(args);
 #endif
     if (NOT_THROWING) {
-	prepare_to_draw;
+	prepare_to_draw2(UNBOUND);
 	fp = (FILE *)file_list->n_obj;
 	restore_palette(fp);
 	fread(&record_index, sizeof(FIXNUM), 1, fp);