coldlog.cpp File Reference

(r1785/r1685)

#include "camtypes.h"
#include "bubbleid.h"
#include "camelot.h"
#include "ccolbar.h"
#include "colcontx.h"
#include "coldlog.h"
#include "coldrop.h"
#include "colmenu.h"
#include "colormgr.h"
#include "colourix.h"
#include "colpick.h"
#include "ctrlhelp.h"
#include "dlgmgr.h"
#include "dragcol.h"
#include "dragmgr.h"
#include "dragpick.h"
#include "helpuser.h"
#include "keypress.h"
#include "lineattr.h"
#include "newcol.h"
#include "nodedoc.h"
#include "oilprog.h"
#include "optsmsgs.h"
#include "progress.h"
#include "scunit.h"
#include "optsunit.h"
#include "sgcolour.h"
#include "ccdc.h"
#include "dlgcol.h"
#include "grnddib.h"
#include "palman.h"
#include "objchge.h"
#include "statline.h"
#include "ophist.h"

Go to the source code of this file.

Classes

class  ColourEditDlgParam
 The OpParam to use when Invoke()ing the ColourEditDlg You shouldn't ever need to use this - just call the static function ColourEditDlg::InvokeDialog if you want a colour editor. More...
struct  GadgetHelpInfo

Defines

#define new   CAM_DEBUG_NEW
#define COLOURTYPE_SHADE   ((IndexedColourType) 32)
 Initialises the colour editor dialogue State variable to be 'unknown'. The next SetControls() call after this will set all the controls in the window, rather than only those which are known to have changed. Scope: private.
#define OPTOKEN_MAKECOLOURLOCALTOFRAME   _T("MakeColourLocalToFrame")
 OpMakeColourLocalToFrame initialiser method.

