summaryrefslogtreecommitdiff
path: root/src/widget_select.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-28 16:38:35 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-28 16:38:35 +0000
commit2d776fcd61be168e1ff0ff2e4a5e71835e7cea19 (patch)
tree7cf274897bf540d5332d446f583ffd066e4e2e1d /src/widget_select.c
parentb877ae23ac5d380ab3aa48d7724045cf4883b186 (diff)
- prekopanie adresarovej struktury, prva cast
git-svn-id: http://opensvn.csie.org/tuxanci_ng@77 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/widget_select.c')
-rw-r--r--src/widget_select.c99
1 files changed, 0 insertions, 99 deletions
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 <stdlib.h>
-
-#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);
-}