#include <oilruler.h>
Inheritance diagram for OILVerticalRuler:
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 () |
Definition at line 334 of file oilruler.h.
|
Creates an OILVerticalRuler object.
Definition at line 1813 of file oilruler.cpp.
|
|
Called by CCamView when its size changes, so it knows where to reposition the CVertical ruler.
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 }
|
|
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 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 }
|
|
Reimplemented from OILRuler. Definition at line 349 of file oilruler.h. 00349 { return FALSE ;};
|
|
Called from the base class Create()- does nothing at the moment.
Reimplemented from OILRuler. Definition at line 1827 of file oilruler.cpp. 01828 { 01829 return TRUE; 01830 }
|
|
Scroll the ruler.
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 }
|
|
Sends a start vertical guideline drag message.
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 }
|