# DProperties

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

## Açıklama

Bir şeyin özelliklerini, isimler ve değerler kullanarak düzenlemek için kullanılan bir tablodur. Özellikler kategorize edilebilir ve kesin türlere sahip olabilir.

![](https://gmod.tr/api/uploads/wiki/8377353470310a0ae14d.png)

### İlişkili kontroller

- [DProperty_VectorColor](https://gmod.tr/wiki/DProperty_VectorColor)
- [DProperty_Boolean](https://gmod.tr/wiki/DProperty_Boolean)
- [DProperty_Generic](https://gmod.tr/wiki/DProperty_Generic)
- [DProperty_Combo](https://gmod.tr/wiki/DProperty_Combo)
- [DProperty_Float](https://gmod.tr/wiki/DProperty_Float)
- [DProperty_Int](https://gmod.tr/wiki/DProperty_Int)

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

## Ebeveyn

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

## Metotlar

[Panel](https://gmod.tr/wiki/Panel) DProperties:[CreateRow](https://gmod.tr/wiki/DProperties:CreateRow)( [string](https://gmod.tr/wiki/string) category, [string](https://gmod.tr/wiki/string) name )

Özellikler panelinde bir satır oluşturur.

[Panel](https://gmod.tr/wiki/Panel) DProperties:[GetCanvas](https://gmod.tr/wiki/DProperties:GetCanvas)()

Tüm özellik panellerinin eklendiği DScrollPanel'i döndürür.

[Panel](https://gmod.tr/wiki/Panel) DProperties:[GetCategory](https://gmod.tr/wiki/DProperties:GetCategory)( [string](https://gmod.tr/wiki/string) name, [boolean](https://gmod.tr/wiki/boolean) create = false )

Bu dahili olarak kullanılır - kullanabilmenize rağmen muhtemelen kullanmamalısınız. Bir özellik kategorisi döndürür (veya oluşturur). Gerçek özellikleri eklemek için DProperties:CreateRow'a bakın.

### Örnek

Birkaç özellik ayarlanmış bir DProperties kontrolü oluşturur

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

local DProperties = vgui.Create( "DProperties", f )
DProperties:Dock( FILL )

local Row1 = DProperties:CreateRow( "Category1", "Vector Color" )
Row1:Setup( "VectorColor" )
Row1:SetValue( Vector( 1, 0, 0 ) )
Row1.DataChanged = function( _, val ) print( val ) end

local Row2 = DProperties:CreateRow( "Category1", "Combo" )
Row2:Setup( "Combo", { text = "Select type..." } )
Row2:AddChoice( "Table", {} )
Row2:AddChoice( "String", "Hello world" )
Row2.DataChanged = function( self, data )
	print( "You selected: ", data )
end

local Row3 = DProperties:CreateRow( "Category1", "Boolean" )
Row3:Setup( "Boolean" )
Row3:SetValue( true )

local Row4 = DProperties:CreateRow( "Category2", "Float" )
Row4:Setup( "Float", { min = 0, max = 5 } )
Row4:SetValue( 2.5 )

local Row5 = DProperties:CreateRow( "Category2", "Integer" )
Row5:Setup( "Int", { min = 0, max = 5 } )
Row5:SetValue( 2.5 )

local Row6 = DProperties:CreateRow( "Category2", "Generic" )
Row6:Setup( "Generic" )
Row6:SetValue( "Hello World!" )
Row6.DataChanged = function( _, val ) print( val ) end
```

**Çıktı:** "Hello World!" metin kutusunu değiştirdiğinizde, yeni içeriğini konsola yazdıracaktır.

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