#include <arsview.h>
Inheritance diagram for Ars::View:


Public Member Functions | |
| View (const XRect Rect, std::string sTitle, const bool bResizable=true) | |
| virtual | ~View (void) |
| Standard Destructor. | |
| virtual const bool | SetupWindow (const Message &msg) |
| Deregister the setup_window message. | |
| bool | IsResizable (void) |
| true if the view is resizable | |
| virtual void | SetWndText (const std::string &sText) |
| virtual const bool | wmResize (const ResizeMessage &Message) |
| Resizes the window. | |
| virtual void | IdleProcess (void) |
Static Public Member Functions | |
| View * | GetMainFrame (void) |
| a pointer to the current and unique View. | |
Protected Member Functions | |
| virtual const bool | MainLoop (void) |
Protected Attributes | |
| bool | m_bResizable |
| Indicates if the view is resizable. | |
Private Member Functions | |
| void | operator= (View) |
| The assignment operator is not allowed for CWindow derived objects. | |
Static Private Attributes | |
| View * | m_pInstance = 0 |
| A pointer to the one allowed view, this is due to the SDL limitation of having only one window. | |
Friends | |
| class | ArsApplication |
A View 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 11 of file arsview.h.
|
||||||||||||||||
|
Definition at line 7 of file arsview.cpp. References Cfg::GetCfg(), Cfg::Handler::GetCfgInt(), Ars::XRect::Height(), m_bResizable, m_pInstance, Ars::HPaint::m_pSurface, Ars::ArsApplication::scrH, Ars::ArsApplication::scrW, Ars::Window::SetWindowRect(), SetWndText(), tron, and Ars::XRect::Width().
00008 : m_bResizable(bResizable) 00009 { 00010 SetWindowRect( Rect ); 00011 00012 m_pInstance = this; 00013 Uint32 iFlags = SDL_HWSURFACE | SDL_ANYFORMAT; 00014 if(m_bResizable) 00015 iFlags |= SDL_RESIZABLE; 00016 // else iFlags |= SDL_FULLSCREEN; 00017 m_pSurface = SDL_SetVideoMode( Width(), Height(), 32, iFlags); 00018 if (m_pSurface == NULL) 00019 tron << "Could not set video mode : " << SDL_GetError() << "\n"; 00020 SetWndText( sTitle ); 00021 00022 Cfg::Handler &h = Cfg::GetCfg(); 00023 Ars::ArsApplication::scrW = h.GetCfgInt( "SetupScreen" , "ScreenW" ); 00024 Ars::ArsApplication::scrH = h.GetCfgInt( "SetupScreen" , "ScreenH" ); 00025 } |
|
|
Standard Destructor.
Definition at line 27 of file arsview.cpp. References Ars::HPaint::m_pSurface.
00028 {
00029 SDL_FreeSurface( m_pSurface );
00030 m_pSurface = 0;
00031 }
|
|
|
a pointer to the current and unique View.
Definition at line 29 of file arsview.h. References m_pInstance.
00029 { return m_pInstance; }
|
|
|
Definition at line 42 of file arsview.h. Referenced by Ars::ArsApplication::MainLoop().
00042 {};
|
|
|
true if the view is resizable
Definition at line 32 of file arsview.h. References m_bResizable.
00032 { return m_bResizable; }
|
|
|
Definition at line 71 of file arsview.cpp. Referenced by Ars::ArsApplication::Exec().
00072 {
00073 return ArsApplication::GetInstance()->MainLoop();
00074 }
|
|
|
The assignment operator is not allowed for CWindow derived objects.
|
|
|
Deregister the setup_window message.
Reimplemented from Ars::Window. Definition at line 33 of file arsview.cpp. References Ars::Window::UpdateWindow().
00034 {
00035 Window::SetupWindow( msg );
00036
00037 MessageServer::Instance().RegisterMessageClient(this, Message::CTRL_RESIZE);
00038
00039 // Send a message to the queue so that the view gets painted as soon as the app starts up
00040 UpdateWindow();
00041
00042 return true;
00043 }
|
|
|
Set the WindowText of the view, which is used as the window caption
Reimplemented from Ars::Window. Definition at line 45 of file arsview.cpp. References Ars::Window::GetWindowText(). Referenced by View().
00046 {
00047 Window::SetWndText( sText );
00048 SDL_WM_SetCaption( GetWindowText().c_str() , "" );
00049 }
|
|
|
Resizes the window.
Reimplemented from Ars::MessageClient. Definition at line 51 of file arsview.cpp. References Ars::Window::clientRect, Ars::XRect::Height(), m_bResizable, Ars::HPaint::m_pSurface, Ars::XRect::SetBottom(), Ars::Thing::SetDirty(), Ars::XRect::SetRight(), Ars::ResizeMessage::size, Ars::CtrlMessage::source, Ars::Window::UpdateWindow(), Ars::XRect::Width(), Ars::XPoint::x, Ars::XRect::XRect(), and Ars::XPoint::y.
00052 {
00053 if( Message.source == 0 )
00054 {
00055 Uint32 iFlags = SDL_HWSURFACE | SDL_ANYFORMAT;
00056 if(m_bResizable)
00057 iFlags |= SDL_RESIZABLE;
00058
00059 SetBottom( y + Message.size.y);
00060 SetRight( x + Message.size.x);
00061 clientRect = XRect(0, 0, Width(), Height());
00062 m_pSurface = SDL_SetVideoMode( Width(), Height(), 32, iFlags);
00063 SetDirty();
00064 UpdateWindow( true );
00065 return true;
00066 }
00067
00068 return false;
00069 }
|
|
|
|
|
|
Indicates if the view is resizable.
Definition at line 50 of file arsview.h. Referenced by IsResizable(), View(), and wmResize(). |
|
|
A pointer to the one allowed view, this is due to the SDL limitation of having only one window.
Definition at line 5 of file arsview.cpp. Referenced by GetMainFrame(), and View(). |
1.3.3