OILVerticalRuler Class Reference

#include <oilruler.h>

Inheritance diagram for OILVerticalRuler:

OILRuler List of all members.

Public Member Functions

 OILVerticalRuler ()
 Creates an OILVerticalRuler object.
virtual BOOL PostCreate ()
 Called from the base class Create()- does nothing at the moment.
void CalcPosFromParentClient (WinRect *lpRect)
 Called by CCamView when its size changes, so it knows where to reposition the CVertical ruler.
void ScrollRuler (INT32 amount)
 Scroll the ruler.
virtual BOOL DrawMajorGraticule (OilCoord GratOilPos, LPCTSTR str)
 Draw a major graticule on the horizontal ruler Note: Must be called from within the scope of the OILRuler::OnPaint() as it is this function which is responsible for creating a DC and selecting the correct objects into it.

Protected Member Functions

virtual BOOL StartDrag (UINT32 nFlags, wxPoint point)
 Sends a start vertical guideline drag message.
virtual BOOL IsHorizontal ()

Detailed Description

Definition at line 334 of file oilruler.h.


Constructor & Destructor Documentation

OILVerticalRuler::OILVerticalRuler  ) 
 

Creates an OILVerticalRuler object.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/3/94

Definition at line 1813 of file oilruler.cpp.

01814 { 
01815 }


Member Function Documentation

void OILVerticalRuler::CalcPosFromParentClient WinRect lpRect  ) 
 

Called by CCamView when its size changes, so it knows where to reposition the CVertical ruler.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
A long pointer to a rectangle which describes the dimensions of the client [INPUTS] area of the window containing the scroller.
Changes lpRect to the position a vretical rulerr would occupy [OUTPUTS] normally, ie. along the left side of the owning window.

Definition at line 1890 of file oilruler.cpp.

01891 {
01892     WinRect parentRect;
01893     parentRect = m_pOwnerView->GetParentFrame()->GetClientRect();
01894 
01895     lpRect->x   = parentRect.x;
01896     lpRect->y    = parentRect.y  + RulerWidth;
01897     lpRect->SetRightEx(parentRect.x + RulerWidth);
01898     lpRect->SetBottomEx(parentRect.GetBottomEx()); //+1);
01899 }

BOOL OILVerticalRuler::DrawMajorGraticule OilCoord  GratOilPos,
LPCTSTR  str
[virtual]
 

Draw a major graticule on the horizontal ruler Note: Must be called from within the scope of the OILRuler::OnPaint() as it is this function which is responsible for creating a DC and selecting the correct objects into it.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/9/95
Parameters:
GratOilPos - position of graticule on ruler in OilCoords (y ignored) [INPUTS] pGratLabel - label for the graticule
Returns:
FALSE if fails

Reimplemented from OILRuler.

Definition at line 1916 of file oilruler.cpp.

01917 {
01918     ERROR2IF(str          ==NULL,FALSE,"OILVerticalRuler::DrawMajorGraticule() - pGrtaLabel==NULL");
01919     ERROR2IF(pPaintDC     ==NULL,FALSE,"OILVerticalRuler::DrawMajorGraticule() - pPaintDC==NULL");
01920     ERROR2IF(pPaintDocView==NULL,FALSE,"OILVerticalRuler::DrawMajorGraticule() - pPaintDocView==NULL");
01921 
01922     // convert to ruler relative win coords
01923     WinCoord GratWinPos = GratOilPos.ToWin(pPaintDocView);
01924     GratWinPos -= RulerToDocOffset;
01925 
01926     wxString Text(str);
01927 
01928     // get width of gap for text
01929     INT32 TextLen  = Text.Length();
01930     INT32 GapWidth = CharWidth*max(2,TextLen)+1;        // +1 for gap to right (left already included)
01931 
01932     // draw the major graticule in 2 halves with a gap for the text between
01933     INT32 GratLen = min(MAJOR_GRAT_LEN,RenderWidth-(GapWidth+1));
01934     WinRect GratWinRect(RenderWidth-GratLen, GratWinPos.y-1, RenderWidth, GratWinPos.y);
01935     pPaintDC->DrawRectangle(GratWinRect);
01936 
01937     // draw the graticule label (centred about grat pos)
01938     wxSize TextSize(0,0);
01939     pPaintDC->GetTextExtent(Text, &TextSize.x, &TextSize.y);
01940     INT32   TextWidth = TextSize.x+1;
01941     INT32   Offset    = (GapWidth-TextWidth)/2;                 // offset to centre text in text gap (if proportional font)
01942     INT32   Textx     = RenderWidth-GratLen-(TextWidth+Offset);
01943     INT32   Texty     = GratWinPos.y-TextSize.y/2-1;
01944     pPaintDC->DrawText(Text, Textx, Texty);                     // actual digits drawn 1 pixel beyond, and 2 pixels below this point
01945 
01946     return TRUE;
01947 }

virtual BOOL OILVerticalRuler::IsHorizontal  )  [inline, protected, virtual]
 

Reimplemented from OILRuler.

Definition at line 349 of file oilruler.h.

00349 { return FALSE ;};

BOOL OILVerticalRuler::PostCreate void   )  [virtual]
 

Called from the base class Create()- does nothing at the moment.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/3/94
Returns:
FALSE if fails

Reimplemented from OILRuler.

Definition at line 1827 of file oilruler.cpp.

01828 { 
01829     return TRUE;
01830 }

void OILVerticalRuler::ScrollRuler INT32  amount  ) 
 

Scroll the ruler.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/3/94
Returns:
-

Definition at line 1842 of file oilruler.cpp.

01843 { 
01844     WinRect ClipRect;
01845     ClipRect = GetClientRect();
01846 //  ClipRect.y+=1;
01847 //  ClipRect.SetHeight(ClipRect.GetHeight()-2);
01848 
01849     ScrollWindow(0, amount, &ClipRect);
01850     Update();
01851 }

BOOL OILVerticalRuler::StartDrag UINT32  nFlags,
wxPoint  point
[protected, virtual]
 

Sends a start vertical guideline drag message.

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/3/94
Returns:
FALSE if fails

Reimplemented from OILRuler.

Definition at line 1863 of file oilruler.cpp.

01864 { 
01865     NewGuidelineParam.Method    = GUIDELINEOPMETHOD_NEW_DRAG;
01866     NewGuidelineParam.Type      = GUIDELINE_VERT;
01867 
01868     String_256 OpToken(OPTOKEN_GUIDELINE);
01869 
01870     if (m_pOwnerView != NULL)
01871         m_pOwnerView->InvokeDragOp(&OpToken, &NewGuidelineParam, nFlags, point);
01872 
01873     return TRUE;
01874 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:57:22 2007 for Camelot by  doxygen 1.4.4