InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDialog Class Referenceabstract

#include <IDialog.h>

Inheritance diagram for IDialog:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDIALOG }
 
enum  DialogType { kModal = 0, kMovableModal, kModeless }
 
enum  DialogPosition { kNoPosition = 0, kAutoCenter, kCenterNearTop, kRememberPosition }
 
enum  DialogFocus { kNoAutoFocus = 0, kFirstTextBox }
 

Public Member Functions

virtual void SetDialogType (DialogType dialogType)=0
 
virtual DialogType GetDialogType () const =0
 
virtual void Open (IControlView *ownerPanel=nil, bool16 doWait=kTrue)=0
 
virtual void OpenWithModalCursorType (int16 modalCursorType, IControlView *ownerPanel=nil)=0
 
virtual void Close ()=0
 
virtual void WaitForDialog (bool16 bSupressScheduled=kFalse)=0
 
virtual bool16 GetBufferCommands () const =0
 
virtual void SetBufferCommands (bool16 bufferCommands)=0
 
virtual void SetDialogPositioningAlgorithm (DialogPosition dialogPosition)=0
 
virtual DialogPosition GetDialogPositioningAlgorithm () const =0
 
virtual void SetDialogFocusingAlgorithm (DialogFocus dialogFocus)=0
 
virtual DialogFocus GetDialogFocusAlgorithm () const =0
 
virtual bool16 IsOpen () const =0
 
virtual bool16 HasPreviewButton () const =0
 
virtual IControlViewGetDialogPanel () const =0
 
virtual WidgetID SetDefaultButton (const WidgetID buttonID)=0
 
virtual WidgetID GetDefaultButton () const =0
 
virtual void PressDefaultButton ()=0
 
virtual void CleanUpBeforeClose ()=0
 
virtual void CleanUpAfterClose ()=0
 
virtual void SetDialogPanelID (const WidgetID panelID)=0
 
virtual void DialogCancelled ()=0
 
virtual void SetDeleteOnClose (bool16 deleteOnClose)=0
 
virtual bool16 GetDeleteOnClose () const =0
 
virtual void PostDelayedWaitForDialog () const =0
 
virtual void AddResizingGripperIcon ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Main interface for dialogs. This interface is usually on the same boss as the dialog window, which is a parent of the dialog controller boss.

See Also
IDialogMgr

Member Enumeration Documentation

Dialog Item Focus kFirstTextBox is the default focusing algorithm. This means that when the dialog is opened, the first visible enabled textbox (if there is one) will get the keyboard focus. kNoAutoFocus tells the dialog not to grab the keyboard focus at all.

Dialog Position enums kNoPosition doesn't move the dialog at all on open. Client must specify position. kAutoCenter centers the dialog on the main monitor. Default for first time dialog comes up. kCenterNearTop centers the dialog near top of screen (1/4 of the way down). Use for progress bars. kRememberPosition is the default positioning algorithm if one is not specified before opening the dialog. If dialog has never been moved by user, or first time dialog opens, kAutoCenter logic is used.

Dialog Type
Enumerator
kModal 

Modal dialog which is not movable. Stops all user action until dismissed.

kMovableModal 

Modal dialog which is movable. This is the most common type. Stops all user action until dismissed

kModeless 

Modeless dialog. Similar to a palette. User can interact with other UI while this type of dialog is displayed

Member Function Documentation

virtual void IDialog::AddResizingGripperIcon ()
pure virtual

Adds the gripper icon at corners for resizable dialogs

virtual void IDialog::CleanUpAfterClose ()
pure virtual

Called after the dialog is closed. Custom dialog impls can do clean up in this method

virtual void IDialog::CleanUpBeforeClose ()
pure virtual

Called before the dialog is closed. Custom dialog impls can do clean up in this method

virtual void IDialog::Close ()
pure virtual

Remove the dialog from the screen.

virtual void IDialog::DialogCancelled ()
pure virtual

Called if the dialog was cancelled. Custom dialog impls can implement this to do cleanup.

virtual bool16 IDialog::GetBufferCommands () const
pure virtual

Check if we should buffer commands for this dialog.

See Also
SetBufferCommands
virtual WidgetID IDialog::GetDefaultButton () const
pure virtual
Check which widget a default action is assigned to

Returns
WidgetID of the default button for the specified action
virtual bool16 IDialog::GetDeleteOnClose () const
pure virtual

