summaryrefslogtreecommitdiff
path: root/src/gui/preview/PreviewView.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-03-24 12:24:17 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-03-24 12:24:17 (GMT)
commit9b5b85f9b01cbda7ef9a7ec2a15b2a35630a5b9d (patch)
treeac7d040253b459ce102e476cb19ab59e3cfa90d7 /src/gui/preview/PreviewView.h
parent6bf98ccdca39936a3c51367862eed7c49f8786ec (diff)
parentbdc69f31c0be94191015838886bdcc2bc67f1acb (diff)
downloadpowder-9b5b85f9b01cbda7ef9a7ec2a15b2a35630a5b9d.zip
powder-9b5b85f9b01cbda7ef9a7ec2a15b2a35630a5b9d.tar.gz
Merge branch 'reorganisation' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/gui/preview/PreviewView.h')
-rw-r--r--src/gui/preview/PreviewView.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/gui/preview/PreviewView.h b/src/gui/preview/PreviewView.h
new file mode 100644
index 0000000..2fef5ac
--- /dev/null
+++ b/src/gui/preview/PreviewView.h
@@ -0,0 +1,74 @@
+#ifndef PREVIEWVIEW_H_
+#define PREVIEWVIEW_H_
+
+#include <vector>
+#include "Comment.h"
+#include "gui/interface/Window.h"
+#include "gui/preview/PreviewController.h"
+#include "gui/preview/PreviewModel.h"
+#include "gui/interface/Button.h"
+#include "gui/interface/Label.h"
+#include "gui/interface/Textbox.h"
+
+namespace ui
+{
+ class ScrollPanel;
+ class AvatarButton;
+}
+
+class VideoBuffer;
+class PreviewModel;
+class PreviewController;
+class PreviewView: public ui::Window {
+ class SubmitCommentAction;
+ class LoginAction;
+ class AutoCommentSizeAction;
+ PreviewController * c;
+ VideoBuffer * savePreview;
+ ui::Button * openButton;
+ ui::Button * browserOpenButton;
+ ui::Button * favButton;
+ ui::Button * reportButton;
+ ui::Button * submitCommentButton;
+ ui::Textbox * addCommentBox;
+ ui::Label * saveNameLabel;
+ ui::Label * authorDateLabel;
+ ui::AvatarButton * avatarButton;
+ ui::Label * pageInfo;
+ ui::Label * saveDescriptionLabel;
+ ui::Label * viewsLabel;
+ ui::Textbox * saveIDTextbox;
+ ui::ScrollPanel * commentsPanel;
+ std::vector<ui::Component*> commentComponents;
+ std::vector<ui::Component*> commentTextComponents;
+ int votesUp;
+ int votesDown;
+ bool doOpen;
+ bool showAvatars;
+
+ int commentBoxHeight;
+ float commentBoxPositionX;
+ float commentBoxPositionY;
+ float commentBoxSizeX;
+ float commentBoxSizeY;
+
+ void displayComments();
+ void commentBoxAutoHeight();
+ void submitComment();
+public:
+ void AttachController(PreviewController * controller);
+ PreviewView();
+ void NotifySaveChanged(PreviewModel * sender);
+ void NotifyCommentsChanged(PreviewModel * sender);
+ void NotifyCommentsPageChanged(PreviewModel * sender);
+ void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
+ virtual void OnDraw();
+ virtual void DoDraw();
+ virtual void OnTick(float dt);
+ virtual void OnTryExit(ExitMethod method);
+ virtual void OnMouseWheel(int x, int y, int d);
+ virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
+ virtual ~PreviewView();
+};
+
+#endif /* PREVIEWVIEW_H_ */