Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
vgui_mfc_view Class Reference

#include <vgui_mfc_view.h>

Inheritance diagram for vgui_mfc_view:
Inheritance graph
[legend]

List of all members.

Public Types

typedef vgui_adaptor_mixin mixin

Public Member Functions

CDocument * GetDocument ()
virtual void OnDraw (CDC *pDC)
 Called by MFC when a draw event is required - overridden to draw this view.
virtual BOOL PreCreateWindow (CREATESTRUCT &cs)
 Called by MFC before the creation of the window attached to this object.
virtual ~vgui_mfc_view ()
unsigned int get_width () const
 MFC implementation from vgui_adaptor - returns width of rendering area.
unsigned int get_height () const
 MFC implementation from vgui_adaptor - returns height of rendering area.
void post_redraw ()
 MFC implementation from vgui_adaptor - redraws rendering area.
void post_overlay_redraw ()
 MFC implementation from vgui_adaptor - redraws overlay buffer.
void swap_buffers ()
 MFC impl. from vgui_adaptor - swap buffers if using double buffering.
void make_current ()
 MFC impl. from vgui_adaptor - make this the current GL rendering context.
void draw ()
 MFC implementation from vgui_adaptor - redraw everything now.
bool do_idle ()
void service_redraws ()
 Redraws the OpenGL area.
void set_default_popup (vgui_menu)
 Change the default popup menu to the given one (not yet implemented).
void post_timer (float, int)
 Sets timer to dispatch WM_TIMER event to a mainframe every time milliseconds.
int post_timer (float)
void kill_timer (int id)
 Stop timer.
void post_idle_request ()
 Flags than a child requests idle processing.
vgui_menu get_popup ()
 Return the default popup menu (not yet implemented).
void bind_popups (vgui_modifier m, vgui_button b)
 MFC impl. from vgui_adaptor - set button & modifier to display popup.
void get_popup_bindings (vgui_modifier &m, vgui_button &b) const
 MFC impl. from vgui_adaptor - get button & modifier which display popup.
virtual vgui_windowget_window () const
void set_window (vgui_window *win)
void setup_adaptor (CWnd *this_cwnd, HDC OldDC, HGLRC oldContext)
 If your adaptor is not in the main window of the application call this function.
vgui_tableau_sptr get_tableau () const
 Get the vgui_tableau associated with this vgui_adaptor.
void set_tableau (vgui_tableau_sptr const &t)
 Set the vgui_tableau associated with this vgui_adaptor.
void set_double_buffering (bool b)
 True to use double buffering, false to not use it.
vgui_menu get_total_popup (vgui_popup_params &) const
 Return the concatenation of the adaptor's menu with the tableau's menu.
void config_dialog ()
 Pop up a dialog for changing the popup modifier and button bindings.
void set_popup (vgui_menu const &m)
 Set the popup menu for this adaptor.
void include_in_popup (vgui_menu const &m)
 Add the given menu to the popup menu for this adaptor.
bool dispatch_to_tableau (vgui_event const &)
 Dispatches the given event to the tableau.
virtual void post_message (char const *, void const *)
virtual void post_destroy ()

Public Attributes

CDC * m_pDC
 Device context for this adaptor.
HBITMAP m_pDC_default_bitmap
unsigned width
 Cached width of adaptor render area.
unsigned height
 Cached height of adaptor render area.
vgui_button popup_button
 Mouse button (used with popup_modifier) which causes the popup menu to appear.
vgui_modifier popup_modifier
 Modifier (used with popup_button) which causes the popup menu to appear.

Static Public Attributes

static vgui_DLLDATA vgui_adaptorcurrent = 0
 This static datum points to the adaptor that last received a mouse event.

Protected Member Functions

 vgui_mfc_view ()
virtual BOOL OnPreparePrinting (CPrintInfo *pInfo)
virtual void OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual void OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
 vgui_mfc_view message handlers.
void domouse (vgui_event_type e, UINT nFlags, CPoint point, vgui_button b)
 Handles mouse press/release events.
afx_msg void OnDestroy ()
 Called by MFC when the main window has been destroyed.
afx_msg void OnPaint ()
 Called by MFC when the application requests part of the window is redrawn.
afx_msg BOOL OnEraseBkgnd (CDC *pDC)
 Called by MFC when the background needs erasing.
