MaterialSB/Example_Table.sb
2026-01-24 21:36:45 +01:00

87 lines
2.2 KiB
Plaintext

; MaterialSB Example - Tables
; This example demonstrates the table component.
IncludeFile "MaterialSB.sbi"
EnableExplicit
Procedure Main(Result)
Protected t, item
UseModule MaterialSB
SetDarkTheme(#False)
; Navbar
Navbar(#Navbar_Shadow1 | #Navbar_Container)
NavbarAddLogo("Tables")
; Tables Section
Row(#Grid_Container)
Col(12)
Append("<h3>Table Component</h3>")
Append("<p>Tables help organize data. MaterialSB supports striped, highlighted, centered, and responsive tables.</p>")
CloseCurrentParent(2)
; Basic Table
Row(#Grid_Container)
Col(12, 6)
Append("<h5>Basic Table</h5>")
t = Table("Name", #Table_Default)
TableAddColumn("Age", t)
TableAddColumn("Country", t)
TableAddItem("Alice" + Chr(10) + "28" + Chr(10) + "France", t)
TableAddItem("Bob" + Chr(10) + "34" + Chr(10) + "Germany", t)
TableAddItem("Charlie" + Chr(10) + "22" + Chr(10) + "UK", t)
CloseCurrentParent()
; Striped and Highlighted Table
Col(12, 6)
Append("<h5>Striped & Highlighted</h5>")
t = Table("Product", #Table_Striped | #Table_Highlight)
TableAddColumn("Price", t)
TableAddColumn("Stock", t)
TableAddItem("Widget A" + Chr(10) + "$19.99" + Chr(10) + "150", t)
TableAddItem("Widget B" + Chr(10) + "$29.99" + Chr(10) + "75", t)
TableAddItem("Widget C" + Chr(10) + "$9.99" + Chr(10) + "300", t)
TableAddItem("Widget D" + Chr(10) + "$49.99" + Chr(10) + "25", t)
CloseCurrentParent(2)
; Table flags reference
Row(#Grid_Container)
Col(12)
Append("<h5>Table Flags</h5>")
t = Table("Flag", #Table_Striped | #Table_Centered)
TableAddColumn("Effect", t)
TableAddItem("#Table_Default" + Chr(10) + "Plain table with no styling", t)
TableAddItem("#Table_Striped" + Chr(10) + "Alternating row colors", t)
TableAddItem("#Table_Highlight" + Chr(10) + "Highlight row on hover", t)
TableAddItem("#Table_Centered" + Chr(10) + "Center-align all content", t)
TableAddItem("#Table_Responsive" + Chr(10) + "Horizontal scroll on small screens", t)
CloseCurrentParent(2)
AutoInit()
UnuseModule MaterialSB
EndProcedure
MaterialSB::Download(@Main())
; IDE Options = SpiderBasic 3.10 (Windows - x86)
; CursorPosition = 1
; Folding = -
; iOSAppOrientation = 0
; AndroidAppCode = 0
; AndroidAppOrientation = 0
; EnableXP
; DPIAware
; CompileSourceDirectory