00001 // This is core/vgui/impl/win32/vgui_win32_statusbar.h 00002 #ifndef vgui_win32_statusbar_h_ 00003 #define vgui_win32_statusbar_h_ 00004 //: 00005 // \file 00006 // \brief The Win32 Application Programming Interfaces (API) implementation of vgui_statusbar. 00007 // \author Lianqing Yu 00008 // \date August 4, 2009 00009 // 00010 // Modifications: 00011 // August 4, 2009 Initial version 00012 00013 #include <vcl_string.h> 00014 #include <vcl_iosfwd.h> // for the declaration of vcl_ostream 00015 00016 #include <vgui/vgui_statusbar.h> 00017 #include <vgui/vgui_statusbuf.h> 00018 00019 #include <windows.h> 00020 00021 #define NUMSECTION 255 // A status bar can have a maximum of 255 sections. 00022 00023 class vgui_win32_statusbar : public vgui_statusbar 00024 { 00025 public: 00026 vgui_win32_statusbar(HWND hwndParent, int numPanes = 1); 00027 ~vgui_win32_statusbar(); 00028 00029 //: show or hide status bar. 00030 void setVisible(bool visible) { ShowWindow(hwnd_, visible?SW_SHOW:SW_HIDE); } 00031 00032 //: Get window handle of status bar 00033 HWND getWindowHandle() { return hwnd_; } 00034 00035 //: Append given text (of given length) to the status bar 00036 virtual int write(const char* text, int n); 00037 //: Append given text to the status bar 00038 virtual int write(const char* text); 00039 00040 vcl_string linebuffer; 00041 vgui_statusbuf *statusbuf; 00042 vcl_ostream out; 00043 00044 private: 00045 static int statusBarID; 00046 00047 HWND hwndParent_; //!< parent (main) window of the status bar. 00048 HWND hwnd_; 00049 int numPanes_; //!< number of panes (parts) 00050 }; 00051 00052 #endif // vgui_win32_statusbar_h_