- // Protability NOTE::: DrawLine(..) draws a line from the first position,
- // but not including the point specified by last position.
- // This way Windows draws lines, not sure how Motif and Gtk
- // prots behave...
-
- int width, height;
- GetClientSize( &width, &height );
-
- // check if there's at least a bit of space to draw things
-
- if ( width < mHorizGap*2 + BORDER_SZ*2+1 ||
- height < mVertGap*2 + BORDER_SZ*2+1 + mTitleHeight
- )
- return;
-
- // step #1 - draw border around the tab content area
-
- // setup position for kind of "pencil"
- int curX = mHorizGap;
- int curY = mVertGap;
-
- int xSize = width - mHorizGap*2;
- int ySize = height - mVertGap *2 - mTitleHeight;
-
- // layer 1 (upper white)
- DrawShadedRect( curX+0, curY+0, xSize-0, ySize-0,
- mWhitePen, mBlackPen, dc );
-
- // layer 2 (upper gray)
- DrawShadedRect( curX+1, curY+1, xSize-2-1, ySize-2-1,
- mGrayPen, mGrayPen, dc );
-
- // layer 3 (upper darkGray)
- DrawShadedRect( curX+2, curY+2, xSize-3-2, ySize-3-2,
- mDarkPen, mWhitePen, dc );
-
- // layer 4 (upper black)
- DrawShadedRect( curX+3, curY+3, xSize-4-3, ySize-4-3,
- mBlackPen, mGrayPen, dc );
-
- // add non-siemtric layer from the lower-right side (confroming to MFC-look)
-
- dc.SetPen( mDarkPen );
- dc.DrawLine( curX+1, curY + ySize - 2, curX + xSize - 1, curY + ySize - 2 ); // horiz
- dc.DrawLine( curX + xSize - 2, curY + 1, curX + xSize - 2, curY + ySize - 2 ); // vert
-
- // step #2 - draw tab title bars
-
- curX = mFirstTitleGap;
- curY = height - mVertGap - mTitleHeight;
-
- int tabNo = 0;
- wxNode* pNode = mTabs.First();
-
- while( pNode )
- {
- // "hard-coded metafile" for decorations
-
- twTabInfo& tab = *((twTabInfo*)(pNode->Data()));
-
- xSize = tab.mDims.x;
- ySize = mTitleHeight;
-
- if ( tabNo == mActiveTab )
- {
- dc.SetPen( mGrayPen );
- dc.DrawLine( curX+1, curY-2, curX+xSize-2, curY-2 );
- dc.DrawLine( curX+1, curY-1, curX+xSize-2, curY-1 );
- }
-
- dc.SetPen( mWhitePen );
-
- if ( tabNo == mActiveTab )
- dc.DrawLine( curX, curY-2, curX, curY+ySize-2 );
- else
- dc.DrawLine( curX, curY, curX, curY+ySize-2 );
-
- dc.SetPen( mDarkPen );
- dc.DrawLine( curX+1, curY+ySize-3, curX+1, curY+ySize-1 ); // to pix down
- dc.DrawLine( curX+2, curY+ySize-2, curX+xSize-2, curY+ySize-2 );
- dc.DrawLine( curX+xSize-3, curY+ySize-3, curX+xSize-2, curY+ySize-3 );
- if ( tabNo == mActiveTab )
- dc.DrawLine( curX+xSize-2, curY+ySize-3, curX+xSize-2, curY-3 );
- else
- dc.DrawLine( curX+xSize-2, curY+ySize-3, curX+xSize-2, curY-1 );
-
- dc.SetPen( mBlackPen );
- dc.DrawLine( curX+xSize-1, curY, curX+xSize-1, curY+ySize-2 );
- dc.DrawLine( curX+xSize-2, curY+ySize-2, curX+xSize-3, curY+ySize-2 );
- dc.DrawLine( curX+xSize-3, curY+ySize-1, curX+1, curY+ySize-1 );
-
- pNode = pNode->Next();
- ++tabNo;
-
- // darw image and (or without) text centered within the
- // title bar rectangle
-
- if ( mLayoutType != wxTITLE_BORDER_ONLY && tab.HasImg() )
- {
- wxMemoryDC tmpDc;
- tmpDc.SelectObject( tab.GetImg() );
-
- dc.Blit( curX + mTitleHorizGap,
- curY + ( ySize - tab.ImgHeight() ) / 2,
- tab.ImgWidth(),
- tab.ImgHeight(),
- &tmpDc, 0, 0, wxCOPY
- );
- }
-
- if ( mLayoutType == wxTITLE_IMG_AND_TEXT && tab.HasText() )
+ // Protability NOTE::: DrawLine(..) draws a line from the first position,
+ // but not including the point specified by last position.
+ // This way Windows draws lines, not sure how Motif and Gtk
+ // prots behave...
+
+ int width, height;
+ GetClientSize( &width, &height );
+
+ // check if there's at least a bit of space to draw things
+
+ if ( width < mHorizGap*2 + BORDER_SZ*2+1 ||
+ height < mVertGap*2 + BORDER_SZ*2+1 + mTitleHeight
+ )
+ return;
+
+ // step #1 - draw border around the tab content area
+
+ // setup position for kind of "pencil"
+ int curX = mHorizGap;
+ int curY = mVertGap;
+
+ int xSize = width - mHorizGap*2;
+ int ySize = height - mVertGap *2 - mTitleHeight;
+
+ // layer 1 (upper white)
+ DrawShadedRect( curX+0, curY+0, xSize-0, ySize-0,
+ mWhitePen, mBlackPen, dc );
+
+ // layer 2 (upper gray)
+ DrawShadedRect( curX+1, curY+1, xSize-2-1, ySize-2-1,
+ mGrayPen, mGrayPen, dc );
+
+ // layer 3 (upper darkGray)
+ DrawShadedRect( curX+2, curY+2, xSize-3-2, ySize-3-2,
+ mDarkPen, mWhitePen, dc );
+
+ // layer 4 (upper black)
+ DrawShadedRect( curX+3, curY+3, xSize-4-3, ySize-4-3,
+ mBlackPen, mGrayPen, dc );
+
+ // add non-siemtric layer from the lower-right side (confroming to MFC-look)
+
+ dc.SetPen( mDarkPen );
+ dc.DrawLine( curX+1, curY + ySize - 2, curX + xSize - 1, curY + ySize - 2 ); // horiz
+ dc.DrawLine( curX + xSize - 2, curY + 1, curX + xSize - 2, curY + ySize - 2 ); // vert
+
+ // step #2 - draw tab title bars
+
+ curX = mFirstTitleGap;
+ curY = height - mVertGap - mTitleHeight;
+
+ size_t tabNo = 0;
+ wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
+
+ while( pNode )