value
This commit is contained in:
parent
e9afde5216
commit
b96faacf89
4 changed files with 39 additions and 0 deletions
|
|
@ -62,6 +62,21 @@ namespace Crafter {
|
|||
return CppDOMBindings::HasClass(ptr, className);
|
||||
}
|
||||
|
||||
std::string HtmlElementView::GetValue() {
|
||||
const char* value = CppDOMBindings::GetValue(ptr);
|
||||
if(value != nullptr) {
|
||||
std::string result(value);
|
||||
std::free(value);
|
||||
return result;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void HtmlElementView::SetValue(const std::string_view value) {
|
||||
CppDOMBindings::SetValue(ptr, value);
|
||||
}
|
||||
|
||||
std::int32_t HtmlElementView::AddClickListener(std::function<void(Crafter::MouseEvent)> callback) {
|
||||
std::int32_t id = CppDOMBindings::clickHandlerMaxId++;
|
||||
clickHandlers.push_back(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue