biasdlg.h

Go to the documentation of this file.
00001 // $Id: biasdlg.h 1756 2006-09-16 12:02:30Z alex $
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 
00100 #ifndef  Included_CBiasGainDlg
00101 #define  Included_CBiasGainDlg
00102 
00103 
00104 
00105 
00106 #include "rnddlgs.h"
00107 #include "transop.h"//"selop.h"
00108 #include "biasgain.h"
00109 #include "biasgdgt.h"
00110 #include "bitmapgriddropdown.h"
00111 
00112 
00113 
00114 #define  OPTOKEN_BIASGAIN_DLG  _T("CBiasGainDlg")
00115 #define  OPTOKEN_OPBIASGAIN    _T("OpBiasGain")
00116 
00117 
00118 
00119 
00120 //-------------------------------------------------------------------------------------------------
00121 //
00122 //  class  CBiasGainDlg
00123 //
00124 //  Author:     Harrison Ainsworth
00125 //  Date:       05/99
00126 //  Purpose:    be a dialog for inputing a bias/gain choice. to be owned and called from a 
00127 //              CBiasGainGadget
00128 //  Implemen-   DoWithParam() is supplied with a pointer to the owning gadget (in the OpParam), this 
00129 //  tation:     is mainly used to tell the gadget when the dlg is running, which the gadget uses to 
00130 //              ensure that only one (of its) dlgs is running at a time. So: you can have multiple of
00131 //              these biasgain dialogs running, but each is used for a different purpose and is owned 
00132 //              by a separate gadget.
00133 //
00134 //-------------------------------------------------------------------------------------------------
00135 
00136 class  CBiasGainDlg  :  public  DialogOp
00137 {         
00138     CC_DECLARE_DYNCREATE( CBiasGainDlg )
00139 
00140 public: //-----------------------------------------------------------------------------------------
00141 
00142     // standard object services -------------------------------
00143     
00144                         CBiasGainDlg ();
00145     
00146                         ~CBiasGainDlg ();
00147     //                  CBiasGainDlg ( const CBiasGainDlg& );
00148     //CBiasGainDlg&     operator= ( const CBiasGainDlg& );
00149 
00150     // --------------------------------------------------------
00151 
00152 
00153     // constants ----------------------------------------------
00154     static const UINT32 IDD;
00155     static const CDlgMode   Mode;
00156 
00157 
00158     // usual interface ----------------------------------------
00159     static  BOOL        Init ();
00160     static  OpState     GetState ( String_256*,  OpDescriptor* );
00161 
00162     void                Do ( OpDescriptor* );
00163                         // OwningGadgetParams: param1 is a CBiasGainGadget*, and param2 is a CProfileBiasGain*
00164     void                DoWithParam ( OpDescriptor*,  OpParam* OwningGadgetParams );
00165     virtual MsgResult   Message( Msg* );
00166 
00167     
00168     // DMc
00169     // Sets the profile for the dialog, and updates all the controls
00170     //void SetProfile(CProfileBiasGain const &Profile);
00171 
00172     // CGS
00173     void InvokeVia (CBiasGainGadget& pInvokeWith, CProfileBiasGain* pInvokeOn, BOOL bMany);
00174     void ReInitialiseDialog (CProfileBiasGain* ReInitOn, BOOL bMany);
00175     void DisableAllControls ();
00176     void EnableAllControls ();
00177     void ToggleFillProfile () { useFillProfile = TRUE; }
00178     void ToggleTranspFillProfile () { useTranspFillProfile = TRUE; }
00179     // we need direct access the dialogs 'edited' biasgain within elans feathering bar ....
00180     CProfileBiasGain GetCurrentDialogProfile ();
00181 
00182 protected: //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--
00183 
00184     virtual void        DrawCurve ( const CProfileBiasGain& CurveShape,  ReDrawInfoType* ExtraInfo );
00185     virtual void        DrawCurveInterpolate ( const CProfileBiasGain& CurveShape,  ReDrawInfoType* ExtraInfo );
00186     virtual void        DrawFillInterpolate ( const CProfileBiasGain& CurveShape,  ReDrawInfoType* ExtraInfo );
00187     virtual void        DrawTranspFillInterpolate ( const CProfileBiasGain& CurveShape,  ReDrawInfoType* ExtraInfo );
00188 
00189 
00190     // sliders interface --------------------------------------
00191     virtual void        InitSliders  ( CProfileBiasGain const& );
00192     virtual void        WriteSliders ( CProfileBiasGain const& );
00193     virtual void        ReadSliders  ( CProfileBiasGain& );
00194     virtual void        InitiProfileCombobox();
00195             void        InitOneSlider( CGadgetID GadgetID );
00196             void        WriteOneSlider ( AFp ValueMinus1ToPlus1, CGadgetID GadgetID );
00197             AFp         ReadOneSlider ( CGadgetID GadgetID );
00198             void        InitBiasGainGadget ( CProfileBiasGain const& );
00199 
00200     static const INT32  kSliderLength_s;
00201     static const INT32  kSliderHalfLength_s;
00202     static const INT32  kSliderMin_s;
00203     static const INT32  kSliderMax_s;
00204 
00205 
00206     // edit boxes interface -----------------------------------
00207     virtual void        InitEditBoxes  ( CProfileBiasGain const& );
00208     virtual void        WriteEditBoxes ( CProfileBiasGain const& );
00209     virtual void        ReadEditBoxes  ( CProfileBiasGain& );
00210 
00211 private: 
00212 
00213     // functions ----------------------------------------------
00214     //
00215     // message handlers
00216     virtual void        HandleSliderPosChanging ( CDlgMessage const&,  CProfileBiasGain& );
00217     virtual void        HandleSliderPosSet      ( CDlgMessage const&,  CProfileBiasGain& );
00218     virtual void        HandleCommit            ( CDlgMessage const&,  CProfileBiasGain& );
00219     virtual void        HandleInput             ( CDlgMessage const&,  CProfileBiasGain& );
00220     virtual void        HandleBiasEditChange    ( CDlgMessage const&,  CProfileBiasGain& );
00221 
00222     // communicate bias gain values to outside
00223     virtual void        BroadcastMessage ( CDlgMessage const&,  CProfileBiasGain const& )       const;
00224 
00225 
00226     // members ------------------------------------------------
00227     // 
00228     // ptr to the owning gadget
00229     CBiasGainGadget*    pOwningGadget_m;
00230 
00231     // the 'contained' profile gadget       (CGS - 10/1/99)
00232     CBiasGainGadget BiasGainGadget;
00233 
00234     // identifier for this particular instance
00235     CGadgetID           Id_m;
00236 
00237     CBitmapGridDropDown* m_pobddStandardProfile;
00238 
00239     // the curve representation
00240     CProfileBiasGain    BiasGain_m;
00241 
00242     // whether we disabled all controls or not (i.e.  whether we were asked to display MANY
00243     // profiles
00244     BOOL manyDisabledControls;
00245 
00246     // whether we should render an object profile or a fill profile internally
00247     // (by default we render using an object profile)
00248     BOOL useFillProfile;
00249 
00250     // whether we should render an object profile or a transparency fill profile internally
00251     // (by default we render using an object profile)
00252     BOOL useTranspFillProfile;
00253 
00254 
00255 private:
00256     // Copying is disallowed
00257                         CBiasGainDlg ( const CBiasGainDlg& );
00258     CBiasGainDlg&       operator= ( const CBiasGainDlg& );
00259 
00260 
00261 }; 
00262 
00263 
00264 
00265 #endif//Included_CBiasGainDlg

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