/* * baricon * stripped down version (uses ibicon) * * © 1993-1998 Straylight * */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Steel library. * * Steel is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Steel is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Steel. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "baricon.h" static ibicon baricon__icon; static baricon_clickproc baricon__proc; static void baricon__events(ibicon i,ibicon_eventType t,void *handle) { handle=handle; i=i; if (t==ibicon_LEFTCLICK) baricon__proc(ibicon_syshandle(baricon__icon)); } wimp_i baricon(char *spritename,int spritearea,baricon_clickproc p) { baricon__icon=ibicon_create ( ibicon_RIGHT, spritename, (sprite_area *)spritearea, 0, 0 ); ibicon_eventHandler(baricon__icon,baricon__events,0); baricon__proc=p; return (ibicon_syshandle(baricon__icon)); } wimp_i baricon_left(char *spritename,int spritearea,baricon_clickproc p) { baricon__icon=ibicon_create ( ibicon_LEFT, spritename, (sprite_area *)spritearea, 0, 0 ); ibicon_eventHandler(baricon__icon,baricon__events,0); baricon__proc=p; return (ibicon_syshandle(baricon__icon)); } wimp_i baricon_textandsprite ( char *spritename, char *text, int bufflen, int spritearea, baricon_clickproc p ) { baricon__icon=ibicon_create ( ibicon_RIGHT, spritename, (sprite_area *)spritearea, text, bufflen-1 ); ibicon_eventHandler(baricon__icon,baricon__events,0); baricon__proc=p; return (ibicon_syshandle(baricon__icon)); } wimp_i baricon_textandsprite_left ( char *spritename, char *text, int bufflen, int spritearea, baricon_clickproc p ) { baricon__icon=ibicon_create ( ibicon_LEFT, spritename, (sprite_area *)spritearea, text, bufflen-1 ); ibicon_eventHandler(baricon__icon,baricon__events,0); baricon__proc=p; return (ibicon_syshandle(baricon__icon)); } wimp_i baricon_newsprite(char *newsprite) { ibicon_changeSprite(baricon__icon,newsprite); return (ibicon_syshandle(baricon__icon)); } wimp_i baricon_newtext(char *newtext) { ibicon_changeText(baricon__icon,newtext); return (ibicon_syshandle(baricon__icon)); }