From: Jerome St-Louis Date: Thu, 27 Nov 2014 04:36:50 +0000 (-0500) Subject: extras/CheckListBox: Added 'IsFullyChecked()' X-Git-Tag: 0.44.13~63 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=94a5faca1414671a096043475e5cc1049265bedc extras/CheckListBox: Added 'IsFullyChecked()' - IsChecked() will return true if a check box is partially checked --- diff --git a/extras/gui/controls/CheckListBox.ec b/extras/gui/controls/CheckListBox.ec index 5e8e035..af784c8 100644 --- a/extras/gui/controls/CheckListBox.ec +++ b/extras/gui/controls/CheckListBox.ec @@ -345,12 +345,22 @@ class CheckListBox : ListBox public: bool IsChecked(DataRow row) { - CheckListBoxButton button = buttonMaps[(uintptr)row]; + if(IsFullyChecked(row)) + return true; + else + { + CheckListBoxButton button = buttonMaps[(uintptr)row]; + // For partially checked because of children: + if(button && button.checked) + return true; + } + return false; + } + + bool IsFullyChecked(DataRow row) + { DataRow parent; for(parent = row; parent; parent = parent.parent) if(rowChecks.Find(parent)) return true; - // For partially checked because of children: - if(button && button.checked) - return true; return false; }