File: TImageDisplay.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 12,264 kB
  • ctags: 5,235
  • sloc: cpp: 41,571; ansic: 3,978; sh: 1,420; makefile: 291
file content (83 lines) | stat: -rwxr-xr-x 3,277 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/** \file
	\brief Contains the TImageDisplay class, as well as the TMyImagePanel helper class
*/
#ifndef _TIMAGE_DISPLAY_H_
#define _TIMAGE_DISPLAY_H_

#include "main.h"
#include "ChildBase.h"
#include <wx/splitter.h>
#include <wx/spinctrl.h>
#include <wx/dirctrl.h>
#include <wx/image.h>

class TIMGreader ;
class TMyImagePanel ;
class TMyFileBox ;

/**	\class TImageDisplay
	\brief The image display module
*/
class TImageDisplay : public ChildBase
    {
    public :
    TImageDisplay(wxWindow *parent, const wxString& title) ; ///< Constructor
    ~TImageDisplay () ; ///< Destructor
    
    void initme () ; ///< Initialization
    virtual wxString getName () ; ///< Returns the image module name

    virtual void OnCB ( wxCommandEvent &event ) ; ///< Show labels event handler
    virtual void OnCBinvert ( wxCommandEvent &event ) ; ///< Invert image event handler
    virtual void OnDir ( wxCommandEvent &event ) ; ///< Choose directory event handler
    virtual void OnFile ( wxCommandEvent &event ) ; ///< File selection event handler
    virtual void OnCopy(wxCommandEvent &event); ///< The copy event handler
    virtual void OnPrint(wxCommandEvent &event); ///< The print event handler
    virtual void OnSave(wxCommandEvent &event); ///< The save event handler
    
    void ShowDir ( wxString s ) ; ///< Displays the list of files in the chosen directory

    TIMGreader *r ; ///< Pointer to the BioRad image reader class
    
    private :    
    TMyImagePanel *right ; ///< Pointer to the image display class
    wxListBox *lb ; ///< The list box containing the file list
    wxButton *bu ; ///< The directory button
    wxCheckBox *cb ; ///< The "Show labels" check box
    wxCheckBox *invert ; ///< The "Invert image" check box
    
    DECLARE_EVENT_TABLE()
    } ;
    
/**	\class TMyImagePanel
	\brief This class represents the actual image displayed by TImageDisplay
*/
class TMyImagePanel : public wxPanel
    {
    public :
    TMyImagePanel ( wxWindow *parent , int id = -1 ) ; ///< Constructor
    ~TMyImagePanel () ; ///< Destructor

    virtual void OnDraw(wxDC& pdc) ; ///< The draw event handler
    virtual void Refresh(bool eraseBackground = TRUE, const wxRect* rect = NULL) ; ///< Refresh the image display
    virtual void OnSize(wxSizeEvent &event) ; ///< The resize event handler
    virtual void OnPaint(wxPaintEvent& event) ; ///< The paint event handler

    virtual void OnEvent(wxMouseEvent& event); ///< The mouse event handler
    virtual void OnSaveAsBitmap(wxCommandEvent &event); ///< The "Save bitmap" context menu event handler
    virtual void OnCopy(wxCommandEvent &event); ///< The copy event handler
    virtual void OnPrint(wxCommandEvent &event); ///< The print event handler
    virtual void OnDummy(wxCommandEvent& WXUNUSED(event)){}; ///< The dummy event handler
    
    virtual void WriteIntoBitmap(wxBitmap &bmp2) ; ///< Converts an image into a bitmap

    wxBitmap *bmp ; ///< Pointer to current bitmap structure
    wxImage i ; ///< The current image
    wxString dir , file ;
    bool printing , show_text , invert ;
    TImageDisplay *imdi ; ///< The parent image display module

    DECLARE_EVENT_TABLE()
    } ;
    
#endif