Page 1 of 1

Making list item focused 

Posted: Wed Mar 01, 2017 8:47 pm
by MegumiSawada
Hi
Focused.png
Focused.png (6.7 KiB) Viewed 8762 times
When one of the list item is focused in web page, the item looks something like top image.
I would like to make all the list item looks focused, like bottom image.
Is it possible to do so by setting some property or using theme/styles?

I appreciate your kind advice.

Best Regards,
Megumi Sawada

Re: Making list item focused 

Posted: Thu Mar 02, 2017 7:24 am
by jyoung
You can create a custom DrawStyle in your theme named DrawStyle1 (or whatever).
drawstyle.png
drawstyle.png (100.94 KiB) Viewed 8753 times
You can make this drawstyle look like your focused style.

Then attach that drawstyle to all your list items.

Code: Select all

#STD_INT := 1
dountil cond(#STD_INT > 5)
#STD_STRNG := "Hello " + #STD_INT.AsString
add_entry to_list(#List1)
#List1.CurrentItem.ThemeDrawStyle := DrawStyle1
#STD_INT += 1
enduntil
drawstyle list item.png
drawstyle list item.png (4.07 KiB) Viewed 8753 times
The list items will not be "focused" but they will look like it.

Hope this helps,
Joe

Re: Making list item focused 

Posted: Thu Mar 02, 2017 7:09 pm
by MegumiSawada
Hi Joe,

Thank you for your advice!
There might be some restrictions, but with custom DrawStyle ,it seems I can do similar things to what I wanted to.

Best Regards,
Megumi

Re: Making list item focused 

Posted: Fri Mar 03, 2017 4:31 am
by atostaine
Wouldn't you just mark every item as selected, and then the current draw style is used?

selectList #Grid
#grid.currentItem.selected := true
upd_Entry #grid
endSelect

Grid selection style has to be multiple.

I don't know for sure if upd_entry is required.

Art

Re: Making list item focused 

Posted: Fri Mar 03, 2017 10:23 am
by Stewart Marshall
You could set the items to be selected (UPD_ENTRY is not required), but this would change the moment you click in the list. The clicked item would become the FocusItem and all others would become Selected(False).

Far better then to use a DrawStyle as Joe suggested