DialogManager Class Reference

#include <dlgmgr.h>

Inheritance diagram for DialogManager:

CCObject SimpleCCObject List of all members.

Public Member Functions

 DialogManager ()
 DialogManager constructor. It allocates our special Property atom.
CWindowID Create (DialogOp *DialogOp)
 ~DialogManager ()
 DialogManager destructor.
void SetPropertyPageModified (BOOL Value)
 Sets the modified property of the currently active property page of the current tabbed dialog (if it exists).

Static Public Member Functions

static BOOL Create (DialogOp *DlgOp, CDlgResID MainDlgID, CDlgResID SubDlgID, CDlgMode Mode=MODELESS, INT32 OpeningPage=-1, CWindowID ParentWnd=NULL)
static void Open (CWindowID WindowID, DialogOp *DlgOp)
static void Close (CWindowID WindowID, DialogOp *DlgOp)
 The close method removes a modeless dialog from the display but keeps all system resources associated with it. It hides the dialog. It can be called on a modal dialog but it does nothing.
static BOOL MergeDialogs (CWindowID Dialog, CWindowID Mergee, bool fAbove)
 This function places the contents of a dialog above or below the contents of an existing dialog.
static BOOL BringToTop (CWindowID WindowID, DialogOp *pDlgOp)
 This function brings an open dialog to the top of the z-order.
static wxBookCtrlBase * GetBookControl (CWindowID WindowID, CGadgetID Gadget=0)
 This function will return a pointer to the book control in a window. If the window is of type wxPropertySheetDialog then it Gadget is not required.
static BOOL IsGadgetTickable (CWindowID WindowID, CGadgetID Gadget)
 Determines if the gadget is of a type that can be ticked.
static BOOL ColourPickerAbort (CWindowID WindowID, CGadgetID Gadget, WPARAM wParam=0)
 Instructs camelots custom colour control (which I also wrote) to 'shutdown' and (indirectly) return control to the colour editor dialog.
static void Delete (CWindowID WindowID, DialogOp *DlgOp)
 The delete method will delete all system resources and other information which is kept about the dialog. It also records the dialogs current position so that it can be restored the next time the dialog is created.
static void ProcessMouseEvent (CDlgMessage DialogMessageType, wxWindow *pDlg, UINT32 wParam, INT32 lParam)
static wxWindow * GetGadget (CWindowID WindowID, CGadgetID Gadget)
static OpDescriptorGetGadgetOpDescriptor (CWindowID WindowID, CGadgetID Gadget)
static BOOL SetUnitGadgetValue (CWindowID WindowID, CGadgetID Gadget, UnitType Unit, MILLIPOINT value, BOOL EndOfList=TRUE, INT32 ListPos=0)
 Send custom WM_SETBITMAPEX message to custom controls This method is used to set a gadget which should hold a number to a certain value. The actual type of the gadget does not matter.
static BOOL SetDimensionUnitGadgetValue (CWindowID WindowID, CGadgetID Gadget, UnitType units, double value, Node *pNode, BOOL IncludeUnitSpecifier=TRUE, BOOL EndOfList=FALSE, INT32 ListPos=0)
 as SetDimensionGadgetValue() but you can specify the units in which it is displayed
