~ubuntu-branches/ubuntu/precise/guayadeque/precise

« back to all changes in this revision

Viewing changes to src/.svn/text-base/RatingCtrl.h.svn-base

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-05-14 15:08:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110514150803-8b5evqetnaj35j34
Tags: 0.3.1~dfsg0-1
* New upstream release.
* Strip wxsqlite3 stuff out of upstream's tarballs.
* Update get-orig-source target in debian/rules.
* Update gbp config file.
* Bump Standards.
* Build-depend on libwxsqlite3-2.8-dev
* Enable parallel builds.
* Link binaries against the system-wide copy of wxsqlite3.
* Point sources to the correct wxcurl's headers location.
* Update copyright file as per DEP-5
* Improve debian/watch to handle the ~dfsg\d* suffix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -------------------------------------------------------------------------------- //
2
 
//      Copyright (C) 2008-2010 J.Rios
3
 
//      anonbeat@gmail.com
4
 
//
5
 
//    This Program is free software; you can redistribute it and/or modify
6
 
//    it under the terms of the GNU General Public License as published by
7
 
//    the Free Software Foundation; either version 2, or (at your option)
8
 
//    any later version.
9
 
//
10
 
//    This Program is distributed in the hope that it will be useful,
11
 
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
 
//    GNU General Public License for more details.
14
 
//
15
 
//    You should have received a copy of the GNU General Public License
16
 
//    along with this program; see the file LICENSE.  If not, write to
17
 
//    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
//    http://www.gnu.org/copyleft/gpl.html
19
 
//
20
 
// -------------------------------------------------------------------------------- //
21
 
#ifndef RATINGCTRL_H
22
 
#define RATINGCTRL_H
23
 
 
24
 
#include <wx/control.h>
25
 
 
26
 
#define GURATING_STYLE_TINY     0
27
 
#define GURATING_STYLE_MID      1
28
 
#define GURATING_STYLE_BIG      2
29
 
 
30
 
#define GURATING_IMAGE_MINSIZE      12
31
 
#define GURATING_IMAGE_SEPARATION   1
32
 
#define GURATING_IMAGE_SIZE         GURATING_IMAGE_MINSIZE + GURATING_IMAGE_SEPARATION
33
 
 
34
 
class guRatingEvent : public wxNotifyEvent
35
 
{
36
 
public:
37
 
    guRatingEvent( wxEventType commandType = wxEVT_NULL, int winid = 0 )
38
 
        : wxNotifyEvent( commandType, winid )
39
 
    {
40
 
    };
41
 
 
42
 
    guRatingEvent( const guRatingEvent &clone )
43
 
            : wxNotifyEvent( clone )
44
 
    {
45
 
    };
46
 
 
47
 
    virtual wxEvent *Clone() const
48
 
    {
49
 
        return new guRatingEvent(*this);
50
 
    };
51
 
};
52
 
 
53
 
typedef void (wxEvtHandler::*guRatingEventFunction)(guRatingEvent&);
54
 
 
55
 
#define guRatingEventHandler(func) \
56
 
    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(guRatingEventFunction, &func)
57
 
 
58
 
 
59
 
#define guRATING_CHANGED_ID     1170
60
 
DECLARE_EVENT_TYPE( guEVT_RATING_CHANGED, guRATING_CHANGED_ID )
61
 
#define EVT_RATING_CHANGED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( guEVT_RATING_CHANGED, winid, wxID_ANY, wxRatingEventHandler(fn), (wxObject *) NULL ),
62
 
 
63
 
// -------------------------------------------------------------------------------- //
64
 
class guRating : public wxControl
65
 
{
66
 
  private :
67
 
    int             m_Rating;
68
 
    int             m_Style;
69
 
    wxBitmap *      m_NormalStar;
70
 
    wxBitmap *      m_SelectStar;
71
 
 
72
 
    DECLARE_EVENT_TABLE()
73
 
 
74
 
  protected :
75
 
    virtual wxSize  DoGetBestSize() const;
76
 
    void            OnPaint( wxPaintEvent &event );
77
 
    void            OnMouseEvents( wxMouseEvent &event );
78
 
 
79
 
  public :
80
 
    guRating( wxWindow * parent, const int style );
81
 
    ~guRating();
82
 
    void            SetRating( const int rating );
83
 
    int             GetRating( void );
84
 
 
85
 
};
86
 
 
87
 
 
88
 
#endif
89
 
// -------------------------------------------------------------------------------- //