CWMCaptionPanel Class Reference

Search Toolkit Book for CWMCaptionPanel

#include <wm_caption_panel.hpp>

Inheritance diagram for CWMCaptionPanel:

Inheritance graph
[legend]
Collaboration diagram for CWMCaptionPanel:

Collaboration graph
[legend]
List of all members.

Detailed Description

CWMCaptionPanel - a container with a title bar (caption) hosting a single client window.

Color of the caption changes when one a client or on of it's child windows receives focus.

Definition at line 72 of file wm_caption_panel.hpp.

Public Types

enum  EStyle { eDefaultStyle, eHorzDockStyle, eVertDockStyle, eMaximizedStyle }

Public Member Functions

 CWMCaptionPanel (IWindowManager *manager, IWMClient *client=NULL)
 CWMCaptionPanel.
virtual ~CWMCaptionPanel ()
void SetStyle (EStyle style)
EStyle GetStyle () const
void SetClient (IWMClient *client)
IWMClientGetClient ()
const IWMClientGetClient () const
virtual void UpdateFocusState ()
virtual void Layout ()
virtual bool HasFocus ()
virtual void add (Fl_Widget *widget)
virtual void add (Fl_Widget &widget)
virtual void draw ()
virtual int handle (int event)
virtual void resize (int x, int y, int w, int h)
virtual bool OnCommand (const TCmdID CmdID)
virtual bool OnUpdateCommand (const TCmdID CmdID, ICmdUI *pCmdUI)
IMinMaxClient implementation
virtual EState GetState () const
virtual void SetState (EState state)
virtual EState GetStateBySize (const CPoint &size) const
virtual CPoint GetMinimalSize () const
virtual void UpdateButtons ()
 min size for eMinimized state

Protected Member Functions

 DECLARE_EVENT_MAP ()
void x_InitButtons ()
CButtonx_CreateButton (TCmdID id, const string &icon, const string &tooltip)
bool x_IsColorBoxVisible () const
CRect x_GetColorBoxFullRect () const
CRect x_GetIconFullRect () const
int x_GetFrameOff () const
void x_DrawCaption (Fl_Color cap_color)
void x_DrawIcon (Fl_Color cl_back, int &left, int &right)
void x_DrawColorBox (Fl_Color cl_back, int &left, int &right)
void x_DrawTitle (ESystemColors text_sys_cl, int left, int right)
void x_DrawButtons (Fl_Color cap_color)
void x_DrawClient ()
void x_OnButtonShowMenu ()
virtual void x_OnShowPopupMenu (int x, int y)
bool x_HasDockStyle () const
bool x_IsRotated () const
void x_Layout ()
bool x_OnMousePushRelease (int event)

Protected Attributes

IWindowManagerm_WindowManager
EStyle m_Style
IWMClientm_Client
int m_CaptionHeight
bool m_HasFocus
EState m_State
CGUIEvent m_Event
CButtonm_MenuBtn
CButtonm_MinBtn
CButtonm_MaxBtn
CButtonm_CloseBtn
vector< CButton * > m_Buttons
CPoint m_NormalSize
bool m_Rotated
bool m_PreserveNormalState
CFLTKImageHandle m_Icon


Member Enumeration Documentation

enum CWMCaptionPanel::EStyle
 

Enumerator:
eDefaultStyle 
eHorzDockStyle 
eVertDockStyle 
eMaximizedStyle 

Definition at line 78 of file wm_caption_panel.hpp.


Constructor & Destructor Documentation

CWMCaptionPanel::CWMCaptionPanel IWindowManager manager,
IWMClient client = NULL
 

CWMCaptionPanel.

Definition at line 51 of file wm_caption_panel.cpp.

References Layout(), SetClient(), and x_InitButtons().

CWMCaptionPanel::~CWMCaptionPanel  )  [virtual]
 

Definition at line 129 of file wm_caption_panel.cpp.

References SetClient().


Member Function Documentation

void CWMCaptionPanel::add Fl_Widget &  widget  )  [virtual]
 

Definition at line 261 of file wm_caption_panel.cpp.

void CWMCaptionPanel::add Fl_Widget *  widget  )  [virtual]
 

Definition at line 255 of file wm_caption_panel.cpp.