static BOOL SetLongGadgetValue (CWindowID WindowID, CGadgetID Gadget, INT32 value, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This function is used to set a numeric gadget value. It performs different functions depending on the type of the gadget.
static BOOL SetDoubleGadgetValue (CWindowID WindowID, CGadgetID Gadget, double value, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This function is used to set a numeric gadget value. It performs different functions depending on the type of the gadget.
static BOOL SetStringGadgetValue (CWindowID WindowID, CGadgetID Gadget, UINT32 IDStrID, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This function is used to set a gadgets value to a resource string. It can only be used on gadgets with a string value type.
static BOOL SetStringGadgetValue (CWindowID WindowID, CGadgetID Gadget, const StringBase &StrVal, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This function is used to set a gadgets string value. It can only be used on gadgets with a string value type.
static BOOL SetCustomComboGadgetValue (CWindowID WindowID, CGadgetID Gadget, CustomComboBoxControlDataItem *TheItem, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This function is used to set a CustomComboBoxes item (i.e. basically insert another item).
static BOOL SelectCustomComboGadgetValueOnString (CWindowID WindowID, CGadgetID Gadget, StringBase *StrVal)
 This function is used to select an item (StrVal) within cc_2dBitmapComboBoxEdit custom comboboxes.
static BOOL SetGadgetRange (CWindowID WindowID, CGadgetID Gadget, INT32 Min, INT32 Max, INT32 PageInc=1)
 For setting the range of a gadget.
static BOOL SetListBoxSelection (CWindowID WindowID, CGadgetID Gadget, INT32 Index, BOOL SelectIt, BOOL SingleSelection)
 For selecting the Value specified by Index in a list Gadget. A subroutine used by the selection-setting DialogManager calls.
static BOOL SetBoolGadgetSelected (CWindowID WindowID, CGadgetID Gadget, BOOL IsSelected, INT32 ListPos=0)
 For setting the selection state of a gadget, or an item within a list gadget.
static BOOL SetSelectedValueIndex (CWindowID WindowID, CGadgetID Gadget, INT32 Index)
 For selecting the Value specified by Index in a list Gadget.
static BOOL SetSelectedValueRange (CWindowID WindowID, CGadgetID Gadget, WORD StartIndex, WORD EndIndex, BOOL Selected=TRUE)
 For selecting the Value specified by Index in a list Gadget.
static BOOL SetDimensionGadgetValue (CWindowID WindowID, CGadgetID Gadget, MILLIPOINT value, Node *pNode, BOOL IncludeUnitSpecifier=TRUE, BOOL EndOfList=FALSE, INT32 ListPos=-1)
 This is the routine to call for displaying a node's dimension in a control. It creates a string that represents 'Value' in the units the user wants, possibly scaled up/down if the user has specified a dimension scaling factor (e.g. 1 mile = 2 cm) Once the string is created, SetStringGadgetValue is called on the control, so you should be aware of this routine's features/limitations before calling SetDimensionGadgetValue.
static BOOL SetMemoryGadgetValue (CWindowID WindowID, CGadgetID Gadget, UINT32 value, BOOL EndOfList=TRUE, INT32 ListPos=0)
 This method is used to set a gadget which should display an amount of memory being used or allocated. The value will be rounded to the nearest K or M or G byte value. The actual type of the gadget does not matter.
static BOOL SetGadgetHelp (CWindowID WindowID, CGadgetID Gadget, UINT32 BubbleID, UINT32 StatusID, UINT32 ModuleID=0)
 Allows the Bubble and Status ID's of a control to be changed at runtime.
static MILLIPOINT GetUnitGadgetValue (CWindowID WindowID, CGadgetID Gadget, UnitType DefaultType, MILLIPOINT StartRange, MILLIPOINT EndRange, UINT32 IDSInvalidMsg=0, BOOL *Valid=NULL)
 This function will obtain the gadget value and validate it. Validation will check that data has been entered in a correct unit type, and that it is in the range StartRange..EndRange. If the user enters an incorrect value the InvalidMsgID string will be displayed to the user in a dialog box, and Valid will have a FALSE value.
static INT32 GetLongGadgetValue (CWindowID WindowID, CGadgetID Gadget, INT32 StartRange, INT32 EndRange, UINT32 IDSInvalidMsg=0, BOOL *Valid=NULL, Convert::PFNSTRINGTOINT32 pfnParser=Convert::StringToLong)
 This function will obtain the gadget value and validate it. Validation will check that a correct INT32 value has been entered, and that it is in the range StartRange..EndRange. If the user enters an incorrect value the InvalidMsgID string will be displayed to the user in a dialog box, and Valid will have a FALSE value.
static double GetDoubleGadgetValue (CWindowID WindowID, CGadgetID Gadget, double StartRange, double EndRange, UINT32 IDSInvalidMsg=0, BOOL *Valid=NULL, Convert::PFNSTRINGTODOUBLE pfnParser=Convert::StringToDouble)
 This function will obtain the gadget value and validate it. Validation will check that a correct double value has been entered, and that it is in the range StartRange..EndRange. If the user enters an incorrect value the InvalidMsgID string will be displayed to the user in a dialog box, and Valid will have a FALSE value.
static BOOL GetBoolGadgetSelected (CWindowID WindowID, CGadgetID Gadget, UINT32 IDSInvalidMsg=0, BOOL *Valid=NULL, INT32 ListPos=0)
 This function will obtain the gadget value and validate it. Validation will check that a correct INT32 value has been entered, and that it is in the range StartRange..EndRange. If the user enters an incorrect value the InvalidMsgID string will be displayed to the user in a dialog box, and Valid will have a FALSE value. [This does not seem correct - AMB].
static String_256 GetStringGadgetValue (CWindowID WindowID, CGadgetID Gadget, BOOL *Valid=NULL, INT32 ListPos=-1)
 For finding a gadgets string value. This function can only be used for gadgets with a text value.
static BOOL GetGadgetRange (CWindowID WindowID, CGadgetID Gadget, INT32 *Min, INT32 *Max)
 For obtaining the range of a gadget.
static MILLIPOINT GetDimensionGadgetValue (CWindowID WindowID, CGadgetID Gadget, Node *pNode, BOOL *Valid=NULL, INT32 ListPos=-1)
 This is the routine to call for getting user-entered dimensions from a control. The value is scaled from user dimensions to an internal millipoint value. The routine uses DialogManager::GetStringGadgetValue to extract the string from the control. The caller should be aware of the features/limitations of this routine before calling GetDimensionGadgetValue.
static BOOL GetDoubleAndUnitGadgetValue (double *pMPValue, double *pUnitValue, UnitType *pUnitType, CWindowID WindowID, CGadgetID Gadget, Node *pNode)
 Read the value from a gadget as a double millipont values accounting for unit scaling ALSO read the type of unit specified and the gadget value in terms of these units ie 0.5m would return 36000.0, 0.5 and METERS (assuming scaling 1m->1in).
static UINT32 GetMemoryGadgetValue (CWindowID WindowID, CGadgetID Gadget, UINT32 StartRange, UINT32 EndRange, UINT32 IDSInvalidMsg=0, BOOL *Valid=NULL)
 This function allows a memory value to be read back from a control. It will cope with the memory being specified in bytes, K, M or G bytes and will also validate it. Validation will check that data has been entered in a correct unit type, and that it is in the range StartRange..EndRange. If the user enters an incorrect value the InvalidMsgID string will be displayed to the user in a dialog box, and Valid will have a FALSE value.
static BOOL DeleteAllValues (CWindowID WindowID, CGadgetID Gadget)
 For deleting all values in a list-gadget.
static BOOL DeleteValue (CWindowID WindowID, CGadgetID Gadget, BOOL EndOfList=TRUE, INT32 ListPos=0)
 For deleting a gadget value.
static BOOL GetValueCount (CWindowID WindowID, CGadgetID Gadget, INT32 *Count)
 For finding the number of values stored in a gadget.
static BOOL GetValueIndex (CWindowID WindowID, CGadgetID Gadget, INT32 *Index)
 For finding the index of the currently selected item in a gadget.
static BOOL GetValueIndex (CWindowID WindowID, CGadgetID Gadget, WORD *Index)
 For finding the index of the currently selected item in a gadget.
static INT32 GetSelectedCount (CWindowID WindowID, CGadgetID Gadget)
 Returns the number of selected items in a list-type gadget.
static INT32 GetFirstSelectedItem (CWindowID WindowID, CGadgetID Gadget)
 Returns the index of the first selected item in a list-type gadget.
static INT32 * GetSelectedItems (CWindowID WindowID, CGadgetID Gadget)
 Returns a ptr to an INT32 array that holds the list of selected indexes. The last array entry contains -1.
static BOOL EnableGadget (CWindowID WindowID, CGadgetID Gadget, BOOL Enabled)
 For enabling/disabling a gadget.
static BOOL IsGadgetEnabled (CWindowID WindowID, CGadgetID Gadget)
 For checking if a gadget is enabled/disabled.
static BOOL SetGadgetWritable (CWindowID id, CGadgetID Gadget, BOOL enable)
 Sets the state of the 'Read Only' flag of an edit field or combo box.
static BOOL HideGadget (CWindowID WindowID, CGadgetID Gadget, BOOL Hide)
 For hiding/showing gadgets.
static BOOL GadgetRedraw (CWindowID WindowID, CGadgetID Gadget, BOOL Redraw)
 This function sets a gadgets redraw state. If Redraw = FALSE then the gadget will not be redrawn when changes are made to it. Conversely if Redraw = TRUE then the Gadget will redraw itself after any changes are made.
static void Layout (CWindowID WindowID, BOOL CanYield=FALSE)
 Relayout dialog - for sizer changes.
static void RelayoutDialog (DialogTabOp *DlgOp)
 Force the dialog to relayout after control hide Scope: public.
static BOOL SetKeyboardFocus (CWindowID WindowID, CGadgetID Gadget)
 Sets the keyboard focus to the given control.
static BOOL DefaultKeyboardFocus ()
 Sets the keyboard focus to the "default" window, which currently is the main frame window (which in turn sets it to the active view window).
static BOOL HighlightText (CWindowID WindowID, CGadgetID Gadget, INT32 nStart=0, INT32 nEnd=-1)
 Highlights the given range of text (by default all of it) within a control that holds editable text, eg. an edit field.
static BOOL CaptureMouse (CWindowID WindowID, CGadgetID Gadget)
 Allows the given control to Capture the mouse.
static BOOL ReleaseMouse (CWindowID WindowID, CGadgetID Gadget)
 Release the mouse captured by the given control.
static void PaintGadgetNow (CWindowID WindowID, CGadgetID gid)
 Immediate paints any invalid areas of the given control (like the Windows "UpdateWindow" function).
static void InvalidateGadget (CWindowID WindowID, CGadgetID Gadget, BOOL EraseBackround=TRUE)
 Invalidates the control so that it will be repainted soon.
static void InvalidateGadget (CWindowID WindowID, CGadgetID Gadget, ReDrawInfoType *ExtraInfo, DocRect *InvalidRect)
 Causes the Dialog Manager to tell the host os to get the cc_DialogDraw gadget to be redrawn, over the specfied rectangle. You should recieve a DIM_REDRAW message in the not too distant future.
static void ScrollKernelRenderedGadget (CWindowID WindowID, CGadgetID Gadget, DocRect *RectToScroll, DocCoord *ScrollBy)
 Causes the Dialog Manager to tell the host os to get the cc_DialogDraw gadget to be scrolled, over the specfied rectangle. You should recieve a DIM_REDRAW message in the not too distant future, to update any portions that 'scroll into view'.
static BOOL GetKernelRenderedGadgetInfo (CWindowID WindowID, CGadgetID Gadget, ReDrawInfoType *Result)
 Allows the user access to the same information which is passed in to DIM_REDRAW and the kernel-rendered-dialogue mouse-handling messages. This is just for convenience so they can calculate stuff at a time other than handling those two types of dialogue event (e.g. if a document message causes you to have to redraw a small portion of your gadget, you need this information to calculate the invalidation rectangle from).
static void SetEditGadgetType (CWindowID WindowID, CGadgetID Gadget, EditGadgetType Type)
 Subclasses the edit gadget so that it only accepts characters specified by the Type parameter.
static void SetEditGadgetType (CWindowID WindowID, CGadgetID, UINT32 IDSValidChar)
 To subclass the edit gadget so that it only accepts characters in the string specified by IDSValidChar.
static void DualFunctionButton (CWindowID DialogWnd, CGadgetID ButtonGadget)
 To subclass the button gadget so that it accepts right mouse button clicks.
static BOOL MakeListBoxDragable (CWindowID WindowID, CGadgetID Gadget)
static void SetComboListLength (CWindowID WindowID, CGadgetID Gadget)
static void SetGadgetBitmaps (CWindowID DialogWnd, CGadgetID Gadget, UINT32 Bitmap1, UINT32 Bitmap2)
 This function will set the bitmaps associated with a gadget.
static void SetGadgetBitmaps (CWindowID DialogWnd, CGadgetID Gadget, const CGadgetImageList &images)
 This function will set the bitmaps associated with a gadget.
static void SetGadgetBitmap (CWindowID WindowID, CGadgetID Gadget, ResourceID Bitmap)
 This function will set the bitmaps associated with a gadget.
static ResourceID GetGadgetBitmap (CWindowID WindowID, CGadgetID Gadget)
 This function will get the bitmaps associated with a gadget.
static void SetBitmapButtonIndexes (CWindowID WindowID, CGadgetID Gadget, UINT32 UnselectedIndex, UINT32 SelectedIndex)
 This function allows you to specify bitmaps for both the selected and unselected states of a bitmap button. Most likely you have already selected your bitmap for the selected state in your resource file, however this allows you to specify the unselected state also.
static UINT32 GetGadgetImageCount (CWindowID wnd, CGadgetID Gadget)
 To get the number of images set in the trree control.
static void DeInit ()
 Deinitialise the DialogManager.
static BOOL IsADialogWindow (wxWindow *pWnd)
 To determine if hwnd is the handle of a dialog.
static CTreeItemID SetTreeGadgetItem (CWindowID wnd, CGadgetID Gadget, CTreeItemID hParent, const StringBase &str, CTreeItemID hInsAfter, INT32 iImage, CCObject *pObj=NULL)
 To insert an item into a tree control.
static CCObjectGetTreeGadgetItemData (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem)
 To insert an item into a tree control.
static BOOL SelectTreeGadgetItem (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem, BOOL bNewState=TRUE)
 To select an item in a tree control.
static CTreeItemID GetTreeGadgetRootItem (CWindowID wnd, CGadgetID Gadget)
 To get the ID of the root item in the tree control.
static CTreeItemID GetTreeGadgetFirstSelectedItem (CWindowID wnd, CGadgetID Gadget)
 To get the ID of the first selected item in the tree control.
static BOOL TreeGadgetExpandItem (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem)
 To expand an item in the tree control.
static CTreeItemID GetTreeGadgetNextVisItem (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem)
 To get the ID of the next visible item in the tree control after a specified item.
static CTreeItemID GetTreeGadgetFirstChildItem (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem)
 To get the ID of the first child item of the specified in the tree control.
static UINT32 GetTreeGadgetChildrenCount (CWindowID wnd, CGadgetID Gadget, CTreeItemID hItem, BOOL bRecursive=FALSE)
 To get the number of children of an item in a tree control.
static BOOL AddAPage (DialogTabOp *pDialogTabOp, CDlgResID DialogResID, CGadgetID Gadget=0)
 Adds a page to the tabbed dialog with resource ID DialogResID.
static CWindowID GetPageWindow (CWindowID Win, CDlgResID PageID, INT32 *PageIndex=NULL)
 Returns the Window ID of a page within a property sheet. If the page is NULL then Win is simply returned, It can be called on a non property sheet dialog. Just pretend that they are property sheets without any pages.
static BOOL SetTitlebarName (CWindowID Win, String_256 *Name)
 Sets the titlebar text of the dialog.
static BOOL ModalDialogOpen (DialogOp **pModal=NULL)
 To determine if there is currently an open modal dialog.
static BOOL IsWindowVisible (CWindowID Win)
 To test the visibility of Win.
static BOOL IsCustomComboDropdownVisible (CWindowID WindowID, CGadgetID Gadget)
 To test the visibility of WinID's dropdown.
static BOOL CloseDropdown (CWindowID WindowID, CGadgetID Gadget, BOOL CloseVal)
 Used to close the controls dropdown. This routine was written because of the amount of trouble that I was experiencing with my custom controls down to escape key processing (which is viewed as a hotkey within camelot).
static void EnableAllDialogs (BOOL Enable, wxWindow *pExceptMe=NULL)
 Enables or Disables all Dialogs on the DialogOp message handler list. This is useful when opening/closing modal dialogs.
static BOOL RecordActiveDialogState ()
 This function will get called before a MODAL dialog is opened. It records which window is currently active, and if the window is a MODAL dialog. After a MODAL dialog is closed RestoreActiveDialogState is called to restore the active window.
static void RestoreActiveDialogState ()
 This function is called after a MODAL dialog is closed. it restores the Active window.
static CDlgResID GetActivePage (CWindowID WindowID, CGadgetID Gadget=0)
 To find out the currently active page in a tabbed dialog.
static BOOL AddDialogControlToHelper (CWindowID WindowID, CGadgetID Gadget)
 To add this control to the static dialog control helper, which will subclass it.
static BOOL RemoveDialogControlFromHelper (CWindowID, CGadgetID)
 To add this control to the static dialog control helper, which will subclass it.
static BOOL GetStatusLineText (String_256 *ptext, CWindowID window)
 Fills in the status line text from the help text if over a control Scope: Public.
static CWindowID GetWindowUnderPointer (WinCoord *wc=NULL)
 Fills in the status line text from the help text if over a control Scope: Public.
static UINT32 SetTimer (DialogOp *pDialogOp, CWindowID WindowID, UINT32 nIDEvent, UINT32 nElapse, void(*lpfnTimer)(void *)=NULL, void *param=NULL, BOOL OneShot=FALSE)
 Allows the user access to setting a timer caller back or event for a dialog box. The caller can either specify a call back procedure to be called when the timer goes off or if null is specified, a DIM_TIMER message will be sent. This maps onto the Windows API/CWnd call. The return value is effectively the handle onto the timer system. It must be passed to the KillTimer member function to kill the timer. A Nonzero value indicates successful allocation of the timer; non-zero implies a problem.
static BOOL KillTimer (DialogOp *pDialogOp, CWindowID WindowID, INT32 nIDEvent)
 Allows the user access to killing a timer caller back or event that has been set up for a dialog box. Kills the timer event identified by nIDEvent from the earlier call to SetTimer. Any pending WM_TIMER messages associated with the timer are removed from the message queue.
static BOOL GetWindowPosition (CWindowID WindowID, wxRect *pRect)
 Allows the user to get the current window position.
static BOOL GetWindowPosition (CWindowID WindowID, RECT *pRect)
static BOOL GetGadgetPosition (CWindowID WindowID, CGadgetID Gadget, wxRect *pRect)
 Allows the user to get the current position of the specified gadget or icon.
static BOOL GetGadgetPosition (CWindowID WindowID, CGadgetID Gadget, RECT *pRect)
static BOOL SetWindowPosition (CWindowID WindowID, const wxRect &Rect)
 Allows the user to set the current window position.
static BOOL SetWindowPosition (CWindowID WindowID, const RECT &Rect)
static BOOL SetGadgetPosition (CWindowID WindowID, CGadgetID Gadget, const wxRect &Rect)
 Allows the user to set the current position of the specified gadget or icon.
static BOOL SetGadgetPosition (CWindowID WindowID, CGadgetID Gadget, const RECT &Rect)
static INT32 GetScreenDpi ()
 Allows the user to find out the screen dpi.
static BOOL GetScreenSize (INT32 *pWidth, INT32 *pHeight)
 Allows the user to find out the screen size.
static void FreePaneInfoHash ()
 Free the pane info hash if it exists Scope: protected.

Static Public Attributes

static wxWindow * pDlgCurrent = NULL

Static Protected Member Functions

static void Event (DialogEventHandler *pEvtHandler, wxEvent &event)
 OnCommand message handler. Translates a windows Command message into a DIM.
static void EnsurePanePreferenceDeclared (wxString key)
 Ensures the relevant preference has been declared Scope: protected.
static void InitPaneInfoHash ()
 Initializes the pane info hash if it has not been previously initialized Scope: protected.
static void LoadPaneInfo (wxString key, wxAuiPaneInfo &paneinfo)
 Loads the pane info structure from the hash Scope: protected.
static void SavePaneInfo (wxString key, wxAuiPaneInfo &paneinfo)
 Saves the pane info structure to the hash Scope: protected.

Static Protected Attributes

static IdToSerializedPaneInfo * s_pPaneInfoHash = NULL

Static Private Member Functions

static void CreateRecursor (wxWindow *pwxWindow)
 Initialize platform dependent resources.
static BOOL CreateBar (DialogBarOp *DlgOp)
 Handles the creation of a bar Scope: private.
static BOOL CreateTabbedDialog (DialogTabOp *pTabDlgOp, CDlgMode Mode, INT32 OpeningPage, CDlgResID MainDlgID)
 Handles the creation of a tabbed dialog Opening page allows a page to be specified that is not the initial page, which will be the default if this is the first time the dialog has been opened or if it has been opened before then the initial page will be the last one opened. Scope: private.
static BOOL PostCreate (DialogOp *pDialogOp, INT32 OpeningPage)
 This function will get called after a dialog has been created. If a modeless dialog has been created then it gets called directly from the Create method. For a modal dialog however it gets called after receiving a WM_INIT_DIALOG message. It completes the creation process.
static void DeletePropShtDetails (DialogTabOp *pOp)
static DLGTEMPLATEMergeDialog (CDlgResID Main, CDlgResID Other)
 Merge two dialogs together into one dialog template. The return value points to the new merged dialog, which the caller should pass to CreateDialogIndirect(). Once the dialog has been created using this block, CCFree() should be called on the block to return it to the system pool. The significance of the 'Main' and 'Other' names is that the dialog style (border, menuname, classname, title and font) is taken from 'Main' - the header of 'Other' is discarded.
static void SetGadgetIDToFocus (wxWindow *pDialogWnd)
 If a child control of the dialog window has the focus then the function sets the Gadget to the ID of this control.
static ListGetControlList (CWindowID)
 Hide the mechanism we use to attach our lists to various windows. In fact we use window properties.
static void DeleteControlList (CWindowID)
 Deletes the Properties that are used to store the ControlList. Should be called as the very last thing before the Window is vaped e.g. in response to a WM_DESTROY message. Destroying it earlier will cause GetControlList to return NULL which proves fatal within the various message handlers. Scope: Private, static.
static LPWSTR MovePastWideStr (LPWSTR pWideStr)
 Given a ptr to the first byte in a wide string (or char string if win16) return a ptr to the byte past the null.
static size_t SizeDlgHeader (DLGTEMPLATE *pHeader)
 Given a ptr to DIALOGBOXHEADER, return its size.
static size_t SizeCtrlData (DLGITEMTEMPLATE *pData)
 Given a ptr to a controldata struct, return its length. Under Win32, all strings are UniCode (as they are in the res file).
static wxPropertySheetDialog * GetPropertySheetFromOp (DialogTabOp *pDialogTabOp)
static BOOL HandleScrollBarMsg (wxWindow *pScrollWnd, UINT32 wParam, INT32 lParam, WORD CurrentThumbPos)
static DialogPositionFindDialogPositionRecord (CDlgResID DialogID)
 Searches the DialogPositionList to see if this dialog has been created before if it has then a pointer to its DialogPosition record is returned, else NULL is retuned. Scope: private.
static INT32 FAR PASCAL EXPORT ValidateEditGadgetProc (wxWindow *pwnd, UINT32 message, UINT32 wParam, INT32 lParam)
 subclassed edit control proc
static INT32 FAR PASCAL EXPORT RgtMouseButtonProc (wxWindow *pwnd, UINT32 message, UINT32 wParam, INT32 lParam)
 subclassed button control proc
static BOOL CustomControlMsg (wxWindow *pwnd, UINT32 wParam, INT32 lParam)
 Handles custom control messages.

Static Private Attributes

static List DiscardStrList
static List DialogPositionList
static List ScrollPageIncList
static UINT32 MsgDragList
static UINT32 MsgSlaveDrawItem
static ActiveDlgStateStack ActiveDlgStack

Friends

class DialogEventHandler
class wxPropertySheetDialog

Detailed Description

Definition at line 330 of file dlgmgr.h.


Constructor & Destructor Documentation

DialogManager::DialogManager  ) 
 

DialogManager constructor. It allocates our special Property atom.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/12/93

Definition at line 192 of file dlgmgr.cpp.

00193 {
00194     // we must use a unique string so we don't clash with anyone else
00195 }

DialogManager::~DialogManager  ) 
 

DialogManager destructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/9/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
DialogManager::DeInit

Definition at line 6428 of file dlgmgr.cpp.

06429 {
06430 }


Member Function Documentation

BOOL DialogManager::AddAPage DialogTabOp pDialogTabOp,
CDlgResID  DialogResID,
CGadgetID  Gadget = 0
[static]
 

Adds a page to the tabbed dialog with resource ID DialogResID.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/94
Parameters:
pDialogTabOp,: The operation we wish to add a page too [INPUTS] DialogResID: The resource ID of the dialog page we wish to add to the DialogTabOp Gadget The gadget of the book control to add the page to (or zero to take a good guess)
- [OUTPUTS]
Returns:
TRUE if the page was added successfully.

Errors: -

See also:
-

Definition at line 7003 of file dlgmgr.cpp.

07004 {
07005     // Try to add the page to the property sheet associated with the DialogTabOp
07006     // let's try and find it
07007     wxBookCtrlBase* pNoteBook = GetBookControl(pDialogTabOp->WindowID, Gadget);
07008 
07009     // We need to create a page object
07010     // Because wxNotebookPage is derived from an MFC object we have to cope with exceptions
07011     wxWindow*   pNewPage;
07012     wxString    ObjectName;
07013     try
07014     {
07015         const TCHAR* pDialogName=CamResource::GetObjectNameFail( DialogResID );
07016         ERROR1IF(pDialogName == NULL, FALSE, _R(IDE_CANNOT_CREATE_DIALOG));
07017         TRACEUSER( "jlh92", _T("Cre tab %s\n"), pDialogName );
07018         ObjectName = pDialogName;
07019 
07020         pNewPage = wxXmlResource::Get()->LoadPanel( pNoteBook, pDialogName );
07021         ERROR1IF(pNewPage == NULL, FALSE, _R(IDE_CANNOT_CREATE_DIALOG));
07022         pNewPage->SetId( DialogResID );
07023 
07024         CamArtProvider::Get()->EnsureChildBitmapsLoaded( pNewPage );
07025     }
07026     catch( CMemoryException )
07027     {
07028         ERROR1(FALSE, _R(IDS_OUT_OF_MEMORY));
07029     }
07030 
07031     // Just to  be safe
07032     ERROR1IF(pNewPage == NULL, FALSE, _R(IDS_OUT_OF_MEMORY));
07033 
07034     wxString Title = wxEmptyString;
07035     if (pNewPage->IsKindOf(CLASSINFO(wxDialog)))
07036         Title=((wxDialog *)pNewPage)->GetTitle();
07037     if (Title.IsEmpty()) 
07038         Title = pNewPage->GetLabel(); // because wxPanel doesn't seem to support a title
07039     if( Title.IsEmpty() )
07040     {
07041         ResourceID  NameResID = CamResource::GetResourceID( PCTSTR(ObjectName) );
07042         PCTSTR      pszStringLookup = CamResource::GetTextFail( NameResID );
07043         if( NULL != pszStringLookup )
07044         {
07045             Title = pszStringLookup;
07046             TRACEUSER( "jlh92", _T("Page (FST) = \"%s\"\n"), pszStringLookup );
07047         }
07048     }
07049     if( Title.IsEmpty() )
07050     {
07051         // Finally, in desperation, we (mis-)use the tooltip string because now the wx folks have removed
07052         // the label, even though it's needed for accessibility. Aarrghh
07053         wxToolTip* pTip = pNewPage->GetToolTip();
07054         if (pTip) Title=pTip->GetTip();
07055     }
07056 
07057     wxImageList * pImageList = NULL;
07058     wxBitmap b;
07059     // Add images if present
07060     if (pDialogTabOp->HasImages())
07061     {
07062         // Get the image list 
07063         pImageList = pNoteBook->GetImageList();
07064 
07065         wxBitmap * pBitmap = CamArtProvider::Get()->FindBitmap(DialogResID);
07066         if (!pBitmap || (pBitmap==CamArtProvider::Get()->GetMissingBitmap()) || !pBitmap->Ok())
07067         {
07068             TRACEUSER("Phil", _T("Unable to use options tab icon %d\n"), DialogResID);
07069             int /*TYPENOTE: Correct */ w=32;
07070             int /*TYPENOTE: Correct */ h=32;
07071             if (pImageList)
07072                 pImageList->GetSize(0, w, h);
07073             b = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_OTHER, wxSize(w, h));
07074         }
07075         else
07076             b= *pBitmap;
07077 
07078         // If there is no image list, create one
07079         if (!pImageList)
07080         {
07081             pImageList = new wxImageList(b.GetWidth(), b.GetHeight());
07082             if (pImageList)
07083                 pNoteBook->AssignImageList(pImageList);
07084         }
07085 
07086     }
07087 
07088     if (pImageList)
07089         pImageList->Add(b);
07090     pNoteBook->AddPage( pNewPage, Title );
07091     if (pImageList)
07092         pNoteBook->SetPageImage(pNoteBook->GetPageCount()-1, pImageList->GetImageCount()-1);
07093 
07094     return true;
07095 }

BOOL DialogManager::AddDialogControlToHelper CWindowID  WindowID,
CGadgetID  Gadget
[static]
 

To add this control to the static dialog control helper, which will subclass it.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/2000
Parameters:
WindowID,: Dialog box window identifier [INPUTS] Gadget: Gadget identifier
[OUTPUTS] 
Returns:
TRUE if successful, else FALSE

Definition at line 5103 of file dlgmgr.cpp.

05104 {
05105     // For the time being, we do this by Hide/Unhide
05106     wxWindow * pGadget = GetGadget(WindowID, Gadget);
05107     if (!pGadget) return FALSE;
05108     pGadget->Show(TRUE);
05109     return TRUE;
05110 }

BOOL DialogManager::BringToTop CWindowID  WindowID,
DialogOp pDlgOp
[static]
 

This function brings an open dialog to the top of the z-order.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/95
Parameters:
- [INPUTS]
Returns:
FALSE if the function failed.

Definition at line 1087 of file dlgmgr.cpp.

01088 {
01089     ERROR2IF(!WindowID, FALSE, "BringToTop called on a dialog without a window");
01090     ( (wxWindow *)WindowID )->Raise();
01091     if (pDlgOp->pEvtHandler->wxAUImanaged)
01092         CCamFrame::GetMainFrame()->UpdateFrameManager();
01093     return TRUE;
01094 }

BOOL DialogManager::CaptureMouse CWindowID  WindowID,
CGadgetID  Gadget
[static]
 

Allows the given control to Capture the mouse.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/04/97
Parameters:
WindowID ID of the window / dialogue box containing . . . [INPUTS] Gadget ID of the "gadget" (control) to receive the focus
- [OUTPUTS]
Returns:
TRUE if successful.

Errors: -

See also:
DialogManager::DefaultKeyboardFocus; DialogOp::SetKeyboardFocus

Definition at line 5384 of file dlgmgr.cpp.

05385 {
05386     // Set the focus to the control within the given window/dialogue box.
05387     // For the time being, we do this by Hide/Unhide
05388     wxWindow * pGadget = GetGadget(WindowID, Gadget);
05389     if (!pGadget) return FALSE;
05390 
05391     pGadget->CaptureMouse();
05392     return TRUE;
05393 }

void DialogManager::Close CWindowID  WindowID,
DialogOp pDlgOp
[static]
 

The close method removes a modeless dialog from the display but keeps all system resources associated with it. It hides the dialog. It can be called on a modal dialog but it does nothing.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/8/93
Parameters:
WindowID,: Dialog's window identifier [INPUTS] pDlgOp: The DialogOp
See also:
DialogOp::Close

Definition at line 1017 of file dlgmgr.cpp.

01018 {
01019     // Hide the dialog
01020 
01021     // Determine if we are hiding a bar
01022 PORTNOTE("dialog","Removed DialogBarOp usage")
01023 #ifndef EXCLUDE_FROM_XARALX
01024     if (pDlgOp->IsKindOf(CC_RUNTIME_CLASS(DialogBarOp)))
01025     {
01026         // Find the BaseBar object
01027         wxWindow* pCWnd = CWnd::FromHandlePermanent(WindowID);
01028         ENSURE(pCWnd != NULL, "Could not find bar object");
01029         // Show the bar window
01030         if (pCWnd != NULL)
01031         {
01032             ((BaseBar*)pCWnd)->Hide((DialogBarOp*)pDlgOp);
01033         }
01034     }
01035     else
01036 #endif
01037     if (!(pDlgOp->IsModal())) // The delete method closes a modal dialog
01038     {
01039         ENSURE(WindowID != NULL,"NULL WindowID");
01040         ( (wxWindow *)WindowID )->Show( false );
01041     }
01042 
01043     if (pDlgOp->pEvtHandler->wxAUImanaged)
01044         CCamFrame::GetMainFrame()->UpdateFrameManager();
01045 }

BOOL DialogManager::CloseDropdown CWindowID  WindowID,
CGadgetID  Gadget,
BOOL  CloseVal
[static]
 

Used to close the controls dropdown. This routine was written because of the amount of trouble that I was experiencing with my custom controls down to escape key processing (which is viewed as a hotkey within camelot).

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if things went ok

Errors: -

See also:
-

Definition at line 6956 of file dlgmgr.cpp.

06957 {
06958 PORTNOTE("dialog","Programatic CB drop not supported by wx")
06959     return (TRUE);
06960 }

BOOL DialogManager::ColourPickerAbort CWindowID  WindowID,
CGadgetID  Gadget,
WPARAM  wParam = 0
[static]
 

Instructs camelots custom colour control (which I also wrote) to 'shutdown' and (indirectly) return control to the colour editor dialog.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/1/2000
Parameters:
WindowID,: Dialog's window identifier [INPUTS] Gadget: The colourpicker that this request is made upon (which is checked to ensure that it is a custom colour picker).

Definition at line 1769 of file dlgmgr.cpp.

01770 {
01771     PORTNOTETRACE("dialog","DialogManager::ColourPickerAbort - do nothing");
01772 #ifndef EXCLUDE_FROM_XARALX
01773     // Currently the gadget is only tickable if it is a button
01774     HWND hGadget = GetDlgItem((HWND)WindowID, (INT32)Gadget);
01775     String_256 ClassNameStr;  // The control type
01776 
01777     // Find out the class type of the gadget
01778     GetClassName(hGadget, (TCHAR*)ClassNameStr, 255);
01779 
01780     if (ClassNameStr == String_8(TEXT("cc_colPicker")))
01781     {
01782         BOOL RetVal = FALSE;
01783 
01784         RetVal = SendMessage(hGadget, WM_COLOURPICKERABORT, wParam, 0);
01785 
01786         return (RetVal);
01787     }
01788 
01789     return (TRUE);
01790     ENSURE(FALSE, "Calling ColourPickerAbort for an invalid control");
01791 #endif
01792     return FALSE;
01793 }

CWindowID DialogManager::Create DialogOp DialogOp  ) 
 

BOOL DialogManager::Create DialogOp DlgOp,
CDlgResID  MainDlgID,
CDlgResID  SubDlgID,
CDlgMode  Mode = MODELESS,
INT32  OpeningPage = -1,
CWindowID  ParentWnd = NULL
[static]
 

Definition at line 320 of file dlgmgr.cpp.

00324 {
00325     ERROR2IF(!DlgOp, FALSE, _T("Create Passed Null DialogOp"));
00326     ERROR2IF(DlgOp->pEvtHandler, FALSE, _T("Window has already been created. Having two is greedy"));
00327 
00328     DlgOp->pEvtHandler = new DialogEventHandler(DlgOp);
00329     ERRORIF(!DlgOp->pEvtHandler || !DlgOp->pEvtHandler->pDialogOp, FALSE, _R(IDE_CANNOT_CREATE_DIALOG));
00330 
00331     BOOL wxAUImanaged = FALSE;
00332     if ( DlgOp->IsABar() || DlgOp->IsAGallery() )
00333     {
00334         BOOL modal = DlgOp->IsModal();
00335         ERROR2IF(modal, FALSE, "Attempting to create a wxAUImanaged Dialog that is modal");
00336         // They wanted a bar. Well, the main difference to us is we let wxAUI manage it.
00337         wxAUImanaged = TRUE;
00338     }
00339 
00340 //  ERROR2IF( DlgOp->IS_KIND_OF(DialogBarOp), FALSE, _T("Bar creation not yet supported"));
00341 //  ERROR2IF( DlgOp-&g