From 4d390f501cc0be6d0348352eba35e6c47f25e4cf Mon Sep 17 00:00:00 2001 From: Gee Date: Fri, 22 Jul 2005 03:11:28 +0000 Subject: [PATCH] Heads up, I changed "SelectionChanged" to "SelectionChange" for consistency, it should be read "on selection change", just like "on press". This was SVN commit r2511. --- source/gui/CList.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/gui/CList.cpp b/source/gui/CList.cpp index f94b1edc0a..227a80ed2b 100644 --- a/source/gui/CList.cpp +++ b/source/gui/CList.cpp @@ -27,6 +27,7 @@ CList::CList() AddSetting(GUIST_int, "cell_id"); AddSetting(GUIST_EAlign, "text_align"); AddSetting(GUIST_CColor, "textcolor"); + AddSetting(GUIST_CColor, "textcolor_selected"); AddSetting(GUIST_int, "selected"); // Index selected. -1 is none. //AddSetting(GUIST_CStr, "tooltip"); //AddSetting(GUIST_CStr, "tooltip_style"); @@ -151,6 +152,13 @@ void CList::HandleMessage(const SGUIMessage &Message) SetupText(); } + // If selected is changed, call "SelectionChange" + if (Message.value == "selected") + { + // TODO only works if lower-case, shouldn't it be made case sensitive instead? + ScriptEvent("selectionchange"); + } + if (Message.value == CStr("scrollbar")) { SetupText();