diff gui/win32/gui.c @ 36920:40ad45360c8a

Replace old item 'potmeter' by new item 'pimage'. Recent versions of the X11/GTK GUI didn't allow to control a potmeter, because that didn't seem to make any sense. In order to get rid of the confusing potmeter that doesn't distinguish from a hpotmeter and in order to allow the more useful behaviour recent versions of the X11/GTK GUI have been utilized (and because we're still supporting item 'potmeter' for reasons of compatibility with old skins), introduce new item 'pimage' that reuses most of the current potmeter code. Additionally, remove remaining code and documentation of 'potmeter'.
author ib
date Mon, 17 Mar 2014 12:29:46 +0000
parents ecf965eee74d
children 84c93a60ead3
line wrap: on
line diff
--- a/gui/win32/gui.c	Sun Mar 16 13:30:18 2014 +0000
+++ b/gui/win32/gui.c	Mon Mar 17 12:29:46 2014 +0000
@@ -304,10 +304,10 @@
 
     if(!hwnd) return;
 
-    /* load all potmeters hpotmeters vpotmeters */
+    /* load all hpotmeters vpotmeters pimages */
     for(i=0; i<gui->skin->widgetcount; i++)
     {
-        if(gui->skin->widgets[i]->type == tyHpotmeter || gui->skin->widgets[i]->type == tyVpotmeter || gui->skin->widgets[i]->type == tyPotmeter)
+        if(gui->skin->widgets[i]->type == tyHpotmeter || gui->skin->widgets[i]->type == tyVpotmeter || gui->skin->widgets[i]->type == tyPimage)
         {
             if(gui->skin->widgets[i]->msg == evSetVolume)
                 gui->skin->widgets[i]->value = guiInfo.Volume;
@@ -825,7 +825,7 @@
             gui->mousey = GET_Y_LPARAM(lParam);
             /* inside a widget */
             gui->activewidget = clickedinsidewidget(gui, get_windowtype(hWnd), gui->mousex, gui->mousey);
-            if(gui->activewidget)
+            if(gui->activewidget && gui->activewidget->type != tyPimage)
             {
                 gui->activewidget->pressed = 1;
                 gui->mousewx = gui->mousex - gui->activewidget->x;
@@ -942,13 +942,8 @@
                         item->y = GET_Y_LPARAM(lParam) - gui->mousewy;
                         item->value = 100.0 - 100.0 * (item->y - item->wy) / (item->wheight - item->height);
                     }
-                    if(item->type == tyPotmeter)
-                    {
-                        gui->mousewx = GET_X_LPARAM(lParam) - gui->activewidget->x;
-                        item->value = 100.0 * gui->mousewx / item->wwidth;
-                    }
 
-                    if((item->type == tyPotmeter) || (item->type == tyHpotmeter) || (item->type == tyVpotmeter))
+                    if((item->type == tyHpotmeter) || (item->type == tyVpotmeter))
                     {
                         /* Bound checks */
                         if(item->value > 100.0f)