aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/test/page7b.c
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2020-05-12 16:07:28 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 12:06:42 +0200
commite7d076403df7afd6dc8304196211b49e3ed7f464 (patch)
tree1d5ff1e743839f271de77f8bd312c985033c6a89 /src/libui_sdl/libui/test/page7b.c
parent4cff4b52286a7d1a7e40817d52a5d271a937ddc2 (diff)
parentc17f7b100e36edb1c728dbf21c77f9484d1820c6 (diff)
Merge branch 'generic_jit' of https://github.com/Arisotura/melonDS into generic_jit
Diffstat (limited to 'src/libui_sdl/libui/test/page7b.c')
-rw-r--r--src/libui_sdl/libui/test/page7b.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/libui_sdl/libui/test/page7b.c b/src/libui_sdl/libui/test/page7b.c
deleted file mode 100644
index d1f98a7..0000000
--- a/src/libui_sdl/libui/test/page7b.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// 13 october 2015
-#include "test.h"
-
-static uiArea *area;
-static uiCheckbox *label;
-
-struct handler {
- uiAreaHandler ah;
-};
-
-static struct handler handler;
-
-static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
-{
- // do nothing
-}
-
-static void handlerMouseEvent(uiAreaHandler *a, uiArea *area, uiAreaMouseEvent *e)
-{
- char pos[128];
-
- // wonderful, vanilla snprintf() isn't in visual studio 2013 - http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx
- // we can't use _snprintf() in the test suite because that's msvc-only, so oops. sprintf() it is.
- sprintf(pos, "X %g Y %g", e->X, e->Y);
- uiCheckboxSetText(label, pos);
-}
-
-static void handlerMouseCrossed(uiAreaHandler *ah, uiArea *a, int left)
-{
-printf("%d %d\n", left, !left);
- uiCheckboxSetChecked(label, !left);
-}
-
-static void handlerDragBroken(uiAreaHandler *ah, uiArea *a)
-{
- // do nothing
-}
-
-static int handlerKeyEvent(uiAreaHandler *ah, uiArea *a, uiAreaKeyEvent *e)
-{
- if (e->Key == 'h' && !e->Up) {
- // TODO hide the widget momentarily on the h key
- return 1;
- }
- return 0;
-}
-
-uiGroup *makePage7b(void)
-{
- uiGroup *group;
- uiBox *box;
-
- handler.ah.Draw = handlerDraw;
- handler.ah.MouseEvent = handlerMouseEvent;
- handler.ah.MouseCrossed = handlerMouseCrossed;
- handler.ah.DragBroken = handlerDragBroken;
- handler.ah.KeyEvent = handlerKeyEvent;
-
- group = newGroup("Scrolling Mouse Test");
-
- box = newVerticalBox();
- uiGroupSetChild(group, uiControl(box));
-
- area = uiNewScrollingArea((uiAreaHandler *) (&handler), 5000, 5000);
- uiBoxAppend(box, uiControl(area), 1);
-
- label = uiNewCheckbox("");
- uiBoxAppend(box, uiControl(label), 0);
-
- return group;
-}