#include <scroller.h>
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 |
Definition at line 136 of file scroller.h.
|
Constructs a scroller object. Scope: Protected.
Definition at line 153 of file scroller.cpp.
|
|
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.
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 }
|
|
Send a fake non-client msg to our parent to allow sizing via this window.
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 }
|
|
Paints the client area of the CScrollerCorner. Scope: Protected.
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 }
|
|
Fakes the sizing gadget for our custom scrollbars.
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 }
|
|
Definition at line 148 of file scroller.h. |