Referenced by SetClient(), and x_CreateButton().

CWMCaptionPanel::DECLARE_EVENT_MAP  )  [protected]
 

void CWMCaptionPanel::draw  )  [virtual]
 

Definition at line 269 of file wm_caption_panel.cpp.

References eSysColor_ActiveCaption, eSysColor_CaptionText, eSysColor_Control, eSysColor_ControlText, eSysColor_InactiveCaption, eSysColor_InactiveCaptionText, IWMClient::GetIcon(), CWidgetSettings::GetSystemColor(), HasFocus(), m_Buttons, m_CaptionHeight, m_Client, m_HasFocus, m_Icon, x_DrawButtons(), x_DrawCaption(), x_DrawClient(), x_DrawColorBox(), x_DrawIcon(), x_DrawTitle(), x_GetFrameOff(), x_HasDockStyle(), and x_IsRotated().

const IWMClient * CWMCaptionPanel::GetClient  )  const
 

Definition at line 182 of file wm_caption_panel.cpp.

References m_Client.

IWMClient * CWMCaptionPanel::GetClient  ) 
 

Definition at line 176 of file wm_caption_panel.cpp.

References m_Client.

Referenced by CWMTabControl::Insert(), CWindowManager::OnCaptionPanelCommand(), CWindowManager::OnMinimizeClient(), CWindowManager::OnRestoreMinimizedClient(), CWindowManager::OnSetClientColor(), CWindowManager::PostDockEvent(), CWindowManager::x_CascadeClose(), CWindowManager::x_GetClientByWidget(), CWindowManager::x_RestoreMaximized(), CWindowManager::x_UpdateDockCommand(), CWindowManager::x_UpdateMinMaxCommand(), and CWindowManager::x_WrapClientInTabControl().

CPoint CWMCaptionPanel::GetMinimalSize  )  const [virtual]
 

Implements IMinMaxClient.

Definition at line 227 of file wm_caption_panel.cpp.

References eVertDockStyle, m_Buttons, m_Style, and x_GetFrameOff().

Referenced by GetStateBySize().

CWMCaptionPanel::EState CWMCaptionPanel::GetState  )  const [virtual]
 

Implements IMinMaxClient.

Definition at line 536 of file wm_caption_panel.cpp.

References m_State.

Referenced by x_DrawClient(), x_Layout(), and CWindowManager::x_MoveToDockPos().

CWMCaptionPanel::EState CWMCaptionPanel::GetStateBySize const CPoint size  )  const [virtual]
 

Implements IMinMaxClient.

Definition at line 216 of file wm_caption_panel.cpp.

References IMinMaxClient::eMinimized, IMinMaxClient::eNormal, GetMinimalSize(), size, CPoint::X(), and CPoint::Y().

CWMCaptionPanel::EStyle CWMCaptionPanel::GetStyle  )  const
 

Definition at line 151 of file wm_caption_panel.cpp.

References m_Style.

int CWMCaptionPanel::handle int  event  )  [virtual]
 

Definition at line 457 of file wm_caption_panel.cpp.

References m_Event, CGUIEvent::OnFLTKEvent(), and x_OnMousePushRelease().

bool CWMCaptionPanel::HasFocus  )  [virtual]
 

Definition at line 245 of file wm_caption_panel.cpp.

Referenced by draw(), and UpdateFocusState().

void CWMCaptionPanel::Layout  )  [virtual]
 

Definition at line 204 of file wm_caption_panel.cpp.

References m_CaptionHeight, and x_Layout().

Referenced by CWMCaptionPanel().

bool CWMCaptionPanel::OnCommand const TCmdID  CmdID  )  [virtual]
 

Reimplemented from CCommandTarget.

Definition at line 672 of file wm_caption_panel.cpp.

References m_WindowManager, IWindowManager::OnCaptionPanelCommand(), and CCommandTarget::OnCommand().

Referenced by x_OnMousePushRelease().

bool CWMCaptionPanel::OnUpdateCommand const TCmdID  CmdID,
ICmdUI pCmdUI
[virtual]
 

Reimplemented from CCommandTarget.

Definition at line 682 of file wm_caption_panel.cpp.

