# DCollapsibleCategory

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/DCollapsibleCategory
- **Çeviri tarihi:** 2026-03-03

## Açıklama

Çıkabilir kategorisi, sayısız kontrol bölümü oluşturmanıza ve bunları kısaltma/genişleme yeteneğine sahip olmanıza olanak tanır.

Kullanmayı düşün [DcKategoriList](https://gmod.tr/wiki/DCategoryList)Bunlardan birden fazla kullanmayı planlıyorsanız.

[Görünüm kaynağı](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dcategorycollapse.lua)

## Ebeveyn

Bu sayfada listelenmeyen yöntemleri vb.[Panel](https://gmod.tr/wiki/Panel)

## Uygulamalar

Bunları geçersiz kılmak istiyorsanız, muhtemelen orijinal function too'i aramak isteyeceksiniz.

- [Panel:Init](https://gmod.tr/wiki/PANEL:Init)
- [Panel:Paint](https://gmod.tr/wiki/PANEL:Paint)
- [Panel:Think](https://gmod.tr/wiki/PANEL:Think)
- [Panel:LoadCookies](https://gmod.tr/wiki/PANEL:LoadCookies)
- [Panel:PerformLayout](https://gmod.tr/wiki/PANEL:PerformLayout)
- [Panel:OnMousePressed](https://gmod.tr/wiki/PANEL:OnMousePressed)
- [Panel:GenerateExample](https://gmod.tr/wiki/PANEL:GenerateExample)
- [Panel:UnselectAll](https://gmod.tr/wiki/Panel:UnselectAll)

## Olaylar

DeğişilebilirKategoriya:[Dönüştüğümüzde](https://gmod.tr/wiki/DCollapsibleCategory:OnToggle)(Türkiye)[Boolean](https://gmod.tr/wiki/boolean)genişletilmiş)

Bu function does kendiliğinden hiçbir şey, onu yazmanız gerektiği gibi.

## Yöntemler

[Panel](https://gmod.tr/wiki/Panel)DönüştürülebilirKategoriya:[Ekle](https://gmod.tr/wiki/DCollapsibleCategory:Add)(Türkçe)[İpucu](https://gmod.tr/wiki/string)isim)

Spawnmenu'daki araç menüsü gibi katlanabilir kategoriye yeni bir metin düğmesi eklenir.

Çıkabilir Kategorisi:[AnimSlide](https://gmod.tr/wiki/DCollapsibleCategory:AnimSlide)(Türkçe)[masa](https://gmod.tr/wiki/table)anim, [Numara](https://gmod.tr/wiki/number)delta, [masa](https://gmod.tr/wiki/table)Veriler)

İç: Bu iç olarak kullanılır - muhtemelen kullanmamalısınız. İç function that açık/kapat animasyonları ele alıyor.

DönüştürülebilirKategorisi:[Genişleme](https://gmod.tr/wiki/DCollapsibleCategory:DoExpansion)(Düzenleyici)[Boolean](https://gmod.tr/wiki/boolean)genişletilebilir)

Kategoriyi açmaya ya da çökmeye zorlar

[Numara](https://gmod.tr/wiki/number)DönüştürülebilirKategoriya:[GetAnimTime](https://gmod.tr/wiki/DCollapsibleCategory:GetAnimTime)() Dönüşüm

DCollapsibleCategory:SetAnimTime tarafından belirtilen genişleme / çökme animasyon zamanını iade eden bir AccessorFunc.

[Boolean](https://gmod.tr/wiki/boolean)DeğişilebilirKategoriya:[GetDrawBackground](https://gmod.tr/wiki/DCollapsibleCategory:GetDrawBackground)()

Deprecated: Bunu kullanmamanızı tavsiye ederiz. Gelecekteki bir güncelleme sırasında değiştirilebilir veya silinebilir. Bunun yerine DCollapsibleCategory:GetPaintBackground kullanmalısınız. Panel arka planının çekilmesinden veya çekilmemesinden geri döner.

[Boolean](https://gmod.tr/wiki/boolean)DeğişilebilirKategoriya:[Genişle](https://gmod.tr/wiki/DCollapsibleCategory:GetExpanded)(ii)

DCollapsibleCategory genişletilmiş veya genişlemediğini gönderir.

[numara](https://gmod.tr/wiki/number)D.CollapsibleKategoriya:[GetHeaderHeight](https://gmod.tr/wiki/DCollapsibleCategory:GetHeaderHeight)(ii)

DCollapsibleCategory başlık yüksekliğini gönderir.

[Panel](https://gmod.tr/wiki/Panel)DACollapsibleKategorisi:[GetList](https://gmod.tr/wiki/DCollapsibleCategory:GetList)()

Eğer ayarlanmışsa, bu panel oluşturan DCcategoryList.

[Numarası](https://gmod.tr/wiki/number)DACollapsibleKategorisi:[GetPadding](https://gmod.tr/wiki/DCollapsibleCategory:GetPadding)()

Deprecated: Bunu kullanmamanızı tavsiye ediyoruz. Gelecek bir güncelleme sırasında değiştirilebilir veya silinebilir. Aslında hiçbir şey yapmaz. DCollapsibleCategory:SetPadding tarafından belirtilen numarayı gönderir.

[Boolean](https://gmod.tr/wiki/boolean)DeğişilebilirKategori:[GetPaintBackground](https://gmod.tr/wiki/DCollapsibleCategory:GetPaintBackground)()

Arkaplanın boyanıp boyanmamasını gösteren bir AccessorFunc.

[Numara](https://gmod.tr/wiki/number)DeğişilebilirKategori:[GetStartHeight](https://gmod.tr/wiki/DCollapsibleCategory:GetStartHeight)()

Deprecated: Bunu kullanmamızı tavsiye ederiz. Gelecek bir güncelleme sırasında değiştirilebilir veya silinebilir. DCollapsibleCategory:SetStartHeight tarafından belirleneni geri verir.

DönüştürülebilirKategorisi:[Zamanı belirle](https://gmod.tr/wiki/DCollapsibleCategory:SetAnimTime)(Türkiye ' de)[Numarası](https://gmod.tr/wiki/number)zaman)

DCollapsible Kategorisini genişletmek için gereken zamanı saniyelerde belirler

DeğişirilebilirKategoriya:[Setİzleyici](https://gmod.tr/wiki/DCollapsibleCategory:SetContents)(Türkiye ' de)[Panel](https://gmod.tr/wiki/Panel)pnl)

DCollapsibleCategory'nin içeriğini belirler.

DeğişirilebilirKategoriya:[SetDrawBackground](https://gmod.tr/wiki/DCollapsibleCategory:SetDrawBackground)( [Boolean](https://gmod.tr/wiki/boolean)) çekim

Deprecated: Bunu kullanmamızı tavsiye ediyoruz. Gelecek bir güncelleme sırasında değiştirilebilir veya silinebilir. Bunun yerine DCollapsibleCategory:SetPaintBackground kullanmalısınız. Panel arka planını çizmek ya da çekmemek için belirler.

DönüştürülebilirKategoriya:[SetExpanded](https://gmod.tr/wiki/DCollapsibleCategory:SetExpanded)( [Boolean](https://gmod.tr/wiki/boolean)genişletilmiş = doğru)

DCollapsibleCategory'nin konteyner açıldığında genişletilmiş olup olmadığı belirlenir. Bunun yerine DCollapsibleCategory:Toggle veya DCollapsibleCategory:DoExpansion kullanmalısınız.

DönüştürülebilirKategoriya:[SetHeaderHeight](https://gmod.tr/wiki/DCollapsibleCategory:SetHeaderHeight)( [sayısı](https://gmod.tr/wiki/number)yüksekliği)

DCollapsibleCategory'nin başlık yüksekliğini belirler.

DeğişilebilirKategori:[SetLabel](https://gmod.tr/wiki/DCollapsibleCategory:SetLabel)( [İpucu](https://gmod.tr/wiki/string)Etiket)

DCollapsible kategorisinin adını belirler.

DeğişilebilirKategori:[Yapılandırma Listesi](https://gmod.tr/wiki/DCollapsibleCategory:SetList)( [Panel](https://gmod.tr/wiki/Panel)pnl)

DCategoryList:Add sırasında bir DCollapsibleCategory oluşturduğunda DCategoryList tarafından içeride kullanılır. Eğer ayarlanırsa, bir kategori tıklandığında kategorinin panelini kendisinde çağırmak yerine, listede Panel:UnselectAll çağrılır.

DeğiştirilebilirKategoriya:[Yapıştırma](https://gmod.tr/wiki/DCollapsibleCategory:SetPadding)( [Numarası](https://gmod.tr/wiki/number)dolandırıcılık)

Deprecated: Bunu kullanmamızı tavsiye ediyoruz. Gelecek bir güncelleme sırasında değiştirilebilir veya silinebilir. Aslında hiçbir şey yapmaz.

DönüştürülebilirKategoriya:[SetPaintBackground](https://gmod.tr/wiki/DCollapsibleCategory:SetPaintBackground)( [Boolean](https://gmod.tr/wiki/boolean)boya)

Arkaplanın boyanıp boyanmamasını belirler.

DönüştürülebilirKategorisi:[SetStartHeight](https://gmod.tr/wiki/DCollapsibleCategory:SetStartHeight)(Düzenleyici)[Numarası](https://gmod.tr/wiki/number)yüksekliği)

Deprecated: Bunu kullanmamayı tavsiye ediyoruz. Gelecek bir güncellemede değiştirilebilir veya silinebilir. Hiçbir şey yapmaz.

DönüştürülebilirKategorisi:[Değiştir](https://gmod.tr/wiki/DCollapsibleCategory:Toggle)()

DCollapsibleCategory'nin genişletilmiş durumunu toggles.

D.CollapsibleKategorisi:[AltLines güncelleme](https://gmod.tr/wiki/DCollapsibleCategory:UpdateAltLines)()

İç: Bu içeride kullanılır - muhtemelen kullanmamalısınız. Tüm "çocuk" panellerinde "AltLine" özelliğini güncellemek için içeride kullanılmaktadır.

### Örnek

Bir yaratır.`DCollapsibleCategory`İçeriği için bir alt panel kullanan panel.

```lua
local frame = vgui.Create( "DFrame" )
frame:SetSize( 300, 300 )
frame:Center()
frame:MakePopup()

local DCollapsible = vgui.Create( "DCollapsibleCategory", frame )	-- Bir katlanabilir kategorinin oluşturulması
DCollapsible:SetLabel( "My Collapsible Category" )					-- Adı (etiketi) belirleyin
DCollapsible:SetPos( 25, 50 )		-- Koyduğu pozisyon
DCollapsible:SetSize( 250, 15 )		-- Yapılandırılmış boyut
DCollapsible:SetExpanded( false )	-- Öntanımlı olarak çöktü

local DermaList = vgui.Create( "DPanel" )	-- Kategoriye ekleyecek bir liste yapın (kontrol toplaması)
DermaList:DockPadding( 5, 5, 5, 5 )			-- Listeye doldurma ayarlayın
Derma_Hook( DermaList, "Paint", "Paint", "CategoryList" )
DCollapsible:SetContents( DermaList )		-- DPanelList'i katılabilir kategorimize ekle

local myCheckbox = vgui.Create( "DCheckBoxLabel", DermaList )	- Bu bölüm bir kontrol kutusunu oluşturur ve
myCheckbox:SetText( "God mode" )					-- ayarlarını ayarlar
myCheckbox:SetConVar( "sbox_godmode" )
myCheckbox:SetValue( false )
myCheckbox:SetDark( true )
myCheckbox:Dock( TOP )

local myLabel = vgui.Create( "DLabel", DermaList )		- Daha fazla içerik yap.
myLabel:SetText( "Hello" )
myLabel:SetDark( true )
myLabel:Dock( TOP )
```

**Çıkış:**

![March03-2389-gmod.gif](https://gmod.tr/api/uploads/wiki/96b4172aa11c2ed2c93b.gif)

### Örnek

Bir yaratır.`DCollapsibleCategory`Sıfır seçilebilir metin seçenekleri, tıpkı spawn menüsünün araç tabancası bölümü gibi.

```lua
local frame = vgui.Create( "DFrame" )
frame:SetSize( 300, 300 )
frame:Center()
frame:MakePopup()

local DermaList = vgui.Create( "DPanel", frame )
DermaList:Dock( FILL )
Derma_Hook( DermaList, "Paint", "Paint", "CategoryList" ) -- DCcategoryList panelindeki arka planı kullan (derma deri sistemi ile)

local DCollapsible = vgui.Create( "DCollapsibleCategory", DermaList )
DCollapsible:SetLabel( "Collapsible List" )
DCollapsible:Dock( TOP )

local btn = DCollapsible:Add( "Option one" )
btn.DoClick = function() Derma_Message("Clicked option one", "Info", "OK") end
DCollapsible:Add( "Option 2" )
DCollapsible:Add( "Option III" )
```

**Çıkış:**

![March03-2392-gmod.gif](https://gmod.tr/api/uploads/wiki/44acda18cc4922c2399f.gif)

- [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/DCollapsibleCategory
