Skip to content
A-MC Creative Development

A-MC Creative Development

Programming, Music, Tech, Hardware, Amiga, Commodore, Retrogaming and probably much more :)

  • Home
  • SOFTWARE
    • Hollywood Source & Libraries
    • APPBuilder Tool
    • HFinder 2017
    • HGUI
    • GEMZ
    • White Dot
  • Allanon’s Music Corner
  • About Me
  • MANUALS
  • Hire Me!
  • Privacy Policy
  • Toggle search form

Working on the ListView class

Posted on June 15, 2015June 15, 2015 By allanon No Comments on Working on the ListView class

Hello,
here is the result of my recent working on the ListView class to bring some missing features.

Some time ago I’ve added support for Icons/Images in the ListView items but it was a raw implementation without configuration possibilities so I added some tags definible at creation time that allow to configure this feature at a deeper level. Here are the supported tags:

IconsSizeOffset
By default the icon size is equal to the row height (EntryHeight tag), using this argument you can adjust the icon/image size to suit your needs.

IconsXOffset
By default the icons is placed at x = 0, to the extreme left. Using this tag you can adjust the horizontal position.

IconsAsBackground
Defaults to False. If you set this tag to True the icon/image is used as the ListView’s row background.

Working on the ListView class
IconsAsBackground = FALSE (default)
Working on the ListView class
IconsAsBackground = TRUE

 

 

 

 

 

 

 

 

IconsMaximize
Defaults to False. With the default setting the icon/image will be resized (keeping the aspect ratio) so that it is entirely visible, but if the image size does not match with the aspected size you can have borders (transparent). Setting this tag to True the icon will be maximized so that you will not have borders but the image could be not entirely visible.

Working on the ListView class
IconsMaximize = FALSE (default)
Working on the ListView class
IconsMaximize = TRUE

 

 

 

 

 

 

 

 

IconsTextGap
Defaults to 0. It represent the space in pixels between the icon and the text.

IconsFixedTextOffset

Defaults to False. With the default setting, items with no icon/image will be rendered starting from the left so you can have not not prefectly aligned items. If you set this tag to True all items will be aligned.

Working on the ListView class
IconsFixedTextOffset = TRUE
Working on the ListView class
IconsFixedTextOffset = FALSE (default)

 

Working with ListViews I’ve also faced new problem.

Suppose you want to make a ListView with two columns, one with file names and one with file sizes: if you are goin’ to specify the file sizes in bytes it’s all fine.

But what happen if you try to pass the file sizes in (let’s say) kilobytes and adding the suffix ‘Kb’?

Well, if you convert by hand your values and you create the ListView you will see that when you click on the column header the sorting will mess up all your entries because they will be sorted as strings and, for example, in string sorting ’15Kb’ comes before ‘3Kb’. So how can we solve this thing?

I’ve implemented a new tag called ColumnHandlers, a table where you can specify your custom functions to convert values on the fly when the ListView is rendered. This implementation will easily solve our problem infact if we specify our values in bytes and we provide this converting function…

Function(value)
   Return((value/1024) .. "Kb")
EndFunction

…everytime the values in the specified columns are rendered the values are converted using the given functions, in our example the values are converted in kilobytes and the “Kb” string is added to the result.

Now when you click in the header button the sorting produce the expected result.

This implementation will also provide nice side effects, for example it’s easy to force a column to be rendered in uppercase characters using this method or in bold style or anything you like without influencing the original data and the sorting processes.

[wp_ad_camp_2]

I’ve also added these utility functions:

  • HGui.gadgetExistsByName(gadget_name)
    Returns True if a gadget with the given name exists, otherwise returns False.
  • HGui.validateGadgetStatus(status)
    Returns True if the given status is valid or not, this function is used internally during the gadget creation process.

I’ve also fixed these bugs:

  • Fixed a bug in the AltCode argument in window’s hotkeys detection
  • An exception was raised when trying to hide a window if there was only one window defined.

And that’s all for today!

[wp_ad_camp_2]
HGui, Hollywood, Programming

Post navigation

Previous Post: GLGalore, an OpenGL plugin for Hollywood
Next Post: Skyrim: From Past to Present Cover

Related Posts

My plans Hollywood
Progress Report: September Hollywood
Rewards Updated! Hollywood
Anyone need sha functions? Hollywood
Working on the second map Hollywood
What’s up? :) Hollywood

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Support me on Patreon!

My Patreon PageSupport me on Patreon!

Support with PayPal

Support me with a small donation!

Recent Posts

  • The last progress report of the year!
  • November’s round up!
  • Progress Report: September
  • “The Gate” Playable Demo has landed!

Categories

Archives

Recent Comments

  • allanon on AmiCloud Beta 04 released! The DropBox alternative
  • Paul Issegalö on AmiCloud Beta 04 released! The DropBox alternative
  • allanon on AppBuilder v2.0 released

My Music Page on Facebook

My Music Page on Facebook

My Twitter

My Tweets

I’m on Spotify and Soundcloud!

My Spotify PageListen to my music!
My Soundcloud PageListen to my music!
Privacy & Cookies : This site use cookies. Please take a moment to review our privacy policy. Our Cookie and Privacy Policy

Follow me on Mastodon

Mastodon.Uno

Copyright © 2026 A-MC Creative Development.

Powered by PressBook Masonry Dark

 

Loading Comments...