00001 /* 00002 * Copyright (c) 2006 by Kirill Kolodyazhniy. 00003 * See the file "license.terms" for information on usage and redistribution 00004 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 00005 */ 00006 00007 #ifndef M_WINDOW_H 00008 #define M_WINDOW_H 00009 00010 namespace MWidgets 00011 { 00012 class DockWindow; 00014 class Window:public Widget 00015 { 00016 protected: 00017 std::vector<DockWindow*> m_vecLeft; 00018 std::vector<DockWindow*> m_vecTop; 00019 std::vector<DockWindow*> m_vecRight; 00020 std::vector<DockWindow*> m_vecBottom; 00021 int m_iLeftWidth; 00022 int m_iTopHeight; 00023 int m_iRightWidth; 00024 int m_iBottomHeight; 00025 00027 typedef struct 00028 { 00029 int offsetone; 00030 int offsettwo; 00031 } DockStartPos; 00032 std::map<int,DockStartPos> m_mapDockOrder; 00033 00034 protected: 00036 virtual LRESULT OnMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 00037 public: 00039 Window(); 00041 ~Window(); 00046 virtual void Create(int x,int y,int w,int h,string caption); 00048 virtual WIDGET_TYPE GetType(); 00050 void DockToLeft(DockWindow* pWnd); 00052 void DockToTop(DockWindow* pWnd); 00054 void DockToRight(DockWindow* pWnd); 00056 void DockToBottom(DockWindow* pWnd); 00058 void UndockFromLeft(DockWindow* pWnd); 00060 void UndockFromTop(DockWindow* pWnd); 00062 void UndockFromRight(DockWindow* pWnd); 00064 void UndockFromBottom(DockWindow* pWnd); 00066 int GetLeftWidth(); 00068 int GetLeftHeight(); 00070 int GetTopHeight(); 00072 int GetTopWidth(); 00074 int GetRightWidth(); 00076 int GetRightHeight(); 00078 int GetBottomHeight(); 00080 int GetBottomWidth(); 00083 RECT UpdateLayout(DockWindow *pWnd=NULL); 00085 bool IsFirst(DockWindow *pWnd); 00087 bool IsLast(DockWindow *pWnd); 00090 void ActivateDockWindows(bool bActivate); 00091 }; 00092 }; 00093 00094 #endif