My GUI

Hi, I cant seem to get my GUI to have 2 tick boxes on 1 page, this is the part of the code I have upto now.

[lua]local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos(10,10)
DermaPanel:SetSize( 370, 370 )
DermaPanel:SetTitle( “NOVA Admin Mod Admin Control Panel” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )

local SheetItemOne = vgui.Create( “DCheckBoxLabel” )
SheetItemOne:SetParent( PropertySheet )
SheetItemOne:SetText( “Global God Mode” )
SheetItemOne:SetConVar( “sbox_godmode” )
SheetItemOne:SetValue( 0 )
SheetItemOne:SizeToContents()

local SheetItemTwo = vgui.Create( “DCheckBoxLabel” )
SheetItemTwo:SetText( “Use SENTs?” )
SheetItemTwo:SetConVar( “some_convar” )
SheetItemTwo:SetValue( 1 )
SheetItemTwo:SizeToContents()

PropertySheet:AddSheet( “Cvar Menu”, SheetItemOne, “gui/silkicons/user”, false, false, “Cvar Menu” )
PropertySheet:AddSheet( “Admin Menu”, SheetItemTwo, “gui/silkicons/group”, false, false, “Nova Admin Menu” ) [/lua]

Whenever I add another Cvar on the first page it just covers the other one so I can only see the one I just added.

Like this

[lua]local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos(10,10)
DermaPanel:SetSize( 370, 370 )
DermaPanel:SetTitle( “NOVA Admin Mod Admin Control Panel” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )

local SheetItemOne = vgui.Create( “DCheckBoxLabel” )
SheetItemOne:SetParent( PropertySheet )
SheetItemOne:SetText( “Global God Mode” )
SheetItemOne:SetConVar( “sbox_godmode” )
SheetItemOne:SetValue( 0 )
SheetItemOne:SizeToContents()

local SheetItemOne = vgui.Create( “DCheckBoxLabel” )
SheetItemOne:SetParent( PropertySheet )
SheetItemOne:SetText( “Restrict Noclip” )
SheetItemOne:SetConVar( “noclip_cvarhere” )
SheetItemOne:SetValue( 0 )
SheetItemOne:SizeToContents()

local SheetItemTwo = vgui.Create( “DCheckBoxLabel” )
SheetItemTwo:SetText( “Use SENTs?” )
SheetItemTwo:SetConVar( “some_convar” )
SheetItemTwo:SetValue( 1 )
SheetItemTwo:SizeToContents()

PropertySheet:AddSheet( “Cvar Menu”, SheetItemOne, “gui/silkicons/user”, false, false, “Cvar Menu” )
PropertySheet:AddSheet( “Admin Menu”, SheetItemTwo, “gui/silkicons/group”, false, false, “Nova Admin Menu” ) [/lua]

Like I said it just covers it, so I can only see the nlclip one.

BUMP, I need help

-_- you don’t need to bump after 2 hours wtf. just for the fact that you pointlessly bumped it i won’t help you

You are pointlessly posting too, just saying you wont help and arguing with the guy because he bumped.

Anyway, @OP, please explain better your problem (more particulars), and we’ll try ad help you. I personally didn’t understand what’s the problem.

[editline]03:53PM[/editline]

Oh and if by “it covers it” you mean the two elements are displayed one up the other, you can try and move one of them down so there is space for both

Try this.


