Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on init
- message("")
- set_ui_height_px(150)
- make_perfview
- define table_cols := 2
- declare table_x := 100
- declare table_y := 20
- declare table_w := 150
- declare table_h := 100
- declare ui_table table[table_cols](1, 4, 100) // real table
- declare ui_xy ?table_control[2] // an invisible xy pad overlay
- declare pad_y // just so we don't need to do the calculations later on again
- table_control -> x := table_x
- table_control -> y := table_y + 3 // to make the invisible pad fit in the table
- table_control -> width := table_w
- table_control -> height := table_h - 3
- table_control -> picture := "transparent"
- table_control -> cursor_picture := "transparent_px"
- table_control -> mouse_mode := 2
- table -> x := table_x
- table -> y := table_y
- table -> width := table_w
- table -> height := table_h
- declare ui_label txt (1,1)
- end on
- // Let's sprinkle the code with some magic dust!
- on ui_control(table_control)
- pad_y := real_to_int(table_control[1] * int_to_real(table_h))
- table[real_to_int(table_control[0] * int_to_real(table_cols))] := pad_y - pad_y mod 2 // 2 is the step size!
- set_text(txt, table[0] & " " & table[1])
- end on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement