ccolbar.cpp File Reference

(r1785/r1528)

#include "camtypes.h"
#include "camelot.h"
#include "ccolbar.h"
#include "colcontx.h"
#include "coldlog.h"
#include "colmsg.h"
#include "colormgr.h"
#include "colourix.h"
#include "colpick.h"
#include "comattrmsg.h"
#include "devcolor.h"
#include "dragmgr.h"
#include "keypress.h"
#include "lineattr.h"
#include "linwthop.h"
#include "camframe.h"
#include "opgrad.h"
#include "palman.h"
#include "sgcolour.h"
#include "statline.h"
#include "cartprov.h"

Go to the source code of this file.

Classes

struct  ColBarDefaultSizeInfo

Defines

#define NoColourSize   (CellSize)
#define EditButtonSizeX   (CellSize)
#define EditButtonSizeY   (CellSize)
#define new   CAM_DEBUG_NEW
#define new   CAM_DEBUG_NEW

Functions

DocumentSetCurrentDoc (void)
 The ColourBar works exclusively on the SELECTED Doc. Thus, on entry to any of its routines which call routines outside this file (ccolbar.cpp), it must ensure that CurrentDoc is equal to SelectedDoc. This local macro inline does this, and returns the old setting of CurrentDoc so that the caller can restore the previous CurrentDoc on exit.
void RestoreCurrentDoc (Document *OldCurrentDoc)
 The ColourBar works exclusively on the SELECTED Doc. After calling SetCurrentDoc on entry to a routine, you should call RestoreCurrentDoc on exit to restore the old current document./.
static void Paint3dPlinth (wxDC *pDC, wxRect *rect, BOOL PlinthOut)
 Draws a rectangular 3d plinth around the edge of the given rectangle.
BOOL GetModifierKeyState (void)
 Handle resizing of our parent - ask for the amount of client space we want to occupy. This is done by setting a member variable and then calling up to a base class method.Checks if the modifier key for the colour bar's push-the-strip mode is down. This is an inline macro to make it easy to change the key at later date. (Now uses KeyPress::IsAlternativePressed).
BOOL ShiftIsDown (void)
 Checks if SHIFT is held down - used to convert shift-left-clicks into "right clicks". (Now uses KeyPress::IsAdjustPressed() to determine this).

Variables

const INT32 MAXDEFAULTSIZES = 4
ColBarDefaultSizeInfo ColBarDefaultSize [MAXDEFAULTSIZES]
static INT32 DefaultSizeIndex = 2
 Specifies the 'size' at which the colour bar is displayed, with values of:.
static INT32 ColourCellsDivided = 0
 If set to 0, colour cells in the colour line will butt up against each other. If set to 1, a single pixel grey line will be used to divide the cells, to make them easier to distinguish.
const INT32 SCROLLBUTTON_LEFT = 0
const INT32 SCROLLBUTTON_RIGHT = 1
const INT32 CX_BORDER = 2
const INT32 CY_BORDER = 0
const INT32 InterControlGap = 2
const INT32 ButtonWidth = 11
static INT32 BarHeight = 25
static INT32 CellSize = 16
static INT32 ScrollHeight = 9
const INT32 CLICKED_NOTHING = 10000
const INT32 CLICKED_INDICATORS = 10001
const INT32 CLICKED_LEFTSCROLL = 10002
const INT32 CLICKED_RIGHTSCROLL = 10003
const INT32 CLICKED_SCROLLBAR = 10004
const INT32 CLICKED_SCROLLBARLEFT = 10005
const INT32 CLICKED_SCROLLBARRIGHT = 10006
const INT32 CLICKED_SCROLLSTRIP = 10007
const INT32 CLICKED_NOCOLOURCELL = 10008
const INT32 CLICKED_EDITBUTTON = 10009
const INT32 CLICKED_NEWBUTTON = 10010
const INT32 CELLINDEX_NOCOLOURCELL = -1
const INT32 CELLINDEX_NOCELL = -2


Define Documentation

#define EditButtonSizeX   (CellSize)
 

Definition at line 242 of file ccolbar.cpp.