afx_msg void OnSize (UINT nType, int cx, int cy)
 Called by MFC when the application is resized.
vgui_event generate_vgui_event (UINT nChar, UINT nRepCnt, UINT nFlags, vgui_event_type evttype)
 Create the corresponding vgui_event from an MFC event.
afx_msg void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Called by MFC when a key is pressed inside the application.
afx_msg void OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags)
 Called by MFC when a key is released inside the application.
afx_msg void OnLButtonDown (UINT nFlags, CPoint point)
 Called by MFC when the left mouse button is pressed inside the application.
afx_msg void OnLButtonUp (UINT nFlags, CPoint point)
 Called by MFC when left mouse button is released inside the application.
afx_msg void OnMouseMove (UINT nFlags, CPoint point)
 Called by MFC when the mouse is moved inside the application.
afx_msg void OnRButtonDown (UINT nFlags, CPoint point)
 Called by MFC when right mouse button is pressed inside the application.
afx_msg void OnRButtonUp (UINT nFlags, CPoint point)
 Called by MFC when right mouse button is released inside the application.
afx_msg BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
 Called by MFC when a user rotates a mouse wheel.
afx_msg void OnMButtonDown (UINT nFlags, CPoint point)
 Called by MFC when middle mouse button is pressed inside the application.
afx_msg void OnMButtonUp (UINT nFlags, CPoint point)
 Called by MFC when middle mouse button is released inside the application.

Protected Attributes

CWnd * m_pCWnd
 The window associated with this adaptor if it is not the main window.
HDC hOldDC
 The previous device context to this one.
HGLRC hOldRC
 The previous rendering context to this one.
HGLRC m_hRC
 The Win-OpenGL resource context.
int m_width
 Width of rendering area.
int m_height
 Height of rendering area.
vgui_windowwin_
bool nested_popups
 Parameters controlling the popup menu style.
bool default_items
bool use_double_buffering
 Whether or not to use double buffering.

Static Protected Attributes

static vgui_menu last_popup

Detailed Description

Definition at line 14 of file vgui_mfc_view.h.


Member Typedef Documentation

Definition at line 66 of file vgui_mfc_adaptor.h.


Constructor & Destructor Documentation

vgui_mfc_view::vgui_mfc_view ( ) [protected]

Definition at line 26 of file vgui_mfc_view.cxx.

vgui_mfc_view::~vgui_mfc_view ( ) [virtual]

Definition at line 31 of file vgui_mfc_view.cxx.


Member Function Documentation

void vgui_mfc_adaptor::bind_popups ( vgui_modifier  m,
vgui_button  b 
) [inline, virtual, inherited]

MFC impl. from vgui_adaptor - set button & modifier to display popup.

Reimplemented from vgui_adaptor.

Definition at line 116 of file vgui_mfc_adaptor.h.

void vgui_adaptor::config_dialog ( ) [inherited]

Pop up a dialog for changing the popup modifier and button bindings.

Pops up a dialog for changing the popup modifier and button bindings.

Definition at line 102 of file vgui_adaptor.cxx.

bool vgui_adaptor::dispatch_to_tableau ( vgui_event const &  e) [inherited]

Dispatches the given event to the tableau.

This method performs various checks which can be performed generically for all tableaux. It is not the responsibility of this method to take care of overlay handling - the derived class must sort that out.

This method performs various checks which can be performed generically for all tableaux. It is not the responsibility of this method to take care of overlay handling - the derived class must sort that out. The derived class must also ensure that the correct draw buffer is set.

Reimplemented in vgui_qt_adaptor, and vgui_qt_adaptor.

Definition at line 182 of file vgui_adaptor.cxx.

bool vgui_mfc_adaptor::do_idle ( ) [inherited]

Definition at line 482 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::domouse ( vgui_event_type  e,
UINT  nFlags,
CPoint  point,
vgui_button  b 
) [protected, inherited]

Handles mouse press/release events.

Deals with right popup menu.

'point' is window coordinates whereas TrackPopup menu requires screen coordinates. So translate them into screen coordinates

Definition at line 635 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::draw ( ) [inherited]

MFC implementation from vgui_adaptor - redraw everything now.

MFC implementation of vgui_adaptor function - redraw everything now!.

Definition at line 476 of file vgui_mfc_adaptor.cxx.

