~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/widgets/IconBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
ImportĀ upstreamĀ versionĀ 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// C++ Interface: IconBase
 
3
//
 
4
// Description: 
 
5
//
 
6
//
 
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2005
 
8
//
 
9
// This program is free software; you can redistribute it and/or modify
 
10
// it under the terms of the GNU General Public License as published by
 
11
// the Free Software Foundation; either version 2 of the License, or
 
12
// (at your option) any later version.
 
13
// 
 
14
// This program is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
// GNU General Public License for more details.
 
18
// 
 
19
// You should have received a copy of the GNU General Public License
 
20
// along with this program; if not, write to the Free Software
 
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
 
22
//
 
23
#ifndef EMBEROGREICONBASE_H
 
24
#define EMBEROGREICONBASE_H
 
25
 
 
26
#include "components/ogre/EmberOgrePrerequisites.h"
 
27
#include <CEGUI.h>
 
28
 
 
29
namespace EmberOgre {
 
30
namespace Gui {
 
31
 
 
32
/**
 
33
Use this class as base for more advanced buttons where you want a "roll over" effect.
 
34
 
 
35
@author Erik Hjortsberg
 
36
*/
 
37
class IconBase{
 
38
public:
 
39
 
 
40
    /**
 
41
     * Default constructor.
 
42
     * @param name the name of the icon
 
43
     * @param background the image for the background, will always be shown
 
44
     * @param foreground the image for the foreground, will always be shown
 
45
     * @param borderInactive the image for the border when active (i.e. rolled over). Will only be active when rolled over.
 
46
     * @param borderActive the image for the border when inactive (i.e. not rolled over). Will only be active when not rolled over.
 
47
     * @param size The size of the icon. Defaults to 48x48px.
 
48
     * @return 
 
49
     */
 
50
    IconBase(const std::string& name, const CEGUI::Image* background, const CEGUI::Image* foreground, const CEGUI::Image* borderInactive, const CEGUI::Image* borderActive, CEGUI::UVector2 size = CEGUI::UVector2(CEGUI::UDim(0, 48), CEGUI::UDim(0, 48)));
 
51
 
 
52
    ~IconBase();
 
53
    
 
54
    /**
 
55
     * Returns a pointer to the container which holds the button. If you want to attach to event etc. use this one.
 
56
     * @return 
 
57
     */
 
58
    CEGUI::Window* getContainer();
 
59
        CEGUI::PushButton* getButton();
 
60
        
 
61
        void setForeground(const CEGUI::Image* image);
 
62
        
 
63
    static const CEGUI::Image* loadImageFromImageset(const std::string & imagesetName, const std::string & image);
 
64
 
 
65
protected:
 
66
        CEGUI::Window* mContainer;
 
67
        CEGUI::PushButton* mButton;
 
68
};
 
69
}
 
70
}
 
71
 
 
72
#endif