Best way to display text that dynamically changes

6 posts / 0 new
Last post
ktadd
ktadd's picture
Offline
Last seen: 1 year 2 months ago
Joined: 2010-12-01 01:20
Best way to display text that dynamically changes

I need advice on recommended says to display text that needs to be able to be dynamically changed. I've done of mock up of what I want to do using labels but labels appear to be constants and can't be updated dynamically (correct me if I'm wrong about that.) Here is a picture of what I'm trying to display.

IMAGE(http://www.os4coding.net/sites/default/files/video_info.jpg)

Approaches I've thought about are as follows:
1. Use a read only text gadget. (seems like a lot of overhead)
2. Use labels for the field titles and boarder-less buttons for the data fields. (alignment could be an issue)
3. Use buttons for labels and data fields.
4. Use string gadgets with no boarders. (less overhead than text gadget?)
5. Other suggestions??

Talking to myself but I ended up going with option 2. As I suspected alignment was a pain and it's not perfect but good enough. Her is how it ended up:
IMAGE(http://www.os4coding.net/sites/default/files/video_info_final.jpg)

File attachments: 

AttachmentSize
Image icon video_info.jpg28.18 KB
Image icon video_info_final.jpg26.32 KB
jabirulo
jabirulo's picture
Offline
Last seen: 6 hours 33 min ago
Joined: 2013-05-30 00:53
Re: Best way to display text that dynamically changes

I would prefeer/use "3. Use buttons for labels and data fields. as it easy to align/justify strings.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

ktadd
ktadd's picture
Offline
Last seen: 1 year 2 months ago
Joined: 2010-12-01 01:20
Re: Best way to display text that dynamically changes

@jubirulo

I would agree, but I did find out how to tweak label positions. :|
There is a justification tag for labels.
The thing I don't like about using buttons is the minimum space between button labels is to big. The above is as close as you can get them. Plus it just seems like using buttons for labels isn't ideal as it uses more overhead than simple labels. It's just that labels are so easy. To bad they are constants and can't be changed.

mritter0
mritter0's picture
Offline
Last seen: 2 years 4 months ago
Joined: 2014-04-21 21:15
Re: Best way to display text that dynamically changes

Use my InfoData gadget class in the Enhancer Pack. Designed just for your kind of need. There are some demos in the package.

jabirulo
jabirulo's picture
Offline
Last seen: 6 hours 33 min ago
Joined: 2013-05-30 00:53
Re: Best way to display text that dynamically changes

Don't know if you are using this mode/layout, but you can create 2 vertical groups (columns) inside VIDEO and align text to right/left, and set CHILD_WeightedWidth ,0 to shrink to its minimun. Not sure if it will work.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 6 hours 33 min ago
Joined: 2013-05-30 00:53
Re: Best way to display text that dynamically changes

This is a snippet that I use in snes9xGUI (contribution, not the oficial one) to show user AmigaInput/Keys defined, using Label/String classes:

  1. LAYOUT_AddChild, IIntuition->NewObject(LayoutClass, NULL, //"layout.gadget",
  2. LAYOUT_SpaceOuter, TRUE,
  3. //LAYOUT_SpaceInner, FALSE,
  4. LAYOUT_AddChild, IIntuition->NewObject(LayoutClass, NULL, //"layout.gadget",
  5. LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
  6. LAYOUT_SpaceOuter, TRUE,
  7. //LAYOUT_SpaceInner, FALSE,
  8. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  9. GA_ReadOnly,TRUE, STRINGA_TextVal,"H",
  10. TAG_DONE),
  11. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  12. LABEL_Text, "Left:",
  13. TAG_DONE),
  14. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  15. GA_ReadOnly,TRUE, STRINGA_TextVal,"K",
  16. TAG_DONE),
  17. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  18. LABEL_Text, "Right:",
  19. TAG_DONE),
  20. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  21. GA_ReadOnly,TRUE, STRINGA_TextVal,"U",
  22. TAG_DONE),
  23. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  24. LABEL_Text, "Up:",
  25. TAG_DONE),
  26. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  27. GA_ReadOnly,TRUE, STRINGA_TextVal,"J",
  28. TAG_DONE),
  29. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  30. LABEL_Text, "Down:",
  31. TAG_DONE),
  32. TAG_DONE), // END of buttons: left, right, up, down
  33. CHILD_ScaleWidth, 50,
  34. LAYOUT_AddChild, IIntuition->NewObject(LayoutClass, NULL, //"layout.gadget",
  35. LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
  36. LAYOUT_SpaceOuter, TRUE,
  37. //LAYOUT_SpaceInner, FALSE,
  38. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  39. GA_ReadOnly,TRUE, STRINGA_TextVal,"R",
  40. TAG_DONE),
  41. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  42. LABEL_Text, "A-button:",
  43. TAG_DONE),
  44. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  45. GA_ReadOnly,TRUE, STRINGA_TextVal,"T",
  46. TAG_DONE),
  47. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  48. LABEL_Text, "B-button:",
  49. TAG_DONE),
  50. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  51. GA_ReadOnly,TRUE, STRINGA_TextVal,"Y",
  52. TAG_DONE),
  53. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  54. LABEL_Text, "X-button:",
  55. TAG_DONE),
  56. LAYOUT_AddChild, IIntuition->NewObject(StringClass, NULL,
  57. GA_ReadOnly,TRUE, STRINGA_TextVal,"I",
  58. TAG_DONE),
  59. CHILD_Label, IIntuition->NewObject(LabelClass, NULL,
  60. LABEL_Text, "Y-button:",
  61. TAG_DONE),
  62. TAG_DONE), // END of buttons: A, B, X, Y

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments