1 /////////////////////////////////////////////////////////////////////////////
2 // Name: generic/scrolwin.cpp
3 // Purpose: wxScrolledWindow implementation
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "scrolwin.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/dcclient.h"
34 #include "wx/gtk/scrolwin.h"
38 #include "wx/gtk/win_gtk.h"
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 BEGIN_EVENT_TABLE(wxScrolledWindow
, wxPanel
)
45 EVT_SCROLLWIN(wxScrolledWindow::OnScroll
)
46 EVT_SIZE(wxScrolledWindow::OnSize
)
47 EVT_PAINT(wxScrolledWindow::OnPaint
)
48 EVT_CHAR(wxScrolledWindow::OnChar
)
51 IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindow
, wxPanel
)
53 // ============================================================================
55 // ============================================================================
57 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
61 extern bool g_blockEventsOnDrag
;
63 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
67 extern void wxapp_install_idle_handler();
70 //-----------------------------------------------------------------------------
71 // "value_changed" from m_vAdjust
72 //-----------------------------------------------------------------------------
74 static void gtk_scrolled_window_vscroll_callback( GtkAdjustment
*adjust
, wxScrolledWindow
*win
)
77 wxapp_install_idle_handler();
79 if (g_blockEventsOnDrag
) return;
81 if (!win
->m_hasVMT
) return;
83 win
->GtkVScroll( adjust
->value
);
86 //-----------------------------------------------------------------------------
87 // "value_changed" from m_hAdjust
88 //-----------------------------------------------------------------------------
90 static void gtk_scrolled_window_hscroll_callback( GtkAdjustment
*adjust
, wxScrolledWindow
*win
)
93 wxapp_install_idle_handler();
95 if (g_blockEventsOnDrag
) return;
96 if (!win
->m_hasVMT
) return;
98 win
->GtkHScroll( adjust
->value
);
101 //-----------------------------------------------------------------------------
102 // InsertChild for wxScrolledWindow
103 //-----------------------------------------------------------------------------
105 static void wxInsertChildInScrolledWindow( wxWindow
* parent
, wxWindow
* child
)
107 // The window might have been scrolled already, do we
108 // have to adapt the position.
109 GtkPizza
*pizza
= GTK_PIZZA(parent
->m_wxwindow
);
110 child
->m_x
+= pizza
->xoffset
;
111 child
->m_y
+= pizza
->yoffset
;
113 gtk_pizza_put( GTK_PIZZA(parent
->m_wxwindow
),
114 GTK_WIDGET(child
->m_widget
),
121 // ----------------------------------------------------------------------------
122 // wxScrolledWindow creation
123 // ----------------------------------------------------------------------------
125 void wxScrolledWindow::Init()
127 m_xScrollPixelsPerLine
= 0;
128 m_yScrollPixelsPerLine
= 0;
129 m_xScrollingEnabled
= TRUE
;
130 m_yScrollingEnabled
= TRUE
;
131 m_xScrollPosition
= 0;
132 m_yScrollPosition
= 0;
135 m_xScrollLinesPerPage
= 0;
136 m_yScrollLinesPerPage
= 0;
137 m_targetWindow
= (wxWindow
*) NULL
;
142 bool wxScrolledWindow::Create(wxWindow
*parent
,
147 const wxString
& name
)
151 if (!PreCreation( parent
, pos
, size
) ||
152 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
154 wxFAIL_MSG( wxT("wxWindow creation failed") );
158 m_insertCallback
= wxInsertChildInScrolledWindow
;
160 m_targetWindow
= this;
162 m_widget
= gtk_scrolled_window_new( (GtkAdjustment
*) NULL
, (GtkAdjustment
*) NULL
);
163 GTK_WIDGET_UNSET_FLAGS( m_widget
, GTK_CAN_FOCUS
);
165 GtkScrolledWindow
*scrolledWindow
= GTK_SCROLLED_WINDOW(m_widget
);
167 GtkScrolledWindowClass
*scroll_class
= GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget
) );
168 scroll_class
->scrollbar_spacing
= 0;
170 gtk_scrolled_window_set_policy( scrolledWindow
, GTK_POLICY_AUTOMATIC
, GTK_POLICY_AUTOMATIC
);
172 m_hAdjust
= gtk_range_get_adjustment( GTK_RANGE(scrolledWindow
->hscrollbar
) );
173 m_vAdjust
= gtk_range_get_adjustment( GTK_RANGE(scrolledWindow
->vscrollbar
) );
175 m_wxwindow
= gtk_pizza_new();
177 gtk_container_add( GTK_CONTAINER(m_widget
), m_wxwindow
);
179 GtkPizza
*pizza
= GTK_PIZZA(m_wxwindow
);
181 if (HasFlag(wxRAISED_BORDER
))
183 gtk_pizza_set_shadow_type( pizza
, GTK_MYSHADOW_OUT
);
185 else if (HasFlag(wxSUNKEN_BORDER
))
187 gtk_pizza_set_shadow_type( pizza
, GTK_MYSHADOW_IN
);
189 else if (HasFlag(wxSIMPLE_BORDER
))
191 gtk_pizza_set_shadow_type( pizza
, GTK_MYSHADOW_THIN
);
195 gtk_pizza_set_shadow_type( pizza
, GTK_MYSHADOW_NONE
);
198 GTK_WIDGET_SET_FLAGS( m_wxwindow
, GTK_CAN_FOCUS
);
199 m_acceptsFocus
= TRUE
;
201 // I _really_ don't want scrollbars in the beginning
202 m_vAdjust
->lower
= 0.0;
203 m_vAdjust
->upper
= 1.0;
204 m_vAdjust
->value
= 0.0;
205 m_vAdjust
->step_increment
= 1.0;
206 m_vAdjust
->page_increment
= 1.0;
207 gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust
), "changed" );
208 m_hAdjust
->lower
= 0.0;
209 m_hAdjust
->upper
= 1.0;
210 m_hAdjust
->value
= 0.0;
211 m_hAdjust
->step_increment
= 1.0;
212 m_hAdjust
->page_increment
= 1.0;
213 gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust
), "changed" );
215 // Handlers for new scrollbar values
219 gtk_widget_show( m_wxwindow
);
222 m_parent
->DoAddChild( this );
231 // ----------------------------------------------------------------------------
232 // setting scrolling parameters
233 // ----------------------------------------------------------------------------
236 * pixelsPerUnitX/pixelsPerUnitY: number of pixels per unit (e.g. pixels per text line)
237 * noUnitsX/noUnitsY: : no. units per scrollbar
239 void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX
, int pixelsPerUnitY
,
240 int noUnitsX
, int noUnitsY
,
241 int xPos
, int yPos
, bool noRefresh
)
243 m_xScrollPixelsPerLine
= pixelsPerUnitX
;
244 m_yScrollPixelsPerLine
= pixelsPerUnitY
;
245 m_xScrollPosition
= xPos
;
246 m_yScrollPosition
= yPos
;
247 m_xScrollLines
= noUnitsX
;
248 m_yScrollLines
= noUnitsY
;
250 m_hAdjust
->lower
= 0.0;
251 m_hAdjust
->upper
= noUnitsX
;
252 m_hAdjust
->value
= xPos
;
253 m_hAdjust
->step_increment
= 1.0;
254 m_hAdjust
->page_increment
= 2.0;
256 m_vAdjust
->lower
= 0.0;
257 m_vAdjust
->upper
= noUnitsY
;
258 m_vAdjust
->value
= yPos
;
259 m_vAdjust
->step_increment
= 1.0;
260 m_vAdjust
->page_increment
= 2.0;
265 void wxScrolledWindow::AdjustScrollbars()
268 m_targetWindow
->GetClientSize( &w
, &h
);
270 if (m_xScrollPixelsPerLine
== 0)
271 m_hAdjust
->page_size
= 1.0;
273 m_hAdjust
->page_size
= (w
/ m_xScrollPixelsPerLine
);
275 if (m_yScrollPixelsPerLine
== 0)
276 m_vAdjust
->page_size
= 1.0;
278 m_vAdjust
->page_size
= (h
/ m_yScrollPixelsPerLine
);
280 m_xScrollLinesPerPage
= (int)(m_hAdjust
->page_size
+ 0.5);
281 m_yScrollLinesPerPage
= (int)(m_vAdjust
->page_size
+ 0.5);
283 gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust
), "changed" );
284 gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust
), "changed" );
287 // ----------------------------------------------------------------------------
288 // target window handling
289 // ----------------------------------------------------------------------------
291 void wxScrolledWindow::SetTargetWindow( wxWindow
*target
)
293 wxASSERT_MSG( target
, wxT("target window must not be NULL") );
294 m_targetWindow
= target
;
297 wxWindow
*wxScrolledWindow::GetTargetWindow()
299 return m_targetWindow
;
302 // Override this function if you don't want to have wxScrolledWindow
303 // automatically change the origin according to the scroll position.
304 void wxScrolledWindow::PrepareDC(wxDC
& dc
)
306 dc
.SetDeviceOrigin( -m_xScrollPosition
* m_xScrollPixelsPerLine
,
307 -m_yScrollPosition
* m_yScrollPixelsPerLine
);
310 void wxScrolledWindow::GetScrollPixelsPerUnit (int *x_unit
, int *y_unit
) const
313 *x_unit
= m_xScrollPixelsPerLine
;
315 *y_unit
= m_yScrollPixelsPerLine
;
318 int wxScrolledWindow::GetScrollPageSize(int orient
) const
320 if ( orient
== wxHORIZONTAL
)
321 return m_xScrollLinesPerPage
;
323 return m_yScrollLinesPerPage
;
326 void wxScrolledWindow::SetScrollPageSize(int orient
, int pageSize
)
328 if ( orient
== wxHORIZONTAL
)
329 m_xScrollLinesPerPage
= pageSize
;
331 m_yScrollLinesPerPage
= pageSize
;
334 void wxScrolledWindow::OnScroll(wxScrollWinEvent
& event
)
336 int orient
= event
.GetOrientation();
338 int nScrollInc
= CalcScrollInc(event
);
339 if (nScrollInc
== 0) return;
341 if (orient
== wxHORIZONTAL
)
343 int newPos
= m_xScrollPosition
+ nScrollInc
;
344 SetScrollPos(wxHORIZONTAL
, newPos
, TRUE
);
348 int newPos
= m_yScrollPosition
+ nScrollInc
;
349 SetScrollPos(wxVERTICAL
, newPos
, TRUE
);
352 if (orient
== wxHORIZONTAL
)
354 m_xScrollPosition
+= nScrollInc
;
358 m_yScrollPosition
+= nScrollInc
;
361 if (orient
== wxHORIZONTAL
)
363 if (m_xScrollingEnabled
)
364 m_targetWindow
->ScrollWindow(-m_xScrollPixelsPerLine
* nScrollInc
, 0, (const wxRect
*) NULL
);
366 m_targetWindow
->Refresh();
370 if (m_yScrollingEnabled
)
371 m_targetWindow
->ScrollWindow(0, -m_yScrollPixelsPerLine
* nScrollInc
, (const wxRect
*) NULL
);
373 m_targetWindow
->Refresh();
377 void wxScrolledWindow::Scroll( int x_pos
, int y_pos
)
382 if (((x_pos
== -1) || (x_pos
== m_xScrollPosition
)) &&
383 ((y_pos
== -1) || (y_pos
== m_yScrollPosition
))) return;
385 if ((x_pos
!= -1) && (m_xScrollPixelsPerLine
))
387 int max
= (int)(m_hAdjust
->upper
- m_hAdjust
->page_size
+ 0.5);
388 if (max
< 0) max
= 0;
389 if (x_pos
> max
) x_pos
= max
;
390 if (x_pos
< 0) x_pos
= 0;
392 int old_x
= m_xScrollPosition
;
393 m_xScrollPosition
= x_pos
;
394 m_hAdjust
->value
= x_pos
;
396 m_targetWindow
->ScrollWindow( (old_x
-m_xScrollPosition
)*m_xScrollPixelsPerLine
, 0 );
398 // Just update the scrollbar, don't send any wxWindows event
399 GtkHDisconnectEvent();
400 gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust
), "value_changed" );
404 if ((y_pos
!= -1) && (m_yScrollPixelsPerLine
))
406 int max
= (int)(m_vAdjust
->upper
- m_vAdjust
->page_size
+ 0.5);
407 if (max
< 0) max
= 0;
408 if (y_pos
> max
) y_pos
= max
;
409 if (y_pos
< 0) y_pos
= 0;
411 int old_y
= m_yScrollPosition
;
412 m_yScrollPosition
= y_pos
;
413 m_vAdjust
->value
= y_pos
;
415 m_targetWindow
->ScrollWindow( 0, (old_y
-m_yScrollPosition
)*m_yScrollPixelsPerLine
);
417 // Just update the scrollbar, don't send any wxWindows event
418 GtkVDisconnectEvent();
419 gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust
), "value_changed" );
424 void wxScrolledWindow::GtkVScroll( float value
)
429 if (m_yScrollPixelsPerLine
== 0)
432 int y_pos
= (int)(value
+0.5);
434 if (y_pos
== m_yScrollPosition
)
437 GtkScrolledWindow
*scrolledWindow
= GTK_SCROLLED_WINDOW(m_widget
);
438 GtkRange
*range
= GTK_RANGE(scrolledWindow
->vscrollbar
);
440 wxEventType command
= wxEVT_SCROLLWIN_THUMBTRACK
;
441 if (range
->scroll_type
== GTK_SCROLL_STEP_BACKWARD
) command
= wxEVT_SCROLLWIN_LINEUP
;
442 else if (range
->scroll_type
== GTK_SCROLL_STEP_FORWARD
) command
= wxEVT_SCROLLWIN_LINEDOWN
;
443 else if (range
->scroll_type
== GTK_SCROLL_PAGE_BACKWARD
) command
= wxEVT_SCROLLWIN_PAGEUP
;
444 else if (range
->scroll_type
== GTK_SCROLL_PAGE_FORWARD
) command
= wxEVT_SCROLLWIN_PAGEDOWN
;
446 wxScrollWinEvent
event( command
, y_pos
, wxVERTICAL
);
447 event
.SetEventObject( this );
448 GetEventHandler()->ProcessEvent( event
);
451 void wxScrolledWindow::GtkHScroll( float value
)
456 if (m_xScrollPixelsPerLine
== 0)
459 int x_pos
= (int)(value
+0.5);
461 if (x_pos
== m_xScrollPosition
)
464 GtkScrolledWindow
*scrolledWindow
= GTK_SCROLLED_WINDOW(m_widget
);
465 GtkRange
*range
= GTK_RANGE(scrolledWindow
->hscrollbar
);
467 wxEventType command
= wxEVT_SCROLLWIN_THUMBTRACK
;
468 if (range
->scroll_type
== GTK_SCROLL_STEP_BACKWARD
) command
= wxEVT_SCROLLWIN_LINEUP
;
469 else if (range
->scroll_type
== GTK_SCROLL_STEP_FORWARD
) command
= wxEVT_SCROLLWIN_LINEDOWN
;
470 else if (range
->scroll_type
== GTK_SCROLL_PAGE_BACKWARD
) command
= wxEVT_SCROLLWIN_PAGEUP
;
471 else if (range
->scroll_type
== GTK_SCROLL_PAGE_FORWARD
) command
= wxEVT_SCROLLWIN_PAGEDOWN
;
473 wxScrollWinEvent
event( command
, x_pos
, wxHORIZONTAL
);
474 event
.SetEventObject( this );
475 GetEventHandler()->ProcessEvent( event
);
478 void wxScrolledWindow::EnableScrolling (bool x_scroll
, bool y_scroll
)
480 m_xScrollingEnabled
= x_scroll
;
481 m_yScrollingEnabled
= y_scroll
;
484 void wxScrolledWindow::GetVirtualSize (int *x
, int *y
) const
487 *x
= m_xScrollPixelsPerLine
* m_xScrollLines
;
489 *y
= m_yScrollPixelsPerLine
* m_yScrollLines
;
492 // Where the current view starts from
493 void wxScrolledWindow::GetViewStart (int *x
, int *y
) const
496 *x
= m_xScrollPosition
;
498 *y
= m_yScrollPosition
;
501 void wxScrolledWindow::CalcScrolledPosition(int x
, int y
, int *xx
, int *yy
) const
504 *xx
= x
- m_xScrollPosition
* m_xScrollPixelsPerLine
;
506 *yy
= y
- m_yScrollPosition
* m_yScrollPixelsPerLine
;
509 void wxScrolledWindow::CalcUnscrolledPosition(int x
, int y
, int *xx
, int *yy
) const
512 *xx
= x
+ m_xScrollPosition
* m_xScrollPixelsPerLine
;
514 *yy
= y
+ m_yScrollPosition
* m_yScrollPixelsPerLine
;
517 int wxScrolledWindow::CalcScrollInc(wxScrollWinEvent
& event
)
519 int pos
= event
.GetPosition();
520 int orient
= event
.GetOrientation();
523 if (event
.GetEventType() == wxEVT_SCROLLWIN_TOP
)
525 if (orient
== wxHORIZONTAL
)
526 nScrollInc
= - m_xScrollPosition
;
528 nScrollInc
= - m_yScrollPosition
;
530 if (event
.GetEventType() == wxEVT_SCROLLWIN_BOTTOM
)
532 if (orient
== wxHORIZONTAL
)
533 nScrollInc
= m_xScrollLines
- m_xScrollPosition
;
535 nScrollInc
= m_yScrollLines
- m_yScrollPosition
;
537 if (event
.GetEventType() == wxEVT_SCROLLWIN_LINEUP
)
541 if (event
.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN
)
545 if (event
.GetEventType() == wxEVT_SCROLLWIN_PAGEUP
)
547 if (orient
== wxHORIZONTAL
)
548 nScrollInc
= -GetScrollPageSize(wxHORIZONTAL
);
550 nScrollInc
= -GetScrollPageSize(wxVERTICAL
);
552 if (event
.GetEventType() == wxEVT_SCROLLWIN_PAGEDOWN
)
554 if (orient
== wxHORIZONTAL
)
555 nScrollInc
= GetScrollPageSize(wxHORIZONTAL
);
557 nScrollInc
= GetScrollPageSize(wxVERTICAL
);
559 if ((event
.GetEventType() == wxEVT_SCROLLWIN_THUMBTRACK
) ||
560 (event
.GetEventType() == wxEVT_SCROLLWIN_THUMBRELEASE
))
562 if (orient
== wxHORIZONTAL
)
563 nScrollInc
= pos
- m_xScrollPosition
;
565 nScrollInc
= pos
- m_yScrollPosition
;
568 if (orient
== wxHORIZONTAL
)
570 if (m_xScrollPixelsPerLine
> 0)
572 int max
= (int)(m_hAdjust
->upper
- m_hAdjust
->page_size
+ 0.5);
573 if (max
< 0) max
= 0;
575 if ( (m_xScrollPosition
+ nScrollInc
) < 0 )
576 nScrollInc
= -m_xScrollPosition
; // As -ve as we can go
577 else if ( (m_xScrollPosition
+ nScrollInc
) > max
)
578 nScrollInc
= max
- m_xScrollPosition
; // As +ve as we can go
581 m_targetWindow
->Refresh();
585 if (m_yScrollPixelsPerLine
> 0)
587 int max
= (int)(m_vAdjust
->upper
- m_vAdjust
->page_size
+ 0.5);
588 if (max
< 0) max
= 0;
590 if ( (m_yScrollPosition
+ nScrollInc
) < 0 )
591 nScrollInc
= -m_yScrollPosition
; // As -ve as we can go
592 else if ( (m_yScrollPosition
+ nScrollInc
) > max
)
593 nScrollInc
= max
- m_yScrollPosition
; // As +ve as we can go
596 m_targetWindow
->Refresh();
602 void wxScrolledWindow::SetScrollPos( int orient
, int pos
, bool WXUNUSED(refresh
) )
604 wxCHECK_RET( m_widget
!= NULL
, wxT("invalid window") );
606 wxCHECK_RET( m_wxwindow
!= NULL
, wxT("window needs client area for scrolling") );
608 if (orient
== wxHORIZONTAL
)
610 int max
= (int)(m_hAdjust
->upper
- m_hAdjust
->page_size
+ 0.5);
611 if (max
< 0) max
= 0;
613 if (pos
> max
) pos
= 0;
614 if (pos
< 0) pos
= 0;
616 if (pos
== (int)(m_hAdjust
->value
+0.5)) return;
617 m_hAdjust
->value
= pos
;
621 int max
= (int)(m_vAdjust
->upper
- m_vAdjust
->page_size
+ 0.5);
622 if (max
< 0) max
= 0;
624 if (pos
> max
) pos
= 0;
625 if (pos
< 0) pos
= 0;
627 if (pos
== (int)(m_vAdjust
->value
+0.5)) return;
628 m_vAdjust
->value
= pos
;
631 if (m_wxwindow
->window
)
633 if (orient
== wxHORIZONTAL
)
635 // Just update the scrollbar, don't send any wxWindows event
636 GtkHDisconnectEvent();
637 gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust
), "value_changed" );
642 // Just update the scrollbar, don't send any wxWindows event
643 GtkVDisconnectEvent();
644 gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust
), "value_changed" );
650 void wxScrolledWindow::GtkVConnectEvent()
652 gtk_signal_connect( GTK_OBJECT(m_vAdjust
), "value_changed",
653 (GtkSignalFunc
) gtk_scrolled_window_vscroll_callback
, (gpointer
) this );
656 void wxScrolledWindow::GtkHConnectEvent()
658 gtk_signal_connect( GTK_OBJECT(m_hAdjust
), "value_changed",
659 (GtkSignalFunc
) gtk_scrolled_window_hscroll_callback
, (gpointer
) this );
662 void wxScrolledWindow::GtkHDisconnectEvent()
664 gtk_signal_disconnect_by_func( GTK_OBJECT(m_hAdjust
),
665 (GtkSignalFunc
) gtk_scrolled_window_hscroll_callback
, (gpointer
) this );
668 void wxScrolledWindow::GtkVDisconnectEvent()
670 gtk_signal_disconnect_by_func( GTK_OBJECT(m_vAdjust
),
671 (GtkSignalFunc
) gtk_scrolled_window_vscroll_callback
, (gpointer
) this );
674 // ----------------------------------------------------------------------------
676 // ----------------------------------------------------------------------------
678 // Default OnSize resets scrollbars, if any
679 void wxScrolledWindow::OnSize(wxSizeEvent
& WXUNUSED(event
))
681 #if wxUSE_CONSTRAINTS
689 // This calls OnDraw, having adjusted the origin according to the current
691 void wxScrolledWindow::OnPaint(wxPaintEvent
& WXUNUSED(event
))
699 // kbd handling: notice that we use OnChar() and not OnKeyDown() for
700 // compatibility here - if we used OnKeyDown(), the programs which process
701 // arrows themselves in their OnChar() would never get the message and like
702 // this they always have the priority
703 void wxScrolledWindow::OnChar(wxKeyEvent
& event
)
705 int stx
, sty
, // view origin
706 szx
, szy
, // view size (total)
707 clix
, cliy
; // view size (on screen)
709 ViewStart(&stx
, &sty
);
710 GetClientSize(&clix
, &cliy
);
711 GetVirtualSize(&szx
, &szy
);
713 if( m_xScrollPixelsPerLine
)
715 clix
/= m_xScrollPixelsPerLine
;
716 szx
/= m_xScrollPixelsPerLine
;
723 if( m_yScrollPixelsPerLine
)
725 cliy
/= m_yScrollPixelsPerLine
;
726 szy
/= m_yScrollPixelsPerLine
;
735 switch ( event
.KeyCode() )
739 dsty
= sty
- (5 * cliy
/ 6);
740 Scroll(-1, (dsty
== -1) ? 0 : dsty
);
745 Scroll(-1, sty
+ (5 * cliy
/ 6));
749 Scroll(0, event
.ControlDown() ? 0 : -1);
753 Scroll(szx
- clix
, event
.ControlDown() ? szy
- cliy
: -1);