Example: creating icon menus
|
01-03-2014, 10:31 PM
(This post was last modified: 01-04-2014 04:55 AM by Han.)
Post: #1
|
|||
|
|||
Example: creating icon menus
Link to DIMGROBHELPER: DIMGROBHELPER
Code:
Graph 3D | QPI | SolveSys |
|||
01-03-2014, 10:46 PM
Post: #2
|
|||
|
|||
RE: Example: creating icon menus
|
|||
01-04-2014, 04:45 AM
Post: #3
|
|||
|
|||
RE: Example: creating icon menus
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.
Graph 3D | QPI | SolveSys |
|||
01-04-2014, 09:27 AM
Post: #4
|
|||
|
|||
RE: Example: creating icon menus
"Indexed color 'mode? I did not know there was anything like this in HP Prime. Where I can learn more about that?
|
|||
01-04-2014, 02:57 PM
Post: #5
|
|||
|
|||
RE: Example: creating icon menus
Very good work Han.
http://mic.nic.free.fr - Youtube - Facebook |
|||
01-04-2014, 03:55 PM
Post: #6
|
|||
|
|||
RE: Example: creating icon menus
(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. Graph 3D | QPI | SolveSys |
|||
01-04-2014, 07:51 PM
Post: #7
|
|||
|
|||
RE: Example: creating icon menus | |||
01-08-2014, 03:58 AM
(This post was last modified: 01-08-2014 03:58 AM by The Shadow.)
Post: #8
|
|||
|
|||
RE: Example: creating icon menus
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. |
|||
01-08-2014, 05:07 AM
(This post was last modified: 01-08-2014 05:13 AM by Han.)
Post: #9
|
|||
|
|||
RE: Example: creating icon menus
(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:
Graph 3D | QPI | SolveSys |
|||
01-08-2014, 10:14 AM
Post: #10
|
|||
|
|||
RE: Example: creating icon menus
(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. |
|||
01-08-2014, 06:20 PM
(This post was last modified: 01-08-2014 06:21 PM by Han.)
Post: #11
|
|||
|
|||
RE: Example: creating icon menus
(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. Graph 3D | QPI | SolveSys |
|||
10-07-2016, 07:38 PM
(This post was last modified: 10-18-2016 09:29 AM by junioratn.)
Post: #12
|
|||
|
|||
RE: Example: creating icon menus
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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)