CWinCtrlBase

All controls have inherited CWinCtrlBase.

CWinCtrlBase has common methods / properties of each control.

Control that inherits CWinCtrlBase is also one that has its own properties. Please refer to the description of each control about it.

About contents

By getContents(), you can access controls that are defined by the CONTENTS property.

The corresponding control: CHECKBOX , RADIO , CONTAINER

// Get the CONTAINER(Map)
CWinCtrlContainer      ctnMap = find<CWinCtrlContainer>(CONTAINER_Map);
CWinContents contents = ctnMap.getContents();
// Get the BUTTON(A) in contents
CWinCtrlButton btnA = contents.find<CWinCtrlButton>(BUTTON_A);

By CWindowBase.find and CWinContents.find , you can get the specific control on the contents.

CWinCtrlButton btnA = find<CWinCtrlButton>(BUTTON_A);

Contents list

List box have a lot of contents. To add a row in the list box, you need to duplicate the contents as a template. Therefore, the control with the same control ID exists on the contents list. To get a control on the contents list, it is necessary to identify the contents from the contents list.

In this case, you use the getContentsFromIndex(int index) .

It shows a typical code for access to the control in the list box.

// get the listbox control
CWinCtrlListbox     lbFriends = find<CWinCtrlListbox>(LISTBOX_Friends);

// set the listbox contents number
lbFriends.resize(10);

// update each contents in listbox(update 10 contents).
for (int i = 0;i < lbFriends.Count;++i) {
    // get the one column(= contents) from listbox
    CWinContents contents = lbFriends.getContentsFromIndex(i);

    CWInCtrlIcon icon = contents.find<CWinCtrlIcon>(ICON_Avatar);
class CWinCtrlBase

For the contents

CWinContents getContents ()
return CWinContents

Gets the contents defined by the CONTENTS properties.

For the contents list

Int32 count { get; }

Get the number of content lists.

void resize (Int32 num)
Param int num

Contents list

Set the number of content lists.

As the number of content lists increases, duplicate the content as needed as a template.

It does not work with elements in content lists that already exist.

CWinContents insert (Int32 pos)
Param int pos

Where to create and insert content into the content list.

Return CWinContents

:type:Content<CWinContents>` in the content list

Generate and insert content to a specific location in the content list.

CWinContents getContentsFromIndex (Int32 index)
Param int index

Index of the content you want to get in the content list.

Return CWinContents

:type:Content<CWinContents>` in the content list

Get from a content list by index.

Int32 getContentsIndex (CWinCtrlBase ctrl)

Returns the index of the content list that contains the specified control.If it is not in any content list element, -1 is returned.

Int32 getContentsIndex (CWinContents contents)

Returns the index of the content list that contains the specified content.If it is not in any content list element, -1 is returned.

Others

String ToString ()

Generate a string by control type and ID.

UInt32 id { get; set; }

Get/Set the ID of the control.

e_WinCtrlKind kind { get; }

Return the type of control.

Int32 priority { get; set; }

Get/Set the priority of the control.

Vector3 position { get; set; }

Set the coordinates of a control.

Vector2 absPosition { get; set; }

Get Control Coordinates From Window Base

Vector2 screenPosition { get; set; }

Get Control Coordinates From Screen Reference

Single width { get; set; }
Single height { get; set; }

Get/Set the size of the control.

Vector2 size { get; set; }

Get/Set the size of the control.

Vector2 contentsSize { get; set; }

Get/Set the size of the content.

WinColor getColor (Int32 index)

index = 0 … 7. Get the color. A control can have up to 8 texture parts, so you can have up to 8 colors.

void setColor (Int32 index, WinColor color)

index = 0 … 7. Set the color. A control can have up to 8 texture parts, so you can have up to 8 colors.

WinColor color { get; set; }

Get/set the color of texture part number 0.

WinColor color1 { get; set; }
WinColor color2 { get; set; }
WinColor color3 { get; set; }
WinColor color4 { get; set; }
WinColor color5 { get; set; }
WinColor color6 { get; set; }
WinColor color7 { get; set; }

Get/set the color of texture part number 1 (… 7).

void setTextureId (Int32 index, UInt32 texid)

index = 0 … 7. Set a specific texture ID.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture IDs.

WinColor getTextureId (Int32 index)

index = 0 … 7. Set a specific texture ID.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture IDs.

UInt32 texId { get; set; }
UInt32 texId1 { get; set; }

Get/Set the Texture ID.

void setPartId (Int32 index, UInt32 partId)

index = 0 … 7. Set a specific texture part ID.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture part IDs.

UInt32 getPartId (Int32 index)

index = 0 … 7. Set a specific texture part ID.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture part IDs.

void setTextureSize (Int32 index, Vector2 size)

index = 0 … 7. Set a specific texture part size.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture sizes.In particular, when index = 0, it is equivalent to accessing width, height.

UInt32 parts { get; set; }
UInt32 partId1 { get; set; }
UInt32 partId2 { get; set; }
UInt32 partId3 { get; set; }
UInt32 partId4 { get; set; }
UInt32 partId5 { get; set; }
UInt32 partId6 { get; set; }
UInt32 partId7 { get; set; }

Get/Set the Texture part ID.

void setTextureOffset (Int32 index, Vector2 offset)

index = 0 … 7. Set a specific texture part offset.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture part offsets.

Vector2 getTextureOffset (Int32 index)

index = 0 … 7. Set a specific texture part offset.Since a control can have up to 8 texture parts, it can also have 8 corresponding texture part offsets.

e_Anchor anchor { get; set; }

Get/Set the anchor for determining the origin position.

e_Anchor baseAnchor { get; set; }

Get/Set the base anchor that determines where the control’s origin will be.

e_Anchor textAnchor { get; set; }

Get/set the text anchor that determines where the caption’s origin will be.

UInt32 fontKind { get; set; }

Get/Set the font type.

String caption { get; set; }

Get/Set the caption.

UInt32 captionId { get; }

Get/Set the Caption ID. However, this does not affect caption.

WinColor captionColor { get; set; }

Get/Set the caption color.

Vector2 captionOffset { get; set; }

Set the display offset of the caption.

Single lineSpace { get; set; }

Set the spacing between content. In rich text, for example, this is the value between lines.

UInt32 SEId { get; set; }

Get/Set the ID of the SE assigned to the control.

CWinContents parent { get; set; }

Gets the content that contains the control.

CWinCtrlBase[] groups { get; }

Gets the GROUP that the control has.

CWindowBase window { get; }

Return the window that contains the control.

e_WinCtrlStyle style { get; }

Gets the style flag for a control.

Boolean hide { get; set; }

true: Turns off the display of the control.

false: Show controls.

Boolean disable { get; set; }
  • true: makes the control inoperable and darkens.

  • false: The control is normally visible.

Boolean nohit { get; set; }
  • true: makes the control inoperable(Not as dark as disable).

  • false: The control is normally visible.