mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
搭建PVB架构,实现前端的基础布局、菜单、表格、图示等功能
This commit is contained in:
53
src/pv/PvPopWidget.h
Normal file
53
src/pv/PvPopWidget.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include "PvApp.h"
|
||||
#include "DataFields.h"
|
||||
|
||||
class PvPopWidget : public PvObject
|
||||
{
|
||||
public:
|
||||
struct ParamLine
|
||||
{
|
||||
std::string key;
|
||||
std::string type;
|
||||
std::string val;
|
||||
int widget;
|
||||
std::vector<std::string> items;
|
||||
ParamLine(std::string type, std::string key) : type(type), key(key) {}
|
||||
};
|
||||
|
||||
PvPopWidget(PARAM* p, int width, int height);
|
||||
|
||||
void addParamLineEdit(std::string key, std::string title, int x, int y, bool editable=true);
|
||||
|
||||
void addParamCombox(std::string key, std::string title, int x, int y, std::vector<std::string> items);
|
||||
|
||||
void setParamText(std::shared_ptr<ParamLine> line, std::string text);
|
||||
void setParamText(std::string key, std::string text);
|
||||
|
||||
void setCallbackConfirm(std::function<void()> callback) { callbackConfirm = callback; };
|
||||
|
||||
void setTitle(std::string title);
|
||||
|
||||
void setData(DataFields fields);
|
||||
DataFields getData();
|
||||
|
||||
void setLineGeometry(int wKey, int wVal, int h);
|
||||
|
||||
int width {800};
|
||||
int height {600};
|
||||
|
||||
int lineKeyWidth {70};
|
||||
int lineValWidth {180};
|
||||
int lineHeight {30};
|
||||
|
||||
struct {
|
||||
int widget;
|
||||
int title;
|
||||
} ui;
|
||||
|
||||
std::map<std::string, std::shared_ptr<ParamLine>> mapLines;
|
||||
DataFields data;
|
||||
|
||||
std::function<void()> callbackConfirm = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user