2 * This file is part of ShapeFusion (Copyright 2000 Tito Dal Canton)
4 * ShapeFusion is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * ShapeFusion is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with ShapeFusion; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 // An editor widget for sequence frames. It displays the frames of a
22 // sequence keeping them organized in views.
25 #ifndef SEQUENCEVIEW_H
26 #define SEQUENCEVIEW_H
28 #include "wx/wxprec.h"
32 #include "wx/docview.h"
33 #include "ShapesElements.h"
35 DECLARE_EVENT_TYPE(wxEVT_SEQUENCEVIEW, -1)
37 class SequenceView: public wxScrolledWindow {
39 vector<ShapesFrame*> mFrames; // pointers to frames
40 vector<ShapesBitmap*> mBitmaps; // pointers to bitmaps
41 vector<wxBitmap> mThumbnails; // scaled/rendered frame thumbnails
42 ShapesColorTable *mColorTable; // which palette to use for display
43 vector<wxPoint> mThumbnailPositions; // thumbnail positions within window
44 wxCoord mThumbnailSize,
45 mMargin, // margin between thumbnails and window edges
47 wxBitmap mPrevBtnIcon,
51 int mSelection; // selected thumbnail
59 vector<short> *mFrameIndexes;
61 wxBitmap CreateThumbnail(ShapesFrame *fp);
62 void UpdateVirtualSize(void);
64 void PopupFrameIndexDialog(int index);
67 wxRect GetNextArrowButtonRect(int thumbnail_index) const;
68 wxRect GetPrevArrowButtonRect(int thumbnail_index) const;
71 DECLARE_EVENT_TABLE();
74 SequenceView(wxWindow *parent, wxWindowID id);
76 void OnPaint(wxPaintEvent& e);
77 void OnSize(wxSizeEvent& e);
78 void OnMouseDown(wxMouseEvent& e);
79 void OnMouseMove(wxMouseEvent &e);
80 void OnMouseUp(wxMouseEvent& e);
81 void OnKeyDown(wxKeyEvent& e);
82 void OnMouseDoubleClick(wxMouseEvent& e);
84 int GetSelection(void) const;
85 void SetThumbnailSize(int size);
86 void SetTranspPixelsDisplay(bool show);
87 void AddFrame(ShapesFrame *fp);
88 void AddBitmap(ShapesBitmap *bp);
89 void SetColorTable(ShapesColorTable *ct);
90 void SetSeqParameters(int animtype, int fpv, vector<short> *indexes, wxView* view);
93 void RebuildThumbnail(unsigned int i);
94 void RebuildThumbnails(void);