Skip to content

AddEntry

otvv edited this page Feb 27, 2020 · 8 revisions

CWidget::AddEntry

What it does:

This function adds a new entry inside the widget. In other words, it adds a option to a list.

Parameters:

This function takes a std::string and a optional unsigned int as arguments. The arguments are the entry name and the entry value (defaults to 0 or false)

NOTE: You don't need to set the entry value.

Widgets:

List of widgets that are using this function:

  • MultiBox
  • ListBox

Setting up a list

Here's how you can add a entry to one of these widgets.

I'll be using a ListBox as an example.

buildrPattern.Widget(ListBox).Title("ListBox").Font("Tahoma", 12).Position(30, 30).Size(200, 300)
.Entry("Entry 1")
.Entry("Entry 2")
.Entry("Entry 3")
.Entry("Entry 4")
.Entry("Entry 5")
.Entry("Entry 6")
.Entry("Entry 7")
.Entry("Entry 8")
.Entry("Entry 9")
.Entry("Entry 10")
.Spawn(Tab);

NOTE: There's an extra function added into the pattern: Entry. This function takes the name of the entry, but you see that I'm not setting a custom value, as I said, its not mandatory.

After adding this into my menu, I should have a ListBox with 10 entries.

You can call Entry() inside a loop, to make your life easier.


What's next?

Next you will learn about the AddEntry function.