compiler/libec; eda, extras: const fixes for DB apps
[sdk] / extras / gui / controls / CheckListBox.ec
index 99dabeb..a88d97a 100644 (file)
@@ -1,4 +1,8 @@
-import "ecere"
+#ifdef ECERE_STATIC
+public import static "ecere"
+#else
+public import "ecere"
+#endif
 
 class CheckListBoxButton : Button
 {
@@ -38,7 +42,7 @@ class CheckListBox : ListBox
 
    checkIndent = 20;
 
-   fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true, 
+   fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
    noDragging = true;
    // rowHeight = 18;
 
@@ -46,7 +50,7 @@ class CheckListBox : ListBox
    {
       buttonMaps.RemoveAll();
    }
-   
+
    bool NotifyCollapse(CheckListBox listBox, DataRow row, bool collapsed)
    {
       DataRow r;
@@ -69,9 +73,9 @@ class CheckListBox : ListBox
          {
             listBox.SetupButtons(r, false);
          }
-         if(r.firstRow && !r.collapsed) 
+         if(r.firstRow && !r.collapsed)
             r = r.firstRow;
-         else 
+         else
             for(; r != row; r = r.parent)
                if(r.next) { r = r.next; break; }
       }
@@ -94,7 +98,7 @@ class CheckListBox : ListBox
       }
       return false;
    }
-   
+
    void SetupButtons(DataRow row, bool recurse)
    {
       DataRow parent;
@@ -142,7 +146,7 @@ class CheckListBox : ListBox
       if(ListBox::OnCreate())
       {
          DataRow row;
-         
+
          buttonMaps.RemoveAll();
 
          for(row = firstRow; row; row = row.next)
@@ -161,10 +165,10 @@ class CheckListBox : ListBox
          DataRow r;
          for(r = row; r; r = r.parent)
             if(rowChecks.Find(r))
-            { 
+            {
                checked = true;
                break;
-            }         
+            }
          SetCheck(row, !checked);
       }
    }
@@ -176,7 +180,6 @@ class CheckListBox : ListBox
          CheckListBoxButton button = buttonMaps[(uintptr)row];
          if(button)
          {
-            bool wasChecked = button.checked;
             button.checked = false;
             button.buttonState = up;
          }
@@ -189,7 +192,7 @@ class CheckListBox : ListBox
       }
       NotifyChecked(master, this, row);
    }
-   
+
    void UnsetChildren(DataRow row)
    {
       DataRow r;
@@ -208,9 +211,9 @@ class CheckListBox : ListBox
             it.Remove();
          UnsetChildren(r);
          NotifyChecked(master, this, r);
-      }      
+      }
    }
-   
+
    void SetCheck(DataRow row, bool checked)
    {
       DataRow parent;
@@ -245,7 +248,7 @@ class CheckListBox : ListBox
             // Take out all children from rowChecks, checking them all
             UnsetChildren(rr);
 
-            NotifyChecked(master, this, row);
+            NotifyChecked(master, this, rr);
 
             for(parent = rr.parent; parent; parent = parent.parent)
             {
@@ -308,7 +311,7 @@ class CheckListBox : ListBox
          }
       }
    }
-   
+
    bool NotifyKeyDown(CheckListBox listBox, DataRow row, Key key, unichar ch)
    {
       if(key == space)