Browse Source

cleanup for release

JimMarlowe 8 years ago
parent
commit
4ef2a04fe7
25 changed files with 123 additions and 177 deletions
  1. 2 2
      UIPeriodicTable/AtomicExample.json
  2. 9 9
      UIPeriodicTable/JavaScript/Resources/Components/code_table.js
  3. 1 0
      UIPeriodicTable/JavaScript/Resources/Components/code_uibutton.js
  4. 0 2
      UIPeriodicTable/JavaScript/Resources/Components/code_uicheckbox.js
  5. 1 0
      UIPeriodicTable/JavaScript/Resources/Components/code_uifinderwindow.js
  6. 1 1
      UIPeriodicTable/JavaScript/Resources/Components/code_uifontdescription.js
  7. 10 11
      UIPeriodicTable/JavaScript/Resources/Components/code_uilayout.js
  8. 0 1
      UIPeriodicTable/JavaScript/Resources/Components/code_uilayoutparams.js
  9. 0 88
      UIPeriodicTable/JavaScript/Resources/Components/code_uilistview.js
  10. 23 3
      UIPeriodicTable/JavaScript/Resources/Components/code_uimenuwindow.js
  11. 0 1
      UIPeriodicTable/JavaScript/Resources/Components/code_uiradiobutton.js
  12. 1 1
      UIPeriodicTable/JavaScript/Resources/Components/code_uisceneview.js
  13. 1 1
      UIPeriodicTable/JavaScript/Resources/Components/code_uitexturewidget.js
  14. 1 1
      UIPeriodicTable/JavaScript/Resources/Scenes/layout_uilayout.ui.txt
  15. 0 11
      UIPeriodicTable/JavaScript/Resources/Scenes/layout_uilistview.ui.txt
  16. 4 2
      UIPeriodicTable/JavaScript/Resources/Scenes/layout_uimenuwindow.ui.txt
  17. 6 1
      UIPeriodicTable/JavaScript/Resources/Scenes/layout_uiskinimage.ui.txt
  18. 0 7
      UIPeriodicTable/JavaScript/Resources/Scenes/main_atomic_layout.ui.txt
  19. 1 5
      UIPeriodicTable/JavaScript/Resources/Scenes/main_layout.ui.txt
  20. 1 1
      UIPeriodicTable/JavaScript/Resources/Scenes/main_table.ui.txt
  21. 2 0
      UIPeriodicTable/JavaScript/Resources/Scenes/view_layout.ui.txt
  22. 0 5
      UIPeriodicTable/JavaScript/Resources/Scenes/view_undock.ui.txt
  23. 21 9
      UIPeriodicTable/JavaScript/Resources/Scripts/main.js
  24. 38 15
      UIPeriodicTable/JavaScript/Resources/Scripts/utils.js
  25. BIN
      UIPeriodicTable/Screenshot.png

+ 2 - 2
UIPeriodicTable/AtomicExample.json

@@ -1,4 +1,4 @@
 {
-    "name": "UI Periodic Table",
-    "desc" : "Example of using all UI Widgets."
+    "name": "Atomic Widget Periodic Table",
+    "desc" : "Example of using all the UI Widgets."
 }

+ 9 - 9
UIPeriodicTable/JavaScript/Resources/Components/code_table.js

@@ -1,5 +1,6 @@
 // handle the periodic table jumps
 'use strict';
