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¶
// 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
()¶For the contents list
Get the number of content lists.
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
Generate a string by control type and ID.
Get/Set the ID of the control.
- e_WinCtrlKind
kind
{ get; }¶Return the type of control.
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
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.
index = 0 … 7. Get the color. A control can have up to 8 texture parts, so you can have up to 8 colors.
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).
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.
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.
Get/Set the Texture ID.
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.
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.
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.
Get/Set the Texture part ID.
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.
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.
Get/Set the font type.
Get/Set the caption.
Get/Set the Caption ID. However, this does not affect caption.
Get/Set the caption color.
Set the display offset of the caption.
Set the spacing between content. In rich text, for example, this is the value between lines.
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.
true: Turns off the display of the control.
false: Show controls.
true: makes the control inoperable and darkens.
false: The control is normally visible.
true: makes the control inoperable(Not as dark as disable).
false: The control is normally visible.