1
// $Id: object_selector_window.hxx,v 1.2 2002/12/03 00:51:19 grumbel Exp $
3
// Pingus - A free Lemmings clone
4
// Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
6
// This program is free software; you can redistribute it and/or
7
// modify it under the terms of the GNU General Public License
8
// as published by the Free Software Foundation; either version 2
9
// of the License, or (at your option) any later version.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with this program; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef HEADER_PINGUS_EDITOR_OBJECT_SELECTOR_WINDOW_HXX
21
#define HEADER_PINGUS_EDITOR_OBJECT_SELECTOR_WINDOW_HXX
25
#include <ClanLib/GUI/window.h>
26
#include <ClanLib/GUI/button.h>
28
/** A Little window that lets you select an object type to insert */
29
class ObjectSelectorWindow : public CL_Window
32
typedef void (ObjectSelectorWindow::*Callback)();
36
ObjectSelectorWindow* parent;
39
CL_Slot button_click_slot;
42
ButtonPair (ObjectSelectorWindow* p, const std::string& name, Callback c, int y_pos)
45
button (CL_Rect(10, y_pos, 190, y_pos + 20), name, parent->get_client_area())
47
button_click_slot = button.sig_clicked().connect(this, &ButtonPair::on_click);
52
// Call the callback, yeah, func_ptr synaxt is cool...
53
((*parent).*callback)();
57
/** Position for the next inserted button */
60
/** container for buttons and callbacks */
61
std::vector<ButtonPair*> buttons;
64
ObjectSelectorWindow(CL_Component*);
65
~ObjectSelectorWindow();
67
void on_close_press();
69
void on_groundpiece_ground_press();
70
void on_groundpiece_solid_press();
71
void on_groundpiece_transparent_press();
72
void on_groundpiece_remove_press();
73
void on_hotspot_press();
74
void on_entrance_press();
76
void on_liquid_press();
77
void on_weather_press();
79
void on_worldobject_press();
80
void on_background_press();
81
void on_prefab_press();
82
void on_from_file_press();
85
void add_button (const std::string& name, Callback callback);
87
ObjectSelectorWindow (const ObjectSelectorWindow&);
88
ObjectSelectorWindow& operator= (const ObjectSelectorWindow&);