#include <oilruler.h>
Inheritance diagram for OILHorizontalRuler:
Public Member Functions | |
OILHorizontalRuler () | |
Creates an OILHorizontalRuler object. | |
~OILHorizontalRuler () | |
destructor for OILHorizontalRuler object - delete the legend label;. | |
virtual BOOL | PostCreate () |
Called from the base class Create() to create the legend label. | |
void | CalcPosFromParentClient (WinRect *lpRect) |
Called by CCamView when its size changes, so it knows where to reposition the CHorzScroller. | |
void | ScrollRuler (INT32 amount) |
Scroll the ruler. | |
virtual void | ShowRuler (BOOL show) |
Shows or hides this 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. | |
BOOL | PositionLegend () |
Ask the Legend Label to position itself. | |
BOOL | SetLegendText (StringBase *pText) |
Ask the Legend Label to position itself. | |
LegendLabel * | GetpLegendLabel () |
Protected Member Functions | |
virtual BOOL | StartDrag (UINT32 nFlags, wxPoint point) |
StartDrag function . | |
virtual BOOL | IsHorizontal () |
Private Attributes | |
LegendLabel * | pLegend |
Friends | |
class | LegendLabel |
Definition at line 297 of file oilruler.h.
|
Creates an OILHorizontalRuler object.
Definition at line 1581 of file oilruler.cpp.
|
|
destructor for OILHorizontalRuler object - delete the legend label;.
Definition at line 1595 of file oilruler.cpp.
|
|
Called by CCamView when its size changes, so it knows where to reposition the CHorzScroller.
Definition at line 1683 of file oilruler.cpp. 01684 { 01685 WinRect parentRect; 01686 parentRect = m_pOwnerView->GetParentFrame()->GetClientRect(); 01687 01688 lpRect->x = parentRect.x + RulerWidth; 01689 lpRect->y = parentRect.y; 01690 lpRect->SetRightEx(parentRect.GetRightEx()); //+1); 01691 lpRect->SetBottomEx(parentRect.y + RulerWidth); 01692 01693 }
|
|
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.
Reimplemented from OILRuler. Definition at line 1710 of file oilruler.cpp. 01711 { 01712 ERROR2IF(str ==NULL,FALSE,"OILHorizontalRuler::DrawMajorGraticule() - pGrtaLabel==NULL"); 01713 ERROR2IF(pPaintDC ==NULL,FALSE,"OILHorizontalRuler::DrawMajorGraticule() - pPaintDC==NULL"); 01714 ERROR2IF(pPaintDocView==NULL,FALSE,"OILHorizontalRuler::DrawMajorGraticule() - pPaintDocView==NULL"); 01715 01716 // convert to ruler relative win coords 01717 WinCoord GratWinPos = GratOilPos.ToWin(pPaintDocView); 01718 GratWinPos -= RulerToDocOffset; 01719 01720 // draw the major graticule in 2 halves with a gap for the text between 01721 INT32 GratLen = MAJOR_GRAT_LEN; 01722 WinRect GratWinRect(GratWinPos.x, RenderWidth-MAJOR_GRAT_LEN, GratWinPos.x+1, RenderWidth); 01723 pPaintDC->DrawRectangle(GratWinRect); 01724 01725 // draw the graticule label (centred about grat pos) 01726 wxSize TextSize(0,0); 01727 wxString Text(str); 01728 pPaintDC->GetTextExtent(Text, &TextSize.x, &TextSize.y); 01729 01730 INT32 Textx = GratWinPos.x-TextSize.x/2; // centre text about grat (+1 for gap to right - left inclusive) 01731 INT32 Texty = RenderWidth-(GratLen+TextSize.y); 01732 pPaintDC->DrawText(Text, Textx, Texty); // actual digits drawn 1 pixel beyond, and 2 pixels below this point 01733 01734 return TRUE; 01735 }
|
|
Definition at line 316 of file oilruler.h. 00316 { return pLegend; }
|
|
Reimplemented from OILRuler. Definition at line 320 of file oilruler.h. 00320 { return TRUE ;};
|
|
Ask the Legend Label to position itself.
Definition at line 1747 of file oilruler.cpp. 01748 { 01749 // ERROR2IF(pLegend==NULL,FALSE,"OILHorizontalRuler::PositionLegend() - pLegend==NULL"); 01750 if (pLegend==NULL) 01751 { 01752 TRACE( _T("This should never be NULL but is regularly on Win95 implying the creation order is wrong\n")); 01753 return FALSE; 01754 } 01755 01756 return pLegend->PositionLegend(); 01757 }
|
|
Called from the base class Create() to create the legend label.
Reimplemented from OILRuler. Definition at line 1614 of file oilruler.cpp. 01615 { 01616 pLegend = new LegendLabel; 01617 if (pLegend == NULL) 01618 return FALSE; 01619 01620 // pLegend->Create(this, -1); 01621 pLegend->Create(this, m_pOwnerView->GetParentFrame(), -1); 01622 01623 return TRUE; 01624 }
|
|
Scroll the ruler.
Definition at line 1635 of file oilruler.cpp. 01636 { 01637 WinRect ClipRect; 01638 ClipRect = GetClientRect(); 01639 // ClipRect.x+=1; 01640 // ClipRect.SetWidth(ClipRect.GetWidth()-2); 01641 01642 ScrollWindow(amount, 0, &ClipRect); 01643 Update(); 01644 }
|
|
Ask the Legend Label to position itself.
Definition at line 1769 of file oilruler.cpp. 01770 { 01771 // ERROR2IF(pLegend==NULL,FALSE,"OILHorizontalRuler::SetLegendText() - pLegend==NULL"); 01772 if (pLegend==NULL) 01773 { 01774 TRACE( _T("This should never be NULL but is regularly on Win95 implying the creation order is wrong\n")); 01775 return FALSE; 01776 } 01777 01778 return pLegend->SetLegendText(pText); 01779 }
|
|
Shows or hides this ruler.
Reimplemented from OILRuler. Definition at line 1791 of file oilruler.cpp. 01792 { 01793 OILRuler::ShowRuler(show); 01794 if (pLegend) 01795 pLegend->ShowLabel(show); 01796 }
|
|
StartDrag function .
Reimplemented from OILRuler. Definition at line 1656 of file oilruler.cpp. 01657 { 01658 NewGuidelineParam.Method = GUIDELINEOPMETHOD_NEW_DRAG; 01659 NewGuidelineParam.Type = GUIDELINE_HORZ; 01660 01661 String_256 OpToken(OPTOKEN_GUIDELINE); 01662 01663 if (m_pOwnerView != NULL) 01664 m_pOwnerView->InvokeDragOp(&OpToken ,&NewGuidelineParam, nFlags, point); 01665 01666 return TRUE; 01667 }
|
|
Definition at line 299 of file oilruler.h. |
|
Definition at line 320 of file oilruler.h. |