vgui_event vgui_mfc_adaptor::generate_vgui_event ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags,
vgui_event_type  evttype 
) [protected, inherited]

Create the corresponding vgui_event from an MFC event.

Definition at line 593 of file vgui_mfc_adaptor.cxx.

unsigned int vgui_mfc_adaptor::get_height ( ) const [inline, virtual, inherited]

MFC implementation from vgui_adaptor - returns height of rendering area.

Implements vgui_adaptor.

Definition at line 74 of file vgui_mfc_adaptor.h.

vgui_menu vgui_mfc_adaptor::get_popup ( ) [inherited]

Return the default popup menu (not yet implemented).

Reimplemented from vgui_adaptor.

Definition at line 178 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::get_popup_bindings ( vgui_modifier m,
vgui_button b 
) const [inline, virtual, inherited]

MFC impl. from vgui_adaptor - get button & modifier which display popup.

Reimplemented from vgui_adaptor.

Definition at line 122 of file vgui_mfc_adaptor.h.

vgui_tableau_sptr vgui_adaptor::get_tableau ( ) const [inherited]

Get the vgui_tableau associated with this vgui_adaptor.

Get the vgui_tableau associated with this adaptor.

Definition at line 64 of file vgui_adaptor.cxx.

vgui_menu vgui_adaptor::get_total_popup ( vgui_popup_params params) const [inherited]

Return the concatenation of the adaptor's menu with the tableau's menu.

Returns concatenation of the adaptor's menu with the tableau's menu.

Definition at line 78 of file vgui_adaptor.cxx.

unsigned int vgui_mfc_adaptor::get_width ( ) const [inline, virtual, inherited]

MFC implementation from vgui_adaptor - returns width of rendering area.

Implements vgui_adaptor.

Definition at line 71 of file vgui_mfc_adaptor.h.

virtual vgui_window* vgui_mfc_adaptor::get_window ( ) const [inline, virtual, inherited]

Reimplemented from vgui_adaptor.

Definition at line 127 of file vgui_mfc_adaptor.h.

CDocument * vgui_mfc_view::GetDocument ( ) [inline]

Definition at line 56 of file vgui_mfc_view.h.

void vgui_adaptor::include_in_popup ( vgui_menu const &  m) [inline, inherited]

Add the given menu to the popup menu for this adaptor.

Definition at line 81 of file vgui_adaptor.h.

void vgui_mfc_adaptor::kill_timer ( int  id) [virtual, inherited]

Stop timer.

Stop timer to dispatch WM_TIME event.

Reimplemented from vgui_adaptor.

Definition at line 454 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::make_current ( ) [virtual, inherited]

MFC impl. from vgui_adaptor - make this the current GL rendering context.

MFC implementation of vgui_adaptor function - make this the current GL rendering context.

Reimplemented from vgui_adaptor.

Definition at line 159 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_view::OnBeginPrinting ( CDC *  pDC,
CPrintInfo *  pInfo 
) [protected, virtual]

Definition at line 63 of file vgui_mfc_view.cxx.

int vgui_mfc_view::OnCreate ( LPCREATESTRUCT  lpCreateStruct) [protected]

vgui_mfc_view message handlers.

Reimplemented from vgui_mfc_adaptor.

Definition at line 96 of file vgui_mfc_view.cxx.

void vgui_mfc_adaptor::OnDestroy ( ) [protected, inherited]

Called by MFC when the main window has been destroyed.

Note, this function is not called when your adaptor is destroyed inside a non-main window (eg. a dialog box).

Definition at line 358 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_view::OnDraw ( CDC *  pDC) [virtual]

Called by MFC when a draw event is required - overridden to draw this view.

Reimplemented from vgui_mfc_adaptor.

Definition at line 46 of file vgui_mfc_view.cxx.

void vgui_mfc_view::OnEndPrinting ( CDC *  pDC,
CPrintInfo *  pInfo 
) [protected, virtual]

Definition at line 68 of file vgui_mfc_view.cxx.

BOOL vgui_mfc_adaptor::OnEraseBkgnd ( CDC *  pDC) [protected, inherited]

Called by MFC when the background needs erasing.

For example this would be called if the window was resized.

Definition at line 366 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnKeyDown ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags 
) [protected, inherited]

Called by MFC when a key is pressed inside the application.

