summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-crt.h
blob: c1c893126897833ad04ba978d1215da5429d303b (plain) (blame)
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
#ifdef USE_TILE_LOCAL
#ifndef TILEREG_CRT_H
#define TILEREG_CRT_H

#include "tilereg-text.h"

class CRTMenuEntry;
class PrecisionMenu;

/**
 * Expanded CRTRegion to support highlightable and clickable entries - felirx
 * The user of this region will have total control over the positioning of
 * objects at all times
 * The base class behaves like the current CRTRegion used commonly
 * It's identity is mapped to the CRT_NOMOUSESELECT value in TilesFramework
 *
 * Menu Entries are handled via pointers and are shared with whatever MenuClass
 * is using them. This is done to keep the keyboard selections in sync with mouse
 */
class CRTRegion : public TextRegion
{
public:

    CRTRegion(FontWrapper *font);
    virtual ~CRTRegion();

    virtual void render();
    virtual void clear();

    virtual int handle_mouse(MouseEvent& event);

    virtual void on_resize();

    void attach_menu(PrecisionMenu* menu);
    void detach_menu();
protected:
    PrecisionMenu* m_attached_menu;
};

/**
 * Enhanced Mouse handling for CRTRegion
 * The behaviour is CRT_SINGESELECT
 */
class CRTSingleSelect : public CRTRegion
{
public:
    CRTSingleSelect(FontWrapper* font);

    virtual int handle_mouse(MouseEvent& event);
};

#endif
#endif