Hello to everyone,
I'm using STemWin 5.44,
here is just a simple swipelist with a knob attached to item 1.
Display All
When attached the knob lost its motion functionality.
In this case motion passes to the swipelist avoiding the knob.
Is there any ways to keep the motion on a knob?
Thank you.
I'm using STemWin 5.44,
here is just a simple swipelist with a knob attached to item 1.
C Source Code: Main.c
- #include "DIALOG.h"
- #include "stdio.h"
- SWIPELIST_Handle hSwipelist;
- KNOB_Handle hKnob;
- GUI_MEMDEV_Handle hMem;
- void _CreateKnob(void) {
- hMem = GUI_MEMDEV_CreateFixed32(0, 0, 50, 50);
- GUI_MEMDEV_Select(hMem);
- GUI_SetBkColor(GUI_TRANSPARENT);
- GUI_Clear();
- GUI_PreserveTrans(1);
- GUI_SetColor(GUI_WHITE);
- GUI_SetPenSize(3);
- GUI_AA_DrawCircle(25, 25, 23);
- GUI_SetColor(GUI_GREEN);
- GUI_SetPenSize(2);
- GUI_AA_DrawLine(24, 7, 24, 14);
- GUI_PreserveTrans(0);
- GUI_MEMDEV_Select(0);
- hKnob = KNOB_CreateEx(0, 0, 50, 50, WM_HBKWIN, WM_CF_SHOW, GUI_ID_KNOB0);
- KNOB_SetDevice(hKnob, hMem);
- }
- void _CreateSwipelist(void) {
- int i;
- char str[10];
- hSwipelist = SWIPELIST_CreateEx(0, 0, 240, 320, WM_HBKWIN, WM_CF_SHOW, 0, GUI_ID_SWIPELIST0);
- SWIPELIST_AddSepItem(hSwipelist, "Swipelist", 60);
- for (i = 0; i < 10; i++) {
- sprintf(str, "Item %d", i + 1);
- SWIPELIST_AddItem(hSwipelist, str, 60);
- }
- SWIPELIST_ItemAttachWindow(hSwipelist, 1, hKnob, 180, 5);
- }
- void MainTask(void) {
- GUI_Init();
- WM_MULTIBUF_Enable(1);
- WM_SetDesktopColor(GUI_BLACK);
- _CreateKnob();
- _CreateSwipelist();
- while (1) {
- GUI_Exec();
- }
- }
In this case motion passes to the swipelist avoiding the knob.
Is there any ways to keep the motion on a knob?
Thank you.
Regards,
Anthony
Anthony