ui: statusbar
statusbar added, listen to status- , error- and parsingfinishedmessages
This commit is contained in:
@@ -15,6 +15,10 @@ CodeView::CodeSnippetParams::CodeSnippetParams()
|
||||
|
||||
bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b )
|
||||
{
|
||||
if(a.isActive && b.isActive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// sort active snippet first
|
||||
if(a.isActive)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ class MainView: public ViewLayout
|
||||
public:
|
||||
MainView();
|
||||
virtual ~MainView();
|
||||
|
||||
};
|
||||
|
||||
#endif // MAIN_VIEW_H
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "component/view/StatusBarView.h"
|
||||
|
||||
#include "component/controller/StatusBarController.h"
|
||||
|
||||
StatusBarView::StatusBarView(ViewLayout* viewLayout)
|
||||
: View(viewLayout, Vec2i(100,100))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
StatusBarView::~StatusBarView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string StatusBarView::getName() const
|
||||
{
|
||||
return "StatusBarView";
|
||||
}
|
||||
|
||||
StatusBarController* StatusBarView::getController()
|
||||
{
|
||||
return View::getController<StatusBarController>();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef STATUS_BAR_VIEW_H
|
||||
#define STATUS_BAR_VIEW_H
|
||||
|
||||
#include "component/view/View.h"
|
||||
|
||||
class StatusBarController;
|
||||
|
||||
class StatusBarView : public View
|
||||
{
|
||||
public:
|
||||
StatusBarView(ViewLayout* viewLayout);
|
||||
~StatusBarView(void);
|
||||
|
||||
virtual std::string getName() const;
|
||||
virtual void showMessage(const std::string& message, bool isError) = 0;
|
||||
protected:
|
||||
StatusBarController* getController();
|
||||
};
|
||||
|
||||
#endif //STATUS_BAR_VIEW_H
|
||||
@@ -16,6 +16,9 @@ public:
|
||||
template<typename T>
|
||||
static std::shared_ptr<T> create(ViewLayout* viewLayout);
|
||||
|
||||
template<typename T>
|
||||
static std::shared_ptr<T> createAndDontAddToLayout(ViewLayout* viewLayout);
|
||||
|
||||
View(ViewLayout* viewLayout, const Vec2i& minSize);
|
||||
virtual ~View();
|
||||
|
||||
@@ -60,6 +63,19 @@ std::shared_ptr<T> View::create(ViewLayout* viewLayout)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::shared_ptr<T> View::createAndDontAddToLayout(ViewLayout* viewLayout)
|
||||
{
|
||||
std::shared_ptr<T> ptr = std::make_shared<T>(viewLayout);
|
||||
|
||||
ptr->createWidgetWrapper();
|
||||
ptr->initView();
|
||||
|
||||
//viewLayout->addView(ptr.get());
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template <typename ControllerType>
|
||||
ControllerType* View::getController()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ class CodeView;
|
||||
class GraphView;
|
||||
class MainView;
|
||||
class SearchView;
|
||||
class StatusBarView;
|
||||
class ViewLayout;
|
||||
|
||||
class ViewFactory
|
||||
@@ -19,6 +20,7 @@ public:
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||
};
|
||||
|
||||
#endif // VIEW_FACTORY_H
|
||||
|
||||
Reference in New Issue
Block a user