include/imageutils/imagevalidator.h

Go to the documentation of this file.
00001 
00002 // Name:        imagevalidator.h
00003 // Purpose:     wxImageValidator class
00004 // Author:      Julian Smart
00005 // Modified by:
00006 // Created:     July 27th 2007
00007 // RCS-ID:      $Id: imagevalidator.h,v 1.1 2007/07/31 21:24:53 anthemion Exp $
00008 // Copyright:   (c) Julian Smart
00009 // Licence:     wxWindows licence
00011 
00012 #ifndef _WX_IMAGEVALIDATORH__
00013 #define _WX_IMAGEVALIDATORH__
00014 
00015 #include "wx/valgen.h"
00016 #include "wx/image.h"
00017 #include "imageblock.h"
00018 
00019 #if wxUSE_VALIDATORS
00020 
00021 class WXDLLEXPORT wxImageValidator: public wxValidator
00022 {
00023     DECLARE_CLASS(wxImageValidator)
00024     DECLARE_EVENT_TABLE()
00025 public:
00026     wxImageValidator(wxImageBlock* imageBlock = NULL);
00027     wxImageValidator(const wxImageValidator& copyFrom);
00028     
00029     virtual ~wxImageValidator(){}
00030     
00031     // Make a clone of this validator (or return NULL) - currently necessary
00032     // if you're passing a reference to a validator.
00033     // Another possibility is to always pass a pointer to a new validator
00034     // (so the calling code can use a copy constructor of the relevant class).
00035     virtual wxObject *Clone() const { return new wxImageValidator(*this); }
00036     bool Copy(const wxImageValidator& val);
00037     
00038     // Called when the value in the window must be validated.
00039     // This function can pop up an error message.
00040     virtual bool Validate(wxWindow * WXUNUSED(parent)) { return true; }
00041     
00042     // Called to transfer data to the window
00043     virtual bool TransferToWindow();
00044     
00045     // Called to transfer data to the window
00046     virtual bool TransferFromWindow();
00047 
00048     // Respond to left click
00049     void OnLeftClick(wxMouseEvent& event);
00050     
00051 protected:
00052     
00053     // Initialize
00054     void Init();
00055     
00056     wxImageBlock*   m_imageBlock;
00057 
00058 private:
00059     // Cannot use
00060     //  DECLARE_NO_COPY_CLASS(wxImageValidator)
00061     // because copy constructor is explicitly declared above;
00062     // but no copy assignment operator is defined, so declare
00063     // it private to prevent the compiler from defining it:
00064     wxImageValidator& operator=(const wxImageValidator&);
00065 };
00066 
00067 #endif
00068   // wxUSE_VALIDATORS
00069 
00070 #endif
00071   // _WX_IMAGEVALIDATORH__

Generated on Wed May 6 19:20:19 2009 for AxTk by  doxygen 1.5.1