local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos(10,10)
DermaPanel:SetSize( 370, 370 )
DermaPanel:SetTitle( "NOVA Admin Mod Admin Control Panel" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
 
SheetItemOne = vgui.Create("DPanel")
SheetItemOne:SetSize(PropertySheet:GetWide() - 15 , PropertySheet:GetTall() - 15)
SheetItemOne:SetPos(0 , 0)
SheetItemOne:SetParent(PropertySheet) -- Unneccisary, but to be safe...
		
SheetItemTwo = vgui.Create("DPanel")
SheetItemTwo:SetSize(PropertySheet:GetWide() , PropertySheet:GetTall())
SheetItemTwo:SetPos(0 , 0)
SheetItemTwo:SetParent(PropertySheet) -- As before, Unneccisary

PropertySheet:AddSheet( "Cvar Menu", SheetItemOne, "gui/silkicons/user", false, false, "Cvar Menu" )
PropertySheet:AddSheet( "Admin Menu", SheetItemTwo, "gui/silkicons/group", false, false, "Nova Admin Menu" ) 

// Parent your future objects to SheetItemOne or SheetItemTwo, depending on which you want it to appear

This is how you should make them.

use buttonnamegoeshere:SetPos( coord,coord )

EDIT:

I have this code now

[lua]local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos(10,10)
DermaPanel:SetSize( 370, 370 )
DermaPanel:SetTitle( “NOVA Admin Mod Admin Control Panel” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )

SheetItemOne = vgui.Create(“DPanel”)
SheetItemOne:SetSize(PropertySheet:GetWide() - 15 , PropertySheet:GetTall() - 15)
SheetItemOne:SetPos(0 , 0)
SheetItemOne:SetParent(PropertySheet) – Unneccisary, but to be safe…

SheetItemTwo = vgui.Create(“DPanel”)
SheetItemTwo:SetSize(PropertySheet:GetWide() , PropertySheet:GetTall())
SheetItemTwo:SetPos(0 , 0)
SheetItemTwo:SetParent(PropertySheet) – As before, Unneccisary

PropertySheet:AddSheet( “Cvar Menu”, SheetItemOne, “gui/silkicons/user”, false, false, “Cvar Menu” )
PropertySheet:AddSheet( “Admin Menu”, SheetItemTwo, “gui/silkicons/group”, false, false, “Nova Admin Menu” )

// Parent your future objects to SheetItemOne or SheetItemTwo, depending on which you want it to appear[/lua]
How will I add 2 tick boxes on that under eachover on SheetItemOne? so one for noclip and one for global godmode, please someone help.

Do what I told you to do in the internal commentery. I know it sounds harsh, but you won’t learn by copy // pasting code that was written for you.

you seem to have accidentally commented the end of your comment :stuck_out_tongue:

I tried flapjack but it makes the Derma box bigger :S

[editline]12:11AM[/editline]

I do

[lua]local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos(10,10)
DermaPanel:SetSize( 370, 370 )
DermaPanel:SetTitle( “NOVA Admin Mod Admin Control Panel” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )

SheetItemOne = vgui.Create(“DPanel”)
SheetItemOne:SetSize(PropertySheet:GetWide() - 15 , PropertySheet:GetTall() - 15)
SheetItemOne:SetPos(0 , 0)
SheetItemOne:SetParent(PropertySheet) – Unneccisary, but to be safe…

local SheetItemOne = vgui.Create( “DCheckBoxLabel” )
SheetItemOne:SetParent( PropertySheet )
SheetItemOne:SetText( “Global God Mode” )
SheetItemOne:SetConVar( “sbox_godmode” )
SheetItemOne:SetParent(SheetItemOne)
SheetItemOne:SetValue( 0 )
SheetItemOne:SizeToContents()

SheetItemTwo = vgui.Create(“DPanel”)
SheetItemTwo:SetSize(PropertySheet:GetWide() , PropertySheet:GetTall())
SheetItemTwo:SetPos(0 , 0)
SheetItemTwo:SetParent(PropertySheet) – As before, Unneccisary

PropertySheet:AddSheet( “Cvar Menu”, SheetItemOne, “gui/silkicons/user”, false, false, “Cvar Menu” )
PropertySheet:AddSheet( “Admin Menu”, SheetItemTwo, “gui/silkicons/group”, false, false, “Nova Admin Menu” )

// Parent your future objects to SheetItemOne or SheetItemTwo, depending on which you want it to appear[/lua]
But it goes like.

http://www.gmod-strangers.co.uk/gui1.PNG

Never give an item (Or variable) the same name as a previous one, unless you have a very good reason for doing so. Change the name of your checkbox, and parent it to sheet one with :SetParent(SheetItemOne)

Giving two objects the same name will fuck things up 99.9% of the time.

Make your DFrame
Make your DPropertySheet, parent it to the DFrame
Create DPanel
Create all your buttons, labels, tick boxes, parent them to the DPanel
Add the DPanel to the PropertySheet:AddSheet() 's second argument

I’m not doing the code for you.

Right now, I have it all working, but how do I change the text colour thats next to the tick box?

From the wiki:

Although it is not documented on;

DCheckBoxLabel.SetTextColor(int RED, int GREEN, int BLUE)

Were in teh code do I put it?

uhh, just change DCheckBoxLabel with the name of the checkbox

Item one, Item 2 are on the same coordinates…

Does not work, last I checked. I remember needing to use that, but it failed. However, you could try.

Doesn’t work, any other ideas?