view include/preview.h @ 22:92188f60323d default tip

Implement Masking function on Preview Dialog.
author pyon@macmini
date Sat, 04 Apr 2015 17:23:46 +0900
parents de222bc84e48
children
line wrap: on
line source

// Filename   : preview.h
// Last Change: 2015-04-03 11:34:20.
//

#ifndef __PREVIEW_H__
#define __PREVIEW_H__

#include "common.h"
class PreviewDialog;

// サムネイルパネル
class PThumbnailPanel : public wxPanel 
{
	private:
        PreviewDialog* m_parent;
        wxArrayString  m_imagefiles;
        wxArrayString  m_cachefiles;
        wxImageList    m_imageList;
	
	protected:
		wxStaticBitmap* m_bitmap0;
		wxStaticBitmap* m_bitmap1;
		wxStaticBitmap* m_bitmap2;
		wxStaticBitmap* m_bitmap3;
		wxStaticBitmap* m_bitmap4;
		wxStaticBitmap* m_bitmap5;
	
	public:
		PThumbnailPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ); 
		~PThumbnailPanel();

        void OnClick0( wxMouseEvent& WXUNUSED(event) );
        void OnClick1( wxMouseEvent& WXUNUSED(event) );
        void OnClick2( wxMouseEvent& WXUNUSED(event) );
        void OnClick3( wxMouseEvent& WXUNUSED(event) );
        void OnClick4( wxMouseEvent& WXUNUSED(event) );
        void OnClick5( wxMouseEvent& WXUNUSED(event) );
        void SetFiles( wxArrayString imagefiles, wxArrayString cachefiles, int select );	
        void SetImageList( int selected );
        void Preview( int n );
};

// プレビューダイアログ
class PreviewDialog : public wxDialog 
{
    DECLARE_EVENT_TABLE()
	private:
        int               m_preview;
        wxArrayString     m_imagefiles;
        wxArrayString     m_cachefiles;
        float             m_zoom;
        wxRect            m_mask1;
        wxRect            m_mask2;
        wxRect            m_mask3;
        wxRect            m_mask1old;
        wxRect            m_mask2old;
        wxRect            m_mask3old;
        int               cx, cy;
	
	protected:
        wxScrolledWindow* m_scrolledWindow;
		wxStaticBitmap*   m_bitmap;
        PThumbnailPanel*  m_thumbPanel;
        wxTextCtrl*       m_textInfo;
        wxButton*         m_buttonMaskPrint;
		wxButton*         m_buttonPrint;
		wxButton*         m_buttonClose;
	
	public:
		PreviewDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ); 
		~PreviewDialog();
	
        void SetFiles( wxArrayString imagefiles, wxArrayString cachefiles, int select );
        void SetZoom( float zoom );
        void SetPreviewImage( int n );
        void EnableMaskButton( bool flag );
        void OnWheel( wxMouseEvent& event );
        void OnDClick( wxMouseEvent& WXUNUSED(event) );
        void OnStartRGesture( wxMouseEvent& event );
        void OnEndRGesture( wxMouseEvent& event );
        void OnPrint( wxCommandEvent& WXUNUSED(event) );
        void OnMaskPrint( wxCommandEvent& WXUNUSED(event) );
        void SetMask1( wxRect rect ) { m_mask1 = rect; }
        void SetMask2( wxRect rect ) { m_mask2 = rect; }
        void SetMask3( wxRect rect ) { m_mask3 = rect; }
        void SetMask1Old( wxRect rect ) { m_mask1old = rect; }
        void SetMask2Old( wxRect rect ) { m_mask2old = rect; }
        void SetMask3Old( wxRect rect ) { m_mask3old = rect; }
};

enum {
    ID_PRINT = wxID_HIGHEST + 160,
    ID_MPRINT,
};

#endif //__PREVIEW_H__