You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.0 KiB

#include "Component.h"
//#include "../opengl/Window.h"
// we're a control with our own layers (each layer has it's own componentTree)
// we can relay events down to these components
// can be used for documents, tabs, menus and dropdowns?
// this component is not scrollable
class MultiComponent : public Component {
// Methods
MultiComponent(const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int passedWindowWidth, const int passedWindowHeight);
void updateMouse();
void render();
//void renderComponents(std::shared_ptr<Component> component);
//void renderDocumentComponents(std::shared_ptr<Component> component);
//void renderBoxComponents(std::shared_ptr<Component> component);
void renderComponentType(std::string str, std::shared_ptr<Component> component);
void resize(const int passedWindowWidth, const int passedWindowHeight);
std::shared_ptr<Component> searchComponentTree(const std::shared_ptr<Component> &component, const int passedX, const int passedY);
// Properties
// layers will replace rootComponent
std::vector<std::shared_ptr<Component>> layers; // each layer's root component
//std::shared_ptr<Component> rootComponent = std::make_shared<Component>();
// tabbed coordinate system?
bool tabbed = false;
bool windowed = false; // use window/ui picking
// we'll need a way to pass events down and up
// also how do we handle scroll?
// we'll need searchComponentTree for picking
std::shared_ptr<Component> hoverComponent = nullptr;
std::shared_ptr<Component> focusedComponent = nullptr;
std::shared_ptr<Component> relayKeyboardComponent = nullptr;
// components don't need this...
std::function<void(int w, int h)> onResize = nullptr;
// if the component tree changes, we'll need these to recalculate hoverComponent
double cursorX = 0;
double cursorY = 0;