core/vgui/vgui_dialog_extensions.cxx
Go to the documentation of this file.
00001 // This is core/vgui/vgui_dialog_extensions.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author Gamze Tunali, LEMS, Brown University
00008 // \date   16 Nov 2007
00009 // \brief  See vgui_dialog_extensions.h for a description of this file.
00010 
00011 #include "vgui_dialog_extensions.h"
00012 #include <vgui/vgui.h>
00013 #include <vgui/internals/vgui_dialog_extensions_impl.h>
00014 
00015 //-----------------------------------------------------------------------------
00016 //
00017 // Default Constructor
00018 //
00019 
00020 vgui_dialog_extensions::vgui_dialog_extensions(const char* name)
00021 : vgui_dialog()
00022 {
00023   impl = vgui::produce_extension_dialog(name);
00024 }
00025 
00026 
00027 vgui_dialog_extensions::~vgui_dialog_extensions()
00028 {
00029   delete impl;
00030   impl = 0;//so base class doesn't crash
00031 }
00032 
00033 bool vgui_dialog_extensions::ask()
00034 {
00035   if (impl) {
00036     vgui_dialog_extensions_impl* my_impl = static_cast<vgui_dialog_extensions_impl*> (impl);
00037     return my_impl->ask();
00038   }
00039   return false;
00040 }
00041 
00042 void vgui_dialog_extensions::dir(const char* label, vcl_string& regexp, vcl_string& v)
00043 {
00044   if (impl) {
00045     vgui_dialog_extensions_impl* my_impl = static_cast<vgui_dialog_extensions_impl*> (impl);
00046     my_impl->dir_browser(label, regexp, v);
00047   }
00048 }
00049 
00050 void vgui_dialog_extensions::line_break()
00051 {
00052    if (impl) {
00053     vgui_dialog_extensions_impl* my_impl = static_cast<vgui_dialog_extensions_impl*> (impl);
00054     my_impl->line_break();
00055    }
00056 }