DFrame.OnMouseReleased
From GMod Wiki
Function | |
Syntax | DFrame:OnMouseReleased( MouseCode button ) |
Description: | |
Gets called when someone releases his mouse after clicking on or around the DFrame. Button is an integer indicating what mouse button was released | |
Returns: | Function |
In Object: | DPropertySheet |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=DFrame.OnMouseReleased]DFrame.OnMouseReleased [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Demonstration of how DFrame:OnMouseReleased works |
---|---|
Used on | |
Code | local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50,50 ) DermaPanel:SetSize( 1000, 900 ) DermaPanel:SetTitle( "Testing Derma Stuff" ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() DermaPanel.OnMouseReleased = function( mcode ) if mcode == MOUSE_LEFT then print("You released your left mouse button on the DFrame") end end |
Output | Prints "You released your left mouse button on the DFrame" in console when you release your left mouse button on DFrame |
Additional Notes
- Might be used better in combination with DButton, since that looks more like you can actually click it.
- An overview of Mousecodes can be found here.