Imported vanilla contents from upstream
[construo.git] / gui_window.cxx
blob506210b54be2185ecffae84ae05fac3b7e7b663b
1 // $Id: gui_window.cxx,v 1.3 2003/01/10 20:44:09 grumbel Exp $
2 //
3 // Construo - A wire-frame construction gamee
4 // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
5 //
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 #include "graphic_context.hxx"
21 #include "colors.hxx"
22 #include "gui_window.hxx"
23 #include "gui_label.hxx"
24 #include "gui_buttons.hxx"
26 void yes_press()
30 void no_press()
34 GUIWindow::GUIWindow (const std::string& t, int x, int y, int width, int height)
35 : GUIChildManager (x, y, width, height),
36 title (t)
38 mouse_over = true;
39 add (new GUILabel ("Do you really want to quit?", 10, 10, 100, 30));
40 add (new GUIGenericButton("Yes", 10, 50, 80, 25, yes_press));
41 add (new GUIGenericButton("No", 110, 50, 80, 25, no_press));
44 GUIWindow::~GUIWindow ()
48 void
49 GUIWindow::draw(GraphicContext* gc)
51 std::cout << "Window draw.." << mouse_over << std::endl;
52 /*if (mouse_over)
54 std::cout << "MOUSEOVER" << std::endl;
55 gc->draw_fill_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_bg_hover);
56 gc->draw_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_fg_hover);
58 else
60 std::cout << "MOUSEOVER NOT OVER" << std::endl;
61 gc->draw_fill_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_bg_passive);
62 gc->draw_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_fg_passive);
63 }*/
65 GUIChildManager::draw(gc);
68 /* EOF */