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 // A widget for displaying a list of ShapesFrame's as a scrollable list
22 // of selectable thumbnails. Each thumbnail displays the frame's
23 // associated bitmap, altered with the specified mirror transformations.
26 #ifndef FRAMEBROWSER_H
27 #define FRAMEBROWSER_H
29 #include "wx/wxprec.h"
33 #include "ShapesElements.h"
35 DECLARE_EVENT_TYPE(wxEVT_FRAMEBROWSER, -1)
36 DECLARE_EVENT_TYPE(wxEVT_FRAMEBROWSER_DELETE, -1)
38 class FrameBrowser: public wxScrolledWindow {
40 vector<ShapesFrame*> mFrames; // pointers to frames
41 vector<ShapesBitmap*> mBitmaps; // pointers to bitmaps
42 vector<wxBitmap> mThumbnails; // scaled/rendered frame thumbnails
43 ShapesColorTable *mColorTable; // which palette to use for display
44 vector<wxPoint> mThumbnailPositions; // thumbnail positions within window
45 wxCoord mThumbnailSize,
46 mMargin; // margin between thumbnails and window edges
54 unsigned int mFrozenCount;
56 wxBitmap CreateThumbnail(ShapesFrame *fp);
57 void UpdateVirtualSize(void);
60 DECLARE_EVENT_TABLE();
63 FrameBrowser(wxWindow *parent, wxWindowID id);
65 void OnPaint(wxPaintEvent& e);
66 void OnSize(wxSizeEvent& e);
67 void OnMouseDown(wxMouseEvent& e);
68 void OnKeyDown(wxKeyEvent& e);
73 int GetSelection(void) const;
74 void SetThumbnailSize(int size);
75 void SetTranspPixelsDisplay(bool show);
76 void AddFrame(ShapesFrame *fp);
77 void AddBitmap(ShapesBitmap *bp);
78 void SetColorTable(ShapesColorTable *ct);
80 void ClearBitmaps(void);
82 void RebuildThumbnail(unsigned int i);
83 void RebuildThumbnails(void);