|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - panel.h
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2021/11/01 (y/m/d)
|
|
|
|
|
* Mod Date - 2021/11/01 (y/m/d)
|
|
|
|
|
* Description - Base class for all editor panels
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef PANEL_H_
|
|
|
|
|
#define PANEL_H_
|
|
|
|
|
|
|
|
|
|
#include "panel_defs.h"
|
|
|
|
|
#include "panel_manager.h"
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
struct ImGuiInputTextCallbackData;
|
|
|
|
|
|
|
|
|
|
namespace lunarium
|
|
|
|
|
{
|
|
|
|
|
class Panel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Panel(std::string name, PanelDockZone dock_zone, bool isOpen = false);
|
|
|
|
|
virtual ~Panel();
|
|
|
|
|
const char* GetName() const;
|
|
|
|
|
|
|
|
|
|
virtual void Update(float dt);
|
|
|
|
|
virtual bool DoFrame() = 0;
|
|
|
|
|
void SetOpen(bool isOpen);
|
|
|
|
|
bool IsOpen();
|
|
|
|
|
void GetPosition(int& x, int& y) const;
|
|
|
|
|
void GetSize(int& w, int& h) const;
|
|
|
|
|
PanelDockZone GetDockZone() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
std::string mPanelName;
|
|
|
|
|
bool mIsOpen;
|
|
|
|
|
PanelDockZone mDockZone;
|
|
|
|
|
|
|
|
|
|
int mX;
|
|
|
|
|
int mY;
|
|
|
|
|
int mWidth;
|
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void UpdateMetaInfo();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class PanelManager;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // PANEL_H_
|