watch_gui.h

Go to the documentation of this file.
00001 /* $Id: watch_gui.h 17678 2009-10-07 20:54:05  muxy $ */
00002 
00005 #ifndef WATCH_GUI_H
00006 #define WATCH_GUI_H
00007 
00008 #include "window_gui.h"
00009 #include "company_base.h"
00010 
00011 #define MAX_ACTIVITY 30
00012 
00013 enum WatchCompanyWidgets {
00014   EWW_CAPTION,
00015   EWW_PB_COMPANY_FIRST,
00016   EWW_PB_COMPANY_LAST  = EWW_PB_COMPANY_FIRST + MAX_COMPANIES - 1,
00017   EWW_HAS_CLIENT_FIRST,
00018   EWW_HAS_CLIENT_LAST = EWW_HAS_CLIENT_FIRST + MAX_COMPANIES - 1,
00019   EWW_ACTIVITY_FIRST,
00020   EWW_ACTIVITY_LAST = EWW_ACTIVITY_FIRST + MAX_COMPANIES - 1,
00021   EWW_PB_ACTION1_FIRST,
00022   EWW_PB_ACTION1_LAST = EWW_PB_ACTION1_FIRST + MAX_COMPANIES - 1,
00023   EWW_WATCH,
00024   EWW_ZOOMIN,
00025   EWW_ZOOMOUT,
00026   EWW_CENTER,
00027   EWW_NEW_WINDOW
00028 };
00029 
00030 class WatchCompany : public Window
00031 {
00032 
00033 protected:
00034 
00035   CompanyID watched_company;                            // Company ID beeing watched.
00036   int company_activity[MAX_COMPANIES];                  // int array for activity blot.
00037   int company_count_client[MAX_COMPANIES];              // company client count.
00038   char company_name[MAX_LENGTH_COMPANY_NAME_CHARS];     // company name for title display
00039 
00040   void SetWatchWindowTitle();
00041   void ScrollToTile(TileIndex tile);
00042 
00043 
00044 public:
00045 
00046   WatchCompany(const WindowDesc *desc, int window_number, CompanyID company_to_watch);
00047 
00048   virtual void SetStringParameters(int widget) const;
00049 //  virtual void OnPaint();
00050   virtual void DrawWidget(const Rect &r, int widget) const;
00051   virtual void OnClick(Point pt, int widget, int click_count);
00052   virtual void OnResize();
00053   virtual void OnScroll(Point delta);
00054   virtual void OnMouseWheel(int wheel);
00055   virtual void OnInvalidateData(int data, bool gui_scope);
00056   virtual void OnTick();
00057   
00058   void OnDoCommand(CompanyByte company, TileIndex tile);
00059 };
00060 
00061 void ShowWatchWindow(CompanyID company_to_watch);
00062 
00063 #endif // COMPANY_GUI_H