core/vgui/vgui_dialog.cxx

Go to the documentation of this file.
00001 // This is core/vgui/vgui_dialog.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author Philip C. Pritchett, RRG, University of Oxford
00008 // \date   23 Oct 99
00009 // \brief  See vgui_dialog.h for a description of this file.
00010 
00011 #include "vgui_dialog.h"
00012 #include <vgui/vgui.h>
00013 #include <vgui/vgui_tableau_sptr.h>
00014 #include <vgui/internals/vgui_dialog_impl.h>
00015 
00016 //-----------------------------------------------------------------------------
00017 //
00018 // Default Constructor
00019 //
00020 
00021 vgui_dialog::vgui_dialog(const char* name)
00022 {
00023   // will eventually be
00024   impl = vgui::produce_dialog(name);
00025 }
00026 
00027 
00028 vgui_dialog::~vgui_dialog()
00029 {
00030   delete impl;
00031 }
00032 
00033 
00034 bool vgui_dialog::ask()
00035 {
00036   if (impl)
00037     return impl->ask();
00038 
00039   return false;
00040 }
00041 
00042 void vgui_dialog::checkbox(const char* txt, bool& v)
00043 {
00044   if (impl) impl->bool_field(txt, v);
00045 }
00046 
00047 
00048 void vgui_dialog::field(const char* txt, int& v)
00049 {
00050   if (impl) impl->int_field(txt, v);
00051 }
00052 
00053 
00054 void vgui_dialog::field(const char* txt, long& v)
00055 {
00056   if (impl) impl->long_field(txt, v);
00057 }
00058 
00059 void vgui_dialog::field(const char* txt, float& v)
00060 {
00061   if (impl) impl->float_field(txt, v);
00062 }
00063 
00064 void vgui_dialog::field(const char* txt, double& v)
00065 {
00066   if (impl) impl->double_field(txt, v);
00067 }
00068 
00069 void vgui_dialog::field(const char* txt, vcl_string& v)
00070 {
00071   if (impl) impl->string_field(txt, v);
00072 }
00073 
00074 void vgui_dialog::choice(const char* txt, const vcl_vector<vcl_string>& labels, int& v)
00075 {
00076   if (impl) impl->choice_field(txt, labels, v);
00077 }
00078 
00079 void vgui_dialog::choice(const char* label, const char* option1, const char* option2, int& chosen)
00080 {
00081   vcl_vector<vcl_string> strs;
00082   strs.push_back(option1);
00083   strs.push_back(option2);
00084   choice(label, strs, chosen);
00085 }
00086 
00087 void vgui_dialog::choice(const char* label, const char* option1, const char* option2, const char* option3, int& chosen)
00088 {
00089   vcl_vector<vcl_string> strs;
00090   strs.push_back(option1);
00091   strs.push_back(option2);
00092   strs.push_back(option3);
00093   choice(label, strs, chosen);
00094 }
00095 
00096 void vgui_dialog::file(const char* label, vcl_string& regexp, vcl_string& v)
00097 {
00098   if (impl) impl->file_browser(label, regexp, v);
00099 }
00100 
00101 void vgui_dialog::inline_file(const char* label,vcl_string& regexp,
00102                               vcl_string& v)
00103 {
00104   if (impl) impl->inline_file_browser(label, regexp, v);
00105 }
00106 
00107 void vgui_dialog::color(const char* label, vcl_string& v)
00108 {
00109   if (impl) impl->color_chooser(label, v);
00110 }
00111 
00112 void vgui_dialog::inline_color(const char* label, vcl_string& v)
00113 {
00114   if (impl) impl->inline_color_chooser(label, v);
00115 }
00116 
00117 void vgui_dialog::message(const char* txt)
00118 {
00119   if (impl) impl->text_message(txt);
00120 }
00121 
00122 void vgui_dialog::inline_tableau(const vgui_tableau_sptr tab, unsigned width,
00123                                  unsigned height)
00124 {
00125   if (impl) impl->inline_tab(tab, width, height);
00126 }
00127 
00128 void vgui_dialog::set_cancel_button(const char* txt)
00129 {
00130   if (impl) impl->set_cancel_button(txt);
00131 }
00132 
00133 void vgui_dialog::set_ok_button(const char* txt)
00134 {
00135   if (impl) impl->set_ok_button(txt);
00136 }
00137 
00138 void vgui_dialog::set_modal(const bool is_modal)
00139 {
00140   if (impl) impl->modal(is_modal);
00141 }

Generated on Mon Nov 23 05:11:58 2009 for core/vgui by  doxygen 1.5.1