Adobe 65007312 Programming Guide - Page 84
Creating custom dialog boxes, User interface elements, Containers
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 84 highlights
CHAPTER 5: Creating a User Interface for Your Plug-in User interface elements 84 X Confirmations and prompts In addition to your text message, these dialogs have configurable OK and Cancel buttons. These return different values to the invocation function, which you use to decide on the action to be taken. Again, there is a "Don't show again" version. These dialogs are extensible; you can define an optional third button, or a small UI section that you define using LrView; see "Creating custom dialog boxes" on page 84. X Errors You can display a simple error message with a single OK button, or you can wrap an error dialog around a function context, so that if the wrapped function throws an error, the dialog appears. See "Using function contexts for error handling" on page 18. X Platform Open File and Save File You can bring up the platform-defined file-selection dialogs, so that the user can choose a file system location. Creating custom dialog boxes You can use the LrDialogs.presentModalDialog() function to create a completely customized dialog box, which you can, for example, invoke from a menu item that your plug-in adds to the Lightroom menu bar, using one of the menu service items: LrExportMenuItems, LrLibraryMenuItems, or LrHelpMenuItems. Most of the contents of this dialog are defined by an LrView hierarchy that you define. To build the contents of a custom dialog, obtain a factory object using the LrView namespace function LrView.osFactory(). Like the confirmation dialogs, this dialog automatically contains configurable OK and Cancel buttons. You can choose to make this dialog user-resizeable, and can also choose to save its most recent frame size as one of your plug-in settings. The location of the dialog is also saved, if the user moves it. The example code in "Building a basic dialog" on page 110 demonstrates how to build and invoke a custom dialog within a function context. User interface elements This section provides details of the types of container and control nodes you can create with an LrView factory object. Containers When creating a dialog or a section for the Plug-in Manager or Export dialog, you generally begin with a top-level container, then, within that container, create its children. Depending on the complexity of your interface, the children can be nested containers (such as a tabbed view that contains tabbed pages), placement containers (rows and columns), or the visible controls (such as text and buttons). X All containers have the shared view properties listed in "General view properties" on page 91, except as mentioned. X All containers except spacer have the layout properties listed in "Determining layout" on page 107.