Results 1 to 4 of 4
  1. mgmft's Avatar
    Posts
    199 Posts
    Global Posts
    230 Global Posts
       #1  
    Hi,

    I played around with ARES to write an remote controller app for my VDR. It works pretty good already. Now I wanted to add a preferences menu, to enable other users to use ma app also. But:

    How can I add menus in ARES?

    Adding manually, as I found here didn't work for me.

    Is there an easy way to setup menus using Ares?

    Otherwise, I guess I will have to start all over and use Eclipse to write my app. The Documentation of Ares is very poor, but for the regular SDK there are plenty of tutorials and samples around.

    Since Ares is still Beta, and I used it for the first time last week:

    Did anyone see any changes in Ares recently?

    Thanks in advance

    LinuxQ
  2. mgmft's Avatar
    Posts
    199 Posts
    Global Posts
    230 Global Posts
       #2  
    Hi,

    finally I got Menus to work. I added "Prefs" and "Help" like this:
    handleCommand: function(event) {
    if (event.type == Mojo.Event.commandEnable) {
    switch (event.command) {
    case Mojo.Menu.helpCmd:
    event.stopPropagation();
    break;
    case Mojo.Menu.prefsCmd:
    event.stopPropagation();
    break;
    }
    }
    if (event.type == Mojo.Event.command) {
    switch (event.command) {
    case Mojo.Menu.helpCmd:
    // do help command
    Mojo.Controller.stageController.pushScene ("About");
    break;

    case Mojo.Menu.prefsCmd:
    // do help command
    Mojo.Controller.stageController.pushScene ("Preferences");
    break;
    }
    }
    },
    The Menus are active and shown, but when I select them, the Scenes won`t be pushed / shown!?

    Why that? Even if I add another button and try to push them "onTap" they won`t be pushed.

    If I start a complete new project with a second scene and do as above everything works perfect! What might be wrong in my code?

    Thanks

    LinuxQ
  3. #3  
    I am trying your code in my app. I have been trying to figure this out for sometime. Ares is nice but they need to update the documentation.
  4. #4  
    I added this to my stage-assistant.jsjsjs $file$ $and$ $I$ $can$ $then$ $force$ $it$ $to$ $open$ $a$ $scene$ $so$ $I$ $can$ $test$ $it$ $but$ $I$ $can$'$t$ $actually$ $get$ $a$ $scene$ $to$ $show$ $based$ $on$ $the$ $app$ $menu$:

    Code:
    function StageAssistant() {}
    
    StageAssistant.prototype.setup = function() {
    	this.controller.pushScene({
    		name: "main",
    		disableSceneScroller: true
    	});
    	this.controller.pushScene({
    		name: "preferences",
    		disableSceneScroller: true
    	});
    	this.controller.pushScene({
    		name: "help",
    		disableSceneScroller: true
    	});
    	this.controller.setWindowOrientation("free");
    };

Posting Permissions