Newer
Older
#ifndef MULTICOMPONENT_H
#define MULTICOMPONENT_H
#include "Component.h"
#include "../opengl/Window.h"
// we're a control with our own componentTree
// we can relay events down to these components
// can be used for documents, tabs and menus

Odilitime
committed
//
// this component is not scrollable
//
// 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);

Odilitime
committed
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>();
// handle to signal that a redraw is needed, and access to shader programs
// tabbed coordinate system?
bool tabbed = false;
// 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;
// if the component tree changes, we'll need these to recalculate hoverComponent
double cursorX = 0;
double cursorY = 0;
//extern const std::unique_ptr<Window> window;