29 lines
1.4 KiB
Ziran
29 lines
1.4 KiB
Ziran
GridMulti :: #import "kryon/grid_multi";
|
|
Text :: #import "kryon/text";
|
|
#import "kryon/geometry"
|
|
#import "kryon/session"
|
|
|
|
selected: [6]bool;
|
|
cursor: s32;
|
|
anchor: s32;
|
|
#program_export
|
|
Frame :: (session: Session, viewport: Rectangle) -> s32 {
|
|
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Grid multi", .size = 28})
|
|
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
|
|
items := GridMulti.GridMultiItem.[.{.key = 11, .label = "Documents"}, .{.key = 12, .label = "Pictures"}, .{.key = 13, .label = "Music"}, .{.key = 14, .label = "Videos"}, .{.key = 15, .label = "Projects"}, .{.key = 16, .label = "Downloads"}]
|
|
result := GridMulti.Draw(session, GridMulti.Props.{.disabled = example_disabled, .key = 10, .bounds = .{bounds.x, bounds.y, bounds.width, viewport.height - 96.0}, .cell_width = 110, .cell_height = 64, .gap = 12, .cursor = cursor, .anchor = anchor}, items[:], selected[:])
|
|
cursor = result.cursor
|
|
anchor = result.anchor
|
|
return 0
|
|
}
|
|
|
|
example_disabled: bool;
|
|
example_reduced_motion: bool;
|
|
|
|
// Hosts publish these options before the unchanged application entry point.
|
|
#program_export
|
|
SetExampleOptions :: (disabled: bool, reduced_motion: bool) {
|
|
example_disabled = disabled
|
|
example_reduced_motion = reduced_motion
|
|
}
|