CHDK UI version 2.0 ? - page 53 - General Discussion and Assistance - CHDK Forum  

CHDK UI version 2.0 ?

  • 542 Replies
  • 144204 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #520 on: 21 / April / 2013, 22:21:22 »
Advertisements
I'd like to add hexadecimal integer input method to scripts. The attached diff is my first try. Since this requires a change in script parameter handling, I'd like to ask for others' opinions.
The patch includes:
- a new menu item type (MENUITEM_INT_EXTEDIT)
This provides a cleaner way to use the recently introduced "hexbox"
- the number is now displayed for these menu entries
It's looong. Maximal width for unsigned hexadecimal integers is 10 characters + the square brackets. Should this have a different look?
- a change in the process_range() function (gui_script.c)
I found this to be the appropriate place for adding the new input method, since the other ones are also determined here. I can't include minimum/maximum limits, since CMenuItem has not enough space for that (actually, I'm not missing this, it can be done easily in the script).
There are many hints in the code that the box could be enhanced to include decimal input, but that's not implemented yet.

Parts of this change are a bit hack-ish, could look better if I change more existing functions. The new @range addition is more like a temporary syntax.

Finally, I know that this isn't for the average user, but it's useful for peeking and poking camera memory.

Re: CHDK UI version 2.0 ?
« Reply #521 on: 22 / April / 2013, 01:39:08 »
I'd like to add hexadecimal integer input method to scripts.
I'm confused about the use of the word "scripts".   Looking at the patch tells me that this does not add any input functionality to uBASIC or Lua?  Is that right?  Its a different input method for the CHDK menu system?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #522 on: 22 / April / 2013, 09:25:21 »
I'm confused about the use of the word "scripts".   Looking at the patch tells me that this does not add any input functionality to uBASIC or Lua?  Is that right?  Its a different input method for the CHDK menu system?
Yes, sorry about the confusion. I wrote "scripts" because you need to change the script (header) in order to use that input method for the script parameters. That said, it could be added for run-time use, just like textbox and file_browser.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #523 on: 27 / April / 2013, 21:56:59 »
I'll try to reformulate my above question:
1) Is it OK if I change the @range syntax to allow specifying that new "input method"? If so, is this form acceptable, or needs some changes:
@range x full [h [w]]
where x is a script variable, "full" specifies 32bit input, "h" means hexadecimal input, "w" means 32bit (word) alignment for the input value

2) Is it OK to display the whole hexadecimal number on these menu items? (this question is unrelated to the above)
Some menu text   [ 0x123ABCD]


Re: CHDK UI version 2.0 ?
« Reply #524 on: 27 / April / 2013, 22:46:36 »
@range x full [h [w]]
where x is a script variable, "full" specifies 32bit input, "h" means hexadecimal input, "w" means 32bit (word) alignment for the input value
I assume you are doing this to better enable test/debug scripts?  Doesn't look like something any of the end users would care about.  As long as the new code still allows the current @range syntax to also work,  I guess my one little vote would be "yes".

Having said that,  I'm not sure why you need the [w] - doesn't "full" automatically give you that?

Also,  to make it easy to read and understand (not to mention remember) why not use "hex" rather than "full" and skip the [h].  If you want decimal rather than hex,  use "dec" rather than "hex" ?

Quote
2) Is it OK to display the whole hexadecimal number on these menu items? (this question is unrelated to the above)
Some menu text   [ 0x123ABCD]
Kind of a big input field in a line that does not have a lot of width.  But I don't see any drawbacks.  What am I missing?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #525 on: 28 / April / 2013, 08:11:43 »
I assume you are doing this to better enable test/debug scripts?  Doesn't look like something any of the end users would care about.
I know, addresses, memory content and DIGIC poking is the intention.
Quote
As long as the new code still allows the current @range syntax to also work
it's still there of course
Quote
,  I guess my one little vote would be "yes".
Thx.
Quote
Having said that,  I'm not sure why you need the [w] - doesn't "full" automatically give you that?
"w" means word alignment (2 LSB is zero), useful for entering addresses
Quote
Also,  to make it easy to read and understand (not to mention remember) why not use "hex" rather than "full" and skip the [h].
Currently only 16bit integers are supported for input, "full" should mean to allow 32bit input instead. This can't coexist with the min and max limits currently supported by the @range directive (there is not enough space in the structure used for menu items), but I'm not missing those.
Quote
If you want decimal rather than hex,  use "dec" rather than "hex" ?
... or the lack of "hex" would default to decimal.

Quote
Quote
2) Is it OK to display the whole hexadecimal number on these menu items? (this question is unrelated to the above)
Some menu text   [ 0x123ABCD]
Kind of a big input field in a line that does not have a lot of width.  But I don't see any drawbacks.  What am I missing?
That's not an input field, it's there to inform the user about the value that is tied to that menu item.
I chose not to attempt inline editing because
- variable width fonts scared me off
- the menu navigation takes away buttons (& the scrollwheel) which would make editing less comfortable.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK UI version 2.0 ?
« Reply #526 on: 28 / April / 2013, 18:00:43 »
I'll try to reformulate my above question:

I think,
 - for power users and developers is this feature a good improvement.
 - for normal end users is this not necessary.

I tend also for a "yes". Maybe you could create a Lua function or library for special developer things.

msl
CHDK-DE:  CHDK-DE links

Re: CHDK UI version 2.0 ?
« Reply #527 on: 30 / April / 2013, 20:29:28 »
Finally was able to repeat one of the little menu annoyances I've seen often but not been able to nail down.

1) User Menu enabled in [On Direct] mode
2) Enter <ALT>
3) Click Set on the Main Menu item in the User Menu (first line)
4) Click Set again on any of the items in the Main Menu
5) Press the Menu button (normally this will cause you to exit the CHDK menus).
6) Notice that the previous menu from step 4 does not erase - the Main Menu draws on top of it.

This only works once when you enter <ALT> mode.  You have to exit <ALT> and re-enter to make it happen again.

Not a big deal but confusing when it happens the first couple of time.   When I have a few minutes I will look at it.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK UI version 2.0 ?
« Reply #528 on: 14 / May / 2013, 17:53:13 »
Next idea.

I'm thinking about enabling (simple) modules to draw on the screen while inactive.

To accomplish this, I'm using a function pointer which has a setter function. The setter function is exported, a module can use it to set a callback function (and un-set it prior to unloading).

The function pointer is checked and executed if not NULL in gui_draw_debug_vals_osd(). I'm using the existing gui_debug_display_modes[] array (core/gui.c) with an additional setting ("plugin") to enable/disable this display callback.

Potential uses are
- displaying special information about something the core doesn't support (example: my s1is port provides extra information about the movie frames while recording)
- enabling background display for my memory browser mod, so I can watch it while using the Canon UI
- I plan to port the EDMAC viewer from ML, it seems to be more useful when one can adjust camera settings while watching it
- ... ?

Proof of concept seems to work.

@WW
I'm also seeing menu glitches sometimes, it's not exclusive to user menu.

Re: CHDK UI version 2.0 ?
« Reply #529 on: 14 / May / 2013, 18:47:15 »
I'm also seeing menu glitches sometimes, it's not exclusive to user menu.
Just to be clear,  do you have the user menu enabled and you are seeing glitches in other menus?  Or is it disabled and you are seeing glitches?     (I only spent a little time looking at the code but I believe that what I saw is related to how the MENU key is handled in different menu modes)
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal