From 9a8eb66e6b894069cf44711dc6dd5f0842b3b252 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Wed, 14 Jan 2015 12:03:23 +0300 Subject: [PATCH] combo box styles reworked --- examples/example1/src/main.d | 10 ++++++++-- res/theme_default.xml | 8 +++++++- src/dlangui/widgets/combobox.d | 7 +++++-- src/dlangui/widgets/widget.d | 14 +++++++------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/examples/example1/src/main.d b/examples/example1/src/main.d index 2d4a3bd8..93d29374 100644 --- a/examples/example1/src/main.d +++ b/examples/example1/src/main.d @@ -530,11 +530,17 @@ extern (C) int UIAppMain(string[] args) { // row 3 table.addChild((new TextWidget(null, "Param 3"d)).alignment(Align.Right | Align.VCenter)); table.addChild((new EditLine("edit3", "Parameter 3 value"d)).layoutWidth(FILL_PARENT)); - + // normal readonly combo box ComboBox combo1 = new ComboBox("combo1", ["item value 1"d, "item value 2"d, "item value 3"d, "item value 4"d, "item value 5"d, "item value 6"d]); table.addChild((new TextWidget(null, "Combo box param"d)).alignment(Align.Right | Align.VCenter)); - combo1.selectedItemIndex(3); + combo1.selectedItemIndex = 3; table.addChild(combo1).layoutWidth(FILL_PARENT); + // disabled readonly combo box + ComboBox combo2 = new ComboBox("combo2", ["item value 1"d, "item value 2"d, "item value 3"d]); + table.addChild((new TextWidget(null, "Disabled combo box"d)).alignment(Align.Right | Align.VCenter)); + combo2.enabled = false; + combo2.selectedItemIndex = 0; + table.addChild(combo2).layoutWidth(FILL_PARENT); table.margins(Rect(10,10,10,10)).layoutWidth(FILL_PARENT); tabs.addTab(table, "TAB_TABLE_LAYOUT"c); diff --git a/res/theme_default.xml b/res/theme_default.xml index fd35489b..d3fe642d 100644 --- a/res/theme_default.xml +++ b/res/theme_default.xml @@ -149,7 +149,7 @@ fontSize="16" />