+var utils = require("Scripts/utils");
 
 exports.init = function(mylayout,mylogger) {
 
@@ -36,15 +37,14 @@ exports.init = function(mylayout,mylogger) {
     mylayout.getWidget("C7").onClick = function () {        maintb.setCurrentPage(3);        viewtb.setCurrentPage(6);    };
     mylayout.getWidget("C8").onClick = function () {        maintb.setCurrentPage(3);        viewtb.setCurrentPage(7);    };
     mylayout.getWidget("C9").onClick = function () {        maintb.setCurrentPage(3);        viewtb.setCurrentPage(8);    };
-    mylayout.getWidget("D1").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(0);    };
-    mylayout.getWidget("D2").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(1);    };
-    mylayout.getWidget("D3").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(2);    };
-    mylayout.getWidget("D4").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(3);    };
-    mylayout.getWidget("D5").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(4);    };
-    mylayout.getWidget("D6").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(5);    };
-    mylayout.getWidget("D7").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(6);    };
-    mylayout.getWidget("D8").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(7);    };
-    mylayout.getWidget("D9").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(8);    };
+    mylayout.getWidget("D2").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(0);    };
+    mylayout.getWidget("D3").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(1);    };
+    mylayout.getWidget("D4").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(2);    };
+    mylayout.getWidget("D5").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(3);    };
+    mylayout.getWidget("D6").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(4);    };
+    mylayout.getWidget("D7").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(5);    };
+    mylayout.getWidget("D8").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(6);    };
+    mylayout.getWidget("D9").onClick = function () {        maintb.setCurrentPage(4);        supporttb.setCurrentPage(7);    };
 
 };
 

+ 1 - 0
UIPeriodicTable/JavaScript/Resources/Components/code_uibutton.js

@@ -48,5 +48,6 @@ exports.init = function(mylayout,mylogger) {
         mylogger.setText( "UIButton support : " +  button6.id + " was pressed ");
         utils.viewCode ( "Scenes/layout_uibutton.ui.txt", mylayout );
     };
+
 };
 

+ 0 - 2
UIPeriodicTable/JavaScript/Resources/Components/code_uicheckbox.js

@@ -45,7 +45,5 @@ exports.init = function(mylayout,mylogger) {
         utils.viewCode ( "Scenes/layout_uicheckbox.ui.txt", mylayout );
     };
 
-
-
 };
 

+ 1 - 0
UIPeriodicTable/JavaScript/Resources/Components/code_uifinderwindow.js

@@ -7,6 +7,7 @@ exports.init = function(mylayout,mylogger,myview) {
     //
     // widget event and action functions
     //
+
     var button1 = mylayout.getWidget("filefinder");
     button1.onClick = function () {
         var finder = new Atomic.UIFinderWindow(myview, "myfinder");

+ 1 - 1
UIPeriodicTable/JavaScript/Resources/Components/code_uifontdescription.js

@@ -7,7 +7,7 @@ exports.init = function(mylayout,mylogger) {
     //
     // action functions
     //
-    
+
    var steps = mylayout.getWidget("fontstep");
     steps.onChanged = function(ev) {
         var mytext = mylayout.getWidget("changetext");

+ 10 - 11
UIPeriodicTable/JavaScript/Resources/Components/code_uilayout.js

@@ -21,7 +21,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo0);  // drop it in
 
     var tf1 = new Atomic.UITextField();
-    tf1.text = "layout 2 XACAC";
+    tf1.text = "layout config XACAC";
     var lo1 = new Atomic.UILayout();
     lo1.setLayoutConfig ( "XACAC" );
     lo1.load("Scenes/simp_button.ui.txt");
@@ -29,7 +29,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo1);
 
     var tf2 = new Atomic.UITextField();
-    tf2.text = "layout 3 XGCAC";
+    tf2.text = "layout config XGCAC";
     var lo2 = new Atomic.UILayout();
     lo2.setLayoutConfig ( "XGCAC" );
     lo2.load("Scenes/simp_button.ui.txt");
@@ -37,16 +37,15 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo2);
 
     var tf3 = new Atomic.UITextField();
-    tf3.text = "layout 4 XPCAC";
+    tf3.text = "layout config XPCAC";
     var lo3 = new Atomic.UILayout();
     lo3.setLayoutConfig ( "XPCAC" );
     lo3.load("Scenes/simp_button.ui.txt");
     lo3.addChildBefore(tf3, lo3.getFirstChild() );
     myc.addChild(lo3);
 
-
     var tf4 = new Atomic.UITextField();
-    tf4.text = "layout 5 XACGC";
+    tf4.text = "layout config XACGC";
     var lo4 = new Atomic.UILayout();
     lo4.setLayoutConfig ( "XACGC" );
     lo4.load("Scenes/simp_button.ui.txt");
@@ -54,7 +53,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo4);
 
     var tf5 = new Atomic.UITextField();
