CScrollerCorner Class Reference

This OIL class is the little square in the bottom-right of a window featuring horizontal and vertical scroll bars. It is currently completely useless (except visually, of course). More...

#include <scroller.h>

List of all members.

Public Member Functions

 CScrollerCorner ()
 Constructs a scroller object. Scope: Protected.
virtual BOOL Create (LPCTSTR, LPCTSTR, DWORD style, const wxRect &rect, wxWindow *pParent, UINT32 id)
 Creates (attaches) the Windows interface element which corresponds to the C++ CScrollerCorner object. The CScrollerCorner's background brush is set to the one used to colour scroll bars.
void OnPaint (wxPaintEvent &event)
 Paints the client area of the CScrollerCorner. Scope: Protected.
void OnLButtonDown (wxMouseEvent &event)
 Send a fake non-client msg to our parent to allow sizing via this window.
void OnSetCursor (wxSetCursorEvent &event)
 Fakes the sizing gadget for our custom scrollbars.

Private Attributes

wxBitmap SizeBitmap


Detailed Description

This OIL class is the little square in the bottom-right of a window featuring horizontal and vertical scroll bars. It is currently completely useless (except visually, of course).

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago

Definition at line 136 of file scroller.h.


Constructor & Destructor Documentation

CScrollerCorner::CScrollerCorner  ) 
 

Constructs a scroller object. Scope: Protected.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
7th Sept 1993

Definition at line 153 of file scroller.cpp.

00154 {
00155     //SizeBitmap.LoadOEMBitmap(OBM_SIZE);
00156 }


Member Function Documentation

BOOL CScrollerCorner::Create LPCTSTR  ,
LPCTSTR  ,
DWORD  style,
const wxRect &  rect,
wxWindow *  pParent,
UINT32  id
[virtual]
 

Creates (attaches) the Windows interface element which corresponds to the C++ CScrollerCorner object. The CScrollerCorner's background brush is set to the one used to colour scroll bars.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
Two dummy long pointers to constant TCHARs, the window-instance flags, a [INPUTS] rectangle describing the position of the "corner", a pointer to the parent window, the numeric child window identifier, a pointer to a creation context.
- [OUTPUTS]
Returns:
TRUE if the window is successfully created.

Errors: - Scope: Public

See also:
CCamView::OnCreate()

Definition at line 180 of file scroller.cpp.

00182 {
00183     return wxWindow::Create( pParent, id, rect.GetTopLeft(), rect.GetSize(), style );
00184 /*
00185     return CWnd::Create(AfxRegisterWndClass(
00186                             CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS,
00187                             0,
00188                             HBRUSH(COLOR_SCROLLBAR + 1),
00189                             0),
00190                         "",
00191                         style | WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
00192                         rect,
00193                         parent,
00194                         id,
00195                         ctxt);
00196 */
00197 }

void CScrollerCorner::OnLButtonDown wxMouseEvent &  event  ) 
 

Send a fake non-client msg to our parent to allow sizing via this window.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95

Definition at line 295 of file scroller.cpp.

00296 {
00297 #ifdef GERRYXXX
00298     CWnd::OnLButtonDown(nFlags, pt);
00299 
00300     CWnd* pParent = GetParent();
00301     CRect rWin;
00302     pParent->GetWindowRect(&rWin);
00303 
00304     // calc screen coords of bottom-right frame corner
00305     pt.x = rWin.Width() - 1;
00306     pt.y = rWin.Height() - 1;
00307     pParent->ClientToScreen(&pt);
00308 
00309     pParent->SendMessage(WM_NCLBUTTONDOWN, WPARAM(HTSIZE),
00310                          MAKELPARAM(WORD(pt.x), WORD(pt.y)));
00311 #endif
00312 }

void CScrollerCorner::OnPaint wxPaintEvent &  event  ) 
 

Paints the client area of the CScrollerCorner. Scope: Protected.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/10/95
See also:
CScrollerCorner::Create()

Definition at line 215 of file scroller.cpp.

00216 {
00217 #ifdef GERRYXXX
00218     CPaintDC dc(this);
00219     
00220     // Draw the resizing gadget.
00221     CPen nullpen(PS_NULL, 0, RGB(0, 0, 0));
00222     CPen* oldpen = dc.SelectObject(&nullpen);
00223     dc.SetROP2(R2_COPYPEN);
00224 
00225     // Create an appropriately coloured brush to fill the scroller's background.
00226     CBrush brush(::GetSysColor(COLOR_BTNFACE));
00227     CBrush* oldbrush = dc.SelectObject(&brush);
00228 
00229     // Draw the body of the scroller corner.
00230     CRect rClient;
00231     GetClientRect(&rClient);
00232     dc.Rectangle(&rClient);
00233 
00234     // Draw the size gadget on top if not maximised.
00235     BOOL fIsMaxed;
00236     GetMainFrame()->MDIGetActive(&fIsMaxed);
00237     if (!fIsMaxed)
00238     {
00239         CDC scrDC;
00240         scrDC.CreateCompatibleDC(&dc);
00241         CBitmap* pOldSrcBitmap = (CBitmap*) scrDC.SelectObject(&SizeBitmap);
00242         dc.BitBlt(0, 0, rClient.Width(), rClient.Height(), &scrDC, 0, 0, SRCCOPY);
00243         scrDC.SelectObject(pOldSrcBitmap);
00244     }
00245 
00246     // Deselect the drawing tools before destroying the DC.
00247     dc.SelectObject(oldbrush);
00248     dc.SelectObject(oldpen);
00249 #endif
00250 }

void CScrollerCorner::OnSetCursor wxSetCursorEvent &  event  ) 
 

Fakes the sizing gadget for our custom scrollbars.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
14 Oct 93
Parameters:
event The standard SetCursor event, which contains all the info to handle [INPUTS] the request
- [OUTPUTS]
Returns:
TRUE, ie. the cursor has been set, and no further processing is necessary. FALSE if the cursor has not been set, e.g. this view is not active.

Errors: - Scope: Protected

See also:
DocView::OnSetCursor

Definition at line 271 of file scroller.cpp.

00272 {
00273 #ifdef GERRYXXX
00274     // Child windows assume responsibility for setting their own cursor.
00275     if (pWnd != this) return FALSE;
00276     
00277     BOOL fIsMaxed;
00278     GetMainFrame()->MDIGetActive(&fIsMaxed);
00279     Cursor* pc = /*fIsMaxed ?*/ Cursor::Arrow; /*: Cursor::SizeNWSE;*/
00280 
00281     pc->SetActive();
00282     return TRUE;
00283 #endif
00284 }


Member Data Documentation

wxBitmap CScrollerCorner::SizeBitmap [private]
 

Definition at line 148 of file scroller.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:17 2007 for Camelot by  doxygen 1.4.4