From 3588d3b4d791a3a8a0979e2f703266bc57559f90 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 10 Oct 2016 20:23:13 +0000 Subject: [PATCH] Added a test for MUIA_Listview_SelectChange. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@52981 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- test/Zune/test.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/test/Zune/test.c b/test/Zune/test.c index 1fc586cb4d..167b6cf028 100644 --- a/test/Zune/test.c +++ b/test/Zune/test.c @@ -168,6 +168,7 @@ static struct *insert_text, *active_text, *drop_text, + *selected_text, *multi_lists[MULTI_LIST_COUNT], *colorfield, *format_string, @@ -441,6 +442,10 @@ static void UpdateListInfo(void) else DoMethod(list.active_text, MUIM_SetAsString, MUIA_Text_Contents, "%ld", value); + DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All, + MUIV_List_Select_Ask, (IPTR) &value); + DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents, + "%ld", value); GET(list.lists[i], MUIA_List_DropMark, &value); DoMethod(list.drop_text, MUIM_SetAsString, MUIA_Text_Contents, "%ld", value); @@ -474,6 +479,19 @@ static void ListGetFirst(void) "%ld", value); } +static void ListGetSelected(void) +{ + UWORD i; + LONG value = 0; + + i = XGET(list.list_radios, MUIA_Radio_Active); + + DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All, + MUIV_List_Select_Ask, (IPTR) &value); + DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents, + "%ld", value); +} + static void ListSetDraggable(void) { UWORD i; @@ -1989,6 +2007,17 @@ int main(void) Child, list.deactivate_button = MUI_MakeObject(MUIO_Button, "Deactivate"), Child, MUI_MakeObject(MUIO_Label, + "Selected entries:", 0), + Child, list.selected_text = TextObject, + TextFrame, + MUIA_Text_Contents, "N/A", + End, + + Child, HVSpace, + Child, HVSpace, + Child, HVSpace, + Child, HVSpace, + Child, MUI_MakeObject(MUIO_Label, "Last drop index:", 0), Child, list.drop_text = TextObject, TextFrame, @@ -1997,7 +2026,7 @@ int main(void) End, End, Child, VGroup, - Child, ColGroup(LIST_COUNT / 2), + Child, ColGroup(MULTI_LIST_COUNT), Child, VGroup, GroupFrameT("Standard Format"), Child, list.multi_lists[0] = ListviewObject, MUIA_Listview_List, @@ -2560,6 +2589,9 @@ int main(void) DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Active, MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard, UpdateListInfo); + DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_SelectChange, + MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard, + ListGetSelected); } DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard, -- 2.11.4.GIT