-    tf5.text = "layout 6 XGRGC";
+    tf5.text = "layout config XGRGC";
     var lo5 = new Atomic.UILayout();
     lo5.setLayoutConfig ( "XGRGC" );
     lo5.load("Scenes/simp_button.ui.txt");
@@ -62,7 +61,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo5);
 
     var tf6 = new Atomic.UITextField();
-    tf6.text = "layout 7 XPLGC";
+    tf6.text = "layout config XPLGC";
     var lo6 = new Atomic.UILayout();
     lo6.setLayoutConfig ( "XPLGC" );
     lo6.load("Scenes/simp_button.ui.txt");
@@ -70,7 +69,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo6);
 
     var tf7 = new Atomic.UITextField();
-    tf7.text = "layout 8 XACPC";
+    tf7.text = "layout config XACPC";
     var lo7 = new Atomic.UILayout();
     lo7.setLayoutConfig ( "XACPC" );
     lo7.load("Scenes/simp_button.ui.txt");
@@ -78,7 +77,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo7);
 
     var tf8 = new Atomic.UITextField();
-    tf8.text = "layout 9 XGLPL";
+    tf8.text = "layout config XGLPL";
     var lo8 = new Atomic.UILayout();
     lo8.setLayoutConfig ( "XGLPL" );
     lo8.load("Scenes/simp_button.ui.txt");