Definition at line 613 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnKeyUp ( UINT  nChar,
UINT  nRepCnt,
UINT  nFlags 
) [protected, inherited]

Called by MFC when a key is released inside the application.

Definition at line 624 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnLButtonDown ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when the left mouse button is pressed inside the application.

Definition at line 700 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnLButtonUp ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when left mouse button is released inside the application.

Called by MFC when the left mouse button is released inside the application.

Definition at line 706 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnMButtonDown ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when middle mouse button is pressed inside the application.

Called by MFC when the middle mouse button is pressed inside the application.

Definition at line 712 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnMButtonUp ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when middle mouse button is released inside the application.

Called by MFC when the middle mouse button is released inside the application.

Definition at line 718 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnMouseMove ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when the mouse is moved inside the application.

Definition at line 736 of file vgui_mfc_adaptor.cxx.

BOOL vgui_mfc_adaptor::OnMouseWheel ( UINT  nFlags,
short  zDelta,
CPoint  pt 
) [protected, inherited]

Called by MFC when a user rotates a mouse wheel.

Definition at line 742 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnPaint ( ) [protected, inherited]

Called by MFC when the application requests part of the window is redrawn.

Definition at line 491 of file vgui_mfc_adaptor.cxx.

BOOL vgui_mfc_view::OnPreparePrinting ( CPrintInfo *  pInfo) [protected, virtual]

Definition at line 57 of file vgui_mfc_view.cxx.

void vgui_mfc_adaptor::OnRButtonDown ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when right mouse button is pressed inside the application.

Called by MFC when the right mouse button is pressed inside the application.

Definition at line 724 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnRButtonUp ( UINT  nFlags,
CPoint  point 
) [protected, inherited]

Called by MFC when right mouse button is released inside the application.

Called by MFC when the right mouse button is released inside the application.

Definition at line 730 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::OnSize ( UINT  nType,
int  cx,
int  cy 
) [protected, inherited]

Called by MFC when the application is resized.

Definition at line 497 of file vgui_mfc_adaptor.cxx.

void vgui_adaptor::post_destroy ( void  ) [virtual, inherited]
void vgui_mfc_adaptor::post_idle_request ( void  ) [inline, virtual, inherited]

Flags than a child requests idle processing.

Reimplemented from vgui_adaptor.

Definition at line 110 of file vgui_mfc_adaptor.h.

void vgui_adaptor::post_message ( char const *  ,
void const *   
) [virtual, inherited]

Reimplemented in vgui_wx_adaptor.

Definition at line 242 of file vgui_adaptor.cxx.

void vgui_mfc_adaptor::post_overlay_redraw ( void  ) [virtual, inherited]

MFC implementation from vgui_adaptor - redraws overlay buffer.

MFC implementation of vgui_adaptor function - redraws overlay buffer.

Implements vgui_adaptor.

Definition at line 126 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::post_redraw ( void  ) [virtual, inherited]

MFC implementation from vgui_adaptor - redraws rendering area.

MFC implementation of vgui_adaptor function - redraws rendering area.

Implements vgui_adaptor.

Definition at line 142 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::post_timer ( float  tm,
int  id 
) [virtual, inherited]

Sets timer to dispatch WM_TIMER event to a mainframe every time milliseconds.

Reimplemented from vgui_adaptor.

Definition at line 443 of file vgui_mfc_adaptor.cxx.

int vgui_adaptor::post_timer ( float  t) [inherited]

Definition at line 266 of file vgui_adaptor.cxx.

BOOL vgui_mfc_view::PreCreateWindow ( CREATESTRUCT &  cs) [virtual]

Called by MFC before the creation of the window attached to this object.

Reimplemented from vgui_mfc_adaptor.

Definition at line 35 of file vgui_mfc_view.cxx.

void vgui_mfc_adaptor::service_redraws ( ) [inherited]

Redraws the OpenGL area.

Definition at line 373 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::set_default_popup ( vgui_menu  ) [inherited]

Change the default popup menu to the given one (not yet implemented).

Definition at line 172 of file vgui_mfc_adaptor.cxx.

void vgui_adaptor::set_double_buffering ( bool  b) [inline, inherited]

True to use double buffering, false to not use it.

Definition at line 66 of file vgui_adaptor.h.

void vgui_adaptor::set_popup ( vgui_menu const &  m) [inline, inherited]

