Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

gui_directory_button.cxx

Go to the documentation of this file.
00001 //  $Id: gui_directory_button.cxx,v 1.3 2003/01/08 23:14:59 grumbel Exp $
00002 //
00003 //  Construo - A wire-frame construction gamee
00004 //  Copyright (C) 2002 Ingo Ruhnke <[email protected]>
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 "gui_file_manager.hxx"
00021 #include "gui_directory_button.hxx"
00022 
00023 GUIDirectoryButton::GUIDirectoryButton (const std::string& arg_filename)
00024   : GUIFileButton (arg_filename)
00025 {
00026 }
00027 
00028 GUIDirectoryButton::~GUIDirectoryButton ()
00029 {
00030 }
00031 
00032 void
00033 GUIDirectoryButton::draw (GraphicContext* parent_gc)
00034 {
00035   //std::cout << "GUIDirectoryButton: " << filename << std::endl;
00036   parent_gc->draw_fill_rect (x_pos, y_pos, 
00037                              x_pos +  width, y_pos + height,
00038                              Color (0xBB0000FF));
00039 
00040   parent_gc->draw_string (x_pos + 40, y_pos + 20, "..:: Directory ::..");
00041   parent_gc->draw_string (x_pos + 30, y_pos + 40, filename);
00042 
00043   if (mouse_over)
00044     parent_gc->draw_rect (x_pos, y_pos, 
00045                           x_pos +  width, y_pos + height,
00046                           Color (0xFFFFFFFF));
00047   else
00048     parent_gc->draw_rect (x_pos, y_pos, 
00049                           x_pos +  width, y_pos + height,
00050                           Color (0xFF0000FF));
00051 }
00052 
00053 void
00054 GUIDirectoryButton::on_click()
00055 {
00056   std::cout << "Click on GUIDirectoryButton detected" << std::endl;
00057   GUIFileManager::instance()->open_directory(filename);
00058 }
00059 
00060 /* EOF */

Generated on Thu Jul 24 10:24:30 2003 for Construo by doxygen1.3-rc3