#define EditButtonSizeY   (CellSize)
 

Definition at line 243 of file ccolbar.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 5406 of file ccolbar.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 5406 of file ccolbar.cpp.

#define NoColourSize   (CellSize)
 

Definition at line 239 of file ccolbar.cpp.


Function Documentation

BOOL GetModifierKeyState void   )  [inline]
 

Handle resizing of our parent - ask for the amount of client space we want to occupy. This is done by setting a member variable and then calling up to a base class method.Checks if the modifier key for the colour bar's push-the-strip mode is down. This is an inline macro to make it easy to change the key at later date. (Now uses KeyPress::IsAlternativePressed).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/94
Returns:
TRUE if the ColourBar push-mode modifier key ('Alt'ernative) is down
Scope: private (to ccolbar.cpp)

See also:
KeyPress::IsAlternativePressed

Definition at line 4472 of file ccolbar.cpp.

04473 {
04474     return(KeyPress::IsAlternativePressed());
04475 }

static void Paint3dPlinth wxDC *  pDC,
wxRect *  rect,
BOOL  PlinthOut
[static]
 

Draws a rectangular 3d plinth around the edge of the given rectangle.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/6/94
Parameters:
pDC - The DC to draw into [INPUTS] rect - The rectangle to draw around the OUTSIDE of with a plinth PlinthOut - FALSE to indent, TRUE to pop-out the plinth.
- [OUTPUTS]
Returns:
-

Definition at line 1723 of file ccolbar.cpp.

01724 {
01725     wxPen Black(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
01726     wxPen White(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
01727 
01728     wxPoint Points[3];
01729     pDC->SetPen((PlinthOut) ? White : Black);
01730     Points[0] = wxPoint(rect->x, rect->GetBottom());
01731     Points[1] = wxPoint(rect->x, rect->y);
01732     Points[2] = wxPoint(rect->x + rect->width, rect->y);
01733     pDC->DrawLines(3, Points);
01734 
01735     pDC->SetPen((PlinthOut) ? Black : White);
01736     Points[0] = wxPoint(rect->GetRight(), rect->y + 1); // Ensure corner pixel is correct
01737     Points[1] = wxPoint(rect->GetRight(), rect->GetBottom());
01738     Points[2] = wxPoint(rect->x, rect->GetBottom());
01739     pDC->DrawLines(3, Points);
01740 
01741     pDC->SetPen(wxNullPen);
01742 }

void RestoreCurrentDoc Document OldCurrentDoc  )  [inline]
 

The ColourBar works exclusively on the SELECTED Doc. After calling SetCurrentDoc on entry to a routine, you should call RestoreCurrentDoc on exit to restore the old current document./.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Parameters:
The old current document to restore [INPUTS]
- [OUTPUTS]
Returns:
-
Scope: private (to winoil.cpp)
See also:
SetCurrentDoc

Definition at line 334 of file ccolbar.cpp.

00335 {
00336     if (OldCurrentDoc != NULL)
00337         OldCurrentDoc->SetCurrent();
00338 }

Document* SetCurrentDoc void   )  [inline]
 

The ColourBar works exclusively on the SELECTED Doc. Thus, on entry to any of its routines which call routines outside this file (ccolbar.cpp), it must ensure that CurrentDoc is equal to SelectedDoc. This local macro inline does this, and returns the old setting of CurrentDoc so that the caller can restore the previous CurrentDoc on exit.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The old Current Document
Scope: private (to winoil.cpp)
See also:
RestoreCurrentDoc

Definition at line 302 of file ccolbar.cpp.

00303 {
00304     Document *OldCurrentDoc = Document::GetCurrent();
00305     Document *NewCurrentDoc = Document::GetSelected();
00306 
00307     if (NewCurrentDoc != NULL && NewCurrentDoc != OldCurrentDoc)
00308         NewCurrentDoc->SetCurrent();
00309 
00310     return(OldCurrentDoc);
00311 }

BOOL ShiftIsDown void   )  [inline]
 

