934
939
Update( speedEnv, minSpeed, maxSpeed );
941
#ifdef EXPERIMENTAL_THEMING
943
mDC->SetTextForeground(mTickColour);
936
945
mDC->SetPen(*wxBLACK_PEN);
937
946
mDC->SetTextForeground(*wxBLACK);
939
if (mOrientation == wxHORIZONTAL) {
941
mDC->DrawLine(mLeft, mTop, mRight+1, mTop);
943
mDC->DrawLine(mLeft, mBottom, mRight+1, mBottom);
947
mDC->DrawLine(mLeft, mTop, mLeft, mBottom+1);
949
mDC->DrawLine(mRight, mTop, mRight, mBottom+1);
949
// Draws a long line the length of the ruler.
952
if (mOrientation == wxHORIZONTAL) {
954
mDC->DrawLine(mLeft, mTop, mRight+1, mTop);
956
mDC->DrawLine(mLeft, mBottom, mRight+1, mBottom);
960
mDC->DrawLine(mLeft, mTop, mLeft, mBottom+1);
962
mDC->DrawLine(mRight, mTop, mRight, mBottom+1);
954
968
mDC->SetFont(*mMajorFont);
970
// We may want to not show the ticks at the extremes,
971
// though still showing the labels.
972
// This gives a better look when the ruler is on a bevelled
973
// button, since otherwise the tick is drawn on the bevel.
974
int iMaxPos = (mOrientation==wxHORIZONTAL)? mRight : mBottom-5;
956
976
for(i=0; i<mNumMajor; i++) {
957
977
int pos = mMajorLabels[i].pos;
959
if (mOrientation == wxHORIZONTAL) {
961
mDC->DrawLine(mLeft + pos, mTop,
962
mLeft + pos, mTop + 4);
964
mDC->DrawLine(mLeft + pos, mBottom - 4,
965
mLeft + pos, mBottom);
969
mDC->DrawLine(mLeft, mTop + pos,
970
mLeft + 4, mTop + pos);
972
mDC->DrawLine(mRight - 4, mTop + pos,
979
if( mbTicksAtExtremes || ((pos!=0)&&(pos!=iMaxPos)))
981
if (mOrientation == wxHORIZONTAL) {
983
mDC->DrawLine(mLeft + pos, mTop,
984
mLeft + pos, mTop + 4);
986
mDC->DrawLine(mLeft + pos, mBottom - 4,
987
mLeft + pos, mBottom);
991
mDC->DrawLine(mLeft, mTop + pos,
992
mLeft + 4, mTop + pos);
994
mDC->DrawLine(mRight - 4, mTop + pos,
976
999
if (mMajorLabels[i].text != wxT(""))
984
1007
for(i=0; i<mNumMinor; i++) {
985
1008
int pos = mMinorLabels[i].pos;
987
if (mOrientation == wxHORIZONTAL) {
989
mDC->DrawLine(mLeft + pos, mTop,
990
mLeft + pos, mTop + 2);
992
mDC->DrawLine(mLeft + pos, mBottom - 2,
993
mLeft + pos, mBottom);
997
mDC->DrawLine(mLeft, mTop + pos,
998
mLeft + 2, mTop + pos);
1000
mDC->DrawLine(mRight - 2, mTop + pos,
1001
mRight, mTop + pos);
1010
if( mbTicksAtExtremes || ((pos!=0)&&(pos!=iMaxPos)))
1012
if (mOrientation == wxHORIZONTAL)
1015
mDC->DrawLine(mLeft + pos, mTop,
1016
mLeft + pos, mTop + 2);
1018
mDC->DrawLine(mLeft + pos, mBottom - 2,
1019
mLeft + pos, mBottom);
1024
mDC->DrawLine(mLeft, mTop + pos,
1025
mLeft + 2, mTop + pos);
1027
mDC->DrawLine(mRight - 2, mTop + pos,
1028
mRight, mTop + pos);
1004
1032
if (mMinorLabels[i].text != wxT(""))
1391
1422
void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
1393
1424
// Draw AdornedRulerPanel border
1394
AColor::Medium( dc, false );
1425
AColor::MediumTrackInfo( dc, false );
1395
1426
dc->DrawRectangle( mInner );
1397
1428
wxRect r = mOuter;
1398
1429
r.width -= 1; // -1 for bevel
1399
1430
r.height -= 2; // -2 for bevel and for bottom line
1400
AColor::Bevel( *dc, true, r );
1431
AColor::BevelTrackInfo( *dc, true, r );
1402
1433
dc->SetPen( *wxBLACK_PEN );
1403
1434
dc->DrawLine( mOuter.x,