From 2d776fcd61be168e1ff0ff2e4a5e71835e7cea19 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sat, 28 Jun 2008 16:38:35 +0000 Subject: - prekopanie adresarovej struktury, prva cast git-svn-id: http://opensvn.csie.org/tuxanci_ng@77 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/widget_select.c | 99 ----------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 src/widget_select.c (limited to 'src/widget_select.c') diff --git a/src/widget_select.c b/src/widget_select.c deleted file mode 100644 index dbd6fa9..0000000 --- a/src/widget_select.c +++ /dev/null @@ -1,99 +0,0 @@ - -#include - -#include "main.h" -#include "interface.h" -#include "font.h" -#include "widget_select.h" -#include "image.h" - -/* -typedef struct widget_select -{ - int x, y; - int w, h; - list_t *list; - void (*fce_event)(void *); -} widget_select_t; -*/ - -widget_select_t* newWidgetSelect(int x, int y, void (*fce_event)(void *)) -{ - widget_select_t *new; - - new = malloc( sizeof(widget_select_t) ); - new->x = x; - new->y = y; - new->select = 0; - new->fce_event = fce_event; - new->list = newList(); - - return new; -} - -void addToWidgetSelect(widget_select_t *p, char *s) -{ - addList(p->list, strdup(s) ); -} - -void drawWidgetSelect(widget_select_t *p) -{ - int x, y, w, h; - int i; - - getMousePosition(&x, &y); - - for( i = 0 ; i < p->list->count ; i++ ) - { - char *line; - - line = (char *)p->list->list[i]; - - getTextSize(line, &w, &h); - - if( x > p->x && y > p->y + i*20 && x < p->x+w && y < p->y + i*20 + h ) - { - drawFont(line, p->x, p->y + i*20, COLOR_YELLOW); - } - else - { - if( p->select == i ) - { - drawFont(line, p->x, p->y + i*20, COLOR_RED); - } - else - { - drawFont(line, p->x, p->y + i*20, COLOR_WHITE); - } - } - } -} - -void eventWidgetSelect(widget_select_t *p) -{ - int x, y, w, h; - int i; - - getMousePosition(&x, &y); - - for( i = 0 ; i < p->list->count ; i++ ) - { - char *line; - - line = (char *)p->list->list[i]; - - getTextSize(line, &w, &h); - - if( x > p->x && y > p->y + i*20 && x < p->x+w && y < p->y + i*20 + h && isMouseClicked() ) - { - p->select = i; - p->fce_event(p); - } - } -} - -void destroyWidgetSelect(widget_select_t *p) -{ - destroyListItem(p->list, free); - free(p); -} -- cgit v1.2.3