#include <wg_frame.h>
Inheritance diagram for wGui::CFrame:
The CFrame class allows the user to create multiple windows within the view. Unfortunately they're still bounded by the view but it's a slight workaround for the SDL limitation of only 1 SDL view per app
Definition at line 41 of file wg_frame.h.
wGui::CFrame::CFrame | ( | const CRect & | WindowRect, | |
CView * | pParent, | |||
CFontEngine * | pFontEngine = 0 , |
|||
const std::wstring & | sTitle = L"" , |
|||
bool | bResizable = true | |||
) |
WindowRect | A CRect that defines the outer limits of the control | |
pParent | A pointer to the parent view | |
pFontEngine | A pointer to the font engine to use when drawing the control If this is set to 0 it will use the default font engine specified by the CApplication (which must be set before instantiating this object) | |
sTitle | The window title, which will appear in the title bar of the view | |
bResizable | If true, the window will be resizable |
Definition at line 32 of file wg_frame.cpp.
References wGui::CMessage::CTRL_SINGLELCLICK, wGui::CApplication::GetDefaultFontEngine(), wGui::CMessageServer::Instance(), wGui::CApplication::Instance(), m_pFontEngine, m_pFrameCloseButton, m_pRenderedString, wGui::CWindow::m_sWindowText, wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CMessageServer::RegisterMessageClient(), SetWindowRect(), and wGui::CRenderedString::VALIGN_CENTER.
void wGui::CFrame::SetTitleBarColor | ( | CRGBColor & | TitleBarColor | ) | [inline] |
Set the color of the title bar
TitleBarColor | The new color for the title bar |
Definition at line 57 of file wg_frame.h.
References m_TitleBarColor.
void wGui::CFrame::SetTitleBarTextColor | ( | CRGBColor & | TitleBarTextColor | ) | [inline] |
Set the color of the title bar text
TitleBarTextColor | The new color for the title bar text |
Definition at line 61 of file wg_frame.h.
References m_TitleBarTextColor.
void wGui::CFrame::SetTitleBarHeight | ( | int | iTitleBarHeight | ) |
Set the height of the title bar
iTitleBarHeight |
Definition at line 163 of file wg_frame.cpp.
References m_iTitleBarHeight, wGui::CWindow::m_WindowRect, and SetWindowRect().
bool wGui::CFrame::IsResizable | ( | void | ) | const [inline] |
Indicates if the frame is resizable (set in the object constructor)
Definition at line 69 of file wg_frame.h.
References m_bResizable.
void wGui::CFrame::AttachMenu | ( | CMenu * | pMenu | ) |
Attaches a standard menu to the frame, if the frame already has a menu, the old menu will be deleted
pMenu | A pointer to the menu, the CFrame is then responsible for cleaning it up, passing in 0 will delete the current menu |
Definition at line 170 of file wg_frame.cpp.
References wGui::CRect::ClipTo(), wGui::CWindow::GetWindowRect(), wGui::CRect::Height(), wGui::CWindow::m_ClientRect, m_pMenu, wGui::CWindow::m_WindowRect, wGui::CRect::SetTop(), wGui::CWindow::SetWindowRect(), wGui::CRect::SizeRect(), and wGui::CRect::Width().
CMenu* wGui::CFrame::GetMenu | ( | void | ) | const [inline] |
Gets the menu for a frame
Definition at line 77 of file wg_frame.h.
References m_pMenu.
bool wGui::CFrame::IsModal | ( | void | ) | const [inline] |
Indicates if the frame is modal (doesn't allow input to any other windows)
Definition at line 84 of file wg_frame.h.
References m_bModal.
void wGui::CFrame::SetModal | ( | bool | bModal | ) |
Sets the frame's modal state param bModal the modal state to set (CFrames are non-modal by default)
Definition at line 81 of file wg_frame.cpp.
References wGui::CApplication::Instance(), m_bModal, wGui::CWindow::m_pParentWindow, wGui::CApplication::SetKeyFocus(), and wGui::CApplication::SetMouseFocus().
Referenced by ~CFrame().
void wGui::CFrame::PaintToSurface | ( | SDL_Surface & | ScreenSurface, | |
SDL_Surface & | FloatingSurface, | |||
const CPoint & | Offset | |||
) | const [virtual] |
Blit the window to the given surface, using m_WindowRect as the offset into the surface
ScreenSurface | A reference to the surface that the window will be copied to | |
FloatingSurface | A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) | |
Offset | This is the current offset into the Surface that should be used as reference |
Reimplemented from wGui::CWindow.
Definition at line 125 of file wg_frame.cpp.
References wGui::CWindow::m_bVisible, wGui::CWindow::m_ChildWindows, wGui::CWindow::m_ClientRect, wGui::CWindow::m_pSDLSurface, wGui::CWindow::m_WindowRect, wGui::CRect::SizeRect(), and wGui::CRect::TopLeft().
void wGui::CFrame::SetWindowRect | ( | const CRect & | WindowRect | ) | [virtual] |
Giving a control a new WindowRect will move and resize the control
WindowRect | A CRect that defines the outer limits of the control |
Reimplemented from wGui::CWindow.
Definition at line 188 of file wg_frame.cpp.
References wGui::CRect::Height(), wGui::CWindow::m_ClientRect, m_iTitleBarHeight, m_pFrameCloseButton, wGui::CWindow::SetWindowRect(), and wGui::CRect::Width().
Referenced by CFrame(), wGui::CMessageBox::FitToText(), and SetTitleBarHeight().
void wGui::CFrame::SetWindowText | ( | const std::wstring & | sText | ) | [virtual] |
Set the title bar text of the frame
sText | The text to assign to the view |
Reimplemented from wGui::CWindow.
Definition at line 198 of file wg_frame.cpp.
References m_pFontEngine, m_pRenderedString, wGui::CWindow::SetWindowText(), and wGui::CRenderedString::VALIGN_CENTER.
bool wGui::CFrame::OnMouseButtonDown | ( | CPoint | Point, | |
unsigned int | Button | |||
) | [virtual] |
This is called whenever the frame is clicked on by the mouse Only the topmost window that bounds the point will be called by the system
Point | The point where the mouse clicked | |
Button | A bitfield indicating which button the window was clicked with |
Reimplemented from wGui::CWindow.
Definition at line 206 of file wg_frame.cpp.
References wGui::CMessage::APP_PAINT, wGui::CRect::HitTest(), wGui::CMessageServer::Instance(), wGui::CWindow::m_bVisible, wGui::CWindow::m_pParentWindow, wGui::CWindow::m_WindowRect, wGui::CWindow::OnMouseButtonDown(), wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, wGui::CWindow::SetNewParent(), wGui::CRect::SizeRect(), and wGui::CWindow::ViewToWindow().
bool wGui::CFrame::HandleMessage | ( | CMessage * | pMessage | ) | [virtual] |
CFrame handles no messages at the moment
pMessage | A pointer to the message |
Reimplemented from wGui::CWindow.
Reimplemented in wGui::CMessageBox.
Definition at line 227 of file wg_frame.cpp.
References wGui::CMessage::APP_PAINT, wGui::CRect::Bottom(), CloseFrame(), wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::Destination(), wGui::CWindow::GetClientRect(), wGui::CWindow::HandleMessage(), wGui::CMessageServer::Instance(), wGui::CRect::Left(), m_pFrameCloseButton, wGui::CWindow::m_pParentWindow, wGui::CWindow::m_WindowRect, wGui::CMessage::MessageType(), wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CRect::Move(), wGui::CMessageServer::QueueMessage(), wGui::CRect::Right(), wGui::CRect::SizeRect(), wGui::CMessage::Source(), and wGui::CRect::Top().
Referenced by wGui::CMessageBox::HandleMessage().