streamline button.lua

akkartik
Dec 17, 2023, 7:38 AM
GJ4LBCIEKDJDYV7OFSHZZY4R62CR7LWOPWHGDY3P5DCT6FYXNRHQC

Dependencies

  • [2] LJUJH5GP bugfix: propagate mouse press if any button would
  • [3] 6XCJX4DZ bugfix: inscript's bug
  • [4] 5SM6DRHK port inscript's bugfix to source editor
  • [5] MXXCTVXW document facilities for buttons on screen
  • [6] K6DTOGOQ flip return value of button handlers
  • [7] U76D4P36 fix a typo
  • [8] ZNLTRNNK highlight another global
  • [9] XX7G2FFJ intermingle freehand line drawings with text
  • [10] EDWRWZRV use color alpha in button backgrounds
  • [11] LNUHQOGH start passing in Editor_state explicitly
  • [12] 6D5MOJS4 allow buttons to interrupt events
  • [13] OI4FPFIN support drawings in the source editor
  • [14] 4EGQRXDA bugfix: naming points
  • [15] XZ6QVCTT manually maintain mouse button press state
  • [16] Z3TDYADA mouse button state in source editor
  • [17] 2L5MEZV3 experiment: new edit namespace
  • [18] QJISOCHJ some temporary logging to catch a bug
  • [19] OAHNWDYG .
  • [20] GDJSZLYT allow buttons to nest as well
  • [21] LIKTH6HM update stale source X-(
  • [22] LDFXFRUO bring a few things in sync between run and source
  • [23] 7FPELAZB ah, I see the problem
  • [24] KKMFQDR4 editing source code from within the app
  • [25] 54HEXCWV clearer API for drawing a button
  • [26] PP2IIHL6 stop putting button state in a global
  • [27] H5UZI3YN editor documentation
  • [*] LXTTOB33 extract a couple of files
  • [*] YFW4MNNP handle wrapping lines
  • [*] N2NUGNN4 include a brief reference enabling many useful apps

Change contents

  • edit in text_tests.lua at line 884
    [30.467]
    [30.467]
    edit.draw(Editor_state)
  • edit in source_text_tests.lua at line 884
    [4.1374]
    [4.1374]
    edit.draw(Editor_state)
  • replacement in source_edit.lua at line 242
    [6.436][6.157217:157296](),[6.626][6.157217:157296](),[4.4832][6.157217:157296](),[6.21562][6.157217:157296](),[6.157217][6.157217:157296]()
    if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
    [4.4832]
    [6.157296]
    if mouse_press_consumed_by_any_button(State, x,y, mouse_button) then
  • replacement in reference.md at line 297
    [5.1561][5.1561:1634]()
    * `mouse_press_consumed_by_any_button_handler(state, x,y, mouse_button)`
    [5.1561]
    [5.1634]
    * `mouse_press_consumed_by_any_button(state, x,y, mouse_button)`
  • replacement in reference.md at line 305
    [5.1914][5.1914:1995]()
    if mouse_press_consumed_by_any_button_handler(state, x,y, mouse_button) then
    [5.1914]
    [5.1995]
    if mouse_press_consumed_by_any_button(state, x,y, mouse_button) then
  • replacement in edit.lua at line 238
    [6.125][6.15:94](),[6.253][6.15:94](),[6.497][6.15:94](),[3.2254][6.15:94](),[6.4647][6.15:94]()
    if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
    [3.2254]
    [6.172]
    if mouse_press_consumed_by_any_button(State, x,y, mouse_button) then
  • edit in button.lua at line 12
    [6.220][6.220:296]()
    if State.button_handlers == nil then
    State.button_handlers = {}
    end
  • replacement in button.lua at line 19
    [6.2443][6.194:273](),[6.273][6.409:465](),[6.409][6.409:465]()
    function mouse_press_consumed_by_any_button_handler(State, x, y, mouse_button)
    if State.button_handlers == nil then
    return
    end
    [6.2443]
    [2.18]
    function mouse_press_consumed_by_any_button(State, x, y, mouse_button)