Browse Source

flush out textarea

master
Odilitime 5 years ago
parent
commit
3c2ecd2394
  1. 28
      src/graphics/elements/TEXTAREAElement.cpp
  2. 13
      src/graphics/elements/TEXTAREAElement.h

28
src/graphics/elements/TEXTAREAElement.cpp

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
#include "TEXTAREAElement.h"
#include "../components/InputComponent.h"
#include "../components/ButtonComponent.h"
#include "../components/DocumentComponent.h"
#include "../../Log.h"
#include "../../html/HTMLParser.h"
#include "../../FormData.h"
#include <ctime>
TEXTAREAElement::TEXTAREAElement() {
isInline = true;
}
std::unique_ptr<Component> TEXTAREAElement::renderer(const ElementRenderRequest &request) {
// const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int windowWidth, const int windowHeight
// what should our default size be?
//std::cout << "INPUTElement::renderer - creating InputComponent at " << x << "x" << y << std::endl;
TagNode *tagNode = dynamic_cast<TagNode*>(request.node.get());
if (tagNode) {
std::unique_ptr<InputComponent> inputComponent = std::make_unique<InputComponent>(0, 0, 250.0f, 52.0f, request.parentComponent->win->windowWidth, request.parentComponent->win->windowHeight);
inputComponent->node = tagNode;
inputComponent->multiLine = true;
//inputComponent->name = "textareaInput";
return std::move(inputComponent);
}
return nullptr;
}

13
src/graphics/elements/TEXTAREAElement.h

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
#ifndef TEXTAREAELEMENT_H
#define TEXTAREAELEMENT_H
#include "Element.h"
#include "../components/Component.h"
class TEXTAREAElement : public Element {
public:
TEXTAREAElement();
virtual std::unique_ptr<Component> renderer(const ElementRenderRequest &request);
};
#endif
Loading…
Cancel
Save