Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jul 2012
    Posts
    20

    Default Own button opening a custom window/tab

    Hey,

    I'm working with OX community edition and try to integrate an own plugin.

    I already studies the plugin-page and I understood the SMS-button in the contacts-panel. But I can't find a guide or a hint to add these buttons to a different tab (actually it's in the "new-tab") or to the E-Mail-Section.

    The second problem for me is opening a new custom window with labels, buttons etc. I only found how to add own configuration-tabs.

    The guides are a bit outdated sometimes but I want to learn

  2. #2
    Join Date
    Feb 2007
    Posts
    253

    Default

    For the menu, see this post.

    For opening a new window, just use window.open() with your own HTML page as URL. This page can reuse scripts and CSS files of the GUI to get the same look as the main window.

  3. #3
    Join Date
    Jul 2012
    Posts
    20

    Default

    Isn't it possible to create an own inside-window like OX does e.g. with a new-mail-window?

  4. #4
    Join Date
    Jul 2012
    Posts
    20

    Default

    ox.api.mail.open(); does open the new-mail-window. But where is this function defined to look how the window i built?

  5. #5
    Join Date
    Feb 2007
    Posts
    253

    Default

    Then you want to use ox.api.window.open(). The first aprameter is the path to your HTML file, the second parameter is an options object. See js/api.js around line 1800 for details.

  6. #6
    Join Date
    Jul 2012
    Posts
    20

    Default

    Great, that's exactly what I was looking for

    Now there is a new question. Which parameter has to be changed (from the own-panel-button-example) to add the button to the edit-tab and not the new-tab? And how do I make a big button instead of the small ones?

  7. #7
    Join Date
    Feb 2007
    Posts
    253

    Default

    I'm not sure which example you mean, but the buttons appear in the section to which they are added. The default sections are stored in ox.widgets.toolBar.sections.

    The option to create a big button is a boolean called "big":
    Code:
    var button = new ox.gui.MenuItem({ big: true, ... })

  8. #8
    Join Date
    Jul 2012
    Posts
    20

    Default

    Ok, the function MenuNodes.createBigButtonContext contains this value. But only using
    Code:
    MenuNodes.createBigButtonContext ( "myId", "mailEdit", "themes/default/img/menu/btn_save.gif", alert("This is my own big button") );
    is not enough i guess, because it's not working :/

    I meant this example here: http://oxpedia.org/wiki/index.php?ti...s_in_the_panel

  9. #9
    Join Date
    Jul 2012
    Posts
    20

    Default

    Well, this works for adding a big button to the new-tab in the mail section

    Code:
    var section = MenuNodes.contexts["moveid"] = { node: new ox.gui.PanelMenuSection("movemail") };
    
    var item = ox.widgets.toolBar.menuItems["moveid"] = new ox.gui.MenuItem({
        id: "moveid",
        title: "MoveMailTitle",
        icons: "themes/default/img/menu/btn_save.gif",
        big: true,
        action: null
    });
    
    
    section.node.add(item);
    
    changeDisplay("mail", "moveid");
    But I want it to the edit-tab. changeDisplay("mailedit", "moveid"); or changeDisplay("mailEdit", "moveid"); doesn't work

  10. #10
    Join Date
    Feb 2007
    Posts
    253

    Default

    MenuNodes is wrapper for backward compatibility. The old API had no notion of multiple tabs, and that's why all buttons land on the first tab.
    The tab-based code is implemented in js/wtk/classes/, with examples of how it's used in js/wtk/.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •