samples/gui: Added 'ToolTips' sample showcasing the new ToolTips
authorJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 17:37:20 +0000 (00:37 +0700)
committerJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 17:37:20 +0000 (00:37 +0700)
samples/guiAndGfx/toolTips/Tooltips.epj [new file with mode: 0644]
samples/guiAndGfx/toolTips/toolTips.ec [new file with mode: 0644]

diff --git a/samples/guiAndGfx/toolTips/Tooltips.epj b/samples/guiAndGfx/toolTips/Tooltips.epj
new file mode 100644 (file)
index 0000000..e4c7df4
--- /dev/null
@@ -0,0 +1,48 @@
+{
+   "Version" : 0.2,
+   "ModuleName" : "Tooltips",
+   "Options" : {
+      "Warnings" : "All",
+      "TargetType" : "Executable",
+      "TargetFileName" : "Tooltips",
+      "Libraries" : [
+         "ecere"
+      ]
+   },
+   "Configurations" : [
+      {
+         "Name" : "Debug",
+         "Options" : {
+            "Debug" : true,
+            "Optimization" : "None",
+            "PreprocessorDefinitions" : [
+               "_DEBUG"
+            ]
+         }
+      },
+      {
+         "Name" : "Release",
+         "Options" : {
+            "Debug" : false,
+            "Optimization" : "Speed"
+         }
+      },
+      {
+         "Name" : "MemoryGuard",
+         "Options" : {
+            "Debug" : true,
+            "PreprocessorDefinitions" : [
+               "_DEBUG"
+            ],
+            "Console" : true
+         }
+      }
+   ],
+   "Files" : [
+      "toolTips.ec"
+   ],
+   "ResourcesPath" : "",
+   "Resources" : [
+
+   ]
+}
\ No newline at end of file
diff --git a/samples/guiAndGfx/toolTips/toolTips.ec b/samples/guiAndGfx/toolTips/toolTips.ec
new file mode 100644 (file)
index 0000000..68da39e
--- /dev/null
@@ -0,0 +1,40 @@
+import "ecere"
+
+class ToolTipsDemo : Window
+{
+   text = "Tool Tips Demo";
+   background = activeBorder;
+   borderStyle = sizable;
+   hasMaximize = true;
+   hasMinimize = true;
+   nativeDecorations = true;
+   tabCycle = true;
+   hasClose = true;
+   font = { "Arial", 14 };
+   size = { 400, 300 };
+
+   bool OnKeyDown(Key key, unichar ch)
+   {
+      if(key == escape) Destroy(0);
+      return true;
+   }
+
+   Button button1
+   {
+      this, text = "Simple Tooltip", position = { 88, 104 };
+      toolTip = "This button does this.\nPlease click it!";
+   };
+   Button button2
+   {
+      this, text = "Custom Tooltip", position = { 192, 168 }
+   };
+   ToolTip tt
+   {
+      button2, tip = "You can change fonts and colors!";
+      alphaBlend = true, opacity = 0.75;
+      font = { "Comic Sans MS", 12 };
+      background = lightSkyBlue, foreground = darkSlateBlue;      
+   };
+}
+
+ToolTipsDemo demo {};