Project1
标题:
Window_Selectable
[打印本页]
作者:
NaturalBlue
时间:
2009-1-16 22:03
标题:
Window_Selectable
Window_Selectable中控制窗口滚动的方法是哪几个?
O(∩_∩)O谢谢! [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
雪流星
时间:
2009-1-16 22:05
#--------------------------------------------------------------------------
# ● 計算行數
#--------------------------------------------------------------------------
def row_max
return (@item_max + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# ● 獲取首行
#--------------------------------------------------------------------------
def top_row
return self.oy / WLH
end
#--------------------------------------------------------------------------
# ● 設置首行
# row : 顯示在最上的行
#--------------------------------------------------------------------------
def top_row=(row)
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * WLH
end
#--------------------------------------------------------------------------
# ● 獲取一頁能顯示的行數
#--------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / WLH
end
#--------------------------------------------------------------------------
# ● 獲取一頁能顯示的選項
#--------------------------------------------------------------------------
def page_item_max
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# ● 獲取末行
#--------------------------------------------------------------------------
def bottom_row
return top_row + page_row_max - 1
end
#--------------------------------------------------------------------------
# ● 設置末行
# row : 顯示在最底的行
#--------------------------------------------------------------------------
def bottom_row=(row)
self.top_row = row - (page_row_max - 1)
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1