• Dermapanel: Minize and Inlargement button.
    6 replies, posted
Dermapanel: Minize and Inlargement button. Well it disabled them, but they still show up, any way, that i can disable totally?. [editline]28th December 2015[/editline] i ment so it dont display the minize and inlargement, when ShowCloseButton( true ) is set to true
[code]dermaname.btnMaxim:SetVisible( false ) dermaname.btnMinim:SetVisible( false ) [/code] [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dframe.lua#L84[/url]
[QUOTE=mikael12;49401292]i ment so it dont display the minize and inlargement, when ShowCloseButton( true ) is set to true[/QUOTE] You could just implement the code above into your panel's ShowCloseButton function?
[QUOTE=MPan1;49404171]You could just implement the code above into your panel's ShowCloseButton function?[/QUOTE] Look at the link he posted. That will answer your question.
Sorry if you weren't replying to me but I didn't have a question
[code] local function GUI( width, height ) if ( width < 0 or width == 0 ) then width = 506 end if ( height < 0 or height == 0 ) then height = 512 end local frame = vgui.Create( "DFrame" ) frame:SetSize( width, height ) frame:SetPos( ( ScrW() / 2) - ( w / 2 ), ( ScrH() / 2 ) - ( h / 2 ) ) frame:SetTitle( "Inventory" ) frame:SetDraggable( true ) frame:ShowCloseButton( true ) frame:MakePopup( ) local button = vgui.Create( "DButton", frame ) button:SetSize(120, 20 ) button:SetPos( 5, 5 ) button:SetText( "Unequip Primary" ) button.DoClick = function( ) frame:Remove() local newwidth = 506 local newheight = 512 frame = vgui.Create( "DFrame" ) frame:SetSize( newwidth, newheight ) frame:SetPos( ( ScrW() / 2) - ( w / 2 ), ( ScrH() / 2 ) - ( h / 2 ) ) frame:SetTitle( "Inventory" ) frame:SetDraggable( true ) frame:ShowCloseButton( true ) frame:MakePopup( ) end end [/code] Just going to say, i didn't test this. I'm use to Java, and this is how i redraw my GUIs. Yes, i'm aware this isn't Java. But... it may work, because i did this in my development before. Also, Don't make all those spaces and extra `()` next to the if statements, that makes your files run slower. Because, it has to load more char/characters. And i'm not saying to like a timer slower, its more the file would load slower on init of the server/client.
[QUOTE=xrayhunter1;49410409]Just going to say, i didn't test this. I'm use to Java, and this is how i redraw my GUIs. Yes, i'm aware this isn't Java. But... it may work, because i did this in my development before. Also, Don't make all those spaces and extra `()` next to the if statements, that makes your files run slower. Because, it has to load more char/characters. And i'm not saying to like a timer slower, its more the file would load slower on init of the server/client.[/QUOTE] The extra loading time due to unnecessary characters is so inconsequential you shouldn't even worry about it. Its probably a microsecond of difference.
Sorry, you need to Log In to post a reply to this thread.