Returns the flag set by SetDeleteOnClose. By default, this function returns kFalse.

virtual DialogFocus IDialog::GetDialogFocusAlgorithm () const
pure virtual

Check the current dialog keyfocus algorithm

virtual IControlView* IDialog::GetDialogPanel () const
pure virtual

Returns the main dialog panel installed in the dialog window. You can use the returned controlview to get to your dialog observer and controller.

virtual DialogPosition IDialog::GetDialogPositioningAlgorithm () const
pure virtual

Check the dialog positioning algorthim.

virtual DialogType IDialog::GetDialogType () const
pure virtual

Get the type of the dialog

virtual bool16 IDialog::HasPreviewButton () const
pure virtual

Returns true if the dialog has a preview button

virtual bool16 IDialog::IsOpen () const
pure virtual

Returns true if the dialog is currently open

virtual void IDialog::Open (IControlViewownerPanel = nil,
bool16 doWait = kTrue 
)
pure virtual

Place the dialog on the screen. You can pass in the owner panel (i.e. the panel who opens the dialog). This will make the panel available in the dialog controller. OpenWithModalCursorType allows for non standard modal cursor behavior to be specified. Open by default now calls WaitForDialog(kFalse) i.e. not supressing the scheduled commands.

Parameters
ownerPanelThe panel which opened this dialog.
doWaitkFalse if you want to override the default wait behavior, and call WaitForDialog yourself.
virtual void IDialog::OpenWithModalCursorType (int16 modalCursorType,
IControlViewownerPanel = nil 
)
pure virtual

Place the dialog on the screen. OpenWithModalCursorType allows for non standard modal cursor behavior to be specified.

Parameters
modalCursorTypeA constant indicating which modal cursor to use.
See Also
ICursorMgr
Parameters
ownerPanelThe panel which opened this dialog.
virtual void IDialog::PressDefaultButton ()
pure virtual

Press the default button, if any. If none, simply cancel and close the dialog.

virtual void IDialog::SetBufferCommands (bool16 bufferCommands)
pure virtual

This function helps in converting a panel into a modal dialog. Most of the controls in a panel have an observer that fires off a command when the control is actuated. When a panel is converted into a modal dialog, the developer would have to remove each of these observers and create a dialog observer that fires off a command when the user hits the dialog's ok button. In order to save the developer a lot of time, simply call this function BEFORE calling Open. The result will be that the dialog command manager will buffer all the commands fired off by the individual commands. If the user hits "ok", all the commands will be combined into a single compound command and executed.

Parameters
bufferCommandsShould we buffer commands for this dialog?
virtual WidgetID IDialog::SetDefaultButton (const WidgetID buttonID)
pure virtual

Associate default action to push button. Usual values for actionButUsually called like so:


iDialog->SetDefaultButton(kMyCustomOKButtonWidgetID);

Parameters
buttonIDWidgetID of the newdefault button for the specified action
Returns
old default button widget ID
virtual void IDialog::SetDeleteOnClose (bool16 deleteOnClose)
pure virtual

If this is called with kTrue, the dialog is completely deleted out of saved data when the dialog is closed. This is used when creating the 2..nth copies of an open dialog. Rarely needed by client code.

virtual void IDialog::SetDialogFocusingAlgorithm (DialogFocus dialogFocus)
pure virtual

You must call this function BEFORE calling Open() if you want to change the key focus algorithm used when we open the dialog window.

virtual void IDialog::SetDialogPanelID (const WidgetID panelID)
pure virtual

Internal use only

virtual void IDialog::SetDialogPositioningAlgorithm (DialogPosition dialogPosition)
pure virtual

You must call this function BEFORE calling Open() if you want to change the window positioning algorithm used when we open the dialog window.

virtual void IDialog::SetDialogType (DialogType dialogType)
pure virtual

Set the type of the dialog. No effect if called after the dialog has been shown

virtual void IDialog::WaitForDialog (bool16 bSupressScheduled = kFalse)
pure virtual

WaitForDialog takes control of the event loop until the dialog is dismissed. In other words, once WaitForDialog is called, control will not be returned until the dialog is dismissed. This actually starts up another event loop. Use sparingly.

Parameters
bSuppressScheduledSet to true to supress the processing of scheduled commands in the event loop, which in some cases could help supress processing and/or dialogs that have been scheduled but are unwanted while the current dialog is being displayed.