Apple Shake 4 User Manual

Page 924

Advertising
background image

924

Chapter 30

Installing and Creating Macros

The Color control is added to the interface.

Attaching Button Toggles

Next, attach a button to toggle the vidFormat. Since the 0 and 1 settings are not very
intuitive for the video format selection, create buttons labeled “NTSC” and “PAL.” The
following examples show two ways to attach a button toggle.

To attach a button toggle:

1

Create a directory called icons/ux in your $HOME/nreal directory:

mkdir -p $HOME/nreal/icons/ux

2

Copy all of the icons that begin with vr_ from doc/html/cook/macro_icons to your
$HOME/nreal/icons/ux
directory. There are a total of eight files.

When clicked, the first button toggles between PAL (vr_pal.off.nri) and NTSC
(vr_ntsc.off.nri). Two additional buttons, vr_pal.off.focus.nri and vr_ntsc.off.focus.nri,
indicate when the pointer is over the button. These are called focus buttons. To view
the code, see “

Using Parameters Controls Within Macros

” on page 379.

3

To add the toggle button function, edit the VidResizeUI.h file:

nuiPushMenu(“Tools”);

nuiPushToolBox(“Transform”);

nuiToolBoxItem(“@VidResize”,VidResize());

nuiPopToolBox();

nuiPopMenu();

nuxDefExprToggle(“VidResize.keepAspect”);

nuiPushControlGroup(“VidResize.Background Color”);

nuiGroupControl(“VidResize.bgRed”);
nuiGroupControl(“VidResize.bgGreen”);
nuiGroupControl(“VidResize.bgBlue”);

nuiPopControlGroup();
nuiPushControlWidget(“VidResize.Background Color”,

nuiConnectColorTriplet(kRGBToggle,kCurrentColor,1)

);

nuxDefExprToggle(“VidResize.vidFormat”,

“ux/vr_ntsc.off.nri|ux/vr_ntsc.off.focus.nri”,
“ux/vr_pal.off.nri|ux/vr_pal.off.focus.nri”

);

Advertising