@@ -86,7 +85,7 @@ exports.init = function(mylayout,mylogger,myview) {
     myc.addChild(lo8);
 
     var tf9 = new Atomic.UITextField();
-    tf9.text = "layout 10 XPCPR";
+    tf9.text = "layout config XPCPR";
     var lo9 = new Atomic.UILayout();
     lo9.setLayoutConfig ( "XPCPR" );
     lo9.load("Scenes/simp_button.ui.txt");
@@ -99,7 +98,7 @@ exports.init = function(mylayout,mylogger,myview) {
         mylogger.setText( "UILayout action : " +  buttonl.id + " was pressed ");
         var window = new Atomic.UIWindow();
         window.setSettings ( Atomic.UI_WINDOW_SETTINGS_TITLEBAR + Atomic.UI_WINDOW_SETTINGS_RESIZABLE + Atomic.UI_WINDOW_SETTINGS_CLOSE_BUTTON );
-        window.text = "UILAYOUT-O-MATIC(tm)";
+        window.text = "LAYOUT-O-MATIC(tm)";
         window.load("Scenes/view_layout.ui.txt");
         window.resizeToFitContent();
         myview.addChild(window);

+ 0 - 1
UIPeriodicTable/JavaScript/Resources/Components/code_uilayoutparams.js

@@ -20,6 +20,5 @@ exports.init = function(mylayout,mylogger) {
         utils.viewCode ( "Scenes/layout_uilayoutparams.ui.txt", mylayout );
     };
 
-
 };
 

+ 0 - 88
UIPeriodicTable/JavaScript/Resources/Components/code_uilistview.js

@@ -1,88 +0,0 @@
-//UIListView application source code
-'use strict';
-var utils = require("Scripts/utils");
-
-exports.init = function(mylayout,mylogger) {
-
-    var mlvw = mylayout.getWidget("UIListViewDemo"); // get the container
-    if (mlvw !== null) {
-        mylogger.setText( "UIListView : already initialized");
-        return; // already initialized.
-    }
-
-// note : the UIListView widget does not have a corresponding Turbobadger widget, its ALL Atomic.
-// so we have to build it in source code / scripting
-
-    //
-    // action functions
-    //
-
-    var myListview = new Atomic.UIListView();  // make a List...view
-    myListview.id = "UIListViewDemo"; // tag it, in case we want to get it again later
-
-    var lpx = new Atomic.UILayoutParams();  // size it just right
-    lpx.width = 256;
-    lpx.height = 256;
-    lpx.minWidth = 256;
-    lpx.minHeight = 256;
-    lpx.maxWidth = 256;
-    lpx.maxHeight = 256;
-    myListview.layoutParams = lpx;
-
-    var lower = mylayout.getWidget("uilistviewlower");
-    var mylvc = mylayout.getWidget("listviewcontainer"); // get the container layout
-    mylvc.addChildBefore(myListview, lower);  // drop it in
-
-
-    // OMG what the heck was he thinking!
-   
-    // there is no external way of converting a name to an itemLookup_ ???
-
-    var rootsids = [];  // now fill it up
-
-    var id1 = myListview.addRootItem("root1", "", "root1");
-    rootsids.push(id1);
-    var id2 = myListview.addChildItem(id1, "rootish2", "", "root2");
-    rootsids.push(id2);
-    var id3 = myListview.addChildItem(id1, "rootish3", "", "root3");
-    rootsids.push(id3);
-    var id4 = myListview.addChildItem(id1, "rootish4", "", "root4");
-    rootsids.push(id4);
-    var id5 = myListview.addChildItem(id1, "rootish5", "", "root5");
-    rootsids.push(id5);
-
-    var nn;
-    for ( nn=7; nn<55; nn++)
-        rootsids.push( myListview.addChildItem(id2, "child " + nn, "", "child " + nn ) );
-
-    myListview.setExpanded(id1,true);
-    myListview.setExpanded(id2,false);
-
-    //
-    // widget event functions
-    //
-
-
-     myListview.subscribeToEvent("UIListViewSelectionChanged", function (ev) {
-             var selectedId = myListview.selectedItemID; /// hmmm same as the refid...
-             mylogger.setText( "UIListView event : " + myListview.id + "  refid=" +  ev.refid + "  selected=" +  ev.selected + " sid=" + selectedId );
-        });
-
-    //
-    // support functions
-    //
-
-    var button1 = mylayout.getWidget("uilistviewcode");
-    button1.onClick = function () {
-        mylogger.setText( "UIListView support : " +  button1.id + " was pressed ");
-        utils.viewCode ( "Components/code_uilistview.js", mylayout );
-    };
-
-    var button2 = mylayout.getWidget("uilistviewlayout");
-    button2.onClick = function () {
-        mylogger.setText( "UIListView support : " +  button2.id + " was pressed ");
-        utils.viewCode ( "Scenes/layout_uilistview.ui.txt", mylayout );
-    };
-
-};
-

+ 23 - 3
UIPeriodicTable/JavaScript/Resources/Components/code_uimenuwindow.js

@@ -18,8 +18,8 @@ exports.init = function(mylayout,mylogger) {
 
         mis.addItem( new Atomic.UIMenuItem( "UISelectItem1", "item1" ) );
         mis.addItem( new Atomic.UIMenuItem( "UISelectItem2", "item2", "Ctrl+C" ) );
-        mis.addItem( new Atomic.UIMenuItem( "UISelectItem2", "item3", "Ctrl+A", "DuckButton" ) );
-        mis.addItem( new Atomic.UIMenuItem( "UISelectItem3", "item4", "Ctrl+O", "LogoAtomic" ) );
+        mis.addItem( new Atomic.UIMenuItem( "UISelectItem3", "item3", "Ctrl+A", "DuckButton" ) );
+        mis.addItem( new Atomic.UIMenuItem( "UISelectItem4", "item4", "Ctrl+O", "LogoAtomic" ) );
 
         var xx = button1.x + (button1.width/2);
         var yy = button1.y + (button1.height/2);
@@ -44,9 +44,29 @@ exports.init = function(mylayout,mylogger) {
                mylogger.setText( "UIMenuWindow event : " + mymenuwindow.id + " UIUnhandledShortcut id = " + ev.refid );
         });
 
-
     };
 
