1
0
forked from 0ad/0ad

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.
This commit is contained in:
Gee 2005-07-22 03:11:28 +00:00
parent 57ab45c380
commit 4d390f501c

View File

@ -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();