Class: Widget
Lua
C++
Edit

Widget:MouseUp

This method is called when a mouse button is released.

Syntax:

function Widget:MouseUp(button, x, y)

Parameters:

Remarks:

This is a protected virtual method. It can only be used by declaring it in a custom widget.

Example

-- Create a custom widget
local MyWidget = {}
MyWidget.__index = MyWidget

function MyWidget:Create()
    local widget = {}
    setmetatable(widget, MyWidget)
    return widget
end

-- Implement the MouseUp method
function MyWidget:MouseUp(button, x, y)
    -- Add your custom logic here
    print("MouseUp event received: button = ", button, ", x = ", x, ", y = ", y)
end

-- Usage example
local myWidget = MyWidget:Create()
myWidget:MouseUp(MOUSE_LEFT, 100, 200)

In the above example, we define a custom widget MyWidget and implement the MouseUp method. When the MouseUp event is triggered, the custom logic inside the method will be executed. Finally, we create an instance of MyWidget and call the MouseUp method with some sample values to test the event handling.

Copyright © 2024 Ultra Software.
All rights reserved.