void draw_rb() { short i,pos; pos = GetScrollPos(right_sbar,SB_CTL); for (i = pos; i < pos + NRSONPAGE; i++) draw_rb_slot(i,0); }
// is slot >= 0, force that slot // if -1, use 1st free slot void set_rb(short slot, short mode, char const *label, short do_draw) { short i; if (slot < 0) { for (i = 0; i < NRS; i++) if (right_button_status[i] == 0) { slot = i; i = NRS + 5000; } if (i < NRS + 5000) return; } right_button_status[slot] = mode; sprintf((char *)data_store->strings_rs[slot], "%s", label); data_store->strings_rs[slot][39] = 0; for (i = 0; i < 39; i++) if (data_store->strings_rs[slot][i] == '|') data_store->strings_rs[slot][i] = ' '; if (do_draw > 0) draw_rb_slot(slot,0); }