多重版函數(Multiboard Utility Functions)

行5831~6035

//***************************************************************************
//*
//* Multiboard Utility Functions
//*
//***************************************************************************

//===========================================================================
function CreateMultiboardBJ takes integer cols, integer rows, string title returns multiboard
set bj_lastCreatedMultiboard = CreateMultiboard()
call MultiboardSetRowCount(bj_lastCreatedMultiboard, rows)
call MultiboardSetColumnCount(bj_lastCreatedMultiboard, cols)
call MultiboardSetTitleText(bj_lastCreatedMultiboard, title)
call MultiboardDisplay(bj_lastCreatedMultiboard, true)
return bj_lastCreatedMultiboard
endfunction

//===========================================================================
function DestroyMultiboardBJ takes multiboard mb returns nothing
call DestroyMultiboard(mb)
endfunction

//===========================================================================
function GetLastCreatedMultiboard takes nothing returns multiboard
return bj_lastCreatedMultiboard
endfunction

//===========================================================================
function MultiboardDisplayBJ takes boolean show, multiboard mb returns nothing
call MultiboardDisplay(mb, show)
endfunction

//===========================================================================
function MultiboardMinimizeBJ takes boolean minimize, multiboard mb returns nothing
call MultiboardMinimize(mb, minimize)
endfunction

//===========================================================================
function MultiboardSetTitleTextColorBJ takes multiboard mb, real red, real green, real blue, real transparency returns nothing
call MultiboardSetTitleTextColor(mb, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency))
endfunction

//===========================================================================
function MultiboardAllowDisplayBJ takes boolean flag returns nothing
call MultiboardSuppressDisplay(not flag)
endfunction

//===========================================================================
function MultiboardSetItemStyleBJ takes multiboard mb, integer col, integer row, boolean showValue, boolean showIcon returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null

// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows

// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols

// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemStyle(mbitem, showValue, showIcon)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction

//===========================================================================
function MultiboardSetItemValueBJ takes multiboard mb, integer col, integer row, string val returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null

// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows

// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols

// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemValue(mbitem, val)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction

//===========================================================================
function MultiboardSetItemColorBJ takes multiboard mb, integer col, integer row, real red, real green, real blue, real transparency returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null

// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows

// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols

// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemValueColor(mbitem, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency))
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction

//===========================================================================
function MultiboardSetItemWidthBJ takes multiboard mb, integer col, integer row, real width returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null

// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows

// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols

// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemWidth(mbitem, width/100.0)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction

//===========================================================================
function MultiboardSetItemIconBJ takes multiboard mb, integer col, integer row, string iconFileName returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null

// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows

// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols

// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemIcon(mbitem, iconFileName)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction

研究資料/blizzard.j/多重版函數.txt · 上一次變更: 2007年11月03日 7:40 am 來自 wasabi
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0