core/vgui/internals/vgui_button_field.h
Go to the documentation of this file.
00001 // This is core/vgui/internals/vgui_button_field.h
00002 #ifndef vgui_button_field_h_
00003 #define vgui_button_field_h_
00004 
00005 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00006 #pragma interface
00007 #endif
00008 //:
00009 // \file
00010 // \author  Lianqing Yu
00011 // \brief   button control in a dialog.
00012 //
00013 // \verbatim
00014 //  Modifications
00015 //   02 Jan. 2010 initial version
00016 // \endverbatim
00017 
00018 #include "vgui_dialog_field.h"
00019 #include <vgui/vgui_command_sptr.h>
00020 
00021 //: button control in a dialog.
00022 //
00023 // vgui_button_field is a dialog field implementation that holds
00024 // information of a button control. Usually it contains a button label
00025 // and/or an icon/bitmap shown on the button.
00026 class vgui_button_field : public vgui_dialog_field
00027 {
00028  public:
00029   vgui_button_field(vgui_command_sptr c, const char *txt)
00030   : vgui_dialog_field(txt ? txt : ""), cmnd(c) {}
00031 
00032   ~vgui_button_field() {}
00033 
00034   vcl_string current_value() const { return "OK"; }
00035   bool update_value(const vcl_string& s) { return true; }
00036 
00037   // Pointer to the command to be executed.
00038   vgui_command_sptr cmnd;
00039 };
00040 
00041 #endif // vgui_button_field_h_