Set the popup menu for this adaptor.

Definition at line 78 of file vgui_adaptor.h.

void vgui_adaptor::set_tableau ( vgui_tableau_sptr const &  t) [inherited]

Set the vgui_tableau associated with this vgui_adaptor.

Set the vgui_tableau associated with this adaptor.

Definition at line 71 of file vgui_adaptor.cxx.

void vgui_mfc_adaptor::set_window ( vgui_window win) [inline, inherited]

Definition at line 128 of file vgui_mfc_adaptor.h.

void vgui_mfc_adaptor::setup_adaptor ( CWnd *  this_cwnd,
HDC  oldDC,
HGLRC  oldContext 
) [inherited]

If your adaptor is not in the main window of the application call this function.

The first parameter tells it which window this adaptor is associated with, the other parameters are so we can go back to our old rendering context when this adaptor is deleted.

The first parameter tells it which window this adaptor is associated with, the other parameters are so we can go back to our old rendering context.

Definition at line 187 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::swap_buffers ( ) [virtual, inherited]

MFC impl. from vgui_adaptor - swap buffers if using double buffering.

MFC implementation of vgui_adaptor function - swap buffers if using double buffering.

Reimplemented from vgui_adaptor.

Definition at line 165 of file vgui_mfc_adaptor.cxx.


Member Data Documentation

vgui_adaptor * vgui_adaptor::current = 0 [static, inherited]

This static datum points to the adaptor that last received a mouse event.

It is set to zero if its pointer receives a LEAVE event. It will often point to the adaptor which was current when a popup menu was triggered, which is often what one wants it for.

Definition at line 93 of file vgui_adaptor.h.

bool vgui_adaptor::default_items [protected, inherited]

Definition at line 143 of file vgui_adaptor.h.

unsigned vgui_adaptor_mixin::height [inherited]

Cached height of adaptor render area.

Definition at line 29 of file vgui_adaptor_mixin.h.

HDC vgui_mfc_adaptor::hOldDC [protected, inherited]

The previous device context to this one.

Definition at line 168 of file vgui_mfc_adaptor.h.

HGLRC vgui_mfc_adaptor::hOldRC [protected, inherited]

The previous rendering context to this one.

Definition at line 171 of file vgui_mfc_adaptor.h.

vgui_menu vgui_mfc_adaptor::last_popup [static, protected, inherited]

Definition at line 207 of file vgui_mfc_adaptor.h.

int vgui_mfc_adaptor::m_height [protected, inherited]

Height of rendering area.

Definition at line 203 of file vgui_mfc_adaptor.h.

HGLRC vgui_mfc_adaptor::m_hRC [protected, inherited]

The Win-OpenGL resource context.

Definition at line 197 of file vgui_mfc_adaptor.h.

CWnd* vgui_mfc_adaptor::m_pCWnd [protected, inherited]

The window associated with this adaptor if it is not the main window.

Definition at line 165 of file vgui_mfc_adaptor.h.

CDC* vgui_mfc_adaptor::m_pDC [inherited]

Device context for this adaptor.

Definition at line 62 of file vgui_mfc_adaptor.h.

Definition at line 64 of file vgui_mfc_adaptor.h.

int vgui_mfc_adaptor::m_width [protected, inherited]

Width of rendering area.

Definition at line 200 of file vgui_mfc_adaptor.h.

bool vgui_adaptor::nested_popups [protected, inherited]

Parameters controlling the popup menu style.

These are put onto a popup_params object and passed to tableau::get_popup()

Definition at line 142 of file vgui_adaptor.h.

Mouse button (used with popup_modifier) which causes the popup menu to appear.

Definition at line 34 of file vgui_adaptor_mixin.h.

Modifier (used with popup_button) which causes the popup menu to appear.

Definition at line 36 of file vgui_adaptor_mixin.h.

bool vgui_adaptor::use_double_buffering [protected, inherited]

Whether or not to use double buffering.

Definition at line 146 of file vgui_adaptor.h.

unsigned vgui_adaptor_mixin::width [inherited]

Cached width of adaptor render area.

Definition at line 27 of file vgui_adaptor_mixin.h.

vgui_window* vgui_mfc_adaptor::win_ [protected, inherited]

Definition at line 205 of file vgui_mfc_adaptor.h.


The documentation for this class was generated from the following files: