no scroll arrows on List Box with savegames

Started by selmiak, Sat 03/09/2011 21:56:54

Previous topic - Next topic

selmiak

I just made a new background for the list box from the default saveGUI and resized it. Now I tried it, saved a lot of files, and no scroll arrows appear. Do I have to add them manually?

Khris

Listboxes have an option called "ShowScrollArrows", just set that to "true".

selmiak

trust me, it is set to true! but after trying around even more I found out, that the ShowBorder has to be set to true too to show the arrows. But the arrows look ugly and don't fit to the rest of the dialog screen. Can I somehow have custom scollarrows?

Ghost

#3
Easy- just hide the custom scroll arrows on the ListBox again, make BUTTONS instead, and let them call ListBox.ScrollUp/Down. This gives you more freedom to place scroll arrows, too- and you can draw whatever fancy sprites you like ;)
IIRC scrolling is pretty much automated, so you won't even need to check if the list *can* be scrolled at the moment. (But correct me if I'm wrong)

abstauber's NineVerb template, by the way, does it just like that with it's "LucasArts"-style savegame listbox, if you need a code reference.

selmiak

cool, this works, thanks.
Can I also have a custom scrollbar, that shows where in the list you are with the sizedepended square and you can drag it to move through the list faster.

Ghost

Quote from: selmiak on Sun 04/09/2011 15:42:17
cool, this works, thanks.
Can I also have a custom scrollbar, that shows where in the list you are with the sizedepended square and you can drag it to move through the list faster.

If you can live with a horizontal bar, why not use a slider?

A vertical bar is more likely, though. One idea that comes to mind is using two buttons again- one showing a vertical bar, the other an indicator dot. You could calculate the position of the indicator on the bar by getting the listbox's current TopItem and comparing it to the number of entries- having entry 5 selected in a list with ten entries, for example, would place the indicator right in the middle. I'm pretty sure there's some formula for calculating this kind of "percentage-meter". A more code-savvy forumite can probably explain that better, but maybe this is already starter enough.

selmiak

okay, this moves to the back of my priority list now... judging from the aimed length of the game... noone will use so many saves that he will miss the slider bar ;)

SMF spam blocked by CleanTalk