Functions

 CC_IMPLEMENT_DYNCREATE (ColourEditDlg, DialogOp) CC_IMPLEMENT_DYNAMIC(ColEditorDragTarget
KernelDragTarget CC_IMPLEMENT_DYNCREATE (ColEditorDragInfo, ColourDragInformation) CC_IMPLEMENT_DYNCREATE(OpMakeColourLocalToFrame
INT32 GetSliderHeight (INT32 RectHeight, INT32 Num)
INT32 GetSliderGap (INT32 RectHeight, INT32 Num)
INT32 HalfGridLock (INT32 Position, INT32 GridSize)
 Grid-locks a given plotting poisition to lie over a grid (usually the output device-pixel grid). The result is shifted by half the grid size to grid-lock to the _center_ of a pixel rather than the edges.
static void GridLockRect (DocRect *TheRect, INT32 GridSize)
 GridLocks all 4 coordinates of the rectangle using HalfGridLock.
static void CalculateHSVPickerRects (DocRect *VirtualSize, INT32 PixelSize, DocRect *HueRect, DocRect *ValSatSquare)
 Calculates where the important regions are in the square HSV picker.
static void RenderPickerSquare (RenderRegion *pRender, DocRect *SquareRect, ColourGeneric *BaseCol, ColourGeneric *MidCol, ColourGeneric *TopCol, ColourModel TheColourModel, UINT32 TransType)
 Redraws the front face of the RGB/CMY colour cube pickers. This can redraw an axis-aligned planar cut through the RGB/CMY colourspaces, if the input parameters are correct.
static void DrawCubeShadowAndCalcValues (RenderRegion *pRender, DocRect *VirtualSize, INT32 PixelSize, DialogColourInfo *RedrawColours, DocRect *ResultRect, INT32 *ResultSizeZ)
 Clears the background of the picker control, and draws the 'shadow' of the colour cube into the control, in preparation for RGB/CMYK colour slices and stuff to be drawn on top. For convenience, returns the screen area square of the cube face and the size of the Z axis as projected onscreen.
BOOL CanSetColour (IndexedColour *EditingColour)
 Called by the SetNewValue methods to determine if they are allowed to set a new value for the EditingColour. This is so they may have display-only click/drag handling when the colour is non-editable (for example, when it's a tint). This method just makes it easier for us to modify the allow-edit rulesat a later date.
static FIXED24 GetComponent (ColourGeneric *SourceDef, const INT32 ComponentID)
 Extracts the given component from a colour definition.
static BOOL MousePosInCross (DocCoord *MousePos, DocRect *Area, FIXED24 *XPos, FIXED24 *YPos)
 To check if a click near a given area has "hit" a marker cross sticking out of a side of the area.

Variables

const INT32 CROSSRADIUS = 6000
const INT32 PCROSSRADIUS = 3500
const INT32 ZSLIDERSIZE = 8000
const INT32 PATCHSIZE = 13500
static CGadgetID TintGadgetIDs []
static CGadgetID LinkGadgetIDs []
static CGadgetID OtherGadgetIDs []
static GadgetHelpInfo GadgetHelp []
static BOOL TextMayBeWrong = FALSE
 Colour Editor focus bodge thingummy Returns the input focus back to the selected document (mainframe window).
static BOOL LoseKbdFocusPending = FALSE
static BOOL LockLoseFocus = FALSE
static BOOL LoseFocusFromEditControls = FALSE
static UINT32 CurrentTypingGadget = 0
 Initialises the colour editor dialogue controls/gadgets Scope: private.


Define Documentation

#define COLOURTYPE_SHADE   ((IndexedColourType) 32)
 

Initialises the colour editor dialogue State variable to be 'unknown'. The next SetControls() call after this will set all the controls in the window, rather than only those which are known to have changed. Scope: private.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/1/95

Definition at line 963 of file coldlog.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 387 of file coldlog.cpp.

#define OPTOKEN_MAKECOLOURLOCALTOFRAME   _T("MakeColourLocalToFrame")
 

OpMakeColourLocalToFrame initialiser method.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/7/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Definition at line 11110 of file coldlog.cpp.


Function Documentation

static void CalculateHSVPickerRects DocRect VirtualSize,
INT32  PixelSize,
DocRect HueRect,
DocRect ValSatSquare
[static]
 

Calculates where the important regions are in the square HSV picker.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/2/95
Parameters:
VirtualSize - The rectangle defining the coordinate space to draw into [INPUTS]
PixelSize - The size of a pixel as mapped into the MILLIPOINT VirtualSize coordinate space; ensures things line up on display pixel boundaries.

Parameters:
HueRect - The rectangle (a strip along the bottom of VirtualSize) in [OUTPUTS] which the Hue slider should be displayed
ValSatSquare - The Square (above the hue strip) in which the value vs. Satn. square should be displayed.

Definition at line 4360 of file coldlog.cpp.

04362 {
04363     *HueRect = *VirtualSize;
04364     HueRect->hi.y = HueRect->lo.y + (CROSSRADIUS+PixelSize)*2;
04365     GridLockRect(HueRect, PixelSize);
04366 
04367     *ValSatSquare = *VirtualSize;
04368     ValSatSquare->lo.y = HueRect->hi.y + 4000;  // Above the hue slider, with a gap
04369     ValSatSquare->hi.x -= PATCHSIZE; // center within the area left by the patches
04370 
04371     INT32 SquareSize = ValSatSquare->Height();
04372     if (SquareSize > ValSatSquare->Width())
04373     {
04374         SquareSize = ValSatSquare->Width();
04375     
04376         // Center it vertically
04377         ValSatSquare->lo.y += (ValSatSquare->Height() - SquareSize) / 2;
04378         ValSatSquare->hi.y = ValSatSquare->lo.y + SquareSize;
04379     }
04380     else
04381     {
04382         // Center it horizontally
04383         ValSatSquare->lo.x += (ValSatSquare->Width() - SquareSize) / 2;
04384         ValSatSquare->hi.x = ValSatSquare->lo.x + SquareSize;
04385     }
04386 
04387     GridLockRect(ValSatSquare, PixelSize);
04388 }

BOOL CanSetColour IndexedColour EditingColour  )  [inline]
 

Called by the SetNewValue methods to determine if they are allowed to set a new value for the EditingColour. This is so they may have display-only click/drag handling when the colour is non-editable (for example, when it's a tint). This method just makes it easier for us to modify the allow-edit rulesat a later date.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/11/94
Parameters:
EditingColour - the colour to check [INPUTS]
Returns:
TRUE if you may chnage the colour, FALSE if you may not
Scope: private (ColourEditDlg, kernel.cpp)

Definition at line 6927 of file coldlog.cpp.

06928 {
06929     return(EditingColour != NULL && EditingColour->GetType() != COLOURTYPE_TINT);
06930 }

KernelDragTarget CC_IMPLEMENT_DYNCREATE ColEditorDragInfo  ,
ColourDragInformation 
 

CC_IMPLEMENT_DYNCREATE ColourEditDlg  ,
DialogOp 
 

static void DrawCubeShadowAndCalcValues RenderRegion pRender,
DocRect VirtualSize,
INT32  PixelSize,
DialogColourInfo RedrawColours,
DocRect ResultRect,
INT32 *  ResultSizeZ
[static]
 

Clears the background of the picker control, and draws the 'shadow' of the colour cube into the control, in preparation for RGB/CMYK colour slices and stuff to be drawn on top. For convenience, returns the screen area square of the cube face and the size of the Z axis as projected onscreen.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/12/94
Parameters:
pRender - The render region to render the picker in, or NULL if you want to [INPUTS] just calc the values without rendering anything. VirtualSize - The rectangle defining the coordinate space to draw into PixelSize - The size of a pixel as mapped into the MILLIPOINT VirtualSize coordinate space; ensures things line up on display pixel boundaries. RedrawColours - A pointer to a DialogColourInfo object describing OS-friendly drawing colours to be used in redrawing the control (or NULL if pRender is also NULL)
ResultRect - On return will contain the cube face rectangle [OUTPUTS] ResultSizeZ - On return will contain the projected size of the Z axis
Scope: private (static in coldlog.cpp)

See also:
ColourEditDlg::RenderPickerRGB; ColourEditDlg::RenderPickerCMYK

Definition at line 5191 of file coldlog.cpp.

05194 {
05195     DocColour Trans(COLOUR_TRANS);
05196 
05197     // Calculate the basic cube shape
05198     INT32 MaxSize = VirtualSize->Height();
05199     if (VirtualSize->Width() < MaxSize)
05200         MaxSize = VirtualSize->Width();
05201 
05202     const INT32 SizeXY = (100 * MaxSize) / 135;     // Size of the X and Y projections
05203     INT32 SizeZ  = MaxSize - SizeXY;                    // Size of the Z projection
05204 
05205     // Ensure it's a square, aligned in the left side of the available area
05206     DocRect SquareRect;
05207     SquareRect.lo.x = HalfGridLock(VirtualSize->lo.x,                   PixelSize);
05208     SquareRect.hi.x = HalfGridLock(VirtualSize->lo.x + SizeXY,          PixelSize);
05209     SquareRect.lo.y = HalfGridLock(VirtualSize->lo.y + SizeZ,           PixelSize);
05210     SquareRect.hi.y = HalfGridLock(VirtualSize->lo.y + SizeXY + SizeZ,  PixelSize);
05211 
05212     if (VirtualSize->Height() > MaxSize)
05213     {
05214         // The area we're in is higher than it is wide, so center the square vertically
05215         SquareRect.Translate(0, (VirtualSize->Height() - MaxSize) / 2);
05216     }
05217 
05218     GridLockRect(&SquareRect, PixelSize);
05219 
05220     SizeZ = HalfGridLock(SizeZ-ZSLIDERSIZE, PixelSize); // Gridlock & Leave gap at bot-rt for Z-slider drag icon
05221 
05222     if (pRender != NULL)
05223     {
05224         pRender->SaveContext();
05225 #if FALSE
05226 /*
05227         // Draw the cube 'shadow'
05228         DocColour CubeFaceGrey(168L, 168L, 168L);
05229         pRender->SetFillColour(CubeFaceGrey);
05230         pRender->DrawRect(&SquareRect);
05231 
05232         DocColour CubeFillGrey1(176L, 176L, 176L);      // **** !!!! Perhaps we should use transparent black!
05233         pRender->SetFillColour(CubeFillGrey1);
05234 
05235         // Draw the Z extent of the 'cube' - right side
05236         DocCoord BottomRight(HalfGridLock(SquareRect.hi.x + SizeZ, PixelSize),
05237                              HalfGridLock(SquareRect.lo.y - SizeZ, PixelSize));
05238 
05239         Path ZPath1;
05240         ZPath1.Initialise(12, 12);
05241         ZPath1.FindStartOfPath();
05242         ZPath1.InsertMoveTo(BottomRight);
05243         ZPath1.InsertLineTo(DocCoord(SquareRect.hi.x, SquareRect.lo.y));
05244         ZPath1.InsertLineTo(DocCoord(SquareRect.hi.x, SquareRect.hi.y));
05245         ZPath1.InsertLineTo(DocCoord(SquareRect.hi.x + SizeZ, SquareRect.hi.y - SizeZ));
05246         ZPath1.IsFilled = TRUE;
05247 
05248         pRender->DrawPath(&ZPath1);
05249 
05250 
05251         DocColour CubeFillGrey2(160L, 160L, 160L);      // **** !!!! Perhaps we should use transparent black!
05252         pRender->SetFillColour(CubeFillGrey2);
05253 
05254         // Draw the Z extent of the 'cube' - bottom side
05255         Path ZPath2;
05256         ZPath2.Initialise(12, 12);
05257         ZPath2.FindStartOfPath();
05258         ZPath2.InsertMoveTo(BottomRight);
05259         ZPath2.InsertLineTo(DocCoord(SquareRect.lo.x + SizeZ, SquareRect.lo.y - SizeZ));
05260         ZPath2.InsertLineTo(SquareRect.lo);
05261         ZPath2.InsertLineTo(DocCoord(SquareRect.hi.x, SquareRect.lo.y));
05262         ZPath2.IsFilled = TRUE;
05263 
05264         pRender->DrawPath(&ZPath2);
05265 
05266         // Draw the 3 inside-edge lines at the back of the cube
05267         DocRect BackFaceRect(SquareRect);
05268         BackFaceRect.Translate(SizeZ, -SizeZ);
05269 
05270         // Draw the 3 back edges of the cube (The front edges are added by the caller,
05271         // on top of the the colour slice square)
05272         DocColour BackEdgeGrey(144L, 144L, 144L);
05273         pRender->SetLineColour(BackEdgeGrey);
05274         pRender->SetFillColour(Trans);
05275 
05276         DocCoord TLBPoint(BackFaceRect.lo.x, BackFaceRect.hi.y);
05277         pRender->DrawLine(TLBPoint, BackFaceRect.hi);
05278         pRender->DrawLine(TLBPoint, BackFaceRect.lo);
05279         pRender->DrawLine(TLBPoint, DocCoord(SquareRect.lo.x, SquareRect.hi.y));
05280 */
05281 #else
05282         // Draw the Back Face
05283         DocRect BackFaceRect(SquareRect);
05284         BackFaceRect.Translate(SizeZ, -SizeZ);
05285 
05286         DocColour CubeFaceGrey(136L, 136L, 136L);
05287         pRender->SetFillColour(CubeFaceGrey);
05288         pRender->DrawRect(&BackFaceRect);
05289 
05290         // Draw the (Back-)Left face
05291         DocCoord BackTopLeft(HalfGridLock(SquareRect.lo.x + SizeZ, PixelSize),
05292                              HalfGridLock(SquareRect.hi.y - SizeZ, PixelSize));
05293         Path ZPath1;
05294         ZPath1.Initialise(12, 12);
05295         ZPath1.FindStartOfPath();
05296         ZPath1.InsertMoveTo(BackTopLeft);
05297         ZPath1.InsertLineTo(DocCoord(SquareRect.lo.x, SquareRect.hi.y));
05298         ZPath1.InsertLineTo(SquareRect.lo);
05299         ZPath1.InsertLineTo(DocCoord(SquareRect.lo.x + SizeZ, SquareRect.lo.y - SizeZ));
05300         ZPath1.IsFilled = TRUE;
05301 
05302         LinearFillAttribute DepthFill1;
05303         DepthFill1.Colour       = DocColour(180L, 180L, 180L);
05304         DepthFill1.EndColour    = DocColour(144L, 144L, 144L);
05305         DocCoord ThePoint(SquareRect.lo.x, BackTopLeft.y);
05306         DepthFill1.SetStartPoint(&ThePoint);
05307         DepthFill1.SetEndPoint(&BackTopLeft);
05308         DepthFill1.SetEndPoint2(NULL);
05309         pRender->SetFillGeometry(&DepthFill1, FALSE);
05310 
05311         pRender->DrawPath(&ZPath1);
05312 
05313 
05314         // Draw the (Back-)Top face
05315         Path ZPath2;
05316         ZPath2.Initialise(12, 12);
05317         ZPath2.FindStartOfPath();
05318         ZPath2.InsertMoveTo(BackTopLeft);
05319         ZPath2.InsertLineTo(DocCoord(SquareRect.hi.x + SizeZ, BackTopLeft.y));
05320         ZPath2.InsertLineTo(SquareRect.hi);
05321         ZPath2.InsertLineTo(DocCoord(SquareRect.lo.x, SquareRect.hi.y));
05322         ZPath2.IsFilled = TRUE;
05323 
05324         LinearFillAttribute DepthFill2;
05325         DepthFill2.Colour       = DocColour(182L, 182L, 182L);
05326         DepthFill2.EndColour    = DocColour(144L, 144L, 144L);
05327         ThePoint = DocCoord(BackTopLeft.x, SquareRect.hi.y);
05328         DepthFill2.SetStartPoint(&ThePoint);
05329         DepthFill2.SetEndPoint(&BackTopLeft);
05330         DepthFill2.SetEndPoint2(NULL);
05331         pRender->SetFillGeometry(&DepthFill2, FALSE);
05332 
05333         pRender->DrawPath(&ZPath2);
05334 #endif
05335 
05336         pRender->RestoreContext();
05337     }
05338 
05339     // And finally, return the useful values we've calculated
05340     *ResultRect  = SquareRect;
05341     *ResultSizeZ = SizeZ;
05342 }

static FIXED24 GetComponent ColourGeneric SourceDef,
const INT32  ComponentID
[static]
 

Extracts the given component from a colour definition.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/12/94
Parameters:
SourceDef - A Generic colour definition to extract a component from [INPUTS] ComponentID - The component to extract [1..4]
Scope: private (static in kernel.cpp)

Definition at line 7575 of file coldlog.cpp.

07576 {
07577     switch(ComponentID)
07578     {
07579         case 1:
07580             return(SourceDef->Component1);
07581 
07582         case 2:
07583             return(SourceDef->Component2);
07584 
07585         case 3:
07586             return(SourceDef->Component3);
07587     }
07588 
07589     // Assume any other componentID value is for component 4
07590     return(SourceDef->Component4);
07591 }

INT32 GetSliderGap INT32  RectHeight,
INT32  Num
 

Definition at line 500 of file coldlog.cpp.

00501 {
00502     INT32 SliderGap = (RectHeight / Num) - GetSliderHeight(RectHeight, Num);
00503     if (SliderGap < 4000)
00504         SliderGap = 4000;
00505     return SliderGap;
00506 }

INT32 GetSliderHeight INT32  RectHeight,
INT32  Num
 

Definition at line 492 of file coldlog.cpp.

00493 {
00494     INT32 AvailableHeight = (RectHeight / Num) - 4000; // subtract the minimum gap size
00495     if (AvailableHeight<2000)
00496         AvailableHeight = 2000; // minimum height
00497     return (AvailableHeight>18000)?18000:AvailableHeight;
00498 }

static void GridLockRect DocRect TheRect,
INT32  GridSize
[static]
 

GridLocks all 4 coordinates of the rectangle using HalfGridLock.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/94
Parameters:
TheRect - A MILLIPOINT DocRect to be grid-locked [INPUTS] GridSize - the size of the grid to lock to, in millipoints
TheRect is updated as appropriate [OUTPUTS]
Scope: private (to ColourEditDlg rendering routines)

Definition at line 2407 of file coldlog.cpp.

02408 {
02409     TheRect->lo.x = HalfGridLock(TheRect->lo.x, GridSize);
02410     TheRect->lo.y = HalfGridLock(TheRect->lo.y, GridSize);
02411     TheRect->hi.x = HalfGridLock(TheRect->hi.x, GridSize);
02412     TheRect->hi.y = HalfGridLock(TheRect->hi.y, GridSize);
02413 }

INT32 HalfGridLock INT32  Position,
INT32  GridSize
[inline]
 

Grid-locks a given plotting poisition to lie over a grid (usually the output device-pixel grid). The result is shifted by half the grid size to grid-lock to the _center_ of a pixel rather than the edges.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/94
Parameters:
Position - The X/Y position, in millipoints [INPUTS] GridSize - the size of the grid to lock to, in millipoints
Returns:
Position, locked (by rounding) to a grid of the given size, and offset by half a grid.
Scope: private (to ColourEditDlg rendering routines)

Definition at line 2359 of file coldlog.cpp.

02360 {
02361     // By truncating down to the nearest grid point, and adding half the grid value,
02362     // we achieve rounding to the nearest offset-grid position. 
02363 
02364     // NOTE:
02365     // The original algorithm incorrectly rounded negative numbers towards
02366     // zero. Negative numbers should be rounded towards negative infinity.
02367     // The algorithm has been corrected by always rounding a positive number
02368     // and restoring the original sign of the number after rounding.
02369 
02370     BOOL bNegative = FALSE;             // Assume the number is positive
02371 
02372     if (Position < 0)                   // If the number if not positive
02373     {                                   // note the fact and make positive
02374         bNegative   = TRUE;
02375         Position    = -Position;
02376     }
02377 
02378     Position -= Position % GridSize;
02379     Position += GridSize / 2;
02380 
02381     if (bNegative)                      // If the number was negative
02382         Position = -Position;           // restore the sign
02383 
02384     return (Position);
02385 }

static BOOL MousePosInCross DocCoord MousePos,
DocRect Area,
FIXED24 XPos,
FIXED24 YPos
[static]
 

To check if a click near a given area has "hit" a marker cross sticking out of a side of the area.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/95
Parameters:
MousePos - Points to the mouse position [INPUTS]
Area - Points to the picker area in which the cross resides

XPos - A value between 0.0 and 1.0 indicating the center position of the cross in the X direction across the given area. If NULL, the value 0.5 will be used

YPos - A value between 0.0 and 1.0 indicating the center position of the cross in the Y direction up the given area. If NULL, the value 0.5 will be used

Definition at line 7618 of file coldlog.cpp.

07619 {
07620     FIXED24 HalfWay(0.5);
07621 
07622     if (XPos == NULL)   XPos = &HalfWay;
07623     if (YPos == NULL)   YPos = &HalfWay;
07624 
07625     DocRect CrossRect(-CROSSRADIUS, -CROSSRADIUS, CROSSRADIUS, CROSSRADIUS);
07626 
07627     INT32 TransX = Area->lo.x + (INT32) ((double)Area->Width() * XPos->MakeDouble());
07628     INT32 TransY = Area->lo.y + (INT32) ((double)Area->Height() * YPos->MakeDouble());
07629 
07630     CrossRect.Translate(TransX, TransY);
07631 
07632     return(CrossRect.ContainsCoord(*MousePos));
07633 }

static void RenderPickerSquare RenderRegion pRender,
DocRect SquareRect,
ColourGeneric BaseCol,
ColourGeneric MidCol,
ColourGeneric TopCol,
ColourModel  TheColourModel,
UINT32  TransType
[static]
 

Redraws the front face of the RGB/CMY colour cube pickers. This can redraw an axis-aligned planar cut through the RGB/CMY colourspaces, if the input parameters are correct.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/12/94
Parameters:
pRender - The render region to render the picker in [INPUTS] SquareRect - The rectangle to fill with the RGB/CMYK cube slice BaseCol - The colour to use on the base (Z axis) MidCol - The second colour (X axis) TopCol - The third colour (Y axis) TheColourModel - COLOURMODEL_RGBT or COLOURMODEL_CMYK TransType - 3 (stain/additive) for RGB, 2 (stain/filtering) for CMY
Scope: private (to kernel.cpp)

See also:
ColourEditDlg::RenderControl; ColourEditDlg::RenderPickerDefault

Definition at line 5093 of file coldlog.cpp.

05096 {
05097     pRender->SaveContext();     // Save the current rendering context
05098 
05099     // First, render the BaseSquare in BaseColour
05100     DocColour BaseFillCol(TheColourModel, BaseCol);
05101     pRender->SetFillColour(BaseFillCol);
05102     pRender->DrawRect(SquareRect);
05103 
05104 
05105     // Next, create a path for the rectangle so we can fill it with grad fills
05106     Path SquarePath;
05107     SquarePath.Initialise(12, 12);
05108     SquarePath.FindStartOfPath();
05109 
05110     SquarePath.InsertMoveTo(SquareRect->lo);
05111     SquarePath.InsertLineTo(DocCoord(SquareRect->hi.x, SquareRect->lo.y));
05112     SquarePath.InsertLineTo(SquareRect->hi);
05113     SquarePath.InsertLineTo(DocCoord(SquareRect->lo.x, SquareRect->hi.y));
05114     SquarePath.IsFilled = TRUE;
05115 
05116     // Create a vertical transparent fill from 100% transparent to 0% transparent
05117     LinearTranspFillAttribute SquareTransFill1;
05118     SquareTransFill1.Transp     = 0;
05119     SquareTransFill1.EndTransp  = 255;
05120     SquareTransFill1.TranspType = TransType;
05121     DocCoord ThePoint(SquareRect->hi.x, (SquareRect->lo.y + SquareRect->hi.y) / 2);
05122     SquareTransFill1.SetStartPoint(&ThePoint);
05123     ThePoint = DocCoord(SquareRect->lo.x, (SquareRect->lo.y + SquareRect->hi.y) / 2);
05124     SquareTransFill1.SetEndPoint(&ThePoint);
05125     SquareTransFill1.SetEndPoint2(NULL);
05126 
05127     DocColour MidFillCol(TheColourModel, MidCol);       // And flat-fill with the trans fill
05128     pRender->SetFillColour(MidFillCol);
05129 
05130     pRender->SetTranspFillGeometry(&SquareTransFill1, FALSE);
05131 
05132     pRender->DrawPath(&SquarePath);     // Render the Square
05133 
05134 
05135     LinearTranspFillAttribute SquareTransFill2;
05136     SquareTransFill2.Transp     = 0;
05137     SquareTransFill2.EndTransp  = 255;
05138     SquareTransFill2.TranspType = TransType;
05139 
05140     ThePoint = DocCoord((SquareRect->lo.x + SquareRect->hi.x) / 2, SquareRect->hi.y);
05141     SquareTransFill2.SetStartPoint(&ThePoint);
05142     ThePoint = DocCoord((SquareRect->lo.x + SquareRect->hi.x) / 2, SquareRect->lo.y);
05143     SquareTransFill2.SetEndPoint(&ThePoint);
05144     SquareTransFill2.SetEndPoint2(NULL);
05145 
05146     DocColour TopFillCol(TheColourModel, TopCol);       // And flat-fill with the trans fill
05147     pRender->SetFillColour(TopFillCol);
05148 
05149     pRender->SetTranspFillGeometry(&SquareTransFill2, FALSE);
05150     
05151     pRender->DrawPath(&SquarePath);     // Render the Square
05152 
05153 
05154     pRender->RestoreContext();
05155 }


Variable Documentation

const INT32 CROSSRADIUS = 6000
 

Definition at line 393 of file coldlog.cpp.

UINT32 CurrentTypingGadget = 0 [static]
 

Initialises the colour editor dialogue controls/gadgets Scope: private.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/6/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1211 of file coldlog.cpp.

GadgetHelpInfo GadgetHelp[] [static]
 

Initial value:

 
{
    { _R(IDC_EDIT_DROPMENU),    _R(IDS_EDITBH_MENU) },
    { _R(IDC_EDIT_COLMODEL),    _R(IDS_EDITBH_COLMODEL) },
    { _R(IDC_EDIT_NAMEMENU),    _R(IDS_EDITBH_NAME) },
    { _R(IDC_EDIT_COLTYPE),     _R(IDS_EDITBH_COLTYPE) },
    { _R(IDC_EDIT_INHERIT1),    _R(IDS_EDITBH_INHERIT) },
    { _R(IDC_EDIT_INHERIT2),    _R(IDS_EDITBH_INHERIT) },
    { _R(IDC_EDIT_INHERIT3),    _R(IDS_EDITBH_INHERIT) },
    { _R(IDC_EDIT_INHERIT4),    _R(IDS_EDITBH_INHERIT) },
    { _R(IDC_EDIT_PARENTCOL),   _R(IDS_EDITBH_PARENTCOL) },
    { _R(IDC_EDIT_3D),          _R(IDS_EDITBH_3D) },
    { _R(IDC_EDIT_MAKESTYLE),   _R(IDS_EDITBH_MAKESTYLE) },
    { _R(IDC_EDIT_NOCOLOUR),    _R(IDS_COLBAR_HNOCOLOUR) },
    { _R(IDC_EDIT_LINEFILL),    _R(IDS_EDITBH_LINEFILL) },
    { _R(IDC_EDIT_216ONLY),     _R(IDS_EDITBH_216ONLY)  },
    { _R(IDC_MAKE_LOCAL),       _R(IDS_EDITBH_MAKE_LOCAL)   },
    { _R(IDC_EDIT_RENAME),      _R(IDS_COLBAR_HNOCOLOUR) },
    { _R(IDC_COLOURPICKER),     _R(IDS_STATICCOLOURPICKERTOOLHELP) },
    { 0, 0 }                            
}

Definition at line 467 of file coldlog.cpp.

CGadgetID LinkGadgetIDs[] [static]
 

Initial value:

    
{
    _R(IDC_EDIT_INHERITNAME),           
    _R(IDC_EDIT_INHERIT1),
    _R(IDC_EDIT_INHERIT2),
    _R(IDC_EDIT_INHERIT3),
    _R(IDC_EDIT_INHERIT4),
    0
}

Definition at line 417 of file coldlog.cpp.

BOOL LockLoseFocus = FALSE [static]
 

Definition at line 527 of file coldlog.cpp.

BOOL LoseFocusFromEditControls = FALSE [static]
 

Definition at line 530 of file coldlog.cpp.

BOOL LoseKbdFocusPending = FALSE [static]
 

Definition at line 524 of file coldlog.cpp.

CGadgetID OtherGadgetIDs[] [static]
 

Definition at line 428 of file coldlog.cpp.

const INT32 PATCHSIZE = 13500
 

Definition at line 396 of file coldlog.cpp.

const INT32 PCROSSRADIUS = 3500
 

Definition at line 394 of file coldlog.cpp.

BOOL TextMayBeWrong = FALSE [static]
 

Colour Editor focus bodge thingummy Returns the input focus back to the selected document (mainframe window).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/95

Definition at line 521 of file coldlog.cpp.

CGadgetID TintGadgetIDs[] [static]
 

Initial value:

    
{
    _R(IDC_EDIT_TINTNAME),              
    _R(IDC_EDIT_TINT),
    _R(IDC_EDIT_TINTPERCENT),

    _R(IDC_EDIT_SHADE),
    _R(IDC_EDIT_SHADEPERCENT),
    0
}

Definition at line 405 of file coldlog.cpp.

const INT32 ZSLIDERSIZE = 8000
 

Definition at line 395 of file coldlog.cpp.


Generated on Sat Nov 10 03:49:06 2007 for Camelot by  doxygen 1.4.4