References m_WindowManager, IWindowManager::OnCaptionPanelUpdateCommand(), and CCommandTarget::OnUpdateCommand().

Referenced by UpdateButtons().

void CWMCaptionPanel::resize int  x,
int  y,
int  w,
int  h
[virtual]
 

Definition at line 523 of file wm_caption_panel.cpp.

References IMinMaxClient::eNormal, m_PreserveNormalState, m_State, pythonpp::resize(), and x_Layout().

void CWMCaptionPanel::SetClient IWMClient client  ) 
 

Definition at line 157 of file wm_caption_panel.cpp.

References add(), IWMClient::GetWidget(), and m_Client.

Referenced by CWMCaptionPanel(), CWindowManager::x_RemoveClient(), and ~CWMCaptionPanel().

void CWMCaptionPanel::SetState EState  state  )  [virtual]
 

Definition at line 542 of file wm_caption_panel.cpp.

References eCmdCPanelMaximize, eCmdCPanelMinimize, eCmdCPanelRestoreMaximized, eCmdCPanelRestoreMinimized, IMinMaxClient::eMaximized, IMinMaxClient::eMinimized, m_MaxBtn, m_MinBtn, m_State, CButton::SetCommand(), CButton::SetImage(), CButton::SetTooltip(), UpdateButtons(), and x_HasDockStyle().

Referenced by CWindowManager::x_InsertClient(), CWindowManager::x_Maximize(), and CWindowManager::x_RestoreMaximized().

void CWMCaptionPanel::SetStyle EStyle  style  ) 
 

Definition at line 135 of file wm_caption_panel.cpp.

References m_Style, x_HasDockStyle(), x_InitButtons(), and x_Layout().

Referenced by CWindowManager::x_Maximize(), and CWMDockContainer::x_SetPanelStyleByDockPos().

void CWMCaptionPanel::UpdateButtons  )  [virtual]
 

min size for eMinimized state

Implements IMinMaxClient.

Definition at line 566 of file wm_caption_panel.cpp.

References m_Buttons, and OnUpdateCommand().

Referenced by SetState(), CSplitterEx::UpdateButtons(), and CWindowManager::x_InsertClient().

void CWMCaptionPanel::UpdateFocusState  )  [virtual]
 

Definition at line 189 of file wm_caption_panel.cpp.

References HasFocus(), and m_HasFocus.

CButton * CWMCaptionPanel::x_CreateButton TCmdID  id,
const string &  icon,
const string &  tooltip
[protected]
 

Definition at line 112 of file wm_caption_panel.cpp.

References add(), eSysColor_Control, CWidgetSettings::GetSystemColor(), m_Buttons, CButton::SetFlatDesign(), CButton::SetImage(), and CButton::SetTooltip().

void CWMCaptionPanel::x_DrawButtons Fl_Color  cap_color  )  [protected]
 

Definition at line 405 of file wm_caption_panel.cpp.

References ITERATE, and m_Buttons.

Referenced by draw().

void CWMCaptionPanel::x_DrawCaption Fl_Color  cap_color  )  [protected]
 

Definition at line 323 of file wm_caption_panel.cpp.

References eSysColor_Control, Fl_DrawRect(), Fl_FillRect(), CWidgetSettings::GetSystemColor(), CRect::Inflate(), CRect::Init(), m_CaptionHeight, CRect::SetTop(), CRect::Top(), x_GetFrameOff(), x_HasDockStyle(), and x_IsRotated().

Referenced by draw().

void CWMCaptionPanel::x_DrawClient  )  [protected]
 

Definition at line 415 of file wm_caption_panel.cpp.

References IMinMaxClient::eMinimized, GetState(), IWMClient::GetWidget(), m_CaptionHeight, m_Client, and x_HasDockStyle().

Referenced by draw().

void CWMCaptionPanel::x_DrawColorBox Fl_Color  cl_back,
int &  left,
int &  right
[protected]
 

Definition at line 368 of file wm_caption_panel.cpp.

References Fl_DrawRect(), Fl_FillRect(), IWMClient::GetColor(), CFltkUtils::GetFlColor(), CRect::Inflate(), m_Client, CRect::Right(), x_GetColorBoxFullRect(), and x_IsColorBoxVisible().

Referenced by draw().

