Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vgui_mfc_view Class Reference

#include <vgui_mfc_view.h>

Inheritance diagram for vgui_mfc_view:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 14 of file vgui_mfc_view.h.

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


Member Typedef Documentation

typedef vgui_adaptor_mixin vgui_mfc_adaptor::mixin [inherited]
 

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.

Definition at line 102 of file vgui_adaptor.cxx.

bool vgui_adaptor::dispatch_to_tableau vgui_event const &   )  [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.

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 478 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::domouse vgui_event_type  et,
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 631 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::draw  )  [inherited]
 

MFC implementation from vgui_adaptor - redraw everything now.

Definition at line 472 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 589 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.

Definition at line 64 of file vgui_adaptor.cxx.

vgui_menu vgui_adaptor::get_total_popup vgui_popup_params  )  const [inherited]
 

Return the 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 80 of file vgui_adaptor.h.

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

Stop timer.

Reimplemented from vgui_adaptor.

Definition at line 450 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.

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 609 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 620 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 686 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.

Definition at line 692 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.

Definition at line 698 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.

Definition at line 704 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 722 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 728 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 487 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.

Definition at line 710 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.

Definition at line 716 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 493 of file vgui_mfc_adaptor.cxx.

void vgui_adaptor::post_destroy  )  [virtual, inherited]
 

Reimplemented in vgui_glut_adaptor, vgui_gtk_adaptor, vgui_gtk2_adaptor, and vgui_wx_adaptor.

Definition at line 274 of file vgui_adaptor.cxx.

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  )  [virtual, inherited]
 

MFC implementation from vgui_adaptor - redraws overlay buffer.

Implements vgui_adaptor.

Definition at line 126 of file vgui_mfc_adaptor.cxx.

void vgui_mfc_adaptor::post_redraw  )  [virtual, inherited]
 

MFC implementation from vgui_adaptor - redraws rendering area.

Implements vgui_adaptor.

Definition at line 142 of file vgui_mfc_adaptor.cxx.

int vgui_adaptor::post_timer float   )  [inherited]
 

Definition at line 266 of file vgui_adaptor.cxx.

void vgui_mfc_adaptor::post_timer float  ,
int 
[virtual, inherited]
 

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

Reimplemented from vgui_adaptor.

Definition at line 439 of file vgui_mfc_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 65 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 77 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.

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.

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.

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 92 of file vgui_adaptor.h.

bool vgui_adaptor::default_items [protected, inherited]
 

Definition at line 142 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.

HBITMAP vgui_mfc_adaptor::m_pDC_default_bitmap [inherited]
 

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 141 of file vgui_adaptor.h.

vgui_button vgui_adaptor_mixin::popup_button [inherited]
 

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

Definition at line 34 of file vgui_adaptor_mixin.h.

vgui_modifier vgui_adaptor_mixin::popup_modifier [inherited]
 

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 145 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:
Generated on Thu Jan 10 14:42:22 2008 for core/vgui by  doxygen 1.4.4