diguyViewButtonPanel

Generated from diguyViewButtonPanel.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguyViewButtonPanel.h. Do not edit this file directly; the changes will be lost.
Includes: declspec_diguy.h | stdlib.h

Contents:

Alphabetical Index

Link against: libdiguy

class diguyViewButtonPanel

class BDI_DECLSPEC_diguy diguyViewButtonPanel
{
public:
    static diguyViewButtonPanel* find_or_create_instance(const char* name,
        int horizontal = 0,
        int title = 1);
    static diguyViewButtonPanel* make_instance(const char* name,
        int horizontal = 0,
        int title = 1);
    static diguyViewButtonPanel* get_instance(const char* name);
    static int destroy_instance(const char* name);
    static int destroy_all();
    const char* get_name();
    int get_position(int* ret_x, int* ret_y);
    int get_width();
    int get_height();
    int set_visible(int visible);
    int set_minimized_state(int minimized);
    int set_position(int x, int y);
    int set_dimensions(int w, int h);
    int set_depth(int z);
    int set_justifications(int h, int v);
    int set_spacing(int spacing);
    int set_title(const char* title);
    int add_button(const char* name,
        const char* lua_object_name,
        const char* lua_function_name,
        const char* style_sheet = NULL);
    int	add_button_with_script(const char* name, const char* script,
        const char* style_sheet = NULL);
    int set_button_name(int index, const char* name);
    int set_allow_toggle(int index, int can_toggle);
    int set_selected_button(int index);
    int set_selected_button_by_name(const char* name);
    int add_int_slider(const char* name,
        const char* lua_object_name,
        const char* lua_function_name,
        int init_val,
        int min_val,
        int max_val,
        const char* style_sheet = NULL);
    int add_float_slider(const char* name,
        const char* lua_object_name,
        const char* lua_function_name,
        float init_val,
        float min_val,
        float max_val,
        const char* style_sheet = NULL);
    int set_slider_value(const char* name, float value);
    int add_spacer(int pixels);
    void set_item_visibility(int index, bool visible);
    void remove_all_items();
    void set_open_script(const char* lua_script);
    void set_minimize_script(const char* lua_script);
    int set_style_sheet(const char* sheet);

function diguyViewButtonPanel::find_or_create_instance

Prototype:

static diguyViewButtonPanel* find_or_create_instance(const char* name,
    int horizontal = 0,
    int title = 1);
Description:

Returns the named button panel or creates it.

Arguments:

name name of panel (must be unique)
horizontal if 1, make a horizontal panel
title if 1, show panel title
Returns:

pointer to the button panel

Callable From:

function diguyViewButtonPanel::make_instance

Prototype:

static diguyViewButtonPanel* make_instance(const char* name,
    int horizontal = 0,
    int title = 1);
Description:

Makes a button panel with the given name and attributes.

Arguments:

name name of panel (must be unique)
horizontal if 1, make a horizontal panel
title if 1, show panel title
Returns:

pointer to the button panel

Callable From:

function diguyViewButtonPanel::get_instance

Prototype:

static diguyViewButtonPanel* get_instance(const char* name);
Description:

Returns a pointer to the named button panel, if it exists.

Arguments:

namename of panel
Returns:

pointer to the button panel or NULL

Callable From:

function diguyViewButtonPanel::destroy_instance

Prototype:

static int destroy_instance(const char* name);
Description:

Destroys named button panel, if found.

Arguments:

name name of panel
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::destroy_all

Prototype:

static int destroy_all();
Description:

Destroys all button panels.

Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::get_name

Prototype:

const char* get_name();
Description:

Returns the name of the object. This pointer will never be NULL.

Returns:

name of the object

Callable From:

function diguyViewButtonPanel::get_position

Prototype:

int get_position(int* ret_x, int* ret_y);
Description:

Returns the x and y coordinate of the panel.

Callable From:

function diguyViewButtonPanel::get_width

Prototype:

int get_width();
Description:

Returns the width of the panel

Callable From:

function diguyViewButtonPanel::get_height

Prototype:

int get_height();
Description:

Returns the height of the panel

Callable From:

function diguyViewButtonPanel::set_visible

Prototype:

int set_visible(int visible);
Description:

Makes button panel visible or invisible.

Arguments:

visiblepass 1 to make visible, 0 to make invisible
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_minimized_state

Prototype:

int set_minimized_state(int minimized);
Description:

Makes button panel minimized (or un-minimized).

Arguments:

visiblepass 1 to make minimized, 0 to make full size
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_position

Prototype:

int set_position(int x, int y);
Description:

Sets the position of the panel in its parent window. Coordinates work differently if panel is rightbottom justified on its xy (see set_justification()). In that case, the coordinate will imply the position of the panel's rightbottom edge relative to the rightbottom edge of the containing window.

Arguments:

xx position, in pixels
yy position, in pixels
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_dimensions

Prototype:

int set_dimensions(int w, int h);
Description:

Sets the desired dimensions of the panel.

Arguments:

w width, in pixels
h height, in pixels
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_depth

Prototype:

int set_depth(int z);
Description:

Sets the desired z depth of the panel.

Arguments:

zdepth
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_justifications

Prototype:

int set_justifications(int h, int v);
Description:

Sets the horizontal/vertical justifications of the panel (see description in set_position()).

Arguments:

h horizontal justification (> 0 for left, 0 for center, < 0 for right)
v vertical justification (> 0 for top, 0 for center, < 0 for bottom)
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_spacing

Prototype:

int set_spacing(int spacing);
Description:

Sets the spacing between items in panel.

Arguments:

spacing spacing in pixels
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_title

Prototype:

int set_title(const char* title);
Description:

Sets the display title of the panel.

Arguments:

title text to show
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::add_button

Prototype:

int add_button(const char* name,
    const char* lua_object_name,
    const char* lua_function_name,
    const char* style_sheet = NULL);
Description:

Adds a button to the panel and specifies the lua script that should be run upon press.

Arguments:

name text of button
lua_object_name name of lua table containing function to run
lua_function_namename of lua function to run
style_sheet optional css to set on button
An example style sheet string: "QPushButton {background-color : rgba( 192, 210, 192, 192 ); }"

Returns:

index of the new button (zero-indexed)

Callable From:

function diguyViewButtonPanel::add_button_with_script

Prototype:

int    add_button_with_script(const char* name, const char* script,
    const char* style_sheet = NULL);
Description:

Adds a button to the panel and specifies the lua script that should be run upon press.

Arguments:

name text of button
script Lua script to run (the script itself)
style_sheet optional css to set on button
An example style sheet string: "QPushButton {background-color : rgba( 192, 210, 192, 192 ); }"

Returns:

index of the new button (zero-indexed)

Callable From:

function diguyViewButtonPanel::set_button_name

Prototype:

int set_button_name(int index, const char* name);
Description:

Sets the name (text) of button at index n (zero-indexed).

Arguments:

index index of button (starting from 0)
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_allow_toggle

Prototype:

int set_allow_toggle(int index, int can_toggle);
Description:

Sets whether or not the specified button will be a toggle button. A toggle button can be clicked back and forth between an on and off state, whereas a regular button provides only a once-off action.

Arguments:

index index of button (starting from 0)
can_toggle true if toggle button
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_selected_button

Prototype:

int set_selected_button(int index);
Description:

Sets the specified button to be the "selected" one within the panel. The selected button may have a special appearance depending on style sheet. See notes for set_style_sheet().

Arguments:

index index of button (starting from 0)
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::set_selected_button_by_name

Prototype:

int set_selected_button_by_name(const char* name);
Description:

Similar to set_selected_button(), but using button name (text).

Arguments:

name name (text) of button
Returns:

0 on success, -1 on failure

Callable From:

function diguyViewButtonPanel::add_int_slider

Prototype:

int add_int_slider(const char* name,
    const char* lua_object_name,
    const char* lua_function_name,
    int init_val,
    int min_val,
    int max_val,
    const char* style_sheet = NULL);
Description:

Adds an integer slider to the panel and specifies the lua script that should be run upon the slider changing value. lua function should be:

function lua_object_name:lua_function_name(value)
Arguments:

name text of label description
lua_object_name name of lua table containing function to run
lua_function_namename of lua function to run
Returns:

index of the new slider (zero-indexed)

Callable From:

function diguyViewButtonPanel::add_float_slider

Prototype:

int add_float_slider(const char* name,
    const char* lua_object_name,
    const char* lua_function_name,
    float init_val,
    float min_val,
    float max_val,
    const char* style_sheet = NULL);
Description:

Adds a continuous floating slider to the panel and specifies the lua script that should be run upon the slider changing value. lua function should be:

function lua_object_name:lua_function_name(value)
Arguments:

name text of label description
lua_object_name name of lua table containing function to run
lua_function_namename of lua function to run
Returns:

index of the new slider (zero-indexed)

Callable From:

function diguyViewButtonPanel::set_slider_value

Prototype:

int set_slider_value(const char* name, float value);
Description:

Updates specified slider with the value specified.

Arguments:

name name of slider
valuevalue of slider

function diguyViewButtonPanel::add_spacer

Prototype:

int add_spacer(int pixels);
Description:

Adds a vertical or horizontal spacer element.

function diguyViewButtonPanel::set_item_visibility

Prototype:

void set_item_visibility(int index, bool visible);
Description:

Change visibility of item specified by index

function diguyViewButtonPanel::remove_all_items

Prototype:

void remove_all_items();
Description:

Clears all items out of panel

function diguyViewButtonPanel::set_open_script

Prototype:

void set_open_script(const char* lua_script);
Description:

Sets a Lua script to be called when panel is opened (un-minimized).

Arguments:

lua_script the entire script

function diguyViewButtonPanel::set_minimize_script

Prototype:

void set_minimize_script(const char* lua_script);
Description:

Sets a Lua script to be called when panel is opened (un-minimized).

Arguments:

lua_script the entire script

function diguyViewButtonPanel::set_style_sheet

Prototype:

int set_style_sheet(const char* sheet);
Description:

Passes a Qt style sheet to the panel.

Sample one (user must replace "MAIN_BG_COLOR" and other tags with meaningful values):

Note:

"isSelected" used to set visual properties of selected button

----------------

