diff --git a/GNUmakefile b/GNUmakefile index 01241ed..195e1eb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -32,7 +32,7 @@ L_CFLAGS = $(DEPINC) $(CFLAGS) -fPIC -D_MILSKO L_LDFLAGS = $(LDFLAGS) L_LIBS = $(LIBS) -L_OBJS = src/core.o src/default.o src/draw.o src/lowlevel.o src/font.o src/boldfont.o src/error.o src/unicode.o src/color.o src/messagebox.o src/directory.o src/string.o +L_OBJS = src/core.o src/default.o src/draw.o src/lowlevel.o src/font.o src/boldfont.o src/error.o src/unicode.o src/color.o src/messagebox.o src/directory.o src/string.o src/filechooser.o L_OBJS += external/ds.o external/image.o L_OBJS += src/widget/window.o src/widget/button.o src/widget/frame.o src/widget/menu.o src/widget/submenu.o src/widget/image.o src/widget/scrollbar.o src/widget/checkbox.o src/widget/label.o src/widget/entry.o src/widget/numberentry.o src/widget/viewport.o src/widget/listbox.o L_OBJS += src/cursor/default.o src/cursor/cross.o src/cursor/text.o diff --git a/include/Mw/FileChooser.h b/include/Mw/FileChooser.h new file mode 100644 index 0000000..c7eb544 --- /dev/null +++ b/include/Mw/FileChooser.h @@ -0,0 +1,22 @@ +/* $Id$ */ +/*! + * %file Mw/FileChoose.h + * %brief File chooser + */ +#ifndef __MW_FILECHOOSER_H__ +#define __MW_FILECHOOSER_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +MWDECL MwWidget MwFileChooser(MwWidget handle, const char* title); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/Mw/Milsko.h b/include/Mw/Milsko.h index 56f2b0c..b978d01 100644 --- a/include/Mw/Milsko.h +++ b/include/Mw/Milsko.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/src/filechooser.c b/src/filechooser.c new file mode 100644 index 0000000..d498eff --- /dev/null +++ b/src/filechooser.c @@ -0,0 +1,22 @@ +/* $Id$ */ +#include + +MwWidget MwFileChooser(MwWidget handle, const char* title){ + MwWidget window; + MwPoint p; + int ww = MwGetInteger(handle, MwNwidth); + int wh = MwGetInteger(handle, MwNheight); + int w, h; + + p.x = 0; + p.y = 0; + + window = MwVaCreateWidget(MwWindowClass, "filechooser", handle, ww, wh, (w = 640), (h = 300), + MwNtitle, title, + NULL); + + MwLLDetach(window->lowlevel, &p); + MwLLMakePopup(window->lowlevel, handle->lowlevel); + + return window; +}