00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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