Example: creating icon menus - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Example: creating icon menus (/thread-315.html) |
Example: creating icon menus - Han - 01-03-2014 10:31 PM Link to DIMGROBHELPER: DIMGROBHELPER Code:
RE: Example: creating icon menus - ArielPalazzesi - 01-03-2014 10:46 PM RE: Example: creating icon menus - Han - 01-04-2014 04:45 AM LOL! I suppose now would be a bad time to confess that I forgot to reduce the colors of the icons, which could have saved an additional 20KB or so. Anyway, if limiting the palette does not affect (too much) the quality of the images being used, then a lot of memory can be saved by switching over to "indexed color" mode. RE: Example: creating icon menus - ArielPalazzesi - 01-04-2014 09:27 AM "Indexed color 'mode? I did not know there was anything like this in HP Prime. Where I can learn more about that? RE: Example: creating icon menus - Mic - 01-04-2014 02:57 PM Very good work Han. RE: Example: creating icon menus - Han - 01-04-2014 03:55 PM (01-04-2014 09:27 AM)ArielPalazzesi Wrote: "Indexed color 'mode? I did not know there was anything like this in HP Prime. Where I can learn more about that? I meant to write that the colors in the graphic object should be indexed (for example, in Photoshop) before importing to the calculator to save space. RE: Example: creating icon menus - ArielPalazzesi - 01-04-2014 07:51 PM (01-04-2014 03:55 PM)Han Wrote: I meant to write that the colors in the graphic object should be indexed (for example, in Photoshop) before importing to the calculator to save space. Thanks. Reading about this.... RE: Example: creating icon menus - The Shadow - 01-08-2014 03:58 AM Hi, new to the forums here. This program is really awesome - it's much easier to do than I was expecting! Question: Is it possible to differentiate between regular and long clicks? I ask because from messing around with it, it seems that every long click first reports as a regular click. To be clear, I'd like to have a menu in which a regular click on an item does one thing, and a long click on it does another. RE: Example: creating icon menus - Han - 01-08-2014 05:07 AM (01-08-2014 03:58 AM)The Shadow Wrote: Hi, new to the forums here. If using WAIT(-1) to detect the mouse, then it is possible to detect the mouse clicks (long vs short). When a mouse event occurs, the WAIT(-1) command returns a list whose first entry determines the mouse event type. A 3 means a click occurred and a 7 means a long-click occurred. Please note, however, that clicks cause several events. A single click will actually trigger three events: mouse down, mouse up, followed by the actual "click". A long click triggers: mouse down, mouse up, long click, and finally regular click. Thus, your mouse event handler code MUST handle the long click FIRST, and enable some sort of local flag so that it does not also trigger the extraneous click event. Below is the code to test click events and what the WAIT(-1) returns. For some strange reason (likely a bug), a long click is never generated if your first mouse event is in fact a long click! Code:
Here's how I would create the mouse handler: Code:
RE: Example: creating icon menus - The Shadow - 01-08-2014 10:14 AM (01-08-2014 05:07 AM)Han Wrote: For some strange reason (likely a bug), a long click is never generated if your first mouse event is in fact a long click! Many thanks for the detailed response! It's this bug that was tripping me up - I was never seeing the 7 show up. Just to make sure, this bug means that in order for the long-click code to work, you first need to touch the screen somewhere besides the 'active' area, right? Otherwise the bug will ensure that a long-click is never caught. RE: Example: creating icon menus - Han - 01-08-2014 06:20 PM (01-08-2014 10:14 AM)The Shadow Wrote:(01-08-2014 05:07 AM)Han Wrote: For some strange reason (likely a bug), a long click is never generated if your first mouse event is in fact a long click! In general, you just need to have touched the screen anywhere, really. If you are referring specifically to the example in the original post, then yes -- avoid the 'active' area. Only after some other touchscreen event has occurred will WAIT(-1) properly detect the long click. RE: Example: creating icon menus - junioratn - 10-07-2016 07:38 PM Hello very good code congratulations as it does to link with a program? for example when you click on one of the images from your code it execulta another program. I would like to put this code attached for me to see how it looks. |