wGui::CView Class Reference

A general view class. More...

#include <wg_view.h>

Inheritance diagram for wGui::CView:

wGui::CWindow wGui::CMessageClient

Public Member Functions

Protected Attributes


Detailed Description

A general view class.

A CView creates itself as a root window (it has no parent) and responds to APP_PAINT messages with itself or 0 as the destination, and will redraw all of it's children as well as itself Because of a limitation in SDL, there can be only one View

Definition at line 42 of file wg_view.h.


Constructor & Destructor Documentation

wGui::CView::CView ( const CRect Rect,
std::wstring  sTitle,
bool  bResizable = true,
bool  bFullScreen = false 
)

Parameters:
Rect A CRect that defines the outer limits of the control
sTitle The window title, which will appear in the title bar of the view
bResizable If true, the window will be resizable (defaults to true)
bFullScreen If true, the window will be created full-screen, and the bResizable parameter will be ignored (defaults to false)

Definition at line 42 of file wg_view.cpp.

References wUtil::CLog::AddLogEntry(), wGui::CMessage::APP_DESTROY_FRAME, wGui::APP_LOG_INFO, wGui::CMessage::APP_PAINT, wGui::CMessage::CTRL_RESIZE, wGui::CWindow::Draw(), wGui::CApplication::GetApplicationLog(), wGui::CApplication::Instance(), wGui::CMessageServer::Instance(), wGui::CMessage::MOUSE_BUTTONDOWN, wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessageServer::PRIORITY_FIRST, wGui::CMessageServer::RegisterMessageClient(), SetWindowRect(), and SetWindowText().


Member Function Documentation

bool wGui::CView::IsResizable ( void   )  const [inline]

Indicates if the view is resizable (set in the constructor)

Returns:
true if the view is resizable

Definition at line 56 of file wg_view.h.

References m_bResizable.

bool wGui::CView::IsFullScreen ( void   )  const [inline]

Indicates id the view is fullscreen (set in the constructor)

Returns:
true if the view was created as fullscreen

Definition at line 60 of file wg_view.h.

References m_bFullScreen.

void wGui::CView::AttachMenu ( CMenu pMenu  ) 

Attaches a standard menu to the view, if the view already has a menu, the old menu will be deleted

Parameters:
pMenu A pointer to the menu, the CView is then responsible for cleaning it up, passing in 0 will delete the current menu

Definition at line 79 of file wg_view.cpp.

References wGui::CRect::ClipTo(), wGui::CWindow::GetWindowRect(), wGui::CRect::Height(), wGui::CWindow::m_ClientRect, m_pMenu, wGui::CWindow::m_WindowRect, wGui::CWindow::SetNewParent(), wGui::CRect::SetTop(), wGui::CWindow::SetWindowRect(), wGui::CRect::SizeRect(), and wGui::CRect::Width().

CMenu* wGui::CView::GetMenu ( void   )  const [inline]

Gets the menu for the view

Returns:
A pointer to the view's menu, 0 if the view doesn't have a menu

Definition at line 68 of file wg_view.h.

References m_pMenu.

void wGui::CView::SwitchMode ( const CRect WindowRect,
bool  bResizable,
bool  bFullScreen 
) [virtual]

Switch from current mode to other mode ( resizable / fullscreen )

Parameters:
WindowRect The rectangle that specifies the size of the view
bResizable If true, the window will be resizable (defaults to true)
bFullScreen If true, the window will be created full-screen, and the bResizable parameter will be ignored (defaults to false)

Definition at line 127 of file wg_view.cpp.

References m_bFullScreen, m_bResizable, and SetWindowRect().

void wGui::CView::SetFloatingWindow ( CWindow pWindow  )  [inline]

Sets the current floating window, which will be drawn on top of all other controls

Parameters:
pWindow A pointer to the window to set as the floating window

Definition at line 78 of file wg_view.h.

References m_pFloatingWindow.

Referenced by wGui::CPopupMenu::Hide(), wGui::CDropDown::HideListBox(), wGui::CPopupMenu::Show(), and wGui::CDropDown::ShowListBox().

CWindow* wGui::CView::GetFloatingWindow ( void   )  const [inline]

Gets teh current floating window

Returns:
a pointer to the current floating window

Definition at line 82 of file wg_view.h.

References m_pFloatingWindow.

Referenced by wGui::CToolTip::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CEditBox::HandleMessage(), wGui::CPopupMenu::Hide(), and wGui::CDropDown::HideListBox().

void wGui::CView::SetWindowText ( const std::wstring &  sText  )  [virtual]

Set the WindowText of the view, which is used as the window caption

Parameters:
sText The text to assign to the view

Reimplemented from wGui::CWindow.

Definition at line 98 of file wg_view.cpp.

References wGui::CWindow::m_sWindowText, wGui::CWindow::SetWindowText(), and stdex::ToMbString().

Referenced by CView().

void wGui::CView::SetWindowRect ( const CRect WindowRect  )  [virtual]

Set the WindowRect of the view, which is the size of the view ( it recreates the SDL_surface )

Parameters:
WindowRect The rectangle that specifies the size of the view

Reimplemented from wGui::CWindow.

Definition at line 105 of file wg_view.cpp.

References wGui::CApplication::GetBitsPerPixel(), wGui::CRect::Height(), wGui::CApplication::Instance(), m_bFullScreen, m_bResizable, wGui::CWindow::m_ClientRect, m_pScreenSurface, wGui::CWindow::m_WindowRect, wGui::CWindow::SetWindowRect(), stdex::ToWString(), and wGui::CRect::Width().

Referenced by CView(), and SwitchMode().


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:28 2007 for wGui by  doxygen 1.5.1