void CWMCaptionPanel::x_DrawIcon Fl_Color  cl_back,
int &  left,
int &  right
[protected]
 

Definition at line 354 of file wm_caption_panel.cpp.

References CRect::Bottom(), Fl_DrawImage(), CRect::Left(), m_Client, m_Icon, CRect::Right(), CRect::Top(), and x_GetIconFullRect().

Referenced by draw().

void CWMCaptionPanel::x_DrawTitle ESystemColors  text_sys_cl,
int  left,
int  right
[protected]
 

Definition at line 387 of file wm_caption_panel.cpp.

References fl_draw_text(), IWMClient::GetClientLabel(), CWidgetSettings::GetSystemColor(), kMinLabelPixels, kOffsetX, m_CaptionHeight, m_Client, and x_GetFrameOff().

Referenced by draw().

CRect CWMCaptionPanel::x_GetColorBoxFullRect  )  const [protected]
 

Definition at line 442 of file wm_caption_panel.cpp.

References CRect::Bottom(), m_CaptionHeight, CRect::Right(), CRect::SetHeight(), CRect::SetLeft(), CRect::SetTop(), CRect::SetWidth(), size, x_GetIconFullRect(), and x_IsRotated().

Referenced by x_DrawColorBox().

int CWMCaptionPanel::x_GetFrameOff  )  const [protected]
 

Definition at line 311 of file wm_caption_panel.cpp.

References x_HasDockStyle().

Referenced by draw(), GetMinimalSize(), x_DrawCaption(), x_DrawTitle(), x_GetIconFullRect(), and x_Layout().

CRect CWMCaptionPanel::x_GetIconFullRect  )  const [protected]
 

Definition at line 428 of file wm_caption_panel.cpp.

References m_CaptionHeight, m_Icon, size, x_GetFrameOff(), and x_IsRotated().

Referenced by x_DrawIcon(), and x_GetColorBoxFullRect().

bool CWMCaptionPanel::x_HasDockStyle  )  const [protected]
 

Definition at line 575 of file wm_caption_panel.cpp.

References eHorzDockStyle, eVertDockStyle, and m_Style.

Referenced by draw(), SetState(), SetStyle(), x_DrawCaption(), x_DrawClient(), x_GetFrameOff(), and x_OnMousePushRelease().

void CWMCaptionPanel::x_InitButtons  )  [protected]
 

Definition at line 84 of file wm_caption_panel.cpp.

Referenced by CWMCaptionPanel(), and SetStyle().

bool CWMCaptionPanel::x_IsColorBoxVisible  )  const [protected]
 

Definition at line 317 of file wm_caption_panel.cpp.

References IWMClient::GetColor(), and m_Client.

Referenced by x_DrawColorBox().

bool CWMCaptionPanel::x_IsRotated  )  const [protected]
 

Definition at line 581 of file wm_caption_panel.cpp.

References m_Rotated.

Referenced by draw(), x_DrawCaption(), x_GetColorBoxFullRect(), x_GetIconFullRect(), x_Layout(), and x_OnMousePushRelease().

void CWMCaptionPanel::x_Layout  )  [protected]
 

Definition at line 587 of file wm_caption_panel.cpp.

References IMinMaxClient::eMinimized, eVertDockStyle, GetState(), IWMClient::GetWidget(), kBtnSize, m_Buttons, m_CaptionHeight, m_Client, m_Rotated, m_Style, x_GetFrameOff(), and x_IsRotated().

Referenced by Layout(), resize(), and SetStyle().

void CWMCaptionPanel::x_OnButtonShowMenu  )  [protected]
 

Definition at line 647 of file wm_caption_panel.cpp.

References m_MenuBtn, and x_OnShowPopupMenu().

bool CWMCaptionPanel::x_OnMousePushRelease int  event  )  [protected]
 

Definition at line 469 of file wm_caption_panel.cpp.

References _ASSERT, eCmdCPanelMaximize, eCmdCPanelMinimize, eCmdCPanelRestoreMaximized, eCmdCPanelRestoreMinimized, eCmdInvalid, IMinMaxClient::eMaximized, IMinMaxClient::eMinimized, IMinMaxClient::eNormal, CGUIEvent::ePopupSignal, CGUIEvent::GetGUISignal(), IWMClient::GetWidget(), m_CaptionHeight, m_Client, m_Event, m_State, OnCommand(), x_HasDockStyle(), x_IsRotated(), and x_OnShowPopupMenu().

