Adobe GoLive CS2 SDK
SDK Programmer’s Guide Contents 4
Nesting Event Handlers .......................................................................................................................................................34
Sharing Data...................................................................................................................................................................................34
Persistent shared data..........................................................................................................................................................35
Non-persistent shared data................................................................................................................................................35
Communicating with other extensions .........................................................................................................................35
Sending messages to other extension modules..................................................................................................36
Responding to a broadcast ..........................................................................................................................................36
Delays and Timeouts...................................................................................................................................................................36
Timed tasks...............................................................................................................................................................................37
Setting the JavaScript timeout..........................................................................................................................................37
Progress bars ...........................................................................................................................................................................37
Starting a progress or busy bar...................................................................................................................................38
Updating a progress or busy bar................................................................................................................................38
Progress bar example.....................................................................................................................................................39
4 Menus and Toolbars .................................................................................................................. 40
Creating Custom Menus ............................................................................................................................................................40
Basic example..........................................................................................................................................................................40
Adding the menu bar tag....................................................................................................................................................41
Defining the Menu.................................................................................................................................................................41
Defining menu items ............................................................................................................................................................42
Creating submenus ...............................................................................................................................................................43
Defining menu behavior .....................................................................................................................................................43
Using one handler to react to multiple items .......................................................................................................44
Capturing events in the menu object ......................................................................................................................44
Complete simple menu example.....................................................................................................................................45
Assigning Keyboard Shortcuts to Menu Items ..................................................................................................................45
Setting a Menu Item’s State Programmatically .................................................................................................................46
Setting a menu item’s checked state..............................................................................................................................46
Setting a menu item’s enabled state .............................................................................................................................46
Initializing menu items.........................................................................................................................................................47
Adding Items to GoLive Menus...............................................................................................................................................48
Extending Context Menus.........................................................................................................................................................50
Registering context menu handlers................................................................................................................................51
Defining context menu handlers .....................................................................................................................................51
Creating Toolbars .........................................................................................................................................................................52
5 Windows and Controls .............................................................................................................. 54
Types of Windows ........................................................................................................................................................................54
Dialog windows......................................................................................................................................................................54
Positioning windows ............................................................................................................................................................54
Using the Dialog Editor tool...............................................................................................................................................55
Modal Dialog Windows ..............................................................................................................................................................58
Defining the modal dialog window ................................................................................................................................58
Opening and closing modal dialogs...............................................................................................................................58
Displaying a modal dialog............................................................................................................................................58
Closing a modal dialog..................................................................................................................................................60
Palette Windows...........................................................................................................................................................................60
Showing and hiding palettes .....................................................................................................................................61
The Inspector window ...................................................................................................................................................62
Control Containers.......................................................................................................................................................................63
Creating panels.......................................................................................................................................................................63