Mac Developer Library

Developer

DRSetupPanel Class Reference

Options
Deployment Target:

On This Page

DRSetupPanel

This class is the base class for setup panels in the DiscRecordingUI framework. It provides a base framework for handling device selection, media ejection and confirming or cancelling the panel.

  • Presents a setup panel as a sheet.

    Declaration

    - (void) beginSetupSheetForWindow:(NSWindow*)owner modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void*)contextInfo;

    Parameters

    owner

    The window the sheet will be attached to. If owner is not nil, the setup panel slides down as a sheet running as a document modal window. If owner is nil, this is an error.

    modalDelegate

    The modal delegate. The object that implements the didEndSelector.

    didEndSelector

    Selector to invoke when the sheet ends. This selector is optional. If implemented by the modal delegate, this method is invoked after the modal session has ended, but before dismissing the same panel. didEndSelector may dismiss the save panel itself; otherwise it will be dismissed on return from the method. didEndSelector should have the following signature: <br/>

    - (void)setupPanelDidEnd:(DRSetupPanel*)panel returnCode:(int)returnCode contextInfo:(void*)contextInfo;

    <br/>

    contextInfo

    Context information to be passed when the selector named by didEndSelector is invoked.

  • Invoked when the user clicks the panel's cancel button.

    Declaration

    - (IBAction) cancel:(id)sender;

    Parameters

    sender

    The object that invoked this method.

  • Invoked when the user clicks the panel's close button.

    Declaration

    - (IBAction) close:(id)sender;

    Parameters

    sender

    The object that invoked this method.

  • Invoked when the user changes the device selected in the device popup.

    Declaration

    - (void) deviceSelectionChanged:(DRDevice*)device;

    Parameters

    device

    The newly selected device, or nil.

    Discussion

    If the device currently selected is disconnected from the machine, the device popup will remove the device from itself and select a new device. This will act as if the user changed the device selected. Because of this, device may be nil if no eligible devices are currently connected to the machine.

  • Invoked when the user clicks the panel's eject button.

    Declaration

    - (IBAction) eject:(id)sender;

    Parameters

    sender

    The object that invoked this method.

  • Initializes the receiver to use the panel from the nibName nib file.

    Declaration

    - (id) initWithNibName:(NSString*)nibName;

    Parameters

    nibName

    Nib filename.

    Return Value

    The receiver.

  • Invoked when the media state of the currently selected device changes. This can include media being ejected, inserted, being used by another application, etc.

    Declaration

    - (BOOL) mediaStateChanged:(NSDictionary*)status;

    Parameters

    status

    The new device status dictionary.

    Return Value

    YES if the inserted media is valid for use, NO otherwise.

  • Invoked when the user clicks the panel's default button.

    Declaration

    - (IBAction) ok:(id)sender;

    Parameters

    sender

    The object that invoked this method.

  • Invoked when the user clicks the panel's open button.

    Declaration

    - (IBAction) open:(id)sender;

    Parameters

    sender

    The object that invoked this method.

  • Displays the receiver and begins its event loop.

    Declaration

    - (NSInteger) runSetupPanel;

    Return Value

    Returns NSOKButton (if the user clicks the default button) or NSCancelButton (if the user clicks the Cancel button).

    Discussion

    Invokes NSApplication's runModalForWindow: method with self as the argument.

  • This method is called immediately before panel is displayed on the screen. Any setup to be done in preparation for display should be done here.

    Declaration

    - (void) setupForDisplay;