CWinCtrlListboxEx

Script: LISTBOXEX

This is the control for the list box.

It has contents of the same number as the number of rows.

It can have a lot of contents as long as the remaining memory.

Not only the list box that is lined with content in the vertical direction , it is possible to arrange also in the horizontal direction .

Differences between the LISTBOX is to measure the content size automatically.

If the content is arranged in a vertical direction, it automatically calculate only height.

If the content is arranged in a horizontal direction, it automatically calculate only width.

Callbacks arriving at :class:`CWindowBase<CWindowBase>`

class CWinCtrlListboxEx

Functions / Properties

Vector2 viewsize { get; set; }

It is the size of the list box.It is equivalent to the size property.

Vector2 screensize { get; set; }

It is the size of the list box virtual screen.This value is the sum of all heights in the content list.

Vector2 offset { get; set; }

This value represents where the list box is pointing in the virtual screen. Set a value to move there instantly.If you want to move the animation smoothly,you can use setSmoothOffset .

Boolean isSwipe { get; }

This value determines whether the user is swiping.

void setSmoothOffset (Vector2 offset, Single spd)
Param Vector2 offset

Final offset you want to set

Param float spd

Veloccity

Vector2 smoothOffset { get; set; }

It behaves the same as when you call setSmoothOffset at a speed of 0.25 .

Boolean isSmoothScrolled { get; }

You can check this value with to see if you are during setSmoothOffset scrolling animation.

Vector2 getContentsOffset (Int32 index, e_Anchor eAnchor)
Param int index

Index of the content offset you want to get.

Param e_Anchor eAnchor

Specify where you want the content to be placed with the anchor

Specify where you want the content to be placed with the anchor.

If the contents of the list box are arranged in a horizontal direction

e_Anchor

Location

Bottom,LeftBottom,RightBottom

Offset value for the contents to be aligned with the bottom of the view.

Top,LeftTop,RightTop

Offset value for the contents to be aligned with the top of the view

Center,Left,Right

Offset value for the contents to be aligned with the center of the view

If the contents of the list box are arranged in a horizontal direction

e_Anchor

Location

Left,LeftBottom,LeftTop

Offset value for the contents to be aligned with the left of the view

Right,RightBottom,RightTop

Offset value for the contents to be aligned with the right of the view

Center,Top,Bottom

Offset value for the contents to be aligned with the center of the view

Example of use

override public void onUpdate() {
   // get control
   CWinCtrlListboxEx   lbPartys = find<CWinCtrlListboxEx>(LISTBOXEX_Partys);

   // set listbox contents num
   lbPartys.resize(10);

   // Refresh the status in a list box (In this case, 10 lines will be updated.)
   for (int i = 0;i < lbFriends.Count;++i) {
       // Get a single line of list box content.
       CWinContents contents = lbFriends.getContentsFromIndex(i);

       //Get BUTTON(Name)
       CWinCtrlButton btnName = contents.find<CWinCtrlButton>(BUTTON_Name);

       //Get ICON(Icon)
       CWinCtrlIcon icnName = contents.find<CWinCtrlIcon>(ICON_Icon);
   }
}