Module: WR::ScrollInfo

Defined in:
lib/wrb/scrollinfo.rb

Constant Summary collapse

SCROLLINFO =
API.defstruct "
UINT cbSize;
UINT fMask;
int nMin;
int nMax;
UINT nPage;
int nPos;
int nTrackPos;"

Instance Method Summary collapse

Instance Method Details

#hscrollpageObject



122
123
124
125
126
# File 'lib/wrb/scrollinfo.rb', line 122

def hscrollpage()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_PAGE]
  API.GetScrollInfo(self._hwnd, SB_HORZ, lpsi)
  lpsi.nPage
end

#hscrollpage=(pg) ⇒ Object



127
128
129
130
# File 'lib/wrb/scrollinfo.rb', line 127

def hscrollpage=(pg)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_PAGE, nil, nil, pg]
  API.SetScrollInfo(self._hwnd, SB_HORZ, lpsi, 1)
end

#hscrollposObject



112
113
114
115
116
# File 'lib/wrb/scrollinfo.rb', line 112

def hscrollpos()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS]
  API.GetScrollInfo(self._hwnd, SB_HORZ, lpsi)
  lpsi.nPos
end

#hscrollpos=(ps) ⇒ Object



117
118
119
120
# File 'lib/wrb/scrollinfo.rb', line 117

def hscrollpos=(ps)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS, nil, nil, nil, ps]
  API.SetScrollInfo(self._hwnd, SB_HORZ, lpsi, 1)
end

#hscrollrangeObject



101
102
103
104
105
# File 'lib/wrb/scrollinfo.rb', line 101

def hscrollrange()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_RANGE]
  API.GetScrollInfo(self._hwnd, SB_HORZ, lpsi)
  [lpsi.nMin, lpsi.nMax]
end

#hscrollrange=(*args) ⇒ Object



106
107
108
109
110
# File 'lib/wrb/scrollinfo.rb', line 106

def hscrollrange=(*args)
  min, max = args[0].is_a?(Array) ? args[0] : [0, args[0]]
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_RANGE, min, max]
  API.SetScrollInfo(self._hwnd, SB_HORZ, lpsi, 1)
end

#hscrolltrackposObject



132
133
134
135
136
# File 'lib/wrb/scrollinfo.rb', line 132

def hscrolltrackpos()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_TRACKPOS]
  API.GetScrollInfo(self._hwnd, SB_HORZ, lpsi)
  lpsi.nTrackPos
end

#hscrolltrackpos=(tps) ⇒ Object



137
138
139
140
# File 'lib/wrb/scrollinfo.rb', line 137

def hscrolltrackpos=(tps)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS, nil, nil, nil, nil, tps]
  API.SetScrollInfo(self._hwnd, SB_HORZ, lpsi, 1)
end

#vscrollpageObject



81
82
83
84
85
# File 'lib/wrb/scrollinfo.rb', line 81

def vscrollpage()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_PAGE]
  API.GetScrollInfo(self._hwnd, SB_VERT, lpsi)
  lpsi.nPage
end

#vscrollpage=(pg) ⇒ Object



86
87
88
89
# File 'lib/wrb/scrollinfo.rb', line 86

def vscrollpage=(pg)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_PAGE, nil, nil, pg]
  API.SetScrollInfo(self._hwnd, SB_VERT, lpsi, 1)
end

#vscrollposObject



71
72
73
74
75
# File 'lib/wrb/scrollinfo.rb', line 71

def vscrollpos()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS]
  API.GetScrollInfo(self._hwnd, SB_VERT, lpsi)
  lpsi.nPos
end

#vscrollpos=(ps) ⇒ Object



76
77
78
79
# File 'lib/wrb/scrollinfo.rb', line 76

def vscrollpos=(ps)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS, nil, nil, nil, ps]
  API.SetScrollInfo(self._hwnd, SB_VERT, lpsi, 1)
end

#vscrollrangeObject



60
61
62
63
64
# File 'lib/wrb/scrollinfo.rb', line 60

def vscrollrange()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_RANGE]
  API.GetScrollInfo(self._hwnd, SB_VERT, lpsi)
  [lpsi.nMin, lpsi.nMax]
end

#vscrollrange=(*args) ⇒ Object



65
66
67
68
69
# File 'lib/wrb/scrollinfo.rb', line 65

def vscrollrange=(*args)
  min, max = args[0].is_a?(Array) ? args[0] : [0, args[0]]
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_RANGE, min, max]
  API.SetScrollInfo(self._hwnd, SB_VERT, lpsi, 1)
end

#vscrolltrackposObject



91
92
93
94
95
# File 'lib/wrb/scrollinfo.rb', line 91

def vscrolltrackpos()
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_TRACKPOS]
  API.GetScrollInfo(self._hwnd, SB_VERT, lpsi)
  lpsi.nTrackPos
end

#vscrolltrackpos=(tps) ⇒ Object



96
97
98
99
# File 'lib/wrb/scrollinfo.rb', line 96

def vscrolltrackpos=(tps)
  lpsi = SCROLLINFO[SCROLLINFO::Size, SIF_POS, nil, nil, nil, nil, tps]
  API.SetScrollInfo(self._hwnd, SB_VERT, lpsi, 1)
end