+    var topw = mylayout.getWidget("uimenuwindowtop");
+    topw.subscribeToEvent( "WidgetEvent", function (ev) {
+        if ( ev.type == Atomic.UI_EVENT_TYPE_RIGHT_POINTER_UP && ev.target == topw ) {
+                mylogger.setText( "UIMenuWindow event : " + topw.id + " target id = " + ev.target.id + " event type = " + utils.eventReport(ev.type));
+            var mypoppup = new Atomic.UIMenuWindow( mylayout, "MenuPopupDemo");
+            var mix = new Atomic.UIMenuItemSource();
+            mix.addItem( new Atomic.UIMenuItem( "UISelectItem1", "popup1", "Ctrl+A", "DuckButton" ) );
+            mix.addItem( new Atomic.UIMenuItem( "UISelectItem2", "popup2", "Ctrl+C" ) );
+            mix.addItem( new Atomic.UIMenuItem( "UISelectItem3", "popup3" ) );
+            mix.addItem( new Atomic.UIMenuItem( "UISelectItem4", "popup4", "Ctrl+O", "LogoAtomic" ) );
+            var xx = ev.x;
+            var yy = ev.y;
+            mypoppup.show(mix, xx, yy);
+            mypoppup.subscribeToEvent( "WidgetEvent", function (ev) {
+                if ( ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target == mypoppup )
+                    mylogger.setText( "UIMenuWindow event : " + mypoppup.id + " popup entry id = " + ev.refID + " event type = " + utils.eventReport(ev.type));
+            });
+        }
+    });
+
+
     //
     // support functions
     //

+ 0 - 1
UIPeriodicTable/JavaScript/Resources/Components/code_uiradiobutton.js

@@ -45,6 +45,5 @@ exports.init = function(mylayout,mylogger) {
         utils.viewCode ( "Scenes/layout_uiradiobutton.ui.txt", mylayout );
     };
 
-
 };
 

+ 1 - 1
UIPeriodicTable/JavaScript/Resources/Components/code_uisceneview.js