Checks if SHIFT is held down - used to convert shift-left-clicks into "right clicks". (Now uses KeyPress::IsAdjustPressed() to determine this).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/11/94
Returns:
TRUE if the 'Adjust' (shift) key is held is down at present
Scope: private (to ccolbar.cpp)

See also:
KeyPress::IsAdjustPressed

Definition at line 4496 of file ccolbar.cpp.

04497 {
04498     return(KeyPress::IsAdjustPressed());
04499 }


Variable Documentation

INT32 BarHeight = 25 [static]
 

Definition at line 234 of file ccolbar.cpp.

const INT32 ButtonWidth = 11
 

Definition at line 228 of file ccolbar.cpp.

const INT32 CELLINDEX_NOCELL = -2
 

Definition at line 262 of file ccolbar.cpp.

const INT32 CELLINDEX_NOCOLOURCELL = -1
 

Definition at line 261 of file ccolbar.cpp.

INT32 CellSize = 16 [static]
 

Definition at line 235 of file ccolbar.cpp.

const INT32 CLICKED_EDITBUTTON = 10009
 

Definition at line 256 of file ccolbar.cpp.

const INT32 CLICKED_INDICATORS = 10001
 

Definition at line 248 of file ccolbar.cpp.

const INT32 CLICKED_LEFTSCROLL = 10002
 

Definition at line 249 of file ccolbar.cpp.

const INT32 CLICKED_NEWBUTTON = 10010
 

Definition at line 257 of file ccolbar.cpp.

const INT32 CLICKED_NOCOLOURCELL = 10008
 

Definition at line 255 of file ccolbar.cpp.

const INT32 CLICKED_NOTHING = 10000
 

Definition at line 247 of file ccolbar.cpp.

const INT32 CLICKED_RIGHTSCROLL = 10003
 

Definition at line 250 of file ccolbar.cpp.

const INT32 CLICKED_SCROLLBAR = 10004
 

Definition at line 251 of file ccolbar.cpp.

const INT32 CLICKED_SCROLLBARLEFT = 10005
 

Definition at line 252 of file ccolbar.cpp.

const INT32 CLICKED_SCROLLBARRIGHT = 10006
 

Definition at line 253 of file ccolbar.cpp.

const INT32 CLICKED_SCROLLSTRIP = 10007
 

Definition at line 254 of file ccolbar.cpp.

ColBarDefaultSizeInfo ColBarDefaultSize[MAXDEFAULTSIZES]
 

Initial value:

 
{
    {12, 0},    
    {16, 0},    
    {16, 9},    
    {24, 11}    
}

Definition at line 173 of file ccolbar.cpp.

INT32 ColourCellsDivided = 0 [static]
 

If set to 0, colour cells in the colour line will butt up against each other. If set to 1, a single pixel grey line will be used to divide the cells, to make them easier to distinguish.

Preference: ColourCellsDivided Section: Displays Range: 0 (off) or 1 (on)

Definition at line 216 of file ccolbar.cpp.

const INT32 CX_BORDER = 2
 

Definition at line 224 of file ccolbar.cpp.

const INT32 CY_BORDER = 0
 

Definition at line 225 of file ccolbar.cpp.

INT32 DefaultSizeIndex = 2 [static]
 

Specifies the 'size' at which the colour bar is displayed, with values of:.

Preference: ColourBarMode Section: Displays Range: 0..3

MonoOn 0 Small 1 Medium, no scrollbar 2 Medium with scrollbar (default) 3 Large MonoOff

Notes: Normal preference, available from the options dialogue.

See also:
ColourEditDlg

Definition at line 202 of file ccolbar.cpp.

const INT32 InterControlGap = 2
 

Definition at line 227 of file ccolbar.cpp.

const INT32 MAXDEFAULTSIZES = 4
 

Definition at line 172 of file ccolbar.cpp.

const INT32 SCROLLBUTTON_LEFT = 0
 

Definition at line 221 of file ccolbar.cpp.

const INT32 SCROLLBUTTON_RIGHT = 1
 

Definition at line 222 of file ccolbar.cpp.

INT32 ScrollHeight = 9 [static]
 

Definition at line 236 of file ccolbar.cpp.


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