dialogop.h

Go to the documentation of this file.
00001 // $Id: dialogop.h 1751 2006-09-13 11:33:14Z luke $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 // Declaration of the following classes
00100 //
00101 //  DialogOp           Abstract base class which all dialog classes derive from
00102 //      MenuPrefDlg    Menu preferences demo (This has a very short life!)
00103 //      DebugTreeDlg   Dialog showing Camelots debug tree
00104 
00105 
00106 /*
00107 */       
00108 
00109 
00110 #ifndef INC_DIALOGOP
00111 #define INC_DIALOGOP         
00112      
00113 #include "ops.h"        // Operation class  
00114 #include "dlgtypes.h"   // The DialogOp types
00115 #include "convert.h"
00116 
00117 class CGadgetImageList;
00118 class CustomComboBoxControlDataItem;
00119 class DialogManager;
00120 class String_256;    
00121 class Node;
00122 class RenderRegion;
00123 class DocRect;
00124 class DialogEventHandler;
00125 struct ReDrawInfoType;
00126 class CBiasGainGadget;
00127 class CProfileBiasGain;
00128 
00129   
00130 /********************************************************************************************
00131 
00132 >   class DialogOp: public Operation
00133 
00134     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00135     Created:    15/9/93    
00136     
00137     Purpose:    The abstract DialogOp class is used as the base class for all Dialog box
00138                 classes in Camelot. It provides methods required to create dialogs and to 
00139                 communicate with gadgets.  
00140                 
00141     SeeAlso:    DialogManager
00142 
00143 ********************************************************************************************/
00144 
00145 class DialogOp: public Operation
00146 {       
00147     friend class DialogEventHandler;
00148     friend class DialogManager;
00149 
00150     CC_DECLARE_DYNCREATE( DialogOp )  
00151 public:      
00152     // The Constructor of the DialogOp class simply sets the resource ID of the dialog
00153     // and its modality. 
00154     DialogOp(CDlgResID DialogResID, CDlgMode Mode, CDlgResID SubDialogID = 0,
00155              /*HINSTANCE MainInst = 0, HINSTANCE SubInst= 0, */
00156              CCRuntimeClass* Class = CC_RUNTIME_CLASS(DialogOp),
00157              INT32 OpeningPage = -1, CWindowID ParentWnd = NULL);
00158 
00159     virtual BOOL IsABar() { return FALSE; }
00160     virtual BOOL IsAGallery() {return FALSE; }
00161     virtual BOOL IsVertical() { return FALSE; }
00162             
00163     // The create method reserves everything needed to guarantee that the dialog will 
00164     // appear (it does not show the dialog). 
00165     virtual BOOL Create(); 
00166 
00167     // The open method displays the dialog box on the display. 
00168     void Open(); 
00169 
00170     // The close method removes the dialog from the display but keeps all system        
00171     // resources associated with it. It hides the dialog.  
00172     void Close(); 
00173 
00174     // BODGE *** Don't use this it's marked for destruction
00175     BOOL IsOpen();
00176 
00177     // Is the DialogOp's window visible (replaces the old IsOpen)
00178     BOOL IsWindowVisible();
00179 
00180     // Is the DialogOp's custom control dropdown open
00181     BOOL IsCustomComboDropdownVisible(CGadgetID Gadget);
00182 
00183     // Used in conjunction with the above, this command can be used to close the controls
00184     // dropdown on the event of a suitable keypress
00185     BOOL CloseDropdown (CGadgetID Gadget, BOOL CloseVal);
00186 
00187     // Used to test if the DialogOp has an associated window
00188     BOOL HasWindow();
00189 
00190     // Brings an open dialog to the top of the z-order
00191     BOOL BringToTop();
00192 
00193     // Used to determine if a particular gadget can be ticked or not, it only
00194     // makes sense to tick buttons at the moment
00195     BOOL IsGadgetTickable(CGadgetID Gadget); 
00196 
00197     // Used to abort the dragging of the custom colour picker control
00198     // from within the colour editor
00199     BOOL ColourPickerAbort(CGadgetID Gadget, WPARAM wParam=0);
00200 
00201     // The DialogOP destructor destroys the instance of the DialogOp and all    
00202     // associated resources. If the dialog was open then it is closed. 
00203     ~DialogOp();        
00204     
00205     // The following methods call same named functions defined in the DialogManager.
00206     // The parameters of the DialogManager functions are identical except for an additional
00207     // CWindowID parameter.  
00208     
00209     //--------------------------------------------------------------------------------------
00210     // Methods to aid rendering into the dialogue via render regions
00211     RenderRegion* CreateGRenderRegion(DocRect* pRequiredSize, ReDrawInfoType* ExtraInfo,
00212                                         BOOL UseSelViewColContext = FALSE);
00213     BOOL          DestroyGRenderRegion(RenderRegion* pRender);
00214 
00215     RenderRegion* CreateOSRenderRegion(DocRect* pRequiredSize, ReDrawInfoType* ExtraInfo,
00216                                         BOOL UseSelViewColContext = FALSE);
00217     BOOL          DestroyOSRenderRegion(RenderRegion* pRender);
00218 
00219     //--------------------------------------------------------------------------------------
00220     // Methods to set gadget values 
00221 
00222     void SetComboListLength( CGadgetID Gadget );
00223         
00224     BOOL SetUnitGadgetValue( CGadgetID Gadget, 
00225                              UnitType Unit, 
00226                              MILLIPOINT value, 
00227                              BOOL EndOfList = TRUE, 
00228                              INT32 ListPos = 0);
00229 
00230     BOOL SetDimensionUnitGadgetValue(CGadgetID Gadget, 
00231                                      UnitType  units, 
00232                                      double    value, 
00233                                      Node*     pNode,
00234                                      BOOL      IncludeUnitSpecifier = TRUE,
00235                                      BOOL      EndOfList = FALSE, 
00236                                      INT32       ListPos   = -1);
00237 
00238     BOOL SetLongGadgetValue(CGadgetID Gadget, 
00239                             INT32 value,    
00240                             BOOL EndOfList = TRUE, 
00241                             INT32 ListPos = 0);
00242 
00243     BOOL SetDoubleGadgetValue(CGadgetID Gadget, 
00244                             double value,    
00245                             BOOL EndOfList = TRUE, 
00246                             INT32 ListPos = 0);
00247 
00248     BOOL SetBoolGadgetSelected(CGadgetID Gadget,
00249                                 BOOL IsSelected,
00250                                 INT32 ListPos = 0);
00251 
00252     BOOL SetRadioGroupSelected(CGadgetID *GroupGadgets,
00253                                 CGadgetID SelectedGadget);
00254 
00255     BOOL SetStringGadgetValue(CGadgetID Gadget, 
00256                               UINT32 IDStr,    
00257                               BOOL EndOfList = TRUE, 
00258                               INT32 ListPos = 0);
00259 
00260     BOOL SetStringGadgetValue(CGadgetID Gadget, 
00261                               const StringBase& StrVal,   
00262                               BOOL EndOfList = TRUE, 
00263                               INT32 ListPos = 0);
00264 
00266     // CUSTOM COMBOBOX STUFF ....
00267 
00268     BOOL SetCustomComboGadgetValue (CGadgetID Gadget, 
00269                               CustomComboBoxControlDataItem* TheItem,   
00270                               BOOL EndOfList = TRUE, 
00271                               INT32 ListPos = 0);
00272 
00273     BOOL SelectCustomComboGadgetValueOnString (CGadgetID Gadget,
00274                                                StringBase* StrVal);
00275 
00277     
00278     void                    BuildResDropList(const CGadgetID DropListID,
00279                                             const BOOL      bIncludeAuto = TRUE,
00280                                             const BOOL      bVerbose = FALSE,
00281                                             const INT32         Default=0
00282                                             );
00283     void                    SetResDropListValue( const CGadgetID DropListID,
00284                                             const BOOL      bIncludeAuto = TRUE,
00285                                             const INT32         iValue=0
00286                                             );
00287     INT32                       GetResDropListValue(const CGadgetID DropListID,
00288                                                 const BOOL      bIncludeAuto = TRUE,
00289                                                 BOOL*           bValid = NULL
00290                                                 );
00291 
00292     BOOL SetGadgetRange(CGadgetID Gadget, INT32 Min, INT32 Max, INT32 PageInc = 1);  
00293     
00294     BOOL SetSelectedValueIndex(CGadgetID Gadget, INT32 Index);
00295 
00296     BOOL SetSelectedValueRange(CGadgetID Gadget,
00297                                 WORD StartIndex,
00298                                 WORD EndIndex,
00299                                 BOOL Select = TRUE);
00300 
00301     BOOL SetDimensionGadgetValue(   CGadgetID Gadget, 
00302                                     MILLIPOINT value, 
00303                                     Node* pNode,
00304                                     BOOL IncludeUnitSpecifier = TRUE,
00305                                     BOOL EndOfList = FALSE, 
00306                                     INT32 ListPos = 0);
00307 
00308     BOOL SetMemoryGadgetValue( CGadgetID Gadget, 
00309                                UINT32 value, 
00310                                BOOL EndOfList = TRUE, 
00311                                INT32 ListPos = 0);
00312 
00313     BOOL SetGadgetHelp( CGadgetID Gadget, 
00314                         UINT32 BubbleID, 
00315                         UINT32 StatusID, 
00316                         UINT32 ModuleID = 0);   
00317 
00318     //--------------------------------------------------------------------------------------                              
00319     // Methods to get gadget values                                                         
00320     
00321     MILLIPOINT GetUnitGadgetValue(CGadgetID Gadget,  
00322                               UnitType DefaultType,
00323                               MILLIPOINT StartRange, 
00324                               MILLIPOINT EndRange,
00325                               UINT32 IDSInvalidMsg = 0,  
00326                               BOOL* Valid = NULL);
00327     
00328     INT32 GetLongGadgetValue(CGadgetID GadgetID, 
00329                             INT32 StartRange, 
00330                             INT32 EndRange, 
00331                             UINT32 IDSInvalidMsg = 0,
00332                             BOOL* Valid = NULL,
00333                             Convert::PFNSTRINGTOINT32 pfnParser = Convert::StringToLong);
00334 
00335     double GetDoubleGadgetValue(CGadgetID GadgetID, 
00336                             double StartRange, 
00337                             double EndRange, 
00338                             UINT32 IDSInvalidMsg = 0,
00339                             BOOL* Valid = NULL,
00340                             Convert::PFNSTRINGTODOUBLE pfnParser = Convert::StringToDouble);
00341 
00342     BOOL GetDoubleAndUnitGadgetValue(double*   pMPValue,
00343                                      double*   pUnitValue,
00344                                      UnitType* pUnitType,
00345                                      CGadgetID GadgetID,
00346                                      Node*     pNode);
00347 
00348     BOOL GetBoolGadgetSelected(CGadgetID GadgetID,
00349                                 UINT32 IDSInvalidMsg = 0,
00350                                 BOOL* Valid = NULL,
00351                                 INT32 ListPos = -1);
00352 
00353     INT32 GetSelectedValueIndex(CGadgetID GadgetID);
00354 
00355     CGadgetID GetRadioGroupSelected(CGadgetID *GroupGadgets);
00356 
00357     String_256 GetStringGadgetValue(CGadgetID GadgetID, BOOL* Valid = NULL, INT32 ListPos=-1);
00358     
00359     BOOL GetGadgetRange(CGadgetID GadgetID, INT32* Min, INT32* Max);  
00360 
00361     MILLIPOINT GetDimensionGadgetValue( CGadgetID Gadget, Node* pNode, BOOL* Valid = NULL, INT32 ListPos=-1);
00362 
00363     UINT32 GetMemoryGadgetValue(CGadgetID Gadget,  
00364                                UINT32 StartRange, 
00365                                UINT32 EndRange,
00366                                UINT32 IDSInvalidMsg = 0,  
00367                                BOOL* Valid = NULL);
00368     
00369     
00370     //--------------------------------------------------------------------------------------
00371     
00372     BOOL DeleteAllValues(CGadgetID GadgetID);
00373     BOOL DeleteValue(CGadgetID GadgetID, BOOL EndOfList = TRUE, INT32 ListPos = 0);
00374     BOOL GetValueCount(CGadgetID GadgetID, INT32* Count);
00375     BOOL GetValueIndex(CGadgetID GadgetID, WORD* Index);
00376     BOOL GetValueIndex(CGadgetID GadgetID, INT32* Index);
00377 
00378     INT32 GetSelectedCount(CGadgetID GadgetID);
00379     INT32 GetFirstSelectedItem(CGadgetID GadgetID);
00380     INT32* GetSelectedItems(CGadgetID GadgetID);
00381 
00382     BOOL EnableGadget(CGadgetID GadgetID, BOOL Enabled);
00383     BOOL IsGadgetEnabled( CGadgetID Gadget );
00384     BOOL HideGadget(CGadgetID GadgetID, BOOL Hide);
00385     BOOL SetGadgetWritable(CGadgetID Gadget, BOOL enable);
00386     BOOL GadgetRedraw(CGadgetID GadgetID, BOOL Redraw);
00387     void Layout(BOOL CanYield = FALSE);
00388 
00389     //--------------------------------------------------------------------------------------
00390 
00391     BOOL SetKeyboardFocus(CGadgetID gadID);     // sets the keyboard focus
00392     BOOL HighlightText(CGadgetID gadID, INT32 nStart = 0, INT32 nEnd = -1);
00393     BOOL CaptureMouse(CGadgetID gadID); //capture the mouse 
00394     BOOL ReleaseMouse(CGadgetID gadID); //release the mouse 
00395     
00396     //--------------------------------------------------------------------------------------
00397     
00398     void PaintGadgetNow(CGadgetID gid);     // immediately updates gadget's appearance
00399     void InvalidateGadget(CGadgetID Gadget, BOOL EraseBackground=TRUE); // Force the gadget to be repainted
00400 
00401     // Force *part* of a kernel-drawn gadget to repaint
00402     void InvalidateGadget(CGadgetID Gadget,
00403                             ReDrawInfoType *ExtraInfo,
00404                             DocRect *InvalidRect);
00405 
00406     // Scrolls (by blitting) the given area of the gadget, and invalidates
00407     // the bit that has 'scrolled into view'
00408     void ScrollKernelRenderedGadget(CGadgetID Gadget,
00409                                     DocRect *RectToScroll, DocCoord *ScrollBy);
00410 
00411     // Gets information on a cc_DialogDraw gadget
00412     BOOL GetKernelRenderedGadgetInfo(CGadgetID Gadget, ReDrawInfoType *Result);
00413 
00414     
00415     // -------------------------------------------------------------------------------------
00416     // Methods for setting the types of edit fields            
00417     
00418     void SetEditGadgetType(CGadgetID Gadget, EditGadgetType Type);
00419     void SetEditGadgetType(CGadgetID Gadget, UINT32 IDSValidChar);    
00420      
00421 
00422     // --------------------------------------------------------------------------------------
00423     // Methods related to tree controls
00424     CTreeItemID SetTreeGadgetItem(CGadgetID Gadget, CTreeItemID hParent, const StringBase& str, CTreeItemID hInsAfter, INT32 iImage, CCObject* pObj = NULL);
00425     CCObject*   GetTreeGadgetItemData(CGadgetID Gadget, CTreeItemID hItem);
00426     BOOL        SelectTreeGadgetItem(CGadgetID Gadget, CTreeItemID hItem, BOOL bNewState = TRUE);
00427     CTreeItemID GetTreeGadgetRootItem(CGadgetID Gadget);
00428     CTreeItemID GetTreeGadgetFirstSelectedItem(CGadgetID Gadget);
00429     BOOL        TreeGadgetExpandItem(CGadgetID Gadget, CTreeItemID hItem);
00430     CTreeItemID GetTreeGadgetNextVisItem(CGadgetID Gadget, CTreeItemID hItem);
00431     CTreeItemID GetTreeGadgetFirstChildItem(CGadgetID Gadget, CTreeItemID hItem);
00432     size_t      GetTreeGadgetChildrenCount(CGadgetID Gadget, CTreeItemID hItem, BOOL bRecursive = FALSE);
00433 
00434 
00435     // ------------------------------------------------------------------------------------- 
00436     
00437     void DualFunctionButton(CGadgetID ButtonGadget); // Will have no effect on platforms 
00438                                                      // which support right mouse button 
00439                                                      // clicks  
00440 
00441     // Method to set the bitmaps for a bitmap slider
00442     void SetGadgetBitmaps(CGadgetID GadgetID, UINT32 Bitmap1, UINT32 Bitmap2);
00443     void SetGadgetBitmaps(CGadgetID GadgetID, const CGadgetImageList& imagelist);
00444     void SetGadgetBitmap(CGadgetID Gadget, ResourceID Bitmap);
00445     ResourceID GetGadgetBitmap(CGadgetID Gadget);
00446     UINT32 GetGadgetImageCount(CGadgetID);
00447     
00448     // DY 23/9/99 allows you to specify indexes within a bitmap strip
00449     // for both selected and unselected states of a cc_bitmapbutton control
00450     void SetBitmapButtonIndexes(CGadgetID GadgetID, UINT32 UnselectedIndex, UINT32 SelectedIndex);
00451 
00452 
00453     BOOL MakeListBoxDragable(CGadgetID ListGadget);        
00454              
00455     virtual MsgResult Message(Msg* Message); 
00456 
00457     static BOOL IsADialogWindow(CWindowID WndID); 
00458 
00459     // Used to set the dialogs title
00460     BOOL SetTitlebarName(String_256* Name); 
00461  
00462 
00463 
00464     // This function should never get called. It is required because DYNCREATE
00465     // is a bodge  
00466     DialogOp(); 
00467 
00468 
00469     CWindowID WindowID;    // Window associated with dialog 
00470     
00471     BOOL UpdateStringGadgetValue(CGadgetID Gadget, StringBase* NewString);
00472 
00473     OpDescriptor * GetGadgetOpDescriptor(CGadgetID Gadget);
00474 
00475     BOOL SendMessageToControl(OpDescriptor * OpDesc, DialogMsg* Msg, BOOL Processed=FALSE);
00476 
00477     // Profiles-related functions.
00478     virtual void DisallowInteractiveProfiles() { m_bInteractiveProfiles = FALSE; }
00479 
00480     
00481 protected:
00482     void ProfileSelectionChange (DialogMsg* Message, CGadgetID GadgetID);
00483     virtual void ChangeProfile (CProfileBiasGain* Profile, CGadgetID GadgetID);
00484     virtual void ChangeProfileOnIdle (CProfileBiasGain* Profile, CGadgetID GadgetID);
00485 
00486 
00487 protected:
00488     CDlgResID DlgResID;    // Dialog resource (for main, possibly only dialog)
00489     CDlgResID SubDlgID;    // Dialog resource (for secondary dialog)
00490     CDlgMode DlgMode;      // Dialog's mode { Modal, Modeless }
00491 /*  HINSTANCE MainDlgInst;
00492     HINSTANCE SubDlgInst; */
00493     CWindowID ParentDlgWnd;
00494 
00495     DialogEventHandler* pEvtHandler;    // This is an opaque class as far as we are concerned
00496 
00497     DialogManager* DlgMgr; // A pointer to camelot's dialog manager. This is stored so we
00498                            // don't have to keep looking it up. 
00499     CDlgResID ReadWritePage; // This will be NULL for all classes directly derived from DialogOp
00500                              // It can only be set to a non NULL value for Dialogs which can
00501                              // have pages i.e. tabbed dialogs derived from DialogTabOp. 
00502     INT32 PageToOpen;            // for tabbed dialogs allows opening tab to be chosen, defaults to -1
00503 
00504 public:
00505     CWindowID GetReadWriteWindowID();
00506 
00507 public:
00508     BOOL IsModal() { return (DlgMode == MODAL); }; 
00509     CDlgResID GetCurrentPageID();   // Returns the current page id. For use when in tabbed dialogs mode
00510 
00511 public:
00512     // Setting up and killing timer events for dialog boxes
00513     UINT32 SetTimer(UINT32 nIDEvent, UINT32 nElapse, void (* lpfnTimer)(void *) = NULL, void * param=NULL, BOOL OneShot=FALSE);
00514     BOOL KillTimer(INT32 nIDEvent);
00515 
00516     // Get and set the position of a window or a gadget
00517     BOOL GetWindowPosition( wxRect *pRect );
00518     BOOL GetWindowPosition( RECT *pRect );
00519     BOOL GetGadgetPosition( CGadgetID Gadget, wxRect *pRect );
00520     BOOL GetGadgetPosition( CGadgetID Gadget, RECT *pRect );
00521     BOOL SetWindowPosition( const wxRect &Rect);
00522     BOOL SetWindowPosition( const RECT &Rect);
00523     BOOL SetGadgetPosition( CGadgetID Gadget, const wxRect &Rect );
00524     BOOL SetGadgetPosition( CGadgetID Gadget, const RECT &Rect );
00525 
00526     INT32 GetScreenDpi();
00527     BOOL GetScreenSize(INT32 * pWidth, INT32 * pHeight);
00528 
00529     static DialogOp*    FindDialogOp(CDlgResID ResID);
00530 
00531     BOOL            IsVisible();
00532     virtual void    SetVisibility(BOOL Visible);
00533 
00534 protected:
00535     // Need to subclass your dialog controls? Override this to do so
00536     virtual BOOL AddControlsToHelper();
00537     virtual void RemoveControlsFromHelper();
00538 
00539     // helpers for the above, call these for each control you wish to subclass
00540     BOOL AddDialogControlToHelper(CGadgetID GadgetID);
00541     BOOL AddDialogControlToHelper(CGadgetID GadgetID, CDlgResID PageID); // overridden for tabbed dialogs
00542     BOOL RemoveDialogControlFromHelper(CGadgetID GadgetID);
00543     BOOL RemoveDialogControlFromHelper(CGadgetID GadgetID , CDlgResID PageID);
00544 
00545 private:
00546     UINT32 MagicWord;
00547     BOOL   m_bInteractiveProfiles;
00548 
00549 };  
00550 
00551 
00552 /********************************************************************************************
00553 
00554 >   class DialogTabOp: public DialogOp
00555 
00556     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00557     Created:    15/9/93    
00558     
00559     Purpose:    The abstract DialogTabOp class is used as the base class for all tabbed Dialog 
00560                 box classes in Camelot. It is a simple specialisation of a DialogOp
00561                 
00562     SeeAlso:    DialogManager
00563 
00564 ********************************************************************************************/
00565                               
00566  
00567 class DialogTabOp: public DialogOp
00568 {
00569     CC_DECLARE_DYNCREATE( DialogTabOp )  
00570 public:      
00571     // The Constructor of the DialogTabOp class simply sets the resource ID of the dialog
00572     // and its modality.
00573     
00574     // Note the message handler class is deliberately set to DialogOp, as there is no need to
00575     // distinguish a tab dialog message from a message for any other type of dialog
00576     DialogTabOp(CDlgResID DummyDialogResID, 
00577                 CDlgMode Mode,
00578                 CCRuntimeClass* Class = CC_RUNTIME_CLASS(DialogOp),
00579                 INT32   OpeningPage = -1);
00580 
00581     // This function will be called to give you a chance to create your pages. (See AddAPage)
00582     virtual BOOL RegisterYourPagesInOrderPlease(); 
00583 
00584     // A function to add a dialog page to the tabbed dialog. Note that this function can be
00585     // called many times before the dialog is made visible. 
00586     BOOL AddAPage(CDlgResID DialogResID, CGadgetID Gadget=0); 
00587 
00588     // Call this function before calling create. It sets the name displayed in the dialog's
00589     // title bar window
00590     void SetName(String_256* Name); 
00591 
00592     // Used to set the current page that we are currently reading or writing to.
00593     BOOL TalkToPage(CDlgResID PageID); 
00594 
00595     String_256* GetName(void); 
00596 
00597     virtual MsgResult Message(Msg* Message); 
00598     
00599     virtual void BrushEditDlgOnOK() {}  // does nothing in the base class
00600 
00601     void SetPropertyPageModified(BOOL Modified);
00602 
00603     // Override this function if the dialog's frame should be loaded from resources rather than
00604     // just created with the standard button set
00605     virtual BOOL LoadFrameFromResources() {return FALSE;}
00606 
00607     // Override this function to provide an image list
00608     virtual BOOL HasImages() {return FALSE;}
00609 
00610     virtual TabType GetTabType() {return TABTYPE_TABS;}
00611     virtual CGadgetID GetDefaultBookGadget() {return (CGadgetID)0;}
00612 
00613     // The DialogOP destructor destroys the instance of the DialogTabOp and all     
00614     // associated resources. If the dialog was open then it is closed. 
00615     ~DialogTabOp();
00616     
00617     DialogTabOp(); // I'm not here !, ignore me
00618 private:
00619 
00620 
00621     String_256 MyName; // The name displayed in the title bar of the dialog. We need this because
00622                        // there is no dialog template associated with the Tab dialog itself.    
00623 };
00624 
00625 // Complete bodge that should me made part of the above class
00626 BOOL UpdateStringGadgetValue(DialogOp* Dialog, UINT32 Gadget, StringBase* NewString);
00627 
00628 #endif
00629 
00630 

Generated on Sat Nov 10 03:45:01 2007 for Camelot by  doxygen 1.4.4