biasgdgt.h

Go to the documentation of this file.
00001 // $Id: biasgdgt.h 1386 2006-06-28 17:49:55Z alex $
00002 //------------------------------------------------
00003 //  CBiasGainGadget.h
00004 //------------------------------------------------
00005 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00006 ================================XARAHEADERSTART===========================
00007  
00008                Xara LX, a vector drawing and manipulation program.
00009                     Copyright (C) 1993-2006 Xara Group Ltd.
00010        Copyright on certain contributions may be held in joint with their
00011               respective authors. See AUTHORS file for details.
00012 
00013 LICENSE TO USE AND MODIFY SOFTWARE
00014 ----------------------------------
00015 
00016 This file is part of Xara LX.
00017 
00018 Xara LX is free software; you can redistribute it and/or modify it
00019 under the terms of the GNU General Public License version 2 as published
00020 by the Free Software Foundation.
00021 
00022 Xara LX and its component source files are distributed in the hope
00023 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00024 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00025 See the GNU General Public License for more details.
00026 
00027 You should have received a copy of the GNU General Public License along
00028 with Xara LX (see the file GPL in the root directory of the
00029 distribution); if not, write to the Free Software Foundation, Inc., 51
00030 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00031 
00032 
00033 ADDITIONAL RIGHTS
00034 -----------------
00035 
00036 Conditional upon your continuing compliance with the GNU General Public
00037 License described above, Xara Group Ltd grants to you certain additional
00038 rights. 
00039 
00040 The additional rights are to use, modify, and distribute the software
00041 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00042 library and any other such library that any version of Xara LX relased
00043 by Xara Group Ltd requires in order to compile and execute, including
00044 the static linking of that library to XaraLX. In the case of the
00045 "CDraw" library, you may satisfy obligation under the GNU General Public
00046 License to provide source code by providing a binary copy of the library
00047 concerned and a copy of the license accompanying it.
00048 
00049 Nothing in this section restricts any of the rights you have under
00050 the GNU General Public License.
00051 
00052 
00053 SCOPE OF LICENSE
00054 ----------------
00055 
00056 This license applies to this program (XaraLX) and its constituent source
00057 files only, and does not necessarily apply to other Xara products which may
00058 in part share the same code base, and are subject to their own licensing
00059 terms.
00060 
00061 This license does not apply to files in the wxXtra directory, which
00062 are built into a separate library, and are subject to the wxWindows
00063 license contained within that directory in the file "WXXTRA-LICENSE".
00064 
00065 This license does not apply to the binary libraries (if any) within
00066 the "libs" directory, which are subject to a separate license contained
00067 within that directory in the file "LIBS-LICENSE".
00068 
00069 
00070 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00071 ----------------------------------------------
00072 
00073 Subject to the terms of the GNU Public License (see above), you are
00074 free to do whatever you like with your modifications. However, you may
00075 (at your option) wish contribute them to Xara's source tree. You can
00076 find details of how to do this at:
00077   http://www.xaraxtreme.org/developers/
00078 
00079 Prior to contributing your modifications, you will need to complete our
00080 contributor agreement. This can be found at:
00081   http://www.xaraxtreme.org/developers/contribute/
00082 
00083 Please note that Xara will not accept modifications which modify any of
00084 the text between the start and end of this header (marked
00085 XARAHEADERSTART and XARAHEADEREND).
00086 
00087 
00088 MARKS
00089 -----
00090 
00091 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00092 designs are registered or unregistered trademarks, design-marks, and/or
00093 service marks of Xara Group Ltd. All rights in these marks are reserved.
00094 
00095 
00096       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00097                         http://www.xara.com/
00098 
00099 =================================XARAHEADEREND============================
00100  */
00101 
00102 
00103 
00104 
00105 #ifndef  Include_CBiasGainGadget
00106 #define  Include_CBiasGainGadget
00107 
00108 //#include doccolor.h
00109 
00110 class  CBiasGainDlg;
00111 class  InformationBarOp;
00112 class  CProfileBiasGain;
00113 class  DocColour;
00114 class  FillEffectAttribute;
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 //-------------------------------------------------------------------------------------------------
00127 //
00128 //  class CBiasGainGadget
00129 //
00130 //  Author:     Harrison Ainsworth
00131 //  Date:       06/99
00132 //  Purpose:    represent and contain a gadget specifically for selecting bias/gain choices. 
00133 //              intended to enable easier addition of such a gadget to various toolbars.
00134 //              it handles messages generated by user interaction with the windows gadget, and then
00135 //              sends out commit or slider-set messages (containing the chosen values) to its owning 
00136 //              infobar.
00137 //  Implemen-   depends on a InformationBarOp and valid gadgetID, bubbleID and statusID.
00138 //  tation:     
00139 //  Invariants: pOwningBar_m is valid, 
00140 //              GadgetID_m is valid
00141 //              BubbleID_m is valid
00142 //              StatusID_m is valid
00143 //              pDialog_m is valid
00144 //
00145 //-------------------------------------------------------------------------------------------------
00146 
00147 class CBiasGainGadget
00148 {
00149 
00150 public: //-----------------------------------------------------------------------------------------
00151 
00152 
00153     CBiasGainGadget ();
00154     virtual ~CBiasGainGadget ();
00155 
00156 
00157     virtual void        Init ( DialogOp* pOwningDialog,
00158                                CGadgetID GadgetID, UINT32 BubbleID, UINT32 StatusID );
00159     
00160     virtual void        Enable ( BOOL );
00161     virtual void        GetPresetBiasGainValue ( WORD Index,  CProfileBiasGain& Value )         const;
00162     virtual INT32       FindPresetBiasGain (CProfileBiasGain const& Value)                      const;
00163 
00164     // handle messages
00165     virtual void        Message ( DialogMsg* );
00166     virtual void        Message ( DialogMsg*,  CProfileBiasGain const& );
00167     virtual void        CloseDialog ();
00168     
00169 
00170     // interface for use by CBiasGainDlg ----------------------
00171     virtual void        DialogHasOpened ();
00172     virtual void        DialogHasClosed ();
00173 
00174     virtual CGadgetID   GetGadgetID ()                                                          const;
00175     virtual void        GetDialogTitle ( String_256& DlgTitle )                                 const;
00176 
00177     // DMc
00178     //void SetDialogBiasGain(CProfileBiasGain const& );
00179 
00180     // CGS
00181     // this allows the gadget to know abouts its linked dialog
00182     void SetCBaisGainDlg (CBiasGainDlg* pMyDlg) { pDialog_m = pMyDlg; }
00183     // this allows us to route message from the profile gadget (located on the dialog)
00184     // through the gadget that is located on the infobar
00185     void SetInfobarGadgetID (CGadgetID gadg) { InfobarGadgetID_m = gadg; }
00186     // this allows us to reinit the linked dialog when the selection changes
00187     void ReInitialiseDialog (CProfileBiasGain* ReInitOn, BOOL bMany);
00188     // allows us to query whether the gadgets linked dialog is open (i.e.  exists)
00189     BOOL IsDialogOpen () { if (pDialog_m != NULL) { return (TRUE); } else { return (FALSE); } }
00190     // allows us to change the mode of the linked dialog from its (default) object profile
00191     // rendering to its fill profile rendering
00192     void ToggleFillProfile () { useFillProfile = TRUE; }
00193     // our 'linked' dialog needs access to this information when it is created
00194     BOOL GetUseFillProfile () { return (useFillProfile); }
00195     // allows us to change the mode of the linked dialog from its (default) object profile
00196     // rendering to its transparent fill profile rendering
00197     void ToggleTranspFillProfile () { useTranspFillProfile = TRUE; }
00198     // our 'linked' dialog needs access to this information when it is created
00199     BOOL GetUseTranspFillProfile () { return (useTranspFillProfile); }
00200     // we need direct access the dialogs 'edited' biasgain within elans feathering bar ....
00201     CProfileBiasGain GetCurrentDialogProfile ();
00202 
00203     void SetStartColour(DocColour* NewCol);
00204     void SetEndColour(DocColour* NewCol);
00205     void SetEndColour2(DocColour* NewCol);
00206     void SetEndColour3(DocColour* NewCol);
00207     void SetStartTransp(UINT32* NewTransp);
00208     void SetEndTransp(UINT32* NewTransp);
00209     void SetEndTransp2(UINT32* NewTransp);
00210     void SetEndTransp3(UINT32* NewTransp);
00211     void SetFillEffect(FillEffectAttribute* NewFillEffect);
00212 
00213     DocColour* GetStartColour() { return (StartColour); }
00214     DocColour* GetEndColour() { return (EndColour); }
00215     DocColour* GetEndColour2() { return (EndColour2); }
00216     DocColour* GetEndColour3() { return (EndColour3); }
00217     UINT32* GetStartTransp() { return (StartTransp); }
00218     UINT32* GetEndTransp() { return (EndTransp); }
00219     UINT32* GetEndTransp2() { return (EndTransp2); }
00220     UINT32* GetEndTransp3() { return (EndTransp3); }
00221     FillEffectAttribute* GetFillEffect () { return (FillEffect); }
00222 
00223     // a necessary 'hack' for OpChangeFeatherProfile - to allow us to toggle the state of the
00224     // linked control button
00225 //  InformationBarOp* GetOwningBar () { return (pOwningBar_m); }
00226 
00227 
00228 protected: //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--
00229 
00230 
00231 private: 
00232 
00233 
00234     // members ------------------------------------------------
00235     DialogOp*           pOwningDialog_m;    // owner of me (when located on a dialog)
00236     CGadgetID           GadgetID_m;
00237     CGadgetID           InfobarGadgetID_m;  // owner of dialog
00238     UINT32              BubbleID_m;
00239     UINT32              StatusID_m;
00240 
00241     CBiasGainDlg*       pDialog_m;          // my linked dialog
00242 
00243     BOOL                useFillProfile;     // are we rendering objects or fills within
00244                                             // our linked dialog?
00245     BOOL                useTranspFillProfile;   // do we want to render transparency
00246                                                 // fill profiles?
00247 
00248     DocColour* StartColour;
00249     DocColour* EndColour;
00250     DocColour* EndColour2;
00251     DocColour* EndColour3;
00252     FillEffectAttribute* FillEffect;
00253     UINT32* StartTransp;
00254     UINT32* EndTransp;
00255     UINT32* EndTransp2;
00256     UINT32* EndTransp3;
00257 
00258 
00259     enum { eNumberOfPresets = 5 };
00260     static const INT32          kNumberOfPresets_s;
00261     static const double         kBiasPresets_s[ eNumberOfPresets ];
00262     static const double         kGainPresets_s[ eNumberOfPresets ];
00263 
00264 
00265 
00266 
00267 private:
00268     // Copying is disallowed.
00269     CBiasGainGadget ( const CBiasGainGadget& );
00270     CBiasGainGadget&    operator= ( const CBiasGainGadget& );
00271 
00272 };
00273 
00274 
00275  
00276 
00277 
00278 
00279 
00280 
00281 #endif//Include_CBiasGainGadget

Generated on Sat Nov 10 03:44:22 2007 for Camelot by  doxygen 1.4.4