~flosoft/s25rttr/trunk

« back to all changes in this revision

Viewing changes to src/ctrlMultiline.h

  • Committer: FloSoft
  • Date: 2014-04-25 15:35:50 UTC
  • Revision ID: flosoft@siedler25.org-20140425153550-9muu4vodhlqu58m0
committing subversion revision 9357 by FloSoft
astyle

modified:
s25client/trunk/
s25client/trunk/contrib/lua/lin32/include/
s25client/trunk/contrib/lua/lin64/include/
s25client/trunk/contrib/lua/mac/include/
s25client/trunk/contrib/lua/win32/include/
s25client/trunk/contrib/lua/win64/include/
s25client/trunk/driver/audio/SDL/src/
s25client/trunk/driver/src/
s25client/trunk/driver/video/GLFW/src/
s25client/trunk/driver/video/SDL/src/
s25client/trunk/driver/video/WinAPI/src/
s25client/trunk/src/
s25client/trunk/win32/
s25client/trunk/win32/prebuild-mutex/src/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: ctrlMultiline.h 7521 2011-09-08 20:45:55Z FloSoft $
 
1
// $Id: ctrlMultiline.h 9357 2014-04-25 15:35:25Z FloSoft $
2
2
//
3
3
// Copyright (c) 2005 - 2011 Settlers Freaks (sf-team at siedler25.org)
4
4
//
23
23
 
24
24
class ctrlMultiline : public Window
25
25
{
26
 
public:
27
 
 
28
 
        /// Breite der Scrollbar
29
 
        static const unsigned short SCROLLBAR_WIDTH = 20;
30
 
 
31
 
public:
32
 
        ctrlMultiline(Window *parent, unsigned int id, unsigned short x, unsigned short y, unsigned short width, unsigned short height, TextureColor tc, glArchivItem_Font *font, unsigned int format = 0);
33
 
 
34
 
        //void AddText(const std::string& text, unsigned int color);
35
 
        void AddString(const std::string& str, unsigned int color, bool scroll = true);
36
 
        unsigned GetLineCount() { return unsigned(lines.size()); }
37
 
        /// Gibt den index-ten Eintrag zur�ck
38
 
        const std::string& GetLine(const unsigned index) const { return lines[index].str; }
39
 
        void SetLine(const unsigned index, const std::string& str, unsigned int color);
40
 
 
41
 
        /// Schaltet Box ein und aus
42
 
        void EnableBox(const bool enable) { draw_box = enable; }
43
 
 
44
 
        virtual bool Msg_LeftDown(const MouseCoords& mc);
45
 
        virtual bool Msg_LeftUp(const MouseCoords& mc);
46
 
        virtual bool Msg_WheelUp(const MouseCoords& mc);
47
 
        virtual bool Msg_WheelDown(const MouseCoords& mc);
48
 
        virtual bool Msg_MouseMove(const MouseCoords& mc);
49
 
 
50
 
protected:
51
 
        virtual bool Draw_(void);
52
 
 
53
 
        void Resize_(unsigned short width, unsigned short height);
54
 
 
55
 
private:
56
 
 
57
 
        TextureColor tc;
58
 
        glArchivItem_Font *font;
59
 
        unsigned int format;
60
 
 
61
 
        
62
 
        struct Line
63
 
        {
64
 
                std::string str;
65
 
                unsigned int color;
66
 
        };
67
 
        /// Die ganzen Strings
68
 
        std::vector<Line> lines;
69
 
        /// Anzahl der Zeilen, die in das Control passen
70
 
        unsigned lines_in_control;
71
 
 
72
 
        /// Soll die Box gezeichnet werden?
73
 
        bool draw_box;
 
26
    public:
 
27
 
 
28
        /// Breite der Scrollbar
 
29
        static const unsigned short SCROLLBAR_WIDTH = 20;
 
30
 
 
31
    public:
 
32
        ctrlMultiline(Window* parent, unsigned int id, unsigned short x, unsigned short y, unsigned short width, unsigned short height, TextureColor tc, glArchivItem_Font* font, unsigned int format = 0);
 
33
 
 
34
        //void AddText(const std::string& text, unsigned int color);
 
35
        void AddString(const std::string& str, unsigned int color, bool scroll = true);
 
36
        unsigned GetLineCount() { return unsigned(lines.size()); }
 
37
        /// Gibt den index-ten Eintrag zur�ck
 
38
        const std::string& GetLine(const unsigned index) const { return lines[index].str; }
 
39
        void SetLine(const unsigned index, const std::string& str, unsigned int color);
 
40
 
 
41
        /// Schaltet Box ein und aus
 
42
        void EnableBox(const bool enable) { draw_box = enable; }
 
43
 
 
44
        virtual bool Msg_LeftDown(const MouseCoords& mc);
 
45
        virtual bool Msg_LeftUp(const MouseCoords& mc);
 
46
        virtual bool Msg_WheelUp(const MouseCoords& mc);
 
47
        virtual bool Msg_WheelDown(const MouseCoords& mc);
 
48
        virtual bool Msg_MouseMove(const MouseCoords& mc);
 
49
 
 
50
    protected:
 
51
        virtual bool Draw_(void);
 
52
 
 
53
        void Resize_(unsigned short width, unsigned short height);
 
54
 
 
55
    private:
 
56
 
 
57
        TextureColor tc;
 
58
        glArchivItem_Font* font;
 
59
        unsigned int format;
 
60
 
 
61
 
 
62
        struct Line
 
63
        {
 
64
            std::string str;
 
65
            unsigned int color;
 
66
        };
 
67
        /// Die ganzen Strings
 
68
        std::vector<Line> lines;
 
69
        /// Anzahl der Zeilen, die in das Control passen
 
70
        unsigned lines_in_control;
 
71
 
 
72
        /// Soll die Box gezeichnet werden?
 
73
        bool draw_box;
74
74
};
75
75
 
76
76
#endif /// !CTRLMULTILINE_H_INCLUDED