00001 // $Id: gui_window.cxx,v 1.3 2003/01/10 20:44:09 grumbel Exp $ 00002 // 00003 // Construo - A wire-frame construction gamee 00004 // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de> 00005 // 00006 // This program is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU General Public License 00008 // as published by the Free Software Foundation; either version 2 00009 // of the License, or (at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this program; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 #include "graphic_context.hxx" 00021 #include "colors.hxx" 00022 #include "gui_window.hxx" 00023 #include "gui_label.hxx" 00024 #include "gui_buttons.hxx" 00025 00026 void yes_press() 00027 { 00028 } 00029 00030 void no_press() 00031 { 00032 } 00033 00034 GUIWindow::GUIWindow (const std::string& t, int x, int y, int width, int height) 00035 : GUIChildManager (x, y, width, height), 00036 title (t) 00037 { 00038 mouse_over = true; 00039 add (new GUILabel ("Do you really want to quit?", 10, 10, 100, 30)); 00040 add (new GUIGenericButton("Yes", 10, 50, 80, 25, yes_press)); 00041 add (new GUIGenericButton("No", 110, 50, 80, 25, no_press)); 00042 } 00043 00044 GUIWindow::~GUIWindow () 00045 { 00046 } 00047 00048 void 00049 GUIWindow::draw(GraphicContext* gc) 00050 { 00051 std::cout << "Window draw.." << mouse_over << std::endl; 00052 /*if (mouse_over) 00053 { 00054 std::cout << "MOUSEOVER" << std::endl; 00055 gc->draw_fill_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_bg_hover); 00056 gc->draw_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_fg_hover); 00057 } 00058 else 00059 { 00060 std::cout << "MOUSEOVER NOT OVER" << std::endl; 00061 gc->draw_fill_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_bg_passive); 00062 gc->draw_rect(x_pos, y_pos, x_pos + width, y_pos + height, Colors::button_fg_passive); 00063 }*/ 00064 00065 GUIChildManager::draw(gc); 00066 } 00067 00068 /* EOF */