~ubuntu-branches/ubuntu/natty/plee-the-bear/natty

« back to all changes in this revision

Viewing changes to plee-the-bear/src/ptb/frame/message_box.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge, Julien Jorge
  • Date: 2010-11-17 20:13:34 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101117201334-o4dp7uq437to7oxb
Tags: 0.5.1-1
[ Julien Jorge ]
* New upstream release (Closes: #565062, #546514).
* Add armhf architecture (Closes: #604689).
* Remove patches integrated upstream: rpath-editors.diff, rpath-game.diff,
  editors-menu-section.diff.
* Bump the Standard-Version, no changes.
* Update my email address.
* Set build dependency of libclaw to 1.6.0.
* Add the missing ${misc:Depends} in debian/control.
* List gettext translations in bear-factory.install and plee-the-bear.install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  Plee the Bear
3
3
 
4
 
  Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
 
4
  Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
5
5
 
6
6
  This program is free software; you can redistribute it and/or modify it
7
7
  under the terms of the GNU General Public License as published by the
30
30
#define __PTB_MESSAGE_BOX_HPP__
31
31
 
32
32
#include "ptb/frame/frame.hpp"
33
 
#include "ptb/frame/button.hpp"
34
 
#include "gui/picture.hpp"
35
 
#include "gui/static_text.hpp"
36
 
 
37
 
#include <string>
38
33
 
39
34
namespace ptb
40
35
{
48
43
  public:
49
44
    typedef unsigned int flags;
50
45
 
51
 
  private:
52
 
    typedef button< bear::gui::static_text, std::mem_fun_t<bool, message_box> >
53
 
    button_with_text;
54
 
 
55
46
  public:
56
47
    message_box( windows_layer* in_layer, const std::string& msg,
57
48
                 flags* buttons = NULL );
58
49
 
59
50
  private:
60
 
    bool on_key_press( const bear::input::key_info& key );
61
 
    bool on_button_press
62
 
    ( bear::input::joystick::joy_code button, unsigned int joy_index );
63
 
    bool on_mouse_move( const claw::math::coordinate_2d<unsigned int>& pos );
64
 
 
65
 
    bool on_ok();
66
 
    bool on_cancel();
67
 
    bool on_left();
68
 
    bool on_right();
69
 
 
70
 
    void position_cursor();
71
 
 
72
 
    void create_controls( const std::string& msg_key );
73
 
    void create_text
74
 
    ( const std::string& msg, bear::gui::static_text::font_type f );
75
 
    void create_buttons( bear::gui::static_text::font_type f );
76
 
    void position_buttons();
 
51
    void on_ok();
 
52
    void on_cancel();
 
53
 
 
54
    void create_controls( const std::string& msg );
 
55
    bear::gui::visual_component* create_text( const std::string& msg );
 
56
    bear::gui::visual_component* create_ok_button();
 
57
    bear::gui::visual_component* create_cancel_button();
77
58
 
78
59
  public:
79
60
    /** \brief Flag of the 'ok' button. */
86
67
    /** \brief The flags of the selected buttons. Serves also as result. */
87
68
    flags* m_flags;
88
69
 
89
 
    /** \brief Displayed text */
90
 
    bear::gui::static_text* m_text;
91
 
 
92
 
    /** \brief The cursor to select 'ok' or 'cancel'. */
93
 
    bear::gui::picture* m_cursor;
94
 
 
95
 
    /** \brief The position of the cursor. */
96
 
    unsigned int m_cursor_position;
97
 
 
98
 
    /** \brief The buttons. */
99
 
    std::vector<button_with_text*> m_button;
100
 
 
101
 
    /** \brief The margin between the controls. */
102
 
    const unsigned int m_margin;
103
 
 
104
70
  }; // class message_box
105
71
} // namespace ptb
106
72