# :stopdoc:
# This file is automatically generated by the WXRuby3 documentation
# generator. Do not alter this file.
# :startdoc:
module Wx
# In the name of this class, "V" may stand for "variable" because it can be used for scrolling rows of variable heights; "virtual", because it is not necessary to know the heights of all rows in advance only those which are shown on the screen need to be measured; or even "vertical", because this class only supports scrolling vertically.
# In any case, this is a generalization of {Wx::Scrolled} which can be only used when all rows have the same heights. It lacks some other {Wx::Scrolled} features however, notably it can't scroll specific pixel sizes of the window or its exact client area size.
# To use this class, you need to derive from it and implement the {Wx::VScrolledWindow#on_get_row_height} pure virtual method. You also must call {Wx::VScrolledWindow#set_row_count} to let the base class know how many rows it should display, but from that moment on the scrolling is handled entirely by {Wx::VScrolledWindow}. You only need to draw the visible part of contents in your OnPaint()
method as usual. You should use {Wx::VScrolledWindow#get_visible_rows_begin} and {Wx::VScrolledWindow#get_visible_rows_end} to select the lines to display. Note that the device context origin is not shifted so the first visible row always appears at the point (0, 0) in physical as well as logical coordinates.
#
# == wxWidgets 2.8 Compatibility Functions
#
# The following functions provide backwards compatibility for applications originally built using {Wx::VScrolledWindow} in 2.6 or 2.8. Originally, {Wx::VScrolledWindow} referred to scrolling "lines". We now use "units" in {Wx::VarScrollHelperBase} to avoid implying any orientation (since the functions are used for both horizontal and vertical scrolling in derived classes). And in the new {Wx::VScrolledWindow} and {Wx::HScrolledWindow} classes, we refer to them as "rows" and "columns", respectively. This is to help clear some confusion in not only those classes, but also in {Wx::HVScrolledWindow} where functions are inherited from both.
# You are encouraged to update any existing code using these function to use the new replacements mentioned below, and avoid using these functions for any new code as they are deprecated.
#
# size_t GetFirstVisibleLine() const
# Deprecated for {Wx::VScrolledWindow#get_visible_rows_begin}.
#
# size_t GetLastVisibleLine() const
# Deprecated for {Wx::VScrolledWindow#get_visible_rows_end}. This function originally had a slight design flaw in that it was possible to return (size_t)-1
(ie: a large positive number) if the scroll position was 0 and the first line wasn't completely visible.
#
# size_t GetLineCount() const
# Deprecated for {Wx::VScrolledWindow#get_row_count}.
#
# int HitTest(wxCoord x, wxCoord y) const
#
# int HitTest(const Wx::Point& pt) const
# Deprecated for {Wx::VScrolledWindow#virtual_hit_test}.
#
# virtual wxCoord OnGetLineHeight(size_t line) const
# Deprecated for {Wx::VScrolledWindow#on_get_row_height}.
#
# virtual void OnGetLinesHint(size_t lineMin, size_t lineMax) const
# Deprecated for {Wx::VScrolledWindow#on_get_rows_height_hint}.
#
# virtual void RefreshLine(size_t line)
# Deprecated for {Wx::VScrolledWindow#refresh_row}.
#
# virtual void RefreshLines(size_t from, size_t to)
# Deprecated for {Wx::VScrolledWindow#refresh_rows}.
#
# virtual bool ScrollLines(int lines)
# Deprecated for {Wx::VScrolledWindow#scroll_rows}.
#
# virtual bool ScrollPages(int pages)
# Deprecated for {Wx::VScrolledWindow#scroll_row_pages}.
#
# bool ScrollToLine(size_t line)
# Deprecated for {Wx::VScrolledWindow#scroll_to_row}.
#
# void SetLineCount(size_t count)
# Deprecated for {Wx::VScrolledWindow#set_row_count}.
#
# ===
#
# Category: Miscellaneous Windows
# @see Wx::HScrolledWindow
# @see Wx::HVScrolledWindow
#
#
class VScrolledWindow < Panel
# @overload initialize()
# Default constructor, you must call {Wx::VScrolledWindow#create} later.
# @return [Wx::VScrolledWindow]
# @overload initialize(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::PANEL_NAME_STR)
# This is the normal constructor, no need to call {Wx::VScrolledWindow#create} after using this constructor.
# {Wx::VSCROLL} is always automatically added to the style, there is no need to specify it explicitly.
# @param parent [Wx::Window] The parent window, must not be NULL.
# @param id [Integer] The identifier of this window, {Wx::StandardID::ID_ANY} by default.
# @param pos [Array(Integer, Integer), Wx::Point] The initial window position.
# @param size [Array(Integer, Integer), Wx::Size] The initial window size.
# @param style [Integer] The window style. There are no special style bits defined for this class.
# @param name [String] The name for this window; usually not used.
# @return [Wx::VScrolledWindow]
def initialize(*args) end
# Same as the non-default constructor, but returns a status code: true if ok, false if the window couldn't be created.
# Just as with the constructor, the {Wx::VSCROLL} style is always used, there is no need to specify it explicitly.
# @param parent [Wx::Window]
# @param id [Integer]
# @param pos [Array(Integer, Integer), Wx::Point]
# @param size [Array(Integer, Integer), Wx::Size]
# @param style [Integer]
# @param name [String]
# @return [Boolean]
def create(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::PANEL_NAME_STR) end
# Returns the number of rows the target window contains.
#
# @see Wx::VScrolledWindow#set_row_count
# @return [Integer]
def get_row_count; end
alias_method :row_count, :get_row_count
# Returns the index of the first visible row based on the scroll position.
# @return [Integer]
def get_visible_rows_begin; end
alias_method :visible_rows_begin, :get_visible_rows_begin
# Returns the index of the last visible row based on the scroll position.
# This includes the last row even if it is only partially visible.
# @return [Integer]
def get_visible_rows_end; end
alias_method :visible_rows_end, :get_visible_rows_end
# Returns true if the given row is currently visible (even if only partially visible) or false otherwise.
# @param row [Integer]
# @return [Boolean]
def is_row_visible(row) end
alias_method :row_visible?, :is_row_visible
# Triggers a refresh for just the given row's area of the window if it's visible.
# @param row [Integer]
# @return [void]
def refresh_row(row) end
# Triggers a refresh for the area between the specified range of rows given (inclusively).
# @param from [Integer]
# @param to [Integer]
# @return [void]
def refresh_rows(from, to) end
# Scroll by the specified number of pages which may be positive (to scroll down) or negative (to scroll up).
# @param pages [Integer]
# @return [Boolean]
def scroll_row_pages(pages) end
# Scroll by the specified number of rows which may be positive (to scroll down) or negative (to scroll up).
# true if the window was scrolled, false otherwise (for example, if we're trying to scroll down but we are already showing the last row).
# @param rows [Integer]
# @return [Boolean]
def scroll_rows(rows) end
# Scroll to the specified row.
# It will become the first visible row in the window.
# true if we scrolled the window, false if nothing was done.
# @param row [Integer]
# @return [Boolean]
def scroll_to_row(row) end
# Set the number of rows the window contains.
# The derived class must provide the heights for all rows with indices up to the one given here in it's {Wx::VScrolledWindow#on_get_row_height} implementation.
# @see Wx::VScrolledWindow#get_row_count
# @param rowCount [Integer]
# @return [void]
def set_row_count(rowCount) end
alias_method :row_count=, :set_row_count
# Translates the logical coordinate given to the current device coordinate.
# For example, if the window is scrolled 10 units and each scroll unit represents 10 device units (which may not be the case since this class allows for variable scroll unit sizes), a call to this function with a coordinate of 15 will return -85.
# @see Wx::VScrolledWindow#calc_unscrolled_position
# @param coord [Integer]
# @return [Integer]
def calc_scrolled_position(coord) end
# Translates the device coordinate given to the corresponding logical coordinate.
# For example, if the window is scrolled 10 units and each scroll unit represents 10 device units (which may not be the case since this class allows for variable scroll unit sizes), a call to this function with a coordinate of 15 will return 115.
# @see Wx::VScrolledWindow#calc_scrolled_position
# @param coord [Integer]
# @return [Integer]
def calc_unscrolled_position(coord) end
# With physical scrolling on (when this is true), the device origin is changed properly when a {Wx::PaintDC} is prepared, children are actually moved and laid out properly, and the contents of the window (pixels) are actually moved.
# When this is false, you are responsible for repainting any invalidated areas of the window yourself to account for the new scroll position.
# @param scrolling [Boolean]
# @return [void]
def enable_physical_scrolling(scrolling=true) end
# This function will return the target window this helper class is currently scrolling.
#
# @see Wx::VScrolledWindow#set_target_window
# @return [Wx::Window]
def get_target_window; end
alias_method :target_window, :get_target_window
# Returns the index of the first visible unit based on the scroll position.
# @return [Integer]
def get_visible_begin; end
alias_method :visible_begin, :get_visible_begin
# Returns the index of the last visible unit based on the scroll position.
# This includes the last unit even if it is only partially visible.
# @return [Integer]
def get_visible_end; end
alias_method :visible_end, :get_visible_end
# Returns true if the given scroll unit is currently visible (even if only partially visible) or false otherwise.
# @param unit [Integer]
# @return [Boolean]
def is_visible(unit) end
alias_method :visible?, :is_visible
# Recalculate all parameters and repaint all units.
# @return [void]
def refresh_all; end
# Normally the window will scroll itself, but in some rare occasions you might want it to scroll (part of) another window (e.g.
# a child of it in order to scroll only a portion the area between the scrollbars like a spreadsheet where only the cell area will move).
# @see Wx::VScrolledWindow#get_target_window
# @param target [Wx::Window]
# @return [void]
def set_target_window(target) end
alias_method :target_window=, :set_target_window
# Update the thumb size shown by the scrollbar.
# @return [void]
def update_scrollbar; end
# Returns the virtual scroll unit under the device unit given accounting for scroll position or {Wx::NOT_FOUND} if none (i.e.
# if it is below the last item).
# @param coord [Integer]
# @return [Integer]
def virtual_hit_test(coord) end
protected
end # VScrolledWindow
end