samples:guiAndGfx:toolBars: updated to use newly integrated ToolBar from ecere.
authorRejean Loyer <rejean.loyer@gmail.com>
Wed, 7 Mar 2012 16:59:23 +0000 (11:59 -0500)
committerJerome St-Louis <jerome@ecere.com>
Wed, 7 Mar 2012 17:37:29 +0000 (12:37 -0500)
samples/guiAndGfx/toolBars/toolBarDemo.ec
samples/guiAndGfx/toolBars/toolBars.epj

index 20d4ce8..85e2e3b 100644 (file)
@@ -1,5 +1,4 @@
-import "IconBag"
-import "ToolBar"
+import "ecere"
 
 enum ToolId { none, newWindow, goBack, goForward, goHome };
 
@@ -14,20 +13,6 @@ class ToolBarDemo : Window
    minClientSize = { 600, 300 };
    nativeDecorations = true;
 
-   IconBag<ToolId> iconBag
-   {
-      window = this;
-      alphaBlend = true;
-      iconNames =
-      [
-         "<:ecere>emblems/unreadable.png",
-         "<:ecere>actions/windowNew.png",      /* newWindow */
-         "<:ecere>actions/goPrevious.png",     /* goBack */
-         "<:ecere>actions/goNext.png",         /* goForward */
-         "<:ecere>actions/goHome.png"          /* goHome */
-      ];
-   };
-
    Stacker stack
    {
       this;
@@ -40,10 +25,9 @@ class ToolBarDemo : Window
    ToolBar toolBar
    {
       stack, this;
-      iconBag = iconBag;
       size = { h = 32 };
 
-      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
+      /*bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          ToolId id = (ToolId)button.id;
          switch(id)
@@ -54,28 +38,18 @@ class ToolBarDemo : Window
             case goHome:    break;
          }
          return true;
-      }
+      }*/
    };
 
    Window s1 { toolBar, size = { w = 8 } };
-   ToolButton goBack { toolBar, this, id = ToolId::goBack, toolTip = "Go Back" };
+   ToolButton goBack { toolBar, this, id = ToolId::goBack, toolTip = "Go Back", bitmap = { "<:ecere>actions/goPrevious.png" } };
    Window s2 { toolBar, size = { w = 2 } };
-   ToolButton goForward { toolBar, this, id = ToolId::goForward, toolTip = "Go Forward" };
+   ToolButton goForward { toolBar, this, id = ToolId::goForward, toolTip = "Go Forward", bitmap = { "<:ecere>actions/goNext.png" } };
    Window s3 { toolBar, size = { w = 12 } };
-   ToolButton newWindow { toolBar, this, id = ToolId::newWindow, toolTip = "New Window" };
+   ToolButton newWindow { toolBar, this, id = ToolId::newWindow, toolTip = "New Window", bitmap = { "<:ecere>actions/windowNew.png" } };
    Window s4 { toolBar, size = { w = 2 } };
-   ToolButton goHome { toolBar, this, id = ToolId::goHome, toolTip = "Go Home" };
+   ToolButton goHome { toolBar, this, id = ToolId::goHome, toolTip = "Go Home", bitmap = { "<:ecere>actions/goHome.png" } };
 
-   bool OnLoadGraphics()
-   {
-      iconBag.Load();
-      return true;
-   }
-
-   void OnUnloadGraphics()
-   {
-      iconBag.Unload();
-   }
 }
 
 ToolBarDemo tbDemo { };
index 6c0d906..a094e91 100644 (file)
@@ -29,9 +29,7 @@
       }
    ],
    "Files" : [
-      "toolBarDemo.ec",
-      "../../../extras/gui/IconBag.ec",
-      "../../../extras/gui/controls/ToolBar.ec"
+      "toolBarDemo.ec"
    ],
    "ResourcesPath" : "",
    "Resources" : [