Referenced by handle().

void CWMCaptionPanel::x_OnShowPopupMenu int  x,
int  y
[protected, virtual]
 

Definition at line 662 of file wm_caption_panel.cpp.

References _ASSERT, IWindowManager::GetCaptionPanelMenu(), m_WindowManager, and CPopupMenu::Popup().

Referenced by x_OnButtonShowMenu(), and x_OnMousePushRelease().


Member Data Documentation

vector<CButton*> CWMCaptionPanel::m_Buttons [protected]
 

Definition at line 164 of file wm_caption_panel.hpp.

Referenced by draw(), GetMinimalSize(), UpdateButtons(), x_CreateButton(), x_DrawButtons(), and x_Layout().

int CWMCaptionPanel::m_CaptionHeight [protected]
 

Definition at line 154 of file wm_caption_panel.hpp.

Referenced by draw(), Layout(), x_DrawCaption(), x_DrawClient(), x_DrawTitle(), x_GetColorBoxFullRect(), x_GetIconFullRect(), x_Layout(), and x_OnMousePushRelease().

IWMClient* CWMCaptionPanel::m_Client [protected]
 

Definition at line 153 of file wm_caption_panel.hpp.

Referenced by draw(), GetClient(), SetClient(), x_DrawClient(), x_DrawColorBox(), x_DrawIcon(), x_DrawTitle(), x_IsColorBoxVisible(), x_Layout(), and x_OnMousePushRelease().

CButton* CWMCaptionPanel::m_CloseBtn [protected]
 

Definition at line 163 of file wm_caption_panel.hpp.

CGUIEvent CWMCaptionPanel::m_Event [protected]
 

Definition at line 158 of file wm_caption_panel.hpp.

Referenced by handle(), and x_OnMousePushRelease().

bool CWMCaptionPanel::m_HasFocus [protected]
 

Definition at line 155 of file wm_caption_panel.hpp.

Referenced by draw(), and UpdateFocusState().

CFLTKImageHandle CWMCaptionPanel::m_Icon [protected]
 

Definition at line 169 of file wm_caption_panel.hpp.

Referenced by draw(), x_DrawIcon(), and x_GetIconFullRect().

CButton* CWMCaptionPanel::m_MaxBtn [protected]
 

Definition at line 162 of file wm_caption_panel.hpp.

Referenced by SetState().

CButton* CWMCaptionPanel::m_MenuBtn [protected]
 

Definition at line 160 of file wm_caption_panel.hpp.

Referenced by x_OnButtonShowMenu().

CButton* CWMCaptionPanel::m_MinBtn [protected]
 

Definition at line 161 of file wm_caption_panel.hpp.

Referenced by SetState().

CPoint CWMCaptionPanel::m_NormalSize [protected]
 

Definition at line 166 of file wm_caption_panel.hpp.

bool CWMCaptionPanel::m_PreserveNormalState [protected]
 

Definition at line 168 of file wm_caption_panel.hpp.

Referenced by resize().

bool CWMCaptionPanel::m_Rotated [protected]
 

Definition at line 167 of file wm_caption_panel.hpp.

Referenced by x_IsRotated(), and x_Layout().

EState CWMCaptionPanel::m_State [protected]
 

Definition at line 156 of file wm_caption_panel.hpp.

Referenced by GetState(), resize(), SetState(), and x_OnMousePushRelease().

EStyle CWMCaptionPanel::m_Style [protected]
 

Definition at line 152 of file wm_caption_panel.hpp.

Referenced by GetMinimalSize(), GetStyle(), SetStyle(), x_HasDockStyle(), and x_Layout().

IWindowManager* CWMCaptionPanel::m_WindowManager [protected]
 

Definition at line 151 of file wm_caption_panel.hpp.

Referenced by OnCommand(), OnUpdateCommand(), and x_OnShowPopupMenu().


The documentation for this class was generated from the following files:
Generated on Mon Nov 9 14:49:36 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Nov 09 15:48:36 2009 by modify_doxy.py rev. 173732