@@ -17,7 +17,7 @@ exports.init = function(mylayout,mylogger) {
     //
 
 // note : the UISceneView widget does not have a corresponding Turbobadger widget, its ALL Atomic.
-// so we have to build it in source code / scripting
+// so we have to build it in source code / scripting, no problem.
 
     var mysceneview = new Atomic.UISceneView();  // make a scene...view
     mysceneview.id = "UISceneViewDemo"; // tag it, in case we want to get it again later

+ 1 - 1
UIPeriodicTable/JavaScript/Resources/Components/code_uitexturewidget.js

@@ -27,7 +27,7 @@ exports.init = function(mylayout,mylogger) {
     lpx.maxHeight = 256;
     mytexturewidget.layoutParams = lpx;
 
-	var lower = mylayout.getWidget("uitexturewidgetlower");
+    var lower = mylayout.getWidget("uitexturewidgetlower");
     var myc = mylayout.getWidget("uitwcontainer"); // get the container layout
     myc.addChildBefore(mytexturewidget,lower);  // drop it in
 

+ 1 - 1
UIPeriodicTable/JavaScript/Resources/Scenes/layout_uilayout.ui.txt

@@ -1,6 +1,6 @@
 # UILayout widget layout file
 TBLayout: id: uilayoutcontainer, config: "Y----"
 	TBEditField: multiline: 1, styling: 1, readonly: 1, adapt-to-content: 1, skin: "sheet_cell"
-		text: "UILayout widget. This widget is used to contain and arrange widgets into rows and columns."
+		text: "UILayout widget. This widget is used to contain and arrange widgets into rows and columns. Try the LAYOUT-O-MATIC!"
 
 

+ 0 - 11
UIPeriodicTable/JavaScript/Resources/Scenes/layout_uilistview.ui.txt

@@ -1,11 +0,0 @@
-# UIListView widget layout file
-TBLayout: axis: y, id: listviewcontainer
-	TBEditField: multiline: 1, styling: 1, readonly: 1, adapt-to-content: 1, skin: "sheet_cell"
-		text: "UIListView widget\nThis widget can display a tree structure.\nThe Statusbar will display the results."
-	TBTextField: id: spacer, text: "   "
-# there is NO TBListView widget, its entirely an Atomic Widget, well add it with code
-	TBTextField: id: "uilistviewlower", text: "   "
-	TBLayout
-		TBButton: text: "UIListView help Document", url: "http://docs.atomicgameengine.com/api/classes/atomic.uilistview.html"
-		TBButton: text: "UIListView application code", id: uilistviewcode
-		TBButton: text: "UIListView application code", id: uilistviewlayout

+ 4 - 2
UIPeriodicTable/JavaScript/Resources/Scenes/layout_uimenuwindow.ui.txt

@@ -1,7 +1,9 @@
 # UIMenuWindow widget layout file
-TBLayout: axis: y
+TBLayout: axis: y, id: "uimenuwindowtop"
 	TBEditField: multiline: 1, styling: 1, readonly: 1, adapt-to-content: 1, skin: "sheet_cell"
-		text: "UIMenuWindow widget\nThis widget is used to create popup menus.\nThe Statusbar will display the results."
+		text: "UIMenuWindow widget\nThis widget is used to create menus and popup menus.\nThe Statusbar will display the results."
+	TBTextField: id: spacer, text: "   "
+	TBTextField: text: "Use Mouse button 3 for a popup menu."
 	TBTextField: id: spacer, text: "   "
 	TBButton: text: "push for a UIMenuWindow", id: uimenuwindowpush
 	TBTextField: id: spacer, text: "   "

+ 6 - 1
UIPeriodicTable/JavaScript/Resources/Scenes/layout_uiskinimage.ui.txt

@@ -1,12 +1,17 @@
 # UISkinImage widget layout file
 TBLayout: axis: y
 	TBEditField: multiline: 1, styling: 1, readonly: 1, adapt-to-content: 1, skin: "sheet_cell"
-		text: "UISkinImage widget\nThis widget is used to display a skinned bitmap in another widget."
+		text: "UISkinImage widget\nThis widget is used to display a skinned bitmap in another widget.\nIn order to use this, you must have an applicaion skin.tb.txt or use a stock skin item."
 	TBTextField: id: spacer, text: "   "
 	TBContainer
 		TBLayout
 			TBButton: skin: 0
 				TBSkinImage: skin: LogoAtomic
+			TBButton: skin: 0
+				TBSkinImage: skin: LogoAtomic
+					lp: width: 64, height: 64
+			TBSkinImage: skin: LogoAtomic
+				lp: width: 128, height: 128
 	TBTextField: id: spacer, text: "   "
 	TBLayout
 		TBButton: text: "UISkinImage help Document", url: "http://docs.atomicgameengine.com/api/classes/atomic.uiskinimage.html"

+ 0 - 7
UIPeriodicTable/JavaScript/Resources/Scenes/main_atomic_layout.ui.txt

@@ -3,8 +3,6 @@ TBTabContainer
 	gravity all
 	id atomictabs
 	tabs
-		TBButton
-			text UIListView
 		TBButton
 			text UISceneView
 		TBButton
@@ -21,11 +19,6 @@ TBTabContainer
 			text UIPromptWindow
 		TBButton
 			text UIFinderWindow
-	TBLayout
-		id pageuilistview
-		size available
-		distribution available
-		@file layout_uilistview.ui.txt
 	TBLayout
 		id pageuisceneview
 		size available

+ 1 - 5
UIPeriodicTable/JavaScript/Resources/Scenes/main_layout.ui.txt

@@ -52,12 +52,8 @@ TBTabContainer
 		@file main_atomic_layout.ui.txt
 TBLayout: axis: x, distribution-position: left right, size: available
 	lp: min-height: 32, max-height: 32, pref-height: 32
-	TBButton: id: exitapp
+	TBButton: id: exitapp, skin: LogoAtomic, tooltip: "Press here to exit"
 		axis y
-		TBSkinImage: skin: LogoAtomic
-			gravity: all
-			lp: pref-width: 32, pref-height: 32
 		gravity: left
-		lp: pref-width: 32, pref-height: 32
 	TBTextField: id: LogText, text: "This is the Atomic Widget Periodic Table"
 

+ 1 - 1
UIPeriodicTable/JavaScript/Resources/Scenes/main_table.ui.txt

@@ -18,7 +18,7 @@ TBLayout: axis: x, size: available, position: gravity, distribution: available,
 		lp: pref-width: 150dp
 	TBButton: id: C1, text: "UIWidget", squeezable: 1
 		lp: pref-width: 150dp
-	TBButton: id: D1, text: "UIListView", squeezable: 1
+	TBTextField: id: D1, text: "", squeezable: 1
 		lp: pref-width: 150dp
 TBLayout: axis: x, size: available, position: gravity, distribution: available, spacing: 2
 	TBButton: id: A2, text: "UITextField", squeezable: 1

+ 2 - 0
UIPeriodicTable/JavaScript/Resources/Scenes/view_layout.ui.txt

@@ -1,6 +1,8 @@
 # LAYOUT-O-MATIC layout file
 TBLayout: axis: y
 	lp: min-width: 320dp
+	TBEditField: multiline: 1, styling: 1, readonly: 1, adapt-to-content: 1, skin: "sheet_cell"
+		text: "The LAYOUT-O-MATIC\nThe window allows you to change the top UILayout attributes with the\nclick of a button, so you can see what these things really do."
 	TBLayout: distribution: gravity, distribution-position: left
 		TBTextField: text: "Axis", text-align: right
 			lp: pref-width: 160dp

+ 0 - 5
UIPeriodicTable/JavaScript/Resources/Scenes/view_undock.ui.txt

@@ -1,5 +0,0 @@
-# undock host user interface layout
-TBLayout: axis: y, distribution: gravity
-	lp: min-width: 800dp, min-height: 400dp
-	TBLayout: id: "undocklayout", distribution: gravity
-

+ 21 - 9
UIPeriodicTable/JavaScript/Resources/Scripts/main.js

@@ -1,37 +1,46 @@
-// This script is the main entry point of the game
+// This script is the main entry point of the example 
+
 //Load scene
 Atomic.player.loadScene("Scenes/Scene.scene");
 
 // build host for GUI, which there will be a lot of.
 var view = new Atomic.UIView();
+
 var layout = new Atomic.UILayout();
 layout.rect = view.rect;
 layout.axis = Atomic.UI_AXIS_Y;
 layout.layoutSize = Atomic.UI_LAYOUT_SIZE_AVAILABLE;
 layout.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_AVAILABLE;
 layout.layoutPosition = Atomic.UI_LAYOUT_POSITION_GRAVITY;
-layout.setSkinBg ("background_solid");  // make it look good as a user program
-
+layout.setSkinBg ("background_solid");  // make it look presentable.
 
-Atomic.ui.addFont("Textures/BrokenGlass.ttf", "BrokenGlass"); // add a font
+// example of adding a font, will be used later
+Atomic.ui.addFont("Textures/BrokenGlass.ttf", "BrokenGlass");
 
 // set up some stuff for mobile, so we can use the same app code & layouts
+// by lying about the device DPI. Everyone lies about DPI.
 if (( Atomic.platform == "Android" ) || Atomic.platform == "iOS") {
     Atomic.ui.loadSkin("Textures/mobile.tb.txt");
-    Atomic.ui.setDefaultFont("Vera", 14);
+         if (Atomic.graphics.width > 1200)
+            Atomic.ui.setDefaultFont("Vera", 14);
+        else 
+            Atomic.ui.setDefaultFont("Vera", 10);
 }
 else {
     Atomic.ui.loadSkin("Textures/desktop.tb.txt");
 }
 
-layout.load("Scenes/main_layout.ui.txt"); // load the main layout
+// load the main UI layout
+layout.load("Scenes/main_layout.ui.txt");
 view.addChild(layout);
 
+// and get going
 var maintb = layout.getWidget("maintabs");
 var acttb = layout.getWidget("primarytabs");
 var semitb = layout.getWidget("moretabs");
 var viewtb = layout.getWidget("supporttabs");
 var supporttb = layout.getWidget("atomictabs");
+
 supporttb.setCurrentPage(0); 
 viewtb.setCurrentPage(0); 
 semitb.setCurrentPage(0); 
@@ -39,11 +48,15 @@ acttb.setCurrentPage(0);
 maintb.setCurrentPage(0); // do this or esle the tab contents look like crap!
 
 // exit by pressing the atomic logo button
-layout.getWidget("exitapp").onClick = function () { Atomic.engine.exit(); };
+layout.getWidget("exitapp").onClick = function ()
+{ 
+    Atomic.engine.exit();
+};
 
-//hookup code on all the pages
+//hookup code on all the pages, thats how the javascript example rolls.
 var logger = layout.getWidget("LogText");
 var someview = layout.view;
+
 require("Components/code_table").init(layout, logger);
 require("Components/code_uiwidget").init(layout.getWidget("pageuiwidget"), logger);
 require("Components/code_uibargraph").init(layout.getWidget("pageuibargraph"), logger);
@@ -60,7 +73,6 @@ require("Components/code_uiimagewidget").init(layout.getWidget("pageuiimagewidge
 require("Components/code_uiinlineselect").init(layout.getWidget("pageuiinlineselect"), logger);
 require("Components/code_uilayoutparams").init(layout.getWidget("pageuilayoutparams"), logger);
 require("Components/code_uilayout").init(layout.getWidget("pageuilayout"), logger, someview);
-require("Components/code_uilistview").init(layout.getWidget("pageuilistview"), logger);
 require("Components/code_uimenuitem").init(layout.getWidget("pageuimenuitem"), logger);
 require("Components/code_uimenuwindow").init(layout.getWidget("pageuimenuwindow"), logger);
 require("Components/code_uimessagewindow").init(layout.getWidget("pageuimessagewindow"), logger);

+ 38 - 15
UIPeriodicTable/JavaScript/Resources/Scripts/utils.js

@@ -1,22 +1,45 @@
 // code viewer utility
-// shows project relative text files
+
 exports.viewCode = function(codeFile, mylayout) {
 
- 	    var window = new Atomic.UIWindow();
-    	window.setSettings ( Atomic.UI_WINDOW_SETTINGS_TITLEBAR + Atomic.UI_WINDOW_SETTINGS_RESIZABLE + Atomic.UI_WINDOW_SETTINGS_CLOSE_BUTTON );
-    	window.text = "Code Viewer";
-   	 	window.load("Scenes/view_code.ui.txt");
+        var window = new Atomic.UIWindow();
+        window.setSettings ( Atomic.UI_WINDOW_SETTINGS_DEFAULT );
+        window.text = "Code Viewer";
+        window.load("Scenes/view_code.ui.txt");
 
-    	var filex = Atomic.cache.getFile(codeFile);
-    	var textx = filex.readText();
-    	window.getWidget("viewCodeText").text = textx;
+        var filex = Atomic.cache.getFile(codeFile);
+        var textx = filex.readText();
+        filex.close();
+        window.getWidget("viewCodeText").text = textx;
 
-    	window.resizeToFitContent();
-    	mylayout.view.addChild(window);
- 	   	window.center();
- 		window.getWidget("viewCodeOK").onClick = function () {
-       		window.die();
-        	window = null;
-    	};
+        window.resizeToFitContent();
+        mylayout.view.addChild(window);
+        window.center();
+        window.getWidget("viewCodeOK").onClick = function () {
+            window.die();
+            window = null;
+        };
+};
 
+exports.eventReport = function(eventNumber) {
+    switch ( eventNumber ) {
+        case 0: return "UI_EVENT_TYPE_CLICK";
+        case 1: return "UI_EVENT_TYPE_LONG_CLICK";
+        case 2: return "UI_EVENT_TYPE_POINTER_DOWN";
+        case 3: return "UI_EVENT_TYPE_POINTER_UP";
+        case 4: return "UI_EVENT_TYPE_POINTER_MOVE";
+        case 5: return "UI_EVENT_TYPE_RIGHT_POINTER_DOWN";
+        case 6: return "UI_EVENT_TYPE_RIGHT_POINTER_UP";
+        case 7: return "UI_EVENT_TYPE_WHEEL";
+        case 8: return "UI_EVENT_TYPE_CHANGED";
+        case 9: return "UI_EVENT_TYPE_KEY_DOWN";
+        case 10: return "UI_EVENT_TYPE_KEY_UP";
+        case 11: return "UI_EVENT_TYPE_SHORTCUT";
+        case 12: return "UI_EVENT_TYPE_CONTEXT_MENU";
+        case 13: return "UI_EVENT_TYPE_FILE_DROP";
+        case 14: return "UI_EVENT_TYPE_TAB_CHANGED";
+        case 15: return "UI_EVENT_TYPE_CUSTOM";
+    }
+    return "Unknown";
 };
+

BIN
UIPeriodicTable/Screenshot.png