summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-04-07 06:12:16 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-04-28 05:07:13 (GMT)
commit5d47dce16ab007ebcd5953d0e43325ecb593111a (patch)
treee5fd483d50492cae697827e2297536e50c70483a
parentd1156a5a6d18bd7cc9919b342e1c5dd1456e7273 (diff)
downloadeulogium-5d47dce16ab007ebcd5953d0e43325ecb593111a.zip
eulogium-5d47dce16ab007ebcd5953d0e43325ecb593111a.tar.gz
eulogium-5d47dce16ab007ebcd5953d0e43325ecb593111a.tar.bz2
Add a multi-screen rather then multi-text type
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
-rw-r--r--src/eulogium.c31
-rw-r--r--src/eulogium.h16
2 files changed, 46 insertions, 1 deletions
diff --git a/src/eulogium.c b/src/eulogium.c
index 5126e93..40239c1 100644
--- a/src/eulogium.c
+++ b/src/eulogium.c
@@ -475,13 +475,42 @@ Evas_Object *eulogium_multi_text_menu(struct eulogium_data *eulogium, Evas_Objec
multi_text_next_cb_data->pageindex = EINA_TRUE;
_bottom = elm_button_add(parent);
- elm_object_text_set(_bottom, button ? button->text : "NEXT");
+ elm_object_text_set(_bottom, button ? button->text : "NEXT"); /* change to txtdata->buttontext */
evas_object_smart_callback_add(_bottom, "clicked", _eulogium_multi_text_next_cb, multi_text_next_cb_data);
evas_object_show(_bottom);
return eulogium_split_screen(parent, _top, _bottom);
}
+Evas_Object *eulogium_multi_screen_menu(struct eulogium_data *eulogium, Evas_Object *parent, Eina_List *multi_screen_data)
+{
+ Evas_Object *object;
+ Evas_Object *_top, *_bottom;
+ struct multi_screen *screen;
+
+ switch (screen->type) {
+ case TEXT:
+ break;
+ }
+
+ _bottom = elm_box_add(parent);
+ evas_object_show(_bottom);
+ if (screen->prev_button) {
+ object = elm_button_add(_bottom);
+ elm_object_text_set(_bottom, screen->prev_button);
+ evas_object_show(object);
+ elm_box_pack_end(_bottom, object);
+ }
+ if (screen->next_button) {
+ object = elm_button_add(_bottom);
+ elm_object_text_set(_bottom, screen->next_button);
+ evas_object_show(object);
+ elm_box_pack_end(_bottom, object);
+ }
+
+ return eulogium_split_screen(parent, _top, _bottom);;
+}
+
Evas_Object *eulogium_tripple_button_menu(Evas_Object *parent, const struct button_def *left, const struct button_def *right, const struct button_def *bottom)
{
Evas_Object *object;
diff --git a/src/eulogium.h b/src/eulogium.h
index 88cecc4..ee6294d 100644
--- a/src/eulogium.h
+++ b/src/eulogium.h
@@ -6,6 +6,13 @@
#include <Evas.h>
#include <stdint.h>
+enum screen_type {
+ TEXT,
+ BUTTON,
+ MATERIAL,
+ PROGRESS,
+};
+
struct print_data {
Evas_Object *progress;
Evas_Object *status;
@@ -35,9 +42,18 @@ struct button_def {
struct multi_text {
uint_fast8_t count;
+ const char *button_text;
const char *text[];
};
+struct multi_screen {
+ enum screen_type type;
+ char *text;
+ void *data;
+ char *next_button;
+ char *prev_button;
+};
+
void eulogium_print_file_set(struct eulogium_data *eulogium, char *filepath);
void eulogium_button_cb_set(struct button_def *button, struct button_cb *cb);