Skip to content
A SpiderBasic-Module for additionally ListIconGadget-Functionalities
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
.gitignore
LICENSE
ListIconGadgetEx.sbi
ListIconGadgetExDemo.sb
README.md

README.md

ListIconGadgetEx

A SpiderBasic-Module for additionally ListIconGadget-Functionalities

Example:

IncludeFile "ListIconGadgetEx.sbi"

EnableExplicit

Enumeration
  #Window
  #ListIconGadget1
  #ListIconGadget2
  #ListIconGadget3
  #ListIconGadget4
EndEnumeration

Procedure CellClick(ListIconGadget, Column, Row)
  
  Debug "CellClick():"
  Debug "Column: " + Str(Column)
  
  If Row = -1
    Debug "Row: Header"
  Else
    Debug "Row: " + Str(Row)
  EndIf
  
  Debug "------------------"
  
EndProcedure

OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 800, 800, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

; #ListIconGadget1

ListIconGadget(#ListIconGadget1, 0, 0, 400, 400, "Column 0", 200, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(#ListIconGadget1, 1, "Column 1", 100)

ListIconGadgetEx::SetOddRowColor (#ListIconGadget1, "lightgreen", "darkgreen", "black", "white")
ListIconGadgetEx::SetEvenRowColor(#ListIconGadget1, "white", "lightblue", "black", "black")

; #ListIconGadget2

ListIconGadget(#ListIconGadget2, 400, 0, 400, 400, "Column 0", 200, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(#ListIconGadget2, 1, "Column 1", 100)

ListIconGadgetEx::SetOddRowColor (#ListIconGadget2, "green", "lightgreen", "white", "red")
ListIconGadgetEx::SetEvenRowColor(#ListIconGadget2, "yellow", "lightblue", "orange", "silver")

; #ListIconGadget3

ListIconGadget(#ListIconGadget3, 0, 400, 400, 400, "Column 0", 200, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(#ListIconGadget3, 1, "Column 1", 100)

ListIconGadgetEx::SetRowHeight(#ListIconGadget3, 36)
ListIconGadgetEx::BindCellClick(#ListIconGadget3, @CellClick())

; #ListIconGadget4

ListIconGadget(#ListIconGadget4, 400, 400, 400, 400, "Column 0", 150, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(#ListIconGadget4, 1, "Column 1", 150)

ListIconGadgetEx::SetColumnHeaderAlignment(#ListIconGadget4, 0, "right")
ListIconGadgetEx::SetColumnAlignment(#ListIconGadget4, 0, "center")

ListIconGadgetEx::SetColumnHeaderAlignment(#ListIconGadget4, 1, "left")
ListIconGadgetEx::SetColumnAlignment(#ListIconGadget4, 1, "center")

Define Counter

For Counter = 0 To 9
  AddGadgetItem(#ListIconGadget1, -1, "Column 0 / Row " + Counter + #LF$ + "Column 1 / Row " + Counter)
  AddGadgetItem(#ListIconGadget2, -1, "Column 0 / Row " + Counter + #LF$ + "Column 1 / Row " + Counter)
  AddGadgetItem(#ListIconGadget3, -1, "Column 0 / Row " + Counter + #LF$ + "Column 1 / Row " + Counter)
  AddGadgetItem(#ListIconGadget4, -1, "Column 0 / Row " + Counter + #LF$ + "Column 1 / Row " + Counter)
Next

License

MIT

You can’t perform that action at this time.