         basic_style = [[
           * {
                 background-color : rgba( 192, 192, 192, 192 );
                 color : white;
           }
QFrame#m_button_frame {
               background-color : MAIN_BG_COLOR;
           }
           QLabel#m_title_label {
               color : white;
           }
           QPushButton {
               color : BUTTON_TEXT_COLOR;
                 background-color : BUTTON_BG_COLOR;
             }
             QPushButton[isSelected="true"] {
               color : BUTTON_SELECTED_TEXT_COLOR;
               background-color : BUTTON_SELECTED_BG_COLOR;
           }
]];
Sample two (user must replace "MAIN_BG_COLOR" and other tags with meaningful values):

Note:

"isToggled" used to set visual properties on button that is toggled on

----------------

         basic_style = [[
           * {
                 background-color : rgba( 192, 192, 192, 192 );
                 color : white;
           }
QFrame#m_button_frame {
               background-color : MAIN_BG_COLOR;
           }
           QLabel#m_title_label {
               color : white;
           }
           QPushButton {
               color : BUTTON_TEXT_COLOR;
                 background-color : BUTTON_BG_COLOR;
             }
             QPushButton[isToggled="true"] {
               color : BUTTON_TOGGLED_TEXT_COLOR;
               background-color : BUTTON_TOGGLED_BG_COLOR;
           }
]];
Arguments:

sheet the style sheet
Returns:

0 on success, -1 on failure

Callable From:


Alphabetical Index




Copyright (C) 1992-2012 Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.