Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F126293
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/util/gui/scroll-list.cpp b/util/gui/scroll-list.cpp
new file mode 100644
index 00000000..ddc3c2b2
--- /dev/null
+++ b/util/gui/scroll-list.cpp
@@ -0,0 +1,60 @@
+#include "util/bitmap.h"
+
+#include "scroll-list.h"
+#include "util/font.h"
+
+using namespace Gui;
+
+static const int GradientMax = 50;
+
+static int selectedGradientStart(){
+ static int color = Graphics::makeColor(19, 167, 168);
+ return color;
+}
+
+static int selectedGradientEnd(){
+ static int color = Graphics::makeColor(27, 237, 239);
+ return color;
+}
+
+ScrollList::ScrollList():
+currentIndex(0),
+fontSpacingX(0),
+fontSpacingY(0),
+currentPosition(0),
+scrollWait(0),
+selectedGradient(GradientMax, selectedGradientStart(), selectedGradientEnd()),
+useGradient(false),
+useHighlight(false){}
+
+ScrollList::ScrollList(const ScrollList &):
+currentIndex(0),
+fontSpacingX(0),
+fontSpacingY(0),
+currentPosition(0),
+scrollWait(0),
+selectedGradient(GradientMax, selectedGradientStart(), selectedGradientEnd()),
+useGradient(false),
+useHighlight(false){}
+
+ScrollList::~ScrollList(){}
+
+ScrollList & ScrollList::operator=(const ScrollList &){
+ return *this;
+}
+
+void ScrollList::act(){}
+
+void ScrollList::render(const Graphics::Bitmap &, const Font & font){}
+
+void ScrollList::addText(const std::string &){}
+
+void ScrollList::addText(const std::vector< std::string > &){}
+
+bool ScrollList::next(){
+ return true;
+}
+
+bool ScrollList::previous(){
+ return true;
+}
\ No newline at end of file
diff --git a/util/gui/scroll-list.h b/util/gui/scroll-list.h
new file mode 100644
index 00000000..2823c03b
--- /dev/null
+++ b/util/gui/scroll-list.h
@@ -0,0 +1,82 @@
+#ifndef _gui_scroll_list_h
+#define _gui_scroll_list_h
+
+#include <string>
+#include <vector>
+
+#include "coordinate.h"
+
+#include "../gradient.h"
+#include "../file-system.h"
+
+class Font;
+
+namespace Gui{
+
+class ScrollList {
+ public:
+ ScrollList();
+
+ ScrollList(const ScrollList &);
+
+ virtual ~ScrollList();
+
+ //! copy
+ ScrollList & operator=(const ScrollList &);
+
+ //! Logic
+ virtual void act();
+
+ //! Render
+ virtual void render(const Graphics::Bitmap &, const Font & font);
+
+ //! Add text
+ virtual void addText(const std::string &);
+
+ //! Add vector of text (replaces current text in the text vector)
+ virtual void addText(const std::vector< std::string > &);
+
+ //! Next
+ virtual bool next();
+
+ //! Previous
+ virtual bool previous();
+
+ //! Get current index
+ virtual inline unsigned int getCurrentIndex(){
+ return this->currentIndex;
+ }
+
+ private:
+
+ //! Text
+ std::vector< std::string > text;
+
+ //! Current index
+ unsigned int currentIndex;
+
+ //! Coordinates (size of)
+ Gui::Coordinate position;
+
+ //! Font Spacing
+ int fontSpacingX, fontSpacingY;
+
+ //! Current position for smooth scrolling
+ int currentPosition;
+
+ //! Scroll wait
+ int scrollWait;
+
+ //! Gradient for selected cursor
+ Effects::Gradient selectedGradient;
+
+ //! Use gradient
+ bool useGradient;
+
+ //! Use highlight
+ bool useHighlight;
+};
+
+}
+
+#endif
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 11, 11:11 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68663
Default Alt Text
(3 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline