]> git.saurik.com Git - wxWidgets.git/blob - interface/vscroll.h
Fixed wxScrolledWindow references to properly link (and appropriately changed others...
[wxWidgets.git] / interface / vscroll.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: vscroll.h
3 // Purpose: interface of wxVarHScrollHelper
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxVarScrollHelperBase
11 @wxheader{vscroll.h}
12
13 This class provides all common base functionality for scroll calculations
14 shared among all variable scrolled window implementations as well as
15 automatic scrollbar functionality, saved scroll positions, controlling
16 target windows to be scrolled, as well as defining all required virtual
17 functions that need to be implemented for any orientation specific work.
18
19 Documentation of this class is provided specifically for referencing use
20 of the functions provided by this class for use with the variable scrolled
21 windows that derive from here. You will likely want to derive your window
22 from one of the already implemented variable scrolled windows rather than
23 from wxVarScrollHelperBase directly.
24
25 @library{wxcore}
26 @category{FIXME}
27
28 @see wxHScrolledWindow, wxHVScrolledWindow, wxVScrolledWindow
29 */
30 class wxVarScrollHelperBase
31 {
32 public:
33 /**
34 Constructor taking the target window to be scrolled by this helper class.
35 This will attach scroll event handlers to the target window to catch and
36 handle scroll events appropriately.
37 */
38 wxVarScrollHelperBase(wxWindow* winToScroll);
39
40 /**
41 Virtual destructor for detaching scroll event handlers attached with this
42 helper class.
43 */
44 ~wxVarScrollHelperBase();
45
46 /**
47 Translates the logical coordinate given to the current device coordinate.
48 For example, if the window is scrolled 10 units and each scroll unit
49 represents 10 device units (which may not be the case since this class allows
50 for variable scroll unit sizes), a call to this function with a coordinate of
51 15 will return -85.
52
53 @see CalcUnscrolledPosition()
54 */
55 int CalcScrolledPosition(int coord) const;
56
57 /**
58 Translates the device coordinate given to the corresponding logical
59 coordinate. For example, if the window is scrolled 10 units and each scroll
60 unit represents 10 device units (which may not be the case since this class
61 allows for variable scroll unit sizes), a call to this function with a
62 coordinate of 15 will return 115.
63
64 @see CalcScrolledPosition()
65 */
66 int CalcUnscrolledPosition(int coord) const;
67
68 /**
69 With physical scrolling on (when this is @true), the device origin is
70 changed properly when a wxPaintDC is prepared,
71 children are actually moved and laid out properly, and the contents of the
72 window (pixels) are actually moved. When this is @false, you are
73 responsible for repainting any invalidated areas of the window yourself to
74 account for the new scroll position.
75 */
76 void EnablePhysicalScrolling(bool scrolling = true);
77
78 /**
79 When the number of scroll units change, we try to estimate the total size of
80 all units when the full window size is needed (i.e. to calculate the scrollbar
81 thumb size). This is a rather expensive operation in terms of unit access, so
82 if the user code may estimate the average size better or faster than we do, it
83 should override this function to implement its own logic. This function should
84 return the best guess for the total virtual window size.
85 Note that although returning a totally wrong value would still work, it risks
86 resulting in very strange scrollbar behaviour so this function should really
87 try to make the best guess possible.
88 */
89 virtual wxCoord EstimateTotalSize() const;
90
91 /**
92 This function needs to be overridden in the in the derived class to return the
93 window size with respect to the opposing orientation. If this is a vertical
94 scrolled window, it should return the height.
95
96 @see GetOrientationTargetSize()
97 */
98 virtual int GetNonOrientationTargetSize() const;
99
100 /**
101 This function need to be overridden to return the orientation that this helper
102 is working with, either @c wxHORIZONTAL or @c wxVERTICAL.
103 */
104 virtual wxOrientation GetOrientation() const;
105
106 /**
107 This function needs to be overridden in the in the derived class to return the
108 window size with respect to the orientation this helper is working with. If
109 this is a vertical scrolled window, it should return the width.
110
111 @see GetNonOrientationTargetSize()
112 */
113 virtual int GetOrientationTargetSize() const;
114
115 /**
116 This function will return the target window this helper class is currently
117 scrolling.
118
119 @see SetTargetWindow()
120 */
121 wxWindow* GetTargetWindow() const;
122
123 /**
124 Returns the index of the first visible unit based on the scroll position.
125 */
126 size_t GetVisibleBegin() const;
127
128 /**
129 Returns the index of the last visible unit based on the scroll position. This
130 includes the last unit even if it is only partially visible.
131 */
132 size_t GetVisibleEnd() const;
133
134 /**
135 Returns @true if the given scroll unit is currently visible (even if only
136 partially visible) or @false otherwise.
137 */
138 bool IsVisible(size_t unit) const;
139
140 /**
141 This function must be overridden in the derived class, and should return the
142 size of the given unit in pixels.
143 */
144 virtual wxCoord OnGetUnitSize(size_t unit) const;
145
146 /**
147 This function doesn't have to be overridden but it may be useful to do so if
148 calculating the units' sizes is a relatively expensive operation as it gives
149 your code a chance to calculate several of them at once and cache the result
150 if necessary.
151 @c OnGetUnitsSizeHint() is normally called just before
152 OnGetUnitSize() but you
153 shouldn't rely on the latter being called for all units in the interval
154 specified here. It is also possible that OnGetUnitSize() will be called for
155 units outside of this interval, so this is really just a hint, not a promise.
156 Finally, note that unitMin is inclusive, while unitMax is exclusive.
157 */
158 virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const;
159
160 /**
161 Recalculate all parameters and repaint all units.
162 */
163 virtual void RefreshAll();
164
165 /**
166 Normally the window will scroll itself, but in some rare occasions you might
167 want it to scroll (part of) another window (e.g. a child of it in order to
168 scroll only a portion the area between the scrollbars like a spreadsheet where
169 only the cell area will move).
170
171 @see GetTargetWindow()
172 */
173 void SetTargetWindow(wxWindow* target);
174
175 /**
176 Update the thumb size shown by the scrollbar.
177 */
178 virtual void UpdateScrollbar();
179
180 /**
181 Returns the virtual scroll unit under the device unit given accounting for
182 scroll position or @c wxNOT_FOUND if none (i.e. if it is below the last
183 item).
184 */
185 int VirtualHitTest(wxCoord coord) const;
186 };
187
188
189
190 /**
191 @class wxVarVScrollHelper
192 @wxheader{vscroll.h}
193
194 This class provides functions wrapping the
195 wxVarScrollHelperBase class, targeted for
196 vertical-specific scrolling using wxVScrolledWindow.
197
198 Like wxVarScrollHelperBase, this class is mostly only useful to those classes
199 built into wxWidgets deriving from here, and this documentation is mostly
200 only provided for referencing those functions provided. You will likely want
201 to derive your window from wxVScrolledWindow rather than from here directly.
202
203 @library{wxcore}
204 @category{FIXME}
205
206 @see wxHScrolledWindow, wxHVScrolledWindow, wxVScrolledWindow
207 */
208 class wxVarVScrollHelper : public wxVarScrollHelperBase
209 {
210 public:
211 /**
212 Constructor taking the target window to be scrolled by this helper class.
213 This will attach scroll event handlers to the target window to catch and
214 handle scroll events appropriately.
215 */
216 wxVarVScrollHelper(wxWindow* winToScroll);
217
218 /**
219 This class forwards calls from
220 wxVarScrollHelperBase::EstimateTotalSize
221 to this function so derived classes can override either just the height or
222 the width estimation, or just estimate both differently if desired in any
223 wxHVScrolledWindow derived class.
224 Please note that this function will not be called if @c EstimateTotalSize()
225 is overridden in your derived class.
226 */
227 virtual wxCoord EstimateTotalHeight() const;
228
229 /**
230 Returns the number of rows the target window contains.
231
232 @see SetRowCount()
233 */
234 size_t GetRowCount() const;
235
236 /**
237 Returns the index of the first visible row based on the scroll position.
238 */
239 size_t GetVisibleRowsBegin() const;
240
241 /**
242 Returns the index of the last visible row based on the scroll position. This
243 includes the last row even if it is only partially visible.
244 */
245 size_t GetVisibleRowsEnd() const;
246
247 /**
248 Returns @true if the given row is currently visible (even if only
249 partially visible) or @false otherwise.
250 */
251 bool IsRowVisible(size_t row) const;
252
253 /**
254 This function must be overridden in the derived class, and should return the
255 height of the given row in pixels.
256 */
257 virtual wxCoord OnGetRowHeight(size_t row) const;
258
259 /**
260 This function doesn't have to be overridden but it may be useful to do so if
261 calculating the rows' sizes is a relatively expensive operation as it gives
262 your code a chance to calculate several of them at once and cache the result
263 if necessary.
264 @c OnGetRowsHeightHint() is normally called just before
265 OnGetRowHeight() but you
266 shouldn't rely on the latter being called for all rows in the interval
267 specified here. It is also possible that OnGetRowHeight() will be called for
268 units outside of this interval, so this is really just a hint, not a promise.
269 Finally, note that rowMin is inclusive, while rowMax is exclusive.
270 */
271 virtual void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const;
272
273 /**
274 Triggers a refresh for just the given row's area of the window if it's visible.
275 */
276 virtual void RefreshRow(size_t row);
277
278 /**
279 Triggers a refresh for the area between the specified range of rows given
280 (inclusively).
281 */
282 virtual void RefreshRows(size_t from, size_t to);
283
284 /**
285 Scroll by the specified number of pages which may be positive (to scroll down)
286 or negative (to scroll up).
287 */
288 virtual bool ScrollRowPages(int pages);
289
290 /**
291 Scroll by the specified number of rows which may be positive (to scroll down)
292 or negative (to scroll up).
293 Returns @true if the window was scrolled, @false otherwise (for
294 example, if we're trying to scroll down but we are already showing the last
295 row).
296 */
297 virtual bool ScrollRows(int rows);
298
299 /**
300 Scroll to the specified row. It will become the first visible row in the window.
301 Returns @true if we scrolled the window, @false if nothing was done.
302 */
303 bool ScrollToRow(size_t row);
304
305 /**
306 Set the number of rows the window contains. The derived class must provide the
307 heights for all rows with indices up to the one given here in it's
308 OnGetRowHeight() implementation.
309 */
310 void SetRowCount(size_t rowCount);
311 };
312
313
314
315 /**
316 @class wxVarHScrollHelper
317 @wxheader{vscroll.h}
318
319 This class provides functions wrapping the
320 wxVarScrollHelperBase class, targeted for
321 horizontal-specific scrolling using wxHScrolledWindow.
322
323 Like wxVarScrollHelperBase, this class is mostly only useful to those classes
324 built into wxWidgets deriving from here, and this documentation is mostly
325 only provided for referencing those functions provided. You will likely want
326 to derive your window from wxHScrolledWindow rather than from here directly.
327
328 @library{wxcore}
329 @category{FIXME}
330
331 @see wxHScrolledWindow, wxHVScrolledWindow, wxVScrolledWindow
332 */
333 class wxVarHScrollHelper : public wxVarScrollHelperBase
334 {
335 public:
336 /**
337 Constructor taking the target window to be scrolled by this helper class.
338 This will attach scroll event handlers to the target window to catch and
339 handle scroll events appropriately.
340 */
341 wxVarHScrollHelper(wxWindow* winToScroll);
342
343 /**
344 This class forwards calls from
345 wxVarScrollHelperBase::EstimateTotalSize
346 to this function so derived classes can override either just the height or
347 the width estimation, or just estimate both differently if desired in any
348 wxHVScrolledWindow derived class.
349 Please note that this function will not be called if @c EstimateTotalSize()
350 is overridden in your derived class.
351 */
352 virtual wxCoord EstimateTotalWidth() const;
353
354 /**
355 Returns the number of columns the target window contains.
356
357 @see SetColumnCount()
358 */
359 size_t GetColumnCount() const;
360
361 /**
362 Returns the index of the first visible column based on the scroll position.
363 */
364 size_t GetVisibleColumnsBegin() const;
365
366 /**
367 Returns the index of the last visible column based on the scroll position. This
368 includes the last column even if it is only partially visible.
369 */
370 size_t GetVisibleColumnsEnd() const;
371
372 /**
373 Returns @true if the given column is currently visible (even if only
374 partially visible) or @false otherwise.
375 */
376 bool IsColumnVisible(size_t column) const;
377
378 /**
379 This function must be overridden in the derived class, and should return the
380 width of the given column in pixels.
381 */
382 virtual wxCoord OnGetColumnWidth(size_t column) const;
383
384 /**
385 This function doesn't have to be overridden but it may be useful to do so if
386 calculating the columns' sizes is a relatively expensive operation as it gives
387 your code a chance to calculate several of them at once and cache the result
388 if necessary.
389 @c OnGetColumnsWidthHint() is normally called just before
390 OnGetColumnWidth() but you
391 shouldn't rely on the latter being called for all columns in the interval
392 specified here. It is also possible that OnGetColumnWidth() will be called for
393 units outside of this interval, so this is really just a hint, not a promise.
394 Finally, note that columnMin is inclusive, while columnMax is exclusive.
395 */
396 virtual void OnGetColumnsWidthHint(size_t columnMin,
397 size_t columnMax) const;
398
399 /**
400 Triggers a refresh for just the given column's area of the window if it's
401 visible.
402 */
403 virtual void RefreshColumn(size_t column);
404
405 /**
406 Triggers a refresh for the area between the specified range of columns given
407 (inclusively).
408 */
409 virtual void RefreshColumns(size_t from, size_t to);
410
411 /**
412 Scroll by the specified number of pages which may be positive (to scroll right)
413 or negative (to scroll left).
414 */
415 virtual bool ScrollColumnPages(int pages);
416
417 /**
418 Scroll by the specified number of columns which may be positive (to scroll
419 right)
420 or negative (to scroll left).
421 Returns @true if the window was scrolled, @false otherwise (for
422 example, if we're trying to scroll right but we are already showing the last
423 column).
424 */
425 virtual bool ScrollColumns(int columns);
426
427 /**
428 Scroll to the specified column. It will become the first visible column in the
429 window.
430 Returns @true if we scrolled the window, @false if nothing was done.
431 */
432 bool ScrollToColumn(size_t column);
433
434 /**
435 Set the number of columns the window contains. The derived class must provide
436 the widths for all columns with indices up to the one given here in it's
437 OnGetColumnWidth() implementation.
438 */
439 void SetColumnCount(size_t columnCount);
440 };
441
442
443
444 /**
445 @class wxVarHVScrollHelper
446 @wxheader{vscroll.h}
447
448 This class provides functions wrapping the
449 wxVarHScrollHelper and
450 wxVarVScrollHelper classes, targeted for
451 scrolling a window in both axis using
452 wxHVScrolledWindow. Since this class is also
453 the join class of the horizontal and vertical scrolling functionality, it
454 also addresses some wrappers that help avoid the need to specify class scope
455 in your wxHVScrolledWindow-derived class when using wxVarScrollHelperBase
456 functionality.
457
458 Like all three of it's scroll helper base classes, this class is mostly only
459 useful to those classes built into wxWidgets deriving from here, and this
460 documentation is mostly only provided for referencing those functions
461 provided. You will likely want to derive your window from wxHVScrolledWindow
462 rather than from here directly.
463
464 @library{wxcore}
465 @category{FIXME}
466
467 @see wxHScrolledWindow, wxHVScrolledWindow, wxVScrolledWindow
468 */
469 class wxVarHVScrollHelper : public wxVarVScrollHelper,
470 public wxVarHScrollHelper
471 {
472 public:
473 /**
474 Constructor taking the target window to be scrolled by this helper class.
475 This will attach scroll event handlers to the target window to catch and
476 handle scroll events appropriately.
477 */
478 wxVarHVScrollHelper(wxWindow* winToScroll);
479
480 /**
481 With physical scrolling on (when this is @true), the device origin is
482 changed properly when a wxPaintDC is prepared,
483 children are actually moved and laid out properly, and the contents of the
484 window (pixels) are actually moved. When this is @false, you are
485 responsible for repainting any invalidated areas of the window yourself to
486 account for the new scroll position.
487
488 @param vscrolling
489 Specifies if physical scrolling should be turned on when scrolling
490 vertically.
491 @param hscrolling
492 Specifies if physical scrolling should be turned on when scrolling
493 horizontally.
494 */
495 void EnablePhysicalScrolling(bool vscrolling = true,
496 bool hscrolling = true);
497
498 /**
499 Returns the number of columns and rows the target window contains.
500
501 @see SetRowColumnCount()
502 */
503 wxSize GetRowColumnCount() const;
504
505 /**
506 Returns the index of the first visible column and row based on the current
507 scroll position.
508 */
509 wxPosition GetVisibleBegin() const;
510
511 /**
512 Returns the index of the last visible column and row based on the scroll
513 position. This includes any partially visible columns or rows.
514 */
515 wxPosition GetVisibleEnd() const;
516
517 //@{
518 /**
519 Returns @true if both the given row and column are currently visible
520 (even if only partially visible) or @false otherwise.
521 */
522 bool IsVisible(size_t row, size_t column) const;
523 const bool IsVisible(const wxPosition& pos) const;
524 //@}
525
526 //@{
527 /**
528 Triggers a refresh for just the area shared between the given row and column
529 of the window if it is visible.
530 */
531 virtual void RefreshRowColumn(size_t row, size_t column);
532 virtual void RefreshRowColumn(const wxPosition& pos);
533 //@}
534
535 //@{
536 /**
537 Triggers a refresh for the visible area shared between all given rows and
538 columns (inclusive) of the window. If the target window for both orientations
539 is the same, the rectangle of cells is refreshed; if the target windows
540 differ, the entire client size opposite the orientation direction is
541 refreshed between the specified limits.
542 */
543 virtual void RefreshRowsColumns(size_t fromRow, size_t toRow,
544 size_t fromColumn,
545 size_t toColumn);
546 virtual void RefreshRowsColumns(const wxPosition& from,
547 const wxPosition& to);
548 //@}
549
550 //@{
551 /**
552 Scroll to the specified row and column. It will become the first visible row
553 and column in the window. Returns @true if we scrolled the window,
554 @false if nothing was done.
555 */
556 bool ScrollToRowColumn(size_t row, size_t column);
557 bool ScrollToRowColumn(const wxPosition& pos);
558 //@}
559
560 /**
561 Set the number of rows and columns the target window will contain. The
562 derived class must provide the sizes for all rows and columns with indices up
563 to the ones given here in it's wxVarVScrollHelper::OnGetRowHeight
564 and wxVarHScrollHelper::OnGetColumnWidth implementations,
565 respectively.
566 */
567 void SetRowColumnCount(size_t rowCount, size_t columnCount);
568
569 //@{
570 /**
571 Returns the virtual scroll unit under the device unit given accounting for
572 scroll position or @c wxNOT_FOUND (for the row, column, or possibly both
573 values) if none.
574 */
575 wxPosition VirtualHitTest(wxCoord x, wxCoord y) const;
576 const wxPosition VirtualHitTest(const wxPoint& pos) const;
577 //@}
578 };
579
580
581
582 /**
583 @class wxVScrolledWindow
584 @wxheader{vscroll.h}
585
586 In the name of this class, "V" may stand for "variable" because it can be
587 used for scrolling rows of variable heights; "virtual", because it is not
588 necessary to know the heights of all rows in advance -- only those which
589 are shown on the screen need to be measured; or even "vertical", because
590 this class only supports scrolling vertically.
591
592 In any case, this is a generalization of wxScrolled which can be only used
593 when all rows have the same heights. It lacks some other wxScrolled
594 features however, notably it can't scroll only a rectangle of the window
595 and not its entire client area.
596
597 To use this class, you need to derive from it and implement the
598 wxVarVScrollHelper::OnGetRowHeight pure virtual
599 method. You also must call wxVarVScrollHelper::SetRowCount
600 to let the base class know how many rows it should display, but from that
601 moment on the scrolling is handled entirely by wxVScrolledWindow. You only
602 need to draw the visible part of contents in your @c OnPaint() method as
603 usual. You should use wxVarVScrollHelper::GetVisibleRowsBegin
604 and wxVarVScrollHelper::GetVisibleRowsEnd to
605 select the lines to display. Note that the device context origin is not shifted
606 so the first visible row always appears at the point (0, 0) in physical as
607 well as logical coordinates.
608
609 @library{wxcore}
610 @category{miscwnd}
611
612 @see wxHScrolledWindow, wxHVScrolledWindow
613 */
614 class wxVScrolledWindow : public wxPanel, public wxVarVScrollHelper
615 {
616 public:
617 //@{
618 /**
619 This is the normal constructor, no need to call @c Create() after using this
620 one.
621 Note that @c wxVSCROLL is always automatically added to our style, there is
622 no need to specify it explicitly.
623
624 @param parent
625 The parent window, must not be @NULL
626 @param id
627 The identifier of this window, wxID_ANY by default
628 @param pos
629 The initial window position
630 @param size
631 The initial window size
632 @param style
633 The window style. There are no special style bits defined for
634 this class.
635 @param name
636 The name for this window; usually not used
637 */
638 wxVScrolledWindow();
639 wxVScrolledWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
640 const wxPoint& pos = wxDefaultPosition,
641 const wxSize& size = wxDefaultSize,
642 long style = 0,
643 const wxString& name = wxPanelNameStr);
644 //@}
645
646 /**
647 Same as the @ref wxvscrolledwindow() "non-default constuctor"
648 but returns status code: @true if ok, @false if the window couldn't
649 be created.
650 Just as with the constructor above, the @c wxVSCROLL style is always used,
651 there is no need to specify it explicitly.
652 */
653 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
654 const wxPoint& pos = wxDefaultPosition,
655 const wxSize& size = wxDefaultSize,
656 long style = 0,
657 const wxString& name = wxPanelNameStr);
658
659 //@{
660 /**
661 The following functions provide backwards compatibility for applications
662 originally built using wxVScrolledWindow in 2.6 or 2.8. Originally,
663 wxVScrolledWindow referred to scrolling "lines". We now use "units" in
664 wxVarScrollHelperBase to avoid implying any orientation (since the functions
665 are used for both horizontal and vertical scrolling in derived classes). And
666 in the new wxVScrolledWindow and wxHScrolledWindow classes, we refer to them
667 as "rows" and "columns", respectively. This is to help clear some confusion
668 in not only those classes, but also in wxHVScrolledWindow where functions
669 are inherited from both.
670 You are encouraged to update any existing code using these function to use
671 the new replacements mentioned below, and avoid using these functions for
672 any new code as they are deprecated.
673
674 Deprecated for wxVarVScrollHelper::SetRowCount.
675 */
676 size_t GetFirstVisibleLine();
677 const size_t GetLastVisibleLine();
678 const size_t GetLineCount();
679 const int HitTest(wxCoord x, wxCoord y);
680 const int HitTest(const wxPoint& pt);
681 const virtual wxCoord OnGetLineHeight(size_t line);
682 const virtual void OnGetLinesHint(size_t lineMin,
683 size_t lineMax);
684 const virtual void RefreshLine(size_t line);
685 virtual void RefreshLines(size_t from, size_t to);
686 virtual bool ScrollLines(int lines);
687 virtual bool ScrollPages(int pages);
688 bool ScrollToLine(size_t line);
689 void SetLineCount(size_t count);
690 //@}
691 };
692
693
694
695 /**
696 @class wxHScrolledWindow
697 @wxheader{vscroll.h}
698
699 In the name of this class, "H" stands for "horizontal" because it can be
700 used for scrolling columns of variable widths. It is not necessary to know
701 the widths of all columns in advance -- only those which are shown on the
702 screen need to be measured.
703
704 In any case, this is a generalization of wxScrolled which can be only used
705 when all columns have the same widths. It lacks some other wxScrolled
706 features however, notably it can't scroll only a rectangle of the window
707 and not its entire client area.
708
709 To use this class, you need to derive from it and implement the
710 wxVarHScrollHelper::OnGetColumnWidth pure virtual
711 method. You also must call wxVarHScrollHelper::SetColumnCount
712 to let the base class know how many columns it should display, but from that
713 moment on the scrolling is handled entirely by wxHScrolledWindow. You only
714 need to draw the visible part of contents in your @c OnPaint() method as
715 usual. You should use wxVarHScrollHelper::GetVisibleColumnsBegin
716 and wxVarHScrollHelper::GetVisibleColumnsEnd to
717 select the lines to display. Note that the device context origin is not shifted
718 so the first visible column always appears at the point (0, 0) in physical as
719 well as logical coordinates.
720
721 @library{wxcore}
722 @category{FIXME}
723
724 @see wxHVScrolledWindow, wxVScrolledWindow
725 */
726 class wxHScrolledWindow : public wxPanel, public wxVarHScrollHelper
727 {
728 public:
729 //@{
730 /**
731 This is the normal constructor, no need to call @c Create() after using this
732 one.
733 Note that @c wxHSCROLL is always automatically added to our style, there is
734 no need to specify it explicitly.
735
736 @param parent
737 The parent window, must not be @NULL
738 @param id
739 The identifier of this window, wxID_ANY by default
740 @param pos
741 The initial window position
742 @param size
743 The initial window size
744 @param style
745 The window style. There are no special style bits defined for
746 this class.
747 @param name
748 The name for this window; usually not used
749 */
750 wxHScrolledWindow();
751 wxHScrolledWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
752 const wxPoint& pos = wxDefaultPosition,
753 const wxSize& size = wxDefaultSize,
754 long style = 0,
755 const wxString& name = wxPanelNameStr);
756 //@}
757
758 /**
759 Same as the @ref wxhscrolledwindow() "non-default constuctor"
760 but returns status code: @true if ok, @false if the window couldn't
761 be created.
762 Just as with the constructor above, the @c wxHSCROLL style is always used,
763 there is no need to specify it explicitly.
764 */
765 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
766 const wxPoint& pos = wxDefaultPosition,
767 const wxSize& size = wxDefaultSize,
768 long style = 0,
769 const wxString& name = wxPanelNameStr);
770 };
771
772
773
774 /**
775 @class wxHVScrolledWindow
776 @wxheader{vscroll.h}
777
778 This window inherits all functionality of both vertical and horizontal,
779 variable scrolled windows. It automatically handles everything needed to
780 scroll both axis simultaneously with both variable row heights and variable
781 column widths.
782
783 In any case, this is a generalization of wxScrolled which can be only used
784 when all rows and columns are the same size. It lacks some other wxScrolled
785 features however, notably it can't scroll only a rectangle of the window
786 and not its entire client area.
787
788 To use this class, you must derive from it and implement both the
789 wxVarVScrollHelper::OnGetRowHeight and
790 wxVarHScrollHelper::OnGetColumnWidth pure virtual
791 methods to let the base class know how many rows and columns it should
792 display. You also need to set the total rows and columns the window contains,
793 but from that moment on the scrolling is handled entirely by
794 wxHVScrolledWindow. You only need to draw the visible part of contents in
795 your @c OnPaint() method as usual. You should use
796 wxVarHVScrollHelper::GetVisibleBegin
797 and wxVarHVScrollHelper::GetVisibleEnd to select the
798 lines to display. Note that the device context origin is not shifted so the
799 first visible row and column always appear at the point (0, 0) in physical
800 as well as logical coordinates.
801
802 @library{wxcore}
803 @category{FIXME}
804
805 @see wxHScrolledWindow, wxVScrolledWindow
806 */
807 class wxHVScrolledWindow : public wxPanel, public wxVarHVScrollHelper
808 {
809 public:
810 //@{
811 /**
812 This is the normal constructor, no need to call @c Create() after using this
813 one.
814 Note that @c wxHSCROLL and @c wxVSCROLL are always automatically added
815 to our styles, there is no need to specify it explicitly.
816
817 @param parent
818 The parent window, must not be @NULL
819 @param id
820 The identifier of this window, wxID_ANY by default
821 @param pos
822 The initial window position
823 @param size
824 The initial window size
825 @param style
826 The window style. There are no special style bits defined for
827 this class.
828 @param name
829 The name for this window; usually not used
830 */
831 wxHVScrolledWindow();
832 wxHVScrolledWindow(wxWindow* parent,
833 wxWindowID id = wxID_ANY,
834 const wxPoint& pos = wxDefaultPosition,
835 const wxSize& size = wxDefaultSize,
836 long style = 0,
837 const wxString& name = wxPanelNameStr);
838 //@}
839
840 /**
841 Same as the @ref wxhvscrolledwindow() "non-default constuctor"
842 but returns status code: @true if ok, @false if the window couldn't
843 be created.
844 Just as with the constructor above, the @c wxHSCROLL and @c wxVSCROLL
845 styles are always used, there is no need to specify it explicitly.
846 */
847 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
848 const wxPoint& pos = wxDefaultPosition,
849 const wxSize& size = wxDefaultSize,
850 long style = 0,
851 const wxString& name = wxPanelNameStr);
852 };
853