DRSetupPanel

Inherits from:
Declared In:

Overview

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.



Methods

-beginSetupSheetForWindow:modalDelegate:didEndSelector:contextInfo:

Presents a setup panel as a sheet.

-cancel:

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

-close:

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

-deviceSelectionChanged:

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

-eject:

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

-initWithNibName:

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

-mediaStateChanged:

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

-ok:

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

-open:

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

-runSetupPanel

Displays the receiver and begins its event loop.

-setupForDisplay

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.


beginSetupSheetForWindow:modalDelegate:didEndSelector:contextInfo:


Presents a setup panel as a sheet.

- (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:

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


contextInfo

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


cancel:


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

- (IBAction) cancel:(id)sender; 
Parameters
sender

The object that invoked this method.


close:


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

- (IBAction) close:(id)sender; 
Parameters
sender

The object that invoked this method.


deviceSelectionChanged:


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

- (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.


eject:


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

- (IBAction) eject:(id)sender; 
Parameters
sender

The object that invoked this method.


initWithNibName:


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

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

Nib filename.

Return Value

The receiver.


mediaStateChanged:


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

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

The new device status dictionary.

Return Value

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


ok:


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

- (IBAction) ok:(id)sender; 
Parameters
sender

The object that invoked this method.


open:


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

- (IBAction) open:(id)sender; 
Parameters
sender

The object that invoked this method.


runSetupPanel


Displays the receiver and begins its event loop.

- (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.


setupForDisplay


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.

- (void) setupForDisplay; 

 

Last Updated: 2009-08-13