#include <dockwindow.h>
Inheritance diagram for MWidgets::DockWindow:
Public Member Functions | |
DockWindow () | |
Constructor. | |
virtual void | Create (Widget *parent, int x, int y, int w, int h, string caption) |
Create widgets window. | |
virtual WIDGET_TYPE | GetType () |
Returns class's identifier like WINDOW or BUTTON. | |
DOCKPOS | CheckDockPos (POINT *pPos, RECT *pRect) |
Check if cursor is over dock area. | |
DOCKPOS | GetDockPos () |
Return docking position. | |
float | GetLayout () |
Return docked layout. | |
void | SetLayout (float val) |
Set docked layout. | |
void | DockToLeft () |
Dock wndow to left. | |
void | DockToTop () |
Dock wndow to top. | |
void | DockToRight () |
Dock wndow to right. | |
void | DockToBottom () |
Dock wndow to bottom. | |
Protected Member Functions | |
virtual LRESULT | OnMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
Subclassing for overrides. | |
void | DrawGripper () |
Draw gripper or caption. | |
void | DrawDragFrame (RECT *pRect) |
Draw the drag rectangle around the current frame. | |
void | UnDock () |
Undock window. | |
void | Dock (DOCKPOS pos) |
Dock window. | |
Protected Attributes | |
bool | m_bDrawGripper |
IF window have no caption we draw gripper;. | |
Window * | m_pParent |
Pointer to parent widget;. | |
POINT | m_ptPrevMousePos |
Used for darwing drag rectangle. | |
RECT | m_rPrevRect |
bool | m_bDrag |
Used for darwing drag rectangle. Indicates that we drag window. | |
WORD | m_wDotPatternBmp [8] |
Used by DrawDragFrame() to draw the drag rectangle. | |
RECT | m_rPrevWndFloatSize |
Specify previous window floating size. | |
DOCKPOS | m_dpDocked |
Indicate window is docked or floating. | |
float | m_fLayout |
When docked indicate window length or width. | |
bool | m_bActive |
When window is docked show is it active or not. |
Definition at line 23 of file dockwindow.h.
MWidgets::DockWindow::DockWindow | ( | ) |
Constructor.
Definition at line 21 of file dockwindow.cpp.
References m_bDrag, m_bDrawGripper, m_dpDocked, m_fLayout, m_pParent, m_ptPrevMousePos, m_wDotPatternBmp, and MWidgets::NONE_DOCK.
DOCKPOS MWidgets::DockWindow::CheckDockPos | ( | POINT * | pPos, | |
RECT * | pRect | |||
) |
Check if cursor is over dock area.
pPos | [in] coordinates of cursor. | |
pRect | [out] rectangle with new docked window position. |
Definition at line 315 of file dockwindow.cpp.
References MWidgets::BOTTOM_DOCK, MWidgets::Window::GetBottomHeight(), MWidgets::Window::GetBottomWidth(), MWidgets::Widget::GetHwnd(), MWidgets::Window::GetLeftHeight(), MWidgets::Window::GetLeftWidth(), MWidgets::Window::GetRightHeight(), MWidgets::Window::GetRightWidth(), MWidgets::Window::GetTopHeight(), MWidgets::Window::GetTopWidth(), MWidgets::LEFT_DOCK, m_pParent, MWidgets::NONE_DOCK, MWidgets::RIGHT_DOCK, and MWidgets::TOP_DOCK.
Referenced by OnMessage().
void MWidgets::DockWindow::Create | ( | Widget * | parent, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
string | caption | |||
) | [virtual] |
Create widgets window.
w | new widget's width. | |
h | new widget's height. | |
caption | new widget's caption,if caption is empty - draws gripper. |
Definition at line 39 of file dockwindow.cpp.
References MWidgets::Widget::Create(), EXCEPT, MWidgets::Widget::GetHwnd(), MWidgets::Widget::GetType(), m_bActive, m_bDrag, m_bDrawGripper, m_dpDocked, m_fLayout, MWidgets::Widget::m_hWnd, m_pParent, MWidgets::NONE_DOCK, and MWidgets::WINDOW.
void MWidgets::DockWindow::Dock | ( | DOCKPOS | pos | ) | [protected] |
Dock window.
pos | docking position. |
Definition at line 444 of file dockwindow.cpp.
References MWidgets::BOTTOM_DOCK, MWidgets::Window::DockToBottom(), MWidgets::Window::DockToLeft(), MWidgets::Window::DockToRight(), MWidgets::Window::DockToTop(), MWidgets::LEFT_DOCK, m_dpDocked, m_pParent, MWidgets::NONE_DOCK, MWidgets::RIGHT_DOCK, MWidgets::TOP_DOCK, and MWidgets::Window::UpdateLayout().
Referenced by DockToBottom(), DockToLeft(), DockToRight(), DockToTop(), and OnMessage().
void MWidgets::DockWindow::DockToBottom | ( | ) |
Dock wndow to bottom.
Definition at line 488 of file dockwindow.cpp.
References MWidgets::BOTTOM_DOCK, Dock(), and UnDock().
void MWidgets::DockWindow::DockToLeft | ( | ) |
Dock wndow to left.
Definition at line 470 of file dockwindow.cpp.
References Dock(), MWidgets::LEFT_DOCK, and UnDock().
void MWidgets::DockWindow::DockToRight | ( | ) |
Dock wndow to right.
Definition at line 482 of file dockwindow.cpp.
References Dock(), MWidgets::RIGHT_DOCK, and UnDock().
void MWidgets::DockWindow::DockToTop | ( | ) |
Dock wndow to top.
Definition at line 476 of file dockwindow.cpp.
References Dock(), MWidgets::TOP_DOCK, and UnDock().
void MWidgets::DockWindow::DrawDragFrame | ( | RECT * | pRect | ) | [protected] |
Draw the drag rectangle around the current frame.
Definition at line 269 of file dockwindow.cpp.
References m_wDotPatternBmp.
Referenced by OnMessage().
void MWidgets::DockWindow::DrawGripper | ( | ) | [protected] |
Draw gripper or caption.
Definition at line 67 of file dockwindow.cpp.
References m_bDrawGripper, and MWidgets::Widget::m_hWnd.
Referenced by OnMessage().
DOCKPOS MWidgets::DockWindow::GetDockPos | ( | ) |
Return docking position.
Definition at line 402 of file dockwindow.cpp.
References m_dpDocked.
Referenced by MWidgets::Window::IsFirst(), MWidgets::Window::IsLast(), and MWidgets::Window::UpdateLayout().
float MWidgets::DockWindow::GetLayout | ( | ) |
WIDGET_TYPE MWidgets::DockWindow::GetType | ( | ) | [virtual] |
Returns class's identifier like WINDOW or BUTTON.
Implements MWidgets::Widget.
Definition at line 62 of file dockwindow.cpp.
References MWidgets::DOCKWINDOW.
LRESULT MWidgets::DockWindow::OnMessage | ( | HWND | hWnd, | |
UINT | message, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [protected, virtual] |
Subclassing for overrides.
Reimplemented from MWidgets::Widget.
Definition at line 86 of file dockwindow.cpp.
References MWidgets::BOTTOM_DOCK, CheckDockPos(), Dock(), DrawDragFrame(), DrawGripper(), MWidgets::Widget::GetHwnd(), MWidgets::Window::IsLast(), MWidgets::LEFT_DOCK, m_bDrag, m_bDrawGripper, m_dpDocked, MWidgets::Widget::m_hWnd, m_pParent, m_ptPrevMousePos, m_rPrevRect, m_rPrevWndFloatSize, MWidgets::NONE_DOCK, MWidgets::Widget::OnMessage(), MWidgets::RIGHT_DOCK, MWidgets::TOP_DOCK, UnDock(), and MWidgets::Window::UpdateLayout().
void MWidgets::DockWindow::SetLayout | ( | float | val | ) |
Set docked layout.
Definition at line 412 of file dockwindow.cpp.
References m_fLayout.
Referenced by MWidgets::Window::DockToBottom(), MWidgets::Window::DockToLeft(), MWidgets::Window::DockToRight(), and MWidgets::Window::DockToTop().
void MWidgets::DockWindow::UnDock | ( | ) | [protected] |
Undock window.
Definition at line 417 of file dockwindow.cpp.
References MWidgets::BOTTOM_DOCK, MWidgets::LEFT_DOCK, m_dpDocked, m_pParent, MWidgets::NONE_DOCK, MWidgets::RIGHT_DOCK, MWidgets::TOP_DOCK, MWidgets::Window::UndockFromBottom(), MWidgets::Window::UndockFromLeft(), MWidgets::Window::UndockFromRight(), MWidgets::Window::UndockFromTop(), and MWidgets::Window::UpdateLayout().
Referenced by DockToBottom(), DockToLeft(), DockToRight(), DockToTop(), and OnMessage().
bool MWidgets::DockWindow::m_bActive [protected] |
When window is docked show is it active or not.
Definition at line 35 of file dockwindow.h.
Referenced by Create().
bool MWidgets::DockWindow::m_bDrag [protected] |
Used for darwing drag rectangle. Indicates that we drag window.
Definition at line 30 of file dockwindow.h.
Referenced by Create(), DockWindow(), and OnMessage().
bool MWidgets::DockWindow::m_bDrawGripper [protected] |
IF window have no caption we draw gripper;.
Definition at line 26 of file dockwindow.h.
Referenced by Create(), DockWindow(), DrawGripper(), and OnMessage().
DOCKPOS MWidgets::DockWindow::m_dpDocked [protected] |
Indicate window is docked or floating.
Definition at line 33 of file dockwindow.h.
Referenced by Create(), Dock(), DockWindow(), GetDockPos(), OnMessage(), and UnDock().
float MWidgets::DockWindow::m_fLayout [protected] |
When docked indicate window length or width.
Definition at line 34 of file dockwindow.h.
Referenced by Create(), DockWindow(), GetLayout(), and SetLayout().
Window* MWidgets::DockWindow::m_pParent [protected] |
Pointer to parent widget;.
Definition at line 27 of file dockwindow.h.
Referenced by CheckDockPos(), Create(), Dock(), DockWindow(), OnMessage(), and UnDock().
POINT MWidgets::DockWindow::m_ptPrevMousePos [protected] |
Used for darwing drag rectangle.
Definition at line 28 of file dockwindow.h.
Referenced by DockWindow(), and OnMessage().
RECT MWidgets::DockWindow::m_rPrevRect [protected] |
RECT MWidgets::DockWindow::m_rPrevWndFloatSize [protected] |
Specify previous window floating size.
Definition at line 32 of file dockwindow.h.
Referenced by OnMessage().
WORD MWidgets::DockWindow::m_wDotPatternBmp[8] [protected] |
Used by DrawDragFrame() to draw the drag rectangle.
Definition at line 31 of file dockwindow.h.
Referenced by DockWindow(), and DrawDragFrame().