Switch to gitea

This commit is contained in:
2025-07-03 15:49:14 -05:00
parent 4040dfe98f
commit 7199939260
32 changed files with 2820 additions and 94 deletions

View File

@ -12,7 +12,7 @@ namespace Tesses::Framework::SDL2::Views
public:
ButtonView();
ButtonView(std::string text);
virtual std::pair<int,int> PreferedMinSize();
};
}
#endif

View File

@ -0,0 +1,23 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
#include "ScrollableTextListView.hpp"
namespace Tesses::Framework::SDL2::Views
{
class DropDownView : public View {
GUIContainerPopup popup;
ScrollableTextListView listView;
bool hasSet=false;
protected:
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
DropDownView();
std::vector<std::string>& GetItems();
void SetIndex(int index);
int GetIndex();
};
}
#endif

View File

@ -0,0 +1,24 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class HScrollView : public View {
protected:
virtual void OnValueChanged(GUIEventArgs& e);
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
HScrollView();
HScrollView(uint64_t value, uint64_t min, uint64_t max,uint64_t step=1);
uint64_t value;
uint64_t min;
uint64_t max;
uint64_t step;
EventList<View*,GUIEventArgs&> ValueChanged;
std::pair<int,int> PreferedMinSize();
};
}
#endif

View File

@ -0,0 +1,27 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class HStackView : public ContainerView {
std::vector<std::pair<int,std::pair<View*,bool>>> items;
protected:
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
HStackView();
int spacing=0;
void Add(int sz, View* view, bool owns=true);
void Remove(View* view);
void Clear();
virtual size_t ViewCount();
virtual View* GetViewAt(size_t index);
virtual ~HStackView();
};
}
#endif

View File

@ -0,0 +1,27 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class MultilineEditTextView : public View {
protected:
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
std::string hint;
std::vector<std::string> lines;
SDL_Point topLeft={.x=0,.y=0};
SDL_Point cursorPos={.x=0,.y=0};
SDL_Point cursorEnd={.x=-1,.y=-1};
public:
MultilineEditTextView();
MultilineEditTextView(std::string hint);
virtual std::string GetHint();
virtual void SetHint(std::string hint);
virtual std::string GetText();
virtual void SetText(std::string text);
virtual void TypeText(std::string text);
virtual std::pair<int,int> PreferedMinSize();
};
}
#endif

View File

@ -0,0 +1,21 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class ScrollableTextListView : public View {
protected:
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
ScrollableTextListView();
size_t firstIndex;
int selected;
std::vector<std::string> items;
EventList<View*,GUIEventArgs&> ValueChanged;
};
}
#endif

View File

@ -15,6 +15,7 @@ namespace Tesses::Framework::SDL2::Views
int selected;
std::vector<std::string> items;
EventList<View*,GUIEventArgs&> ValueChanged;
};
}
#endif

View File

@ -0,0 +1,24 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class VScrollView : public View {
protected:
virtual void OnValueChanged(GUIEventArgs& e);
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
VScrollView();
VScrollView(uint64_t value, uint64_t min, uint64_t max,uint64_t step=1);
uint64_t value;
uint64_t min;
uint64_t max;
uint64_t step;
EventList<View*,GUIEventArgs&> ValueChanged;
std::pair<int,int> PreferedMinSize();
};
}
#endif

View File

@ -0,0 +1,29 @@
#pragma once
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "../GUI.hpp"
namespace Tesses::Framework::SDL2::Views
{
class VStackView : public ContainerView {
std::vector<std::pair<int,std::pair<View*,bool>>> items;
protected:
virtual void OnDraw(SDL_Renderer* renderer, SDL_Rect& r);
virtual bool OnEvent(SDL_Event& event, SDL_Rect& myBounds, SDL_Rect& visibleBounds);
public:
VStackView();
int spacing=0;
void Add(int sz, View* view, bool owns=true);
void Remove(View* view);
void Clear();
virtual size_t ViewCount();
virtual View* GetViewAt(size_t index);
virtual ~VStackView();
};
}
#endif