Jump to content
Kingsley1997

Documentation for menuXXX comands

Recommended Posts

There's a bunch of menu commands (listed below) that have no documentation on the wiki. Are these commands discontinued or still a work in progress? Currently unable to get these to work. They would be very useful for a mod I'm making.

menuAdd
menuData
menuSetData
menuText
menuPicture
menuSetPicture
menuAction
menuSetAction
menuCollapse
menuExpand
menuDelete
menuEnable
menuEnabled
menuHover
menuSetCheck
menuSetValue
menuURL
menuValue

Share this post


Link to post
Share on other sites

The blub from SPOTREP #00052 says this:

 

 

 

Added: CT_MENU and CT_MENU_STRIP control types. See CtrlMenu and CtrlMenuStrip base classes for supported config properties. The UI element can be controlled by following script commands:

 

So something to do with Eden Editor configs?

Share this post


Link to post
Share on other sites

All control types used in Eden can basically also be used in any other display.

Share this post


Link to post
Share on other sites

All control types used in Eden can basically also be used in any other display.

 

Got any examples of that perhaps? :)

Share this post


Link to post
Share on other sites

Not really, I am mostly using combo boxes, toolboxes and checkboxes for my 3den mod.

Share this post


Link to post
Share on other sites
class MARS_gui_ctrlMenu: ctrlMenu {
    colorBorder[] = {0,0,0,0};
    colorBackground[] = {0,0,0,1};
    colorText[] = {COLOR_TEXT_RGBA};
    colorSelect[] = {0,0,0,1};
    colorSelectBackground[] = {COLOR_ACTIVE_RGBA};
    colorDisabled[] = {COLOR_TEXT_RGB,0.25};
    colorPicture[] = {1,1,1,1};
    colorPictureSelect[] = {0,0,0,1};
    colorPictureDisabled[] = {1,1,1,0.5};
    arrow = "\a3\3DEN\Data\Controls\ctrlMenu\arrow_ca.paa";

    class Items {
        class Default {
            text = "Empty";
            data = "Empty";
            enable = 0;
        };
    };
};
private _display = (findDisplay 46) createDisplay "mars_editor_interface";
private _control = _display ctrlCreate ["MARS_gui_ctrlMenu", 123456];

_control ctrlSetPosition [
    getMousePosition select 0,
    getMousePosition select 1
];

private _path = _control menuAdd [[], "Option 1"];
_control ctrlCommit 0;

systemChat str (_control menuSize []);

"Option 1" is never added and menuSize remains 0.

Share this post


Link to post
Share on other sites

When hard-coding items (as shown below), they appear as expected, but not with menuAdd.

class Items {
    items[] = {One,Two,Three};

    class One {
        text = "One";
        data = "One";
        value = 0;
    };

    class Two {
        text = "Two";
        data = "Two";
        value = 1;
    };

    class Three {
        text = "Three";
        data = "Three";
        value = 2;
    };

    class Default {
        text = "Empty";
        data = "Empty";
        enable = 0;
    };
};

Share this post


Link to post
Share on other sites

Even on the latest dev branch the menu scripting commands do not work on a CT_MENU control, only CT_MENU_STRIP.

 

Feedback tracker is yet to have any response on the issue: T116695.

Share this post


Link to post
Share on other sites

Menu commands work fine:

systemChat str (menuSize[2700, []])
// Alternative
systemChat str (((findDisplay 2500) displayCtrl 2700) menuSize [])
Says 4 for both in chat as expected (I have 4 menus).

// Let's say I only have one parent menu called Menu 1
_subMenu0 = _myMenuCtrl menuAdd [[0],"Sub Menu 0 of Menu 1"];
_myMenuCtrl menuAdd [[0,_subMenu0],"Sub Menu 0 of Sub Menu 0 of Menu 1"];
_subMenu1 = _myMenuCtrl menuAdd [[1],"Sub Menu 1 of Menu 1"];
_menu2 = _myMenuCtrl menuAdd [[],"Menu 2"];

/*
Menu 1 | Menu 2
|- Sub Menu 0
|  |- Sub Menu 0 of Sub Menu 0 of Menu 1
|- Sub Menu 1
*/
They do work exactly the same way as tree family commands (tvAdd, tvCount etc...), if you know how to mess with CT_TREE control you're gold.

For more infos unpack 3den.pbo and check fn_3DENInterface.sqf located in the Functions folder.

CT_MENU & CT_MENU_STRIP controls can be found in the UI\Controls folder (ctrlMenu.hpp & ctrlMenuStrip).

Now we can make nice context menus :)

Sent from phone.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×