# DCheckBoxLabel

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/DCheckBoxLabel
- **Çeviri tarihi:** 2025-09-08

## Açıklama

**DCheckBoxLabel**, yanında bir [DLabel](https://gmod.tr/wiki/DLabel) bulunan bir [DCheckBox](https://gmod.tr/wiki/DCheckBox)'tır. Kullanıcıdan bir boolean değer (true/false - evet/hayır) almanızı sağlar.

[Kaynağı görüntüle](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dcheckbox.lua)

## Ebeveyn

Bu sayfada listelenmeyen metotları vb. [DPanel](https://gmod.tr/wiki/DPanel)'dan türetir.

## Uygular

Aşağıdaki kancaları/metotları uygular veya geçersiz kılar. Bunları geçersiz kılmak isterseniz, muhtemelen orijinal işlevi de çağırmak istersiniz.

- [Panel:Init](https://gmod.tr/wiki/PANEL:Init)
- [Panel:Paint](https://gmod.tr/wiki/PANEL:Paint)
- [Panel:PerformLayout](https://gmod.tr/wiki/PANEL:PerformLayout)
- [Panel:SizeToContents](https://gmod.tr/wiki/Panel:SizeToContents)
- [Panel:GenerateExample](https://gmod.tr/wiki/PANEL:GenerateExample)

## Olaylar

DCheckBoxLabel:[OnChange](https://gmod.tr/wiki/DCheckBoxLabel:OnChange)( [boolean](https://gmod.tr/wiki/boolean) bVal )

"İşaretli" durumu değiştirildiğinde çağrılır. Bu, geçersiz kılınmak üzere tasarlanmıştır.

## Metotlar

[boolean](https://gmod.tr/wiki/boolean) DCheckBoxLabel:[GetChecked](https://gmod.tr/wiki/DCheckBoxLabel:GetChecked)()

Onay kutusunun işaretli durumunu alır. Bu, onay kutusunun DCheckBox:GetChecked fonksiyonunu çağırır.

[number](https://gmod.tr/wiki/number) DCheckBoxLabel:[GetIndent](https://gmod.tr/wiki/DCheckBoxLabel:GetIndent)()

Elemanın X eksenindeki girintisini alan bir AccessorFunc'tur. Ayrıca bakınız DCheckBoxLabel:SetIndent

DCheckBoxLabel:[SetBright](https://gmod.tr/wiki/DCheckBoxLabel:SetBright)( [boolean](https://gmod.tr/wiki/boolean) bright )

DCheckBoxLabel'ın metin rengini, skin'de tanımlanan parlak metin rengine ayarlar.

DCheckBoxLabel:[SetChecked](https://gmod.tr/wiki/DCheckBoxLabel:SetChecked)( [boolean](https://gmod.tr/wiki/boolean) checked )

Onay kutusunun işaretli durumunu ayarlar. DCheckBoxLabel:SetValue'dan farklı olarak DCheckBoxLabel:OnChange veya Panel:ConVarChanged'ı çağırmaz.

DCheckBoxLabel:[SetConVar](https://gmod.tr/wiki/DCheckBoxLabel:SetConVar)( [string](https://gmod.tr/wiki/string) convar )

DCheckBoxLabel'ın işaretli durumu değiştiğinde ayarlanacak konsol değişkenini belirler.

DCheckBoxLabel:[SetDark](https://gmod.tr/wiki/DCheckBoxLabel:SetDark)( [boolean](https://gmod.tr/wiki/boolean) darkify )

DCheckBoxLabel'ın metnini, o an aktif olan Derma skin'ine uygun olarak koyu renkli olacak şekilde ayarlar.

DCheckBoxLabel:[SetFont](https://gmod.tr/wiki/DCheckBoxLabel:SetFont)( [string](https://gmod.tr/wiki/string) font )

DCheckBoxLabel'ın metin kısmının yazı tipini ayarlar.

DCheckBoxLabel:[SetIndent](https://gmod.tr/wiki/DCheckBoxLabel:SetIndent)( [number](https://gmod.tr/wiki/number) ident )

Elemanın X eksenindeki girintisini ayarlayan bir AccessorFunc'tur.

DCheckBoxLabel:[SetTextColor](https://gmod.tr/wiki/DCheckBoxLabel:SetTextColor)( [table](https://gmod.tr/wiki/table) color )

DCheckBoxLabel için metin rengini ayarlar.

DCheckBoxLabel:[SetValue](https://gmod.tr/wiki/DCheckBoxLabel:SetValue)( [boolean](https://gmod.tr/wiki/boolean) checked )

Onay kutusunun işaretli durumunu ayarlar ve DCheckBoxLabel:OnChange ile onay kutusunun Panel:ConVarChanged metotlarını çağırır.

DCheckBoxLabel:[SizeToContents](https://gmod.tr/wiki/DCheckBoxLabel:SizeToContents)()

Paneli, içindeki DLabel ve DButton'ın boyutuna göre yeniden boyutlandırır.

DCheckBoxLabel:[Toggle](https://gmod.tr/wiki/DCheckBoxLabel:Toggle)()

DCheckBoxLabel'ın işaretli durumunu değiştirir.

### Örnek

Bir DCheckBoxLabel oluşturur, onu bir convar'a bağlar ve başlangıç değerini ayarlar.

```lua
concommand.Add( "example_checkboxlabel", function( ply, cmd, args )
	local window = vgui.Create( "DFrame" )
	window:SetSize( 300, 200 )
	window:Center()
	window:MakePopup()

	local DermaCheckbox = window:Add( "DCheckBoxLabel" ) -- Onay kutusunu oluştur
	DermaCheckbox:SetPos( 25, 50 )						-- Pozisyonu ayarla
	DermaCheckbox:SetText("God Mode")					-- Kutunun yanındaki metni ayarla
	DermaCheckbox:SetConVar("sbox_godmode")				-- Kutu işaretlendiğinde/işareti kaldırıldığında bir ConVar'ı değiştir
	DermaCheckbox:SetValue( true )						-- Başlangıç değeri
	DermaCheckbox:SizeToContents()						-- Boyutunu içeriğiyle aynı yap
end )
```

**Çıktı:** ![](https://gmod.tr/api/uploads/wiki/64de4aebdab3433cd2cd.png)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/DCheckBoxLabel
