Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-10-05 15:38:40 +00:00
parent 908686c52e
commit 254a21292b
49 changed files with 721 additions and 792 deletions

View File

@ -132,7 +132,7 @@ bool BrowserDB::OnStartDB(int Quiet)
p_Dlg->s_Password = Password;
p_Dlg->OnInit();
p_Dlg->Fit();
bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK)
{
@ -252,7 +252,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
{
case DB_DATA_TYPE_VARCHAR:
wxStrcpy(s_temp,_T(""));
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb))
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_dbDataType),&s_temp[0],sizeof(s_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@ -263,7 +263,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
break;
case DB_DATA_TYPE_INTEGER:
l_temp = 0;
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb))
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&l_temp,sizeof(l_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@ -276,7 +276,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
break;
case DB_DATA_TYPE_FLOAT:
f_temp = 0;
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb))
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&f_temp,sizeof(f_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@ -289,8 +289,14 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
}
break;
case DB_DATA_TYPE_DATE:
t_temp.day = t_temp.month = t_temp.year = t_temp.hour = t_temp.minute = t_temp.second = t_temp.fraction = 0;
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb))
t_temp.day = 0;
t_temp.month = 0;
t_temp.year = 0;
t_temp.hour = 0;
t_temp.minute = 0;
t_temp.second = 0;
t_temp.fraction = 0;
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&t_temp,sizeof(t_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@ -425,7 +431,7 @@ wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int WXUNUS
(cl_BrowserDB+i)->pColFor->Format(1,
(cl_BrowserDB+i)->dbDataType,
(cl_BrowserDB+i)->sqlDataType,
(cl_BrowserDB+i)->columnSize,
(cl_BrowserDB+i)->columnSize,
(cl_BrowserDB+i)->decimalDigits);
}
return cl_BrowserDB;

View File

@ -50,12 +50,6 @@ twTabInfo::twTabInfo()
: mpContent( 0 )
{}
//---------------------------------------------------------------------------
twTabInfo::~twTabInfo()
{
// FOR NOW:: nothing
}
//---------------------------------------------------------------------------
int twTabInfo::ImgWidth()
{
@ -158,7 +152,7 @@ wxTabbedWindow::wxTabbedWindow()
wxTabbedWindow::~wxTabbedWindow()
{
wxObjectList::compatibility_iterator pTab = mTabs.GetFirst();
while( pTab )
{
delete ((twTabInfo*)pTab->GetData());
@ -171,26 +165,26 @@ void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool WXUNUSED(
{
wxObjectList::compatibility_iterator pTabNode = mTabs.GetFirst();
size_t n = 0;
while( pTabNode )
{
twTabInfo& info = *((twTabInfo*)pTabNode->GetData());
if ( n == mActiveTab )
{
//wxSizeEvent evt;
//info.mpContent->GetEventHandler()->ProcessEvent( evt );
info.mpContent->SetSize( x, y, width, height, 0 );
info.mpContent->Show(true);
info.mpContent->Refresh();
}
else
{
info.mpContent->Show(false);
}
pTabNode = pTabNode->GetNext();
++n;
}
@ -203,26 +197,26 @@ void wxTabbedWindow::AddTab( wxWindow* pContent,
wxBitmapType imageType )
{
twTabInfo* pTab = new twTabInfo();
pTab->mpContent = pContent;
pTab->mText = tabText;
if ( wxFileExists( imageFileName ) &&
pTab->mBitMap.LoadFile( imageFileName, imageType ) )
{
pTab->mImageFile = imageFileName;
pTab->mImageType = imageType;
}
if ( pContent->GetParent() == NULL )
pContent->Create( this, wxID_ANY );
mTabs.Append( (wxObject*)pTab );
RecalcLayout(true);
OnTabAdded( pTab );
}
@ -231,16 +225,16 @@ void wxTabbedWindow::AddTab( wxWindow* pContent,
wxString tabText, wxBitmap* pImage )
{
twTabInfo* pTab = new twTabInfo();
pTab->mpContent = pContent;
pTab->mText = tabText;
if ( pImage )
pTab->mBitMap = *pImage;
if ( pContent->GetParent() == NULL )
pContent->Create( this, wxID_ANY );
mTabs.Append( (wxObject*)pTab );
RecalcLayout(true);
OnTabAdded( pTab );
@ -297,13 +291,13 @@ void wxTabbedWindow::DrawShadedRect( int x, int y, int width, int height,
)
{
// darw the lightened upper-left sides of the rectangle
dc.SetPen( upperPen );
dc.DrawLine( x,y, x, y + height - 1 ); // vert
dc.DrawLine( x,y, x + width - 1, y ); // horiz
// draw the unenlightened lower-right sides of the rectangle
dc.SetPen( lowerPen );
dc.DrawLine( x + width - 1, y, x + width - 1, y + height - 1 ); // vert
dc.DrawLine( x, y + height - 1, x + width, y + height - 1 ); // horiz
@ -316,79 +310,79 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
// 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 )
{
// "hard-coded metafile" for decorations
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
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 );
@ -397,23 +391,23 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
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->GetNext();
++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(),
@ -421,25 +415,25 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
&tmpDc, 0, 0, wxCOPY
);
}
if ( mLayoutType == wxTITLE_IMG_AND_TEXT && tab.HasText() )
{
long x,w,h;
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
dc.SetTextBackground( GetBackgroundColour() );
dc.GetTextExtent(tab.mText, &w, &h );
x = curX + mTitleHorizGap +
tab.ImgWidth() + tab.ImageToTxtGap(mImageTextGap);
dc.DrawText( tab.GetText(), x, curY + ( ySize - h ) / 2 );
}
curX += xSize;
} // end of `while (pNode)'
} // wxTabbedWindow::DrawDecorations()
@ -448,17 +442,17 @@ int wxTabbedWindow::HitTest( const wxPoint& pos )
{
int width, height;
GetClientSize( &width, &height );
int curX = mFirstTitleGap;
int curY = height - mVertGap - mTitleHeight;
int tabNo = 0;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
// hit test rectangle of the currnet tab title bar
if ( pos.x >= curX && pos.x < curX + tab.mDims.x &&
pos.y >= curY && pos.y < curY + tab.mDims.y
@ -466,13 +460,13 @@ int wxTabbedWindow::HitTest( const wxPoint& pos )
{
return tabNo;
}
curX += tab.mDims.x;
pNode = pNode->GetNext();
++tabNo;
}
return -1;
} // wxTabbedWindow::HitTest()
@ -481,10 +475,10 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint )
{
if ( !andRepaint )
return;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
size_t tabNo = 0;
while( pNode )
{
if ( tabNo != mActiveTab )
@ -492,7 +486,7 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint )
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mpContent->Show(false);
}
pNode = pNode->GetNext();
++tabNo;
}
@ -507,15 +501,15 @@ wxFont wxTabbedWindow::GetLabelingFont()
#else
font.SetFamily( wxSWISS );
#endif
font.SetStyle(40);
font.SetWeight(40);
font.SetPointSize( 8 );
#ifdef __WINDOWS__
font.RealizeResource();
#endif
return font;
} // wxTabbedWindow::GetLabelingFont()
@ -523,87 +517,87 @@ wxFont wxTabbedWindow::GetLabelingFont()
void wxTabbedWindow::RecalcLayout(bool andRepaint)
{
HideInactiveTabs(andRepaint);
// resetup position of the active tab
int width, height;
GetClientSize( &width, &height );
int curX = mHorizGap + BORDER_SZ;
int curY = mVertGap + BORDER_SZ;
int xSize = width - mHorizGap*2 - BORDER_SZ*2-1;
int ySize = height - mVertGap*2 - BORDER_SZ*2-1 - mTitleHeight;
SizeTabs( curX, curY, xSize, ySize, andRepaint );
// pass #1 - try to layout assuming it's wxTITLE_IMG_AND_TEXT
mLayoutType = wxTITLE_IMG_AND_TEXT;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
curX = mFirstTitleGap; // the left-side gap
mTitleHeight = 0;
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
wxWindowDC dc(this);
long w,h;
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
dc.GetTextExtent(tab.mText, &w, &h );
tab.mDims.x = w + tab.ImageToTxtGap(mImageTextGap) +
tab.ImgWidth() + mTitleHorizGap*2;
tab.mDims.y = wxMax( h, tab.ImgHeight() ) + mTitleVertGap*2;
mTitleHeight = wxMax( mTitleHeight, tab.mDims.y );
curX += tab.mDims.x;
pNode = pNode->GetNext();
}
curX += mHorizGap; // the right-side gap
// make all title bars of equel height
pNode = mTabs.GetFirst();
while( pNode )
{
((twTabInfo*)(pNode->GetData()))->mDims.y = mTitleHeight;;
pNode = pNode->GetNext();
}
// if curX has'nt ran out of bounds, leave TITLE_IMG layout and return
if ( curX < width - mHorizGap )
return;
// pass #2 - try to layout assuming wxTITLE_IMG_ONLY
mLayoutType = wxTITLE_IMG_ONLY;
pNode = mTabs.GetFirst();
curX = mFirstTitleGap; // the left-side gap
int denomiator = mTabs.GetCount();
if ( denomiator == 0 )
++denomiator;
mBorderOnlyWidth = (width - mFirstTitleGap - mHorizGap) / denomiator;
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
if ( tab.HasImg() )
{
tab.mDims.x = tab.ImgWidth() + mTitleHorizGap*2;
@ -614,31 +608,31 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
tab.mDims.x = mBorderOnlyWidth;
tab.mDims.y = mTitleHeight;
}
curX += tab.mDims.x;
pNode = pNode->GetNext();
}
curX += mHorizGap; // the right-side gap
// if curX has'nt ran out of bounds, leave IMG_ONLY layout and return
if ( curX < width - mHorizGap )
return;
// pass #3 - set the narrowest layout wxTITLE_BORDER_ONLY
mLayoutType = wxTITLE_BORDER_ONLY;
pNode = mTabs.GetFirst();
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mDims.x = mBorderOnlyWidth;
tab.mDims.y = mTitleHeight;
pNode = pNode->GetNext();
}
} // wxTabbedWindow::RecalcLayout()
@ -671,9 +665,9 @@ void wxTabbedWindow::OnLButtonDown( wxMouseEvent& event )
// floats, why?
int x = (int)event.m_x;
int y = (int)event.m_y;
int tabNo = HitTest( wxPoint(x,y) );
if ( tabNo != -1 )
{
SetActiveTab( tabNo );
@ -721,27 +715,21 @@ wxPagedWindow::wxPagedWindow()
mNoVertScroll = true; // Horizontale Scroll abschalten
}
//---------------------------------------------------------------------------
wxPagedWindow::~wxPagedWindow()
{
// nothing (base class handles destruction)
}
//---------------------------------------------------------------------------
wxFont wxPagedWindow::GetLabelingFont()
{
wxFont font;
#ifdef __WINDOWS__
font.SetFaceName(_T("Comic Sans MS"));
#else
font.SetFamily( wxSWISS );
#endif
font.SetStyle(40);
font.SetWeight(40);
font.SetPointSize( 8 );
return font;
}
@ -749,7 +737,7 @@ wxFont wxPagedWindow::GetLabelingFont()
void wxPagedWindow::OnTabAdded( twTabInfo* WXUNUSED(pInfo) )
{
int units = GetWholeTabRowLen() / 20;
mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
}
@ -769,17 +757,17 @@ wxScrollBar& wxPagedWindow::GetHorizontalScrollBar()
int wxPagedWindow::GetWholeTabRowLen()
{
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
int len = 0;
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
len += tab.mDims.x;
pNode = pNode->GetNext();
}
return len;
} // wxPagedWindow::GetWholeTabRowLen()
@ -788,40 +776,40 @@ void wxPagedWindow::DrawPaperBar( twTabInfo& tab, int x, int y,
wxBrush& brush, wxPen& pen, wxDC& dc )
{
wxPoint poly[4];
// draw organizer-style paper outlet
poly[0].x = x - mTabTrianGap;
poly[0].y = y;
poly[1].x = x + mTabTrianGap;
poly[1].y = y + tab.mDims.y-1;
poly[2].x = x + tab.mDims.x - mTabTrianGap;
poly[2].y = y + tab.mDims.y-1;
poly[3].x = x + tab.mDims.x + mTabTrianGap;
poly[3].y = y;
dc.SetPen( pen );
dc.SetBrush( brush );
dc.DrawPolygon( 4, poly );
long w,h;
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
dc.SetTextBackground( brush.GetColour() );
dc.GetTextExtent(tab.mText, &w, &h );
if ( tab.HasImg() )
{
wxMemoryDC tmpDc;
tmpDc.SelectObject( tab.GetImg() );
dc.Blit( x + mTitleHorizGap,
y + ( tab.mDims.y - tab.ImgHeight() ) / 2,
tab.ImgWidth(),
@ -829,12 +817,12 @@ void wxPagedWindow::DrawPaperBar( twTabInfo& tab, int x, int y,
&tmpDc, 0, 0, wxCOPY
);
}
if ( tab.HasText() )
{
int tx = x + mTitleHorizGap +
tab.ImgWidth() + tab.ImageToTxtGap(mImageTextGap);
dc.DrawText( tab.GetText(), tx, y + ( tab.mDims.y - h ) / 2 );
}
} // wxPagedWindow::DrawPaperBar()
@ -899,48 +887,48 @@ void wxPagedWindow::DrawDecorations( wxDC& dc )
pNode = pNode->GetNext();
++tabNo;
}
// finally, draw the active tab (white-filled)
pNode = mTabs.GetFirst();
tabNo = 0;
curX = mTabTrianGap;
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
if ( tabNo == mActiveTab )
{
DrawPaperBar( tab, curX, curY, mWhiteBrush, mBlackPen, tmpDc );
tmpDc.SetPen( mWhitePen );
tmpDc.DrawLine( curX - mTabTrianGap+1, curY,
curX + tab.mDims.x + mTabTrianGap, curY );
break;
}
curX += tab.mDims.x;
pNode = pNode->GetNext();
++tabNo;
}
// back to initial device origin
tmpDc.SetDeviceOrigin( 0, 0 );
// draw resize-hint-stick
curX = mTitleRowLen - 6;
DrawShadedRect( curX+0, 0+0, 6, mTitleHeight, mGrayPen, mBlackPen, tmpDc );
DrawShadedRect( curX+1, 0+1, 6-2, mTitleHeight-2, mWhitePen, mDarkPen, tmpDc );
DrawShadedRect( curX+2, 0+2, 6-4, mTitleHeight-4, mGrayPen, mGrayPen, tmpDc );
dc.Blit( mTitleRowStart,
height - mVertGap - BORDER_SZ - mTitleHeight,
mTitleRowLen, mTitleHeight,
@ -957,71 +945,71 @@ int wxPagedWindow::HitTest( const wxPoint& pos )
void wxPagedWindow::RecalcLayout(bool andRepaint)
{
mTitleRowLen = mAdjustableTitleRowLen;
if ( int(mpTabScroll) == -1 ) return;
// scroll bars should be created after Create() for this window is called
if ( !mpTabScroll )
{
mpTabScroll =
new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
mpHorizScroll =
new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
if (!mNoVertScroll) // Vertical Scroll (Original)
mpVertScroll = new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
}
{
int units = GetWholeTabRowLen() / 20;
mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
}
// resetup position of the active tab
int thumbLen = 16; // FOR NOW:: hardcoded
int width, height;
GetClientSize( &width, &height );
mTitleHeight = thumbLen;
int curX = mHorizGap + BORDER_SZ;
int curY = mVertGap + BORDER_SZ;
int xSize;
if (!mNoVertScroll) // Vertical Scroll (Original)
xSize = width - mHorizGap*2 - BORDER_SZ*2 - thumbLen;
else
xSize = width - mHorizGap*2 - BORDER_SZ*2;
int ySize = height - mVertGap*2 - BORDER_SZ*2 - mTitleHeight;
SizeTabs( curX, curY, xSize, ySize, andRepaint );
// setup title bar LINES's horizontal scroll bar
curY = height - mVertGap - BORDER_SZ - thumbLen;
mpTabScroll->SetSize( curX, curY, thumbLen*2, thumbLen );
// setup view's HORIZONTAL scroll bar
curX += thumbLen*2;
mTitleRowStart = curX;
mFirstTitleGap = curX + mCurentRowOfs + mTabTrianGap;
mTitleRowLen = wxMin( mAdjustableTitleRowLen,
width - mHorizGap - BORDER_SZ - thumbLen*4 - curX );
curX += mTitleRowLen;
if (!mNoVertScroll) // Vertical Scroll (Original)
mpHorizScroll->SetSize( curX, curY,width - curX - mHorizGap - BORDER_SZ - thumbLen, thumbLen );
else
mpHorizScroll->SetSize( curX, curY,width - curX - mHorizGap - BORDER_SZ-4, thumbLen );
// setup view's VERTICAL scroll bar
if (!mNoVertScroll) // Vertical Scroll (Original)
{
@ -1030,33 +1018,33 @@ void wxPagedWindow::RecalcLayout(bool andRepaint)
mpVertScroll->SetSize( curX, curY, thumbLen,height - curY - mVertGap - BORDER_SZ - thumbLen);
}
// layout tab title bars
mLayoutType = wxTITLE_IMG_AND_TEXT;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
wxWindowDC dc(this);
long w,h;
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
dc.GetTextExtent(tab.mText, &w, &h );
tab.mDims.x = w + tab.ImageToTxtGap(mImageTextGap) +
tab.ImgWidth() + mTitleHorizGap*2;
tab.mDims.y = mTitleHeight;
pNode = pNode->GetNext();
}
// disable title-bar scroller if there's nowhere to scroll to
mpTabScroll->Enable( mTitleRowLen < GetWholeTabRowLen() || mCurentRowOfs < 0 );
}
@ -1082,9 +1070,9 @@ void wxPagedWindow::OnLButtonDown( wxMouseEvent& event )
{
mIsDragged = true;
mDagOrigin = event.m_x;
mOriginalTitleRowLen = mAdjustableTitleRowLen;
CaptureMouse();
}
else
@ -1101,7 +1089,7 @@ void wxPagedWindow::OnLButtonUp( wxMouseEvent& WXUNUSED(event) )
mIsDragged = false;
mCursorChanged = false;
SetCursor( mNormalCursor );
ReleaseMouse();
}
} // wxPagedWindow::OnLButtonUp()
@ -1111,12 +1099,12 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
{
int width, height;
GetClientSize( &width, &height );
if ( !mIsDragged )
{
int y = height - mVertGap - BORDER_SZ - mTitleHeight;
int x = mTitleRowStart + mTitleRowLen - 6;
if ( event.m_x >= x && event.m_y >= y &&
event.m_x < x + 6 &&
event.m_y < y + mTitleHeight
@ -1125,7 +1113,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
if ( !mCursorChanged )
{
SetCursor( mResizeCursor );
mCursorChanged = true;
}
}
@ -1133,7 +1121,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
if ( mCursorChanged )
{
SetCursor( mNormalCursor );
mCursorChanged = false;
}
}
@ -1142,15 +1130,15 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
if ( mIsDragged )
{
mAdjustableTitleRowLen = mOriginalTitleRowLen + ( event.m_x - mDagOrigin );
// FOR NOW:: fixed
if ( mAdjustableTitleRowLen < 6 ) mAdjustableTitleRowLen = 6;
wxWindowDC dc(this);
DrawDecorations( dc );
RecalcLayout(false);
//Refresh();
}
}
@ -1163,16 +1151,16 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event )
// wxMessageBox("wxPagedWindow::OnScroll","-I->");
if ( pSender == mpTabScroll )
{
int maxUnits = GetWholeTabRowLen() / 20;
mCurentRowOfs = -event.GetPosition()*maxUnits;
mFirstTitleGap = mTitleRowStart + mCurentRowOfs + mTabTrianGap;
// let' it automatically disable itself if it's time
mpTabScroll->Enable( mTitleRowLen < GetWholeTabRowLen() || mCurentRowOfs < 0 );
// repaint title bars
wxWindowDC dc(this);
DrawDecorations( dc );
@ -1182,14 +1170,14 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event )
if ( !mScrollEventInProgress )
{
mScrollEventInProgress = true;
GetActiveTab()->GetEventHandler()->ProcessEvent( event );
}
else
{
// event bounced back to us, from here we
// know that it has traveled the loop - thus it's processed!
mScrollEventInProgress = false;
}
}

View File

@ -112,7 +112,7 @@ public:
virtual void AddTab( wxWindow* pContent,
wxString tabText,
wxBitmap* pImage = NULL );
wxBitmap* pImage );
virtual void RemoveTab( int tabNo );
@ -200,7 +200,7 @@ public:
public:
wxPagedWindow();
~wxPagedWindow();
~wxPagedWindow(){};
// NOTE:: use public methods of the base class
// to add "pages" to this window
@ -243,7 +243,7 @@ class twTabInfo : public wxObject
DECLARE_DYNAMIC_CLASS( twTabInfo )
public:
twTabInfo();
~twTabInfo();
~twTabInfo(){};
int ImgWidth();
int ImgHeight();

View File

@ -133,17 +133,6 @@ void Card::SetScale(double scale)
m_height = int(70*scale);
}
//+-------------------------------------------------------------+
//| Card::~Card() |
//+-------------------------------------------------------------+
//| Description: |
//| Destructor - nothing to do at present. |
//+-------------------------------------------------------------+
Card::~Card()
{
}
//+-------------------------------------------------------------+
//| Card::Erase() |
//+-------------------------------------------------------------+
@ -255,272 +244,272 @@ void Card::Draw(wxDC& dc, int x, int y)
// Draw the value
dc.Blit((wxCoord)(x + m_scale*3),
(wxCoord)(y + m_scale*3),
valuewidth,
valuewidth,
valueheight,
&memoryDC,
valuewidth * (m_pipValue - 1),
valuepos,
&memoryDC,
valuewidth * (m_pipValue - 1),
valuepos,
wxCOPY);
dc.Blit((wxCoord)(x + m_width - m_scale*3 - valuewidth),
dc.Blit((wxCoord)(x + m_width - m_scale*3 - valuewidth),
(wxCoord)(y + m_height - valueheight - m_scale*3),
valuewidth,
valuewidth,
valueheight,
&memoryDC,
valuewidth * (m_pipValue - 1),
valuepos+valueheight,
&memoryDC,
valuewidth * (m_pipValue - 1),
valuepos+valueheight,
wxCOPY);
// Draw the pips
dc.Blit((wxCoord)(x + m_scale*3 + valuewidth+2),
(wxCoord)(y + m_scale*3),
pipsize,
dc.Blit((wxCoord)(x + m_scale*3 + valuewidth+2),
(wxCoord)(y + m_scale*3),
pipsize,
&memoryDC,
pipsize * m_suit,
pippos,
pipsize,
&memoryDC,
pipsize * m_suit,
pippos,
wxCOPY);
dc.Blit((wxCoord)(x + m_width - m_scale*3-valuewidth-pipsize-2),
dc.Blit((wxCoord)(x + m_width - m_scale*3-valuewidth-pipsize-2),
(wxCoord)(y + m_height - pipsize - m_scale*3),
pipsize,
pipsize,
&memoryDC,
pipsize * m_suit,
pipsize+pippos,
pipsize,
&memoryDC,
pipsize * m_suit,
pipsize+pippos,
wxCOPY);
switch (m_pipValue)
{
case 1:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - m_scale*5 + m_height / 2),
symsize,
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - m_scale*5 + m_height / 2),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
break;
case 3:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 2),
symsize,
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 2),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
case 2:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 4),
symsize,
(wxCoord)(y - symdist + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
break;
case 5:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 2),
symsize,
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 2),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
case 4:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + m_height / 4),
symsize,
(wxCoord)(y - symdist + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + m_height / 4),
symsize,
(wxCoord)(y - symdist + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
break;
case 8:
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
(wxCoord)(y - symdist + 5 * m_height / 8),
symsize,
(wxCoord)(y - symdist + 5 * m_height / 8),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
case 7:
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
(wxCoord)(y - symdist + 3 * m_height / 8),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 8),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
case 6:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + m_height / 4),
symsize,
(wxCoord)(y - symdist + m_height / 4),
symsize,
symsize,
&memoryDC, symsize * m_suit, sympos, wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + m_height / 2),
symsize,
(wxCoord)(y - symdist + m_height / 2),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + m_height / 4),
symsize,
(wxCoord)(y - symdist + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + m_height / 2),
symsize,
(wxCoord)(y - symdist + m_height / 2),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
break;
case 10:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + 2 * m_height / 3),
symsize,
(wxCoord)(y - symdist + 2 * m_height / 3),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
case 9:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist2 + m_height / 4),
symsize,
(wxCoord)(y - symdist2 + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist2 + 5 * m_height / 12),
symsize,
(wxCoord)(y - symdist2 + 5 * m_height / 12),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + 7 * m_height / 12),
symsize,
(wxCoord)(y - symdist + 7 * m_height / 12),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist2 + m_height / 4),
symsize,
(wxCoord)(y - symdist2 + m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist2 + 5 * m_height / 12),
symsize,
(wxCoord)(y - symdist2 + 5 * m_height / 12),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + 7 * m_height / 12),
symsize,
(wxCoord)(y - symdist + 7 * m_height / 12),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
(wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 3),
symsize,
(wxCoord)(y - symdist + m_height / 3),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
break;
case 11:
@ -528,31 +517,31 @@ void Card::Draw(wxDC& dc, int x, int y)
case 13:
memoryDC.SelectObject(*m_pictureBmap);
int picwidth = 40,picheight = 45;
dc.Blit((wxCoord)(x + (m_width-picwidth)/2),
dc.Blit((wxCoord)(x + (m_width-picwidth)/2),
(wxCoord)(y - picheight/2 + m_height/2),
picwidth,
picwidth,
picheight,
&memoryDC,
picwidth * (m_pipValue - 11),
0,
&memoryDC,
picwidth * (m_pipValue - 11),
0,
wxCOPY);
memoryDC.SelectObject(*m_symbolBmap);
dc.Blit((wxCoord)(x + m_width-(m_width-picwidth)/2-symsize-3),
(wxCoord)(y - picheight/2+m_height/2+1),
symsize,
(wxCoord)(y - picheight/2+m_height/2+1),
symsize,
&memoryDC,
symsize * m_suit,
sympos,
symsize,
&memoryDC,
symsize * m_suit,
sympos,
wxCOPY);
dc.Blit((wxCoord)(x + (m_width-picwidth)/2+2),
(wxCoord)(y + picheight/2 + m_height/2-symsize),
symsize,
(wxCoord)(y + picheight/2 + m_height/2-symsize),
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
symsize,
&memoryDC,
symsize * m_suit,
sympos2,
wxCOPY);
break;
}

View File

@ -44,7 +44,7 @@ class Card {
public:
Card(int value, WayUp way_up = facedown);
virtual ~Card();
virtual ~Card(){};
void Draw(wxDC& pDC, int x, int y);
static void DrawNullCard(wxDC& pDC, int x, int y); // Draw card place-holder

View File

@ -58,10 +58,6 @@ wxColour* FortyApp::m_backgroundColour = 0;
wxColour* FortyApp::m_textColour = 0;
wxBrush* FortyApp::m_backgroundBrush = 0;
FortyApp::FortyApp()
{
}
FortyApp::~FortyApp()
{
delete m_backgroundColour;
@ -210,10 +206,6 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos
#endif // wxUSE_STATUSBAR
}
FortyFrame::~FortyFrame()
{
}
void FortyFrame::OnCloseWindow(wxCloseEvent& event)
{
if (m_canvas->OnCloseCanvas() )
@ -338,8 +330,8 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
if (file.Exists())
{
file.Open();
for ( htmlText = file.GetFirstLine();
!file.Eof();
for ( htmlText = file.GetFirstLine();
!file.Eof();
htmlText << file.GetNextLine() << _T("\n") ) ;
}
}
@ -365,7 +357,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
wxHtmlWindow* html = new wxHtmlWindow(this, ID_ABOUT_HTML_WINDOW, wxDefaultPosition, htmlSize, borderStyle);
html -> SetBorders(10);
html -> SetPage(htmlText);
//// Start of sizer-based control creation
wxSizer *item0 = new wxBoxSizer( wxVERTICAL );

View File

@ -16,7 +16,7 @@
class FortyApp: public wxApp
{
public:
FortyApp();
FortyApp(){};
~FortyApp();
bool OnInit();
@ -38,8 +38,8 @@ class FortyCanvas;
class FortyFrame: public wxFrame
{
public:
FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
virtual ~FortyFrame();
FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
virtual ~FortyFrame(){};
void OnCloseWindow(wxCloseEvent& event);
@ -60,13 +60,13 @@ public:
DECLARE_EVENT_TABLE()
private:
enum MenuCommands {
NEW_GAME = 10,
enum MenuCommands {
NEW_GAME = 10,
SCORES,
UNDO,
UNDO,
REDO,
RIGHT_BUTTON_UNDO,
HELPING_HAND,
RIGHT_BUTTON_UNDO,
HELPING_HAND,
LARGE_CARDS
};
@ -86,7 +86,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE );
bool AddControls(wxWindow* parent);
private:

View File

@ -861,11 +861,6 @@ bool Base::AcceptCard(Card* card)
return retval;
}
Base::~Base()
{
// nothing special at the moment
};
//----------------------------------------------------------------//
// The Foundation class: holds the cards built up from the ace... //
@ -895,11 +890,6 @@ bool Foundation::AcceptCard(Card* card)
return retval;
}
Foundation::~Foundation()
{
// nothing special at the moment
};
//----------------------------------------------------//
// The Discard class: holds cards dealt from the m_pack //
@ -981,7 +971,7 @@ Card* Discard::RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset)
for (int i = m_topCard - 31; i <= m_topCard - 31 + CardWidth / m_dx; i++)
{
m_cards[i]->Draw(dc, m_x - m_xOffset + i * m_dx, m_y - m_yOffset);
m_cards[i]->Draw(dc, m_x - m_xOffset + i * m_dx, m_y - m_yOffset);
}
if (m_topCard > 31)
{
@ -992,9 +982,3 @@ Card* Discard::RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset)
return card;
}
Discard::~Discard()
{
// nothing special at the moment
};

View File

@ -39,7 +39,7 @@ public:
class Base : public Pile {
public:
Base(int x, int y);
~Base();
~Base(){};
bool AcceptCard(Card* card);
};
@ -50,7 +50,7 @@ public:
class Foundation : public Pile {
public:
Foundation(int x, int y);
~Foundation();
~Foundation(){};
bool AcceptCard(Card* card);
};
@ -61,7 +61,7 @@ public:
class Discard : public Pile {
public:
Discard(int x, int y);
~Discard();
~Discard(){};
void Redraw(wxDC& dc);
void GetTopCardPos(int& x, int& y);
Card* RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset);

View File

@ -298,9 +298,3 @@ bool Pile::Overlap(int x, int y)
}
return false;
}
Pile::~Pile()
{
// nothing special at the moment
}

View File

@ -42,7 +42,7 @@ const int NumCards = 2 * PackSize;
class Pile {
public:
Pile(int x, int y, int dx = 0, int dy = 0);
virtual ~Pile();
virtual ~Pile(){};
// General functions
virtual void ResetPile() { m_topCard = -1; }

View File

@ -83,10 +83,6 @@ PlayerSelectionDialog::PlayerSelectionDialog(
CentreOnParent();
}
PlayerSelectionDialog::~PlayerSelectionDialog()
{
}
void PlayerSelectionDialog::OnSize(wxSizeEvent& WXUNUSED(event))
{
Layout();

View File

@ -17,7 +17,7 @@ class PlayerSelectionDialog : public wxDialog
{
public:
PlayerSelectionDialog(wxWindow* parent, ScoreFile* file);
virtual ~PlayerSelectionDialog();
virtual ~PlayerSelectionDialog(){};
const wxString& GetPlayersName();
void ButtonCallback(wxCommandEvent& event);

View File

@ -203,10 +203,6 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) :
CentreOnParent();
}
ScoreDialog::~ScoreDialog()
{
}
void ScoreDialog::Display()
{
ShowModal();

View File

@ -17,7 +17,7 @@ class ScoreDialog : public wxDialog
{
public:
ScoreDialog(wxWindow* parent, ScoreFile* file);
virtual ~ScoreDialog();
virtual ~ScoreDialog(){};
void Display();

View File

@ -1025,7 +1025,7 @@ void LifeCanvas::OnSize(wxSizeEvent& event)
void LifeCanvas::OnScroll(wxScrollWinEvent& event)
{
WXTYPE type = event.GetEventType();
WXTYPE type = (WXTYPE)event.GetEventType();
int pos = event.GetPosition();
int orient = event.GetOrientation();

View File

@ -220,7 +220,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
while (((ch = poem_buffer[i]) != 10) && (ch != 0))
#endif
{
line[j] = ch;
line[j] = (wxChar)ch;
j ++;
i ++;
}
@ -661,7 +661,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
TheMainWindow->GetClientSize(&xx, &yy);
dc.DrawBitmap(* backingBitmap, 0, 0);
#if 0
#if 0
wxMemoryDC memDC;
memDC.SelectObject(* backingBitmap);
dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0);
@ -851,7 +851,7 @@ bool LoadPoem(wxChar *file_name, long position)
i++;
}
poem_buffer[i] = ch;
poem_buffer[i] = (wxChar)ch;
i ++;
if (i == buf_size)
@ -994,7 +994,7 @@ bool Compile(void)
nitems ++;
// Do rest
do {
ch = getc(file);
if (ch == '#')

View File

@ -184,10 +184,13 @@ public:
const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
const wxString &tblPath=wxEmptyString);
// DEPRECATED
wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
const wxString &tblPath=wxEmptyString);
#if WXWIN_COMPATIBILITY_2_4
wxDEPRECATED(
wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
const wxString &tblPath=wxEmptyString)
);
#endif // WXWIN_COMPATIBILITY_2_4
virtual ~wxDbTable();

View File

@ -56,7 +56,7 @@ public:
wxString ReadString(); // deprecated: use ReadLine or ReadWord instead
wxString ReadLine();
wxString ReadWord();
wxChar GetChar() { wxChar c = NextChar(); return c != wxEOT ? c : 0; }
wxChar GetChar() { wxChar c = NextChar(); return (wxChar)(c != wxEOT ? c : 0); }
wxString GetStringSeparators() const { return m_separators; }
void SetStringSeparators(const wxString &c) { m_separators = c; }

View File

@ -320,7 +320,7 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName
return true;
}
if (m_data->IsColNull(m_ColInfo[col].DbCol))
if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
{
return false;
}
@ -508,7 +508,7 @@ void* wxDbGridTableBase::GetValueAsCustom(int row, int col, const wxString& type
wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns"));
return NULL;
}
if (m_data->IsColNull(m_ColInfo[col].DbCol))
if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
return NULL;
if (typeName == wxGRID_VALUE_DATETIME)
@ -580,7 +580,7 @@ bool wxDbGridTableBase::IsEmptyCell(int row, int col)
wxLogDebug(wxT("IsEmtpyCell on %i,%i"),row,col);
ValidateRow(row);
return m_data->IsColNull(m_ColInfo[col].DbCol);
return m_data->IsColNull((UWORD)m_ColInfo[col].DbCol);
}

View File

@ -116,6 +116,7 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumn
/***** DEPRECATED: use wxDbTable::wxDbTable() format above *****/
#if WXWIN_COMPATIBILITY_2_4
wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
const wxChar *qryTblName, bool qryOnly, const wxString &tblPath)
{
@ -124,6 +125,7 @@ wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumn
if (!initialize(pwxDb, tblName, numColumns, tempQryTblName, qryOnly, tblPath))
cleanup();
} // wxDbTable::wxDbTable()
#endif // WXWIN_COMPATIBILITY_2_4
/********** wxDbTable::~wxDbTable() **********/
@ -1260,7 +1262,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
{
// Determine if this column should be included in the WHERE clause
if ((typeOfWhere == DB_WHERE_KEYFIELDS && colDefs[colNo].KeyField) ||
(typeOfWhere == DB_WHERE_MATCHING && (!IsColNull(colNo))))
(typeOfWhere == DB_WHERE_MATCHING && (!IsColNull((UWORD)colNo))))
{
// Skip over timestamp columns
if (colDefs[colNo].SqlCtype == SQL_C_TIMESTAMP)
@ -2217,7 +2219,7 @@ void wxDbTable::ClearMemberVars(bool setToNull)
// Loop through the columns setting each member variable to zero
for (i=0; i < noCols; i++)
ClearMemberVar(i,setToNull);
ClearMemberVar((UWORD)i,setToNull);
} // wxDbTable::ClearMemberVars()
@ -2558,7 +2560,7 @@ bool wxDbTable::SetColNull(const wxString &colName, bool set)
{
colDefs[colNo].Null = set;
if (set) // Blank out the values in the member variable
ClearMemberVar(colNo,false); // Must call with false here, or infinite recursion will happen
ClearMemberVar((UWORD)colNo,false); // Must call with false here, or infinite recursion will happen
setCbValueForColumn(colNo);
@ -2665,7 +2667,7 @@ void wxDbTable::SetRowMode(const rowmode_t rowmode)
wxVariant wxDbTable::GetCol(const int colNo) const
{
wxVariant val;
if ((colNo < noCols) && (!IsColNull(colNo)))
if ((colNo < noCols) && (!IsColNull((UWORD)colNo)))
{
switch (colDefs[colNo].SqlCtype)
{
@ -2718,7 +2720,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
//FIXME: Add proper wxDateTime support to wxVariant..
wxDateTime dateval;
SetColNull(colNo, val.IsNull());
SetColNull((UWORD)colNo, val.IsNull());
if (!val.IsNull())
{
@ -2728,7 +2730,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
{
//Returns null if invalid!
if (!dateval.ParseDate(val.GetString()))
SetColNull(colNo, true);
SetColNull((UWORD)colNo, true);
}
switch (colDefs[colNo].SqlCtype)
@ -2745,7 +2747,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
*(short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
*(short *)(colDefs[colNo].PtrDataObj) = (short)val.GetLong();
break;
case SQL_C_ULONG:
*(unsigned long *)(colDefs[colNo].PtrDataObj) = val.GetLong();
@ -2757,7 +2759,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
*(wxChar *)(colDefs[colNo].PtrDataObj) = val.GetChar();
break;
case SQL_C_USHORT:
*(unsigned short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
*(unsigned short *)(colDefs[colNo].PtrDataObj) = (unsigned short)val.GetLong();
break;
//FIXME: Add proper wxDateTime support to wxVariant..
case SQL_C_DATE:
@ -2765,9 +2767,9 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
DATE_STRUCT *dataptr =
(DATE_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
dataptr->day = dateval.GetDay();
dataptr->year = (SQLSMALLINT)dateval.GetYear();
dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
dataptr->day = (SQLUSMALLINT)dateval.GetDay();
}
break;
case SQL_C_TIME:
@ -2784,9 +2786,9 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
{
TIMESTAMP_STRUCT *dataptr =
(TIMESTAMP_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
dataptr->day = dateval.GetDay();
dataptr->year = (SQLSMALLINT)dateval.GetYear();
dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
dataptr->day = (SQLUSMALLINT)dateval.GetDay();
dataptr->hour = dateval.GetHour();
dataptr->minute = dateval.GetMinute();
@ -2841,7 +2843,7 @@ void wxDbTable::SetKey(const GenericKey& k)
{
if (colDefs[i].KeyField)
{
SetColNull(i, false);
SetColNull((UWORD)i, false);
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
blkptr += colDefs[i].SzDataObj;
}

View File

@ -911,7 +911,7 @@ wxDos2UnixFilename (wxChar *s)
*s = _T('/');
#ifdef __WXMSW__
else
*s = wxTolower (*s); // Case INDEPENDENT
*s = (wxChar)wxTolower (*s); // Case INDEPENDENT
#endif
s++;
}

View File

@ -728,7 +728,7 @@ wxSocketBase *wxFTP::GetPassivePort()
(wxUint16)a[3] << 16 |
(wxUint16)a[4] << 8 |
a[5];
wxUint16 port = (wxUint16)a[0] << 8 | a[1];
wxUint16 port = (wxUint16)(a[0] << 8 | a[1]);
wxIPV4address addr;
addr.Hostname(hostaddr);

View File

@ -1126,7 +1126,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
// read the whole file in memory
m_pData = new size_t8[nSize];
if ( fileMsg.Read(m_pData, nSize) != (size_t)nSize ) {
if ( fileMsg.Read(m_pData, (size_t)nSize) != (size_t)nSize ) {
wxDELETEA(m_pData);
return false;
}
@ -1157,7 +1157,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
Swap(pHeader->ofsOrigTable));
m_pTransTable = (wxMsgTableEntry *)(m_pData +
Swap(pHeader->ofsTransTable));
m_nSize = nSize;
m_nSize = (size_t)nSize;
// now parse catalog's header and try to extract catalog charset and
// plural forms formula from it:

View File

@ -558,7 +558,8 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
if ( traits && !traits->HasStderr() )
{
wxMessageOutputDebug().Printf(_T("%s"), str.c_str());
wxMessageOutputDebug dbgout;
dbgout.Printf(_T("%s"), str.c_str());
}
}
}

View File

@ -1017,7 +1017,7 @@ public:
{ m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1),valptr->year); }
wxVariantDataDateTime(const TIMESTAMP_STRUCT* valptr)
{ m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1), valptr->year,
valptr->hour, valptr->minute, valptr->second, valptr->fraction ); }
valptr->hour, valptr->minute, valptr->second, (wxDateTime::wxDateTime_t)valptr->fraction ); }
#endif //ODBC
inline wxDateTime GetValue() const { return m_value; }
@ -1722,7 +1722,8 @@ wxVariant wxVariant::operator[] (size_t idx) const
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
wxVariant variant( wxString( (const wxChar*) (data->GetValue().Item(idx)->GetData()) ));
wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) );
wxVariant variant( str );
return variant;
}
return wxNullVariant;

View File

@ -545,7 +545,7 @@ void wxGenericColourDialog::OnRedSlider(wxCommandEvent& WXUNUSED(event))
return;
wxClientDC dc(this);
singleCustomColour.Set(redSlider->GetValue(), singleCustomColour.Green(), singleCustomColour.Blue());
singleCustomColour.Set((unsigned char)redSlider->GetValue(), singleCustomColour.Green(), singleCustomColour.Blue());
PaintCustomColour(dc);
}
@ -555,7 +555,7 @@ void wxGenericColourDialog::OnGreenSlider(wxCommandEvent& WXUNUSED(event))
return;
wxClientDC dc(this);
singleCustomColour.Set(singleCustomColour.Red(), greenSlider->GetValue(), singleCustomColour.Blue());
singleCustomColour.Set(singleCustomColour.Red(), (unsigned char)greenSlider->GetValue(), singleCustomColour.Blue());
PaintCustomColour(dc);
}
@ -565,7 +565,7 @@ void wxGenericColourDialog::OnBlueSlider(wxCommandEvent& WXUNUSED(event))
return;
wxClientDC dc(this);
singleCustomColour.Set(singleCustomColour.Red(), singleCustomColour.Green(), blueSlider->GetValue());
singleCustomColour.Set(singleCustomColour.Red(), singleCustomColour.Green(), (unsigned char)blueSlider->GetValue());
PaintCustomColour(dc);
}

View File

@ -218,7 +218,7 @@ void wxFileData::ReadData()
}
}
m_size = buff.st_size;
m_size = (long)buff.st_size;
m_dateTime = buff.st_mtime;

View File

@ -669,7 +669,7 @@ int main(int argc, char **argv)
}
directoryOut = argv[current];
if ( !!directoryOut ) {
if ( !directoryOut.IsEmpty() ) {
// terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) {
case '/':
@ -729,7 +729,7 @@ int main(int argc, char **argv)
// create a parser object and a visitor derivation
CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite);
if ( !!ignoreFile && mode == Mode_Dump )
if ( !ignoreFile.IsEmpty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL;
@ -775,7 +775,7 @@ int main(int argc, char **argv)
}
}
if ( !!ignoreFile )
if ( !ignoreFile.IsEmpty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop);
@ -877,10 +877,10 @@ void HelpGenVisitor::CloseClass()
{
CloseFunction();
if ( m_inClass )
if ( m_inClass )
{
size_t count = m_arrayFuncDocs.GetCount();
if ( count )
if ( count )
{
size_t n;
FunctionDocEntry::classname = m_classname;
@ -1417,7 +1417,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
char *buf = new char[len + 1];
buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) {
if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
@ -1988,7 +1988,7 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
char *buf = new char[len + 1];
buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) {
if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
@ -2186,6 +2186,9 @@ static const wxString GetVersionString()
/*
$Log$
Revision 1.31 2004/10/05 15:38:29 ABX
Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
Revision 1.30 2004/06/18 19:25:50 ABX
Small step in making HelpGen up to date unicode application.

View File

@ -86,10 +86,6 @@ ctSettings::ctSettings(const ctSettings& settings)
}
ctSettings::~ctSettings()
{
}
void ctSettings::operator = (const ctSettings& settings)
{
Copy(settings);
@ -265,7 +261,7 @@ bool ctSettings::SaveConfig()
// Indicate that we're no longer running, so we know if the program
// crashed last time around.
config.Write(wxT("Misc/RunningProgram"), (long) 0);
{
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistorySave(config);

View File

@ -43,7 +43,7 @@ public:
ctSettings(const ctSettings& settings);
/// Destructor.
~ctSettings();
~ctSettings(){};
// Operations

View File

@ -95,10 +95,6 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView)
END_EVENT_TABLE()
ctConfigToolView::ctConfigToolView()
{
}
// What to do when a view is created. Creates actual
// windows for displaying the view.
bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@ -121,11 +117,11 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
if (!treeCtrl)
return;
wxASSERT (doc != NULL);
ctConfigItem* selItem = NULL;
wxTreeItemId sel = treeCtrl->GetSelection();
if (sel.IsOk())
{
@ -133,12 +129,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
if (data)
selItem = data->GetConfigItem() ;
}
ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
int hintOp = ctNoHint;
if (hint)
hintOp = hint->m_op;
switch (hintOp)
{
case ctInitialUpdate:
@ -151,12 +147,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
}
}
break;
case ctSelChanged:
case ctSelChanged:
{
if (selItem)
{
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
}
break;
case ctAllSaved:
@ -175,14 +171,14 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
treeCtrl->DeleteAllItems();
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
break;
}
}
case ctValueChanged:
{
// ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
break;
default:
break;
}
@ -200,7 +196,7 @@ bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
wxGetApp().GetDocManager()->ActivateView(this, false);
Activate(false);
wxGetApp().GetMainFrame()->SetDocument(NULL);
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
@ -443,7 +439,7 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg)
parent = sel->GetParent();
insertBefore = sel->FindNextSibling();
}
ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
newItem->InitProperties();
@ -634,7 +630,7 @@ void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& WXUNUSED(event))
{
ctConfigItem* parent = sel;
ctConfigItem* insertBefore = NULL;
ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
NULL, newItem, parent, insertBefore);
@ -766,7 +762,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString oldType = property->GetVariant().GetType();
wxString oldEditorType = property->GetEditorType();
wxArrayString oldChoices = property->GetChoices();
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
wxID_ANY, _("Edit custom property"));
dialog.SetPropertyName(oldName);
@ -779,7 +775,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString editorType = dialog.GetEditorType();
wxArrayString choices = dialog.GetChoices();
wxString descr = dialog.GetPropertyDescription();
if (name != oldName && sel->GetProperties().FindProperty(name))
{
wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
@ -813,7 +809,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
if (descr != oldDescription)
property->SetDescription(descr);
editor->ShowItem(sel);
OnChangeFilename();
}
@ -917,12 +913,12 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Setup File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@ -936,7 +932,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
}
stream << setupStr;
}
}
}
void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
@ -949,12 +945,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Configure Command File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@ -968,7 +964,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
}
stream << configureStr;
}
}
}
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)

View File

@ -33,9 +33,9 @@ class ctConfigToolView: public wxView
{
DECLARE_DYNAMIC_CLASS(ctConfigToolView)
public:
ctConfigToolView();
~ctConfigToolView() {};
ctConfigToolView(){};
~ctConfigToolView(){};
//// Overrides
bool OnCreate(wxDocument *doc, long flags);
@ -248,7 +248,7 @@ public:
// constructors and destructors
ctFindReplaceDialog( wxWindow* parent, const wxString& title,
long style = 0 );
void OnFind(wxFindDialogEvent& event);
void OnClose(wxFindDialogEvent& event);

View File

@ -119,7 +119,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str)
bool bResult = ParseHtml(m_topLevel);
wxASSERT(bResult); // Failed to parse the TAGs.
wxASSERT(bResult); // Failed to parse the TAGs.
// Hint: Check if every open tag has a close tag!
return bResult;
@ -164,7 +164,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
}
else
parent->AppendTag(tag);
}
}
}
else if (IsTagStartBracket(GetChar(m_pos)))
{
@ -189,7 +189,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
if(parent->GetParent())
parent->GetParent()->AppendTag(tag);
else
parent->AppendTag(tag); // When this occurs it is probably the
parent->AppendTag(tag); // When this occurs it is probably the
// empty lines at the end of the file...
}
}
@ -201,7 +201,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text)
{
while (!Eof() && GetChar(m_pos) != wxT('<'))
{
text += GetChar(m_pos);
text += (wxChar)GetChar(m_pos);
m_pos ++;
}
DecodeSpecialChars(text);
@ -441,7 +441,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt)
while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{
str += GetChar(pos);
str += (wxChar)GetChar(pos);
pos ++;
}
if (eatIt)
@ -524,7 +524,7 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
// See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{
// XML translation
// XML translation
value.Replace(wxT("&gt;"), wxT(">"), true);
value.Replace(wxT("&lt;"), wxT("<"), true);
value.Replace(wxT("&quot;"), wxT("\""), true);
@ -536,13 +536,13 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
{
wxString newvalue = value;
// XML translation
// XML translation
newvalue.Replace(wxT("&"), wxT("&amp;"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), true);
newvalue.Replace(wxT("<"), wxT("&lt;"), true);
newvalue.Replace(wxT("\""),wxT("&quot;"), true);
newvalue.Replace(wxT("'"), wxT("&apos;"), true);
return newvalue;
}
@ -695,7 +695,7 @@ void wxSimpleHtmlTag::RemoveChild(wxSimpleHtmlTag *remove)
{
child->m_next = NULL;
delete child;
if (prev != NULL)
prev->m_next = next;
else
@ -721,7 +721,7 @@ void wxSimpleHtmlTag::AppendTag(wxSimpleHtmlTag* tag)
while (last->m_next)
last = last->m_next;
last->m_next = tag;
last->m_next = tag;
}
else
{
@ -823,7 +823,7 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam
return false;
}
// Search forward from this tag until we find a tag with this name & attribute
// Search forward from this tag until we find a tag with this name & attribute
wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{
wxSimpleHtmlTag* tag = m_next;
@ -902,10 +902,10 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
attr->Write(stream);
if (i < GetAttributeCount() - 1)
stream << wxT(" ");
}
}
if(!m_children)
{
sbUseTab = false; // We're putting the open a close tag on the same line,
sbUseTab = false; // We're putting the open a close tag on the same line,
// so we don't wan't any tabs
stream << wxT(">");
}

View File

@ -192,11 +192,11 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event)
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MINIMIZED ;
else
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_NORMAL ;
// Must delete this now since the DLL loading library will be
// uninitialised by the time the app object is deleted
wxGetApp().ClearHelpControllers();
if (!IsMaximized() && !IsIconized())
{
wxGetApp().GetSettings().m_frameSize = GetRect();
@ -279,9 +279,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
{
// Make a menubar
wxMenu *fileMenu = new wxMenu;
wxGetApp().GetFileHistory().UseMenu(fileMenu);
fileMenu->Append(wxID_NEW, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
@ -297,7 +297,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
wxMenu *editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
@ -349,9 +349,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
helpMenu->Append(wxID_HELP_CONTEXT, wxT("&What's this?"), wxT("Show help on the clicked item"));
helpMenu->AppendSeparator();
helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("Show details about this application"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(editMenu, wxT("&Edit"));
menuBar->Append(viewMenu, wxT("&View"));
@ -361,7 +361,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWidgets"));
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistoryLoad(config);
}
}
return menuBar;
}
@ -438,10 +438,6 @@ ctOutputWindow::ctOutputWindow(wxWindow* parent, wxWindowID id,
CreateWindows();
}
ctOutputWindow::~ctOutputWindow()
{
}
/// Initialise the windows.
void ctOutputWindow::CreateWindows()
{
@ -492,13 +488,13 @@ void ctOutputWindow::OnCopyToClipboard(wxCommandEvent& WXUNUSED(event))
wxMessageBox(_("Sorry, could not open the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION|wxOK);
return;
}
wxString value(m_codeCtrl->GetValue());
#ifdef __WXMSW__
value.Replace(_T("\n"), _T("\r\n"));
#endif
wxTextDataObject *data = new wxTextDataObject( value );
if (!wxTheClipboard->SetData( data ))
{
wxTheClipboard->Close();

View File

@ -41,7 +41,7 @@ class ctConfigurationBrowserWindow;
class ctMainFrame: public wxDocParentFrame
{
DECLARE_CLASS(ctMainFrame)
public:
public:
/// Constructor.
ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
@ -124,7 +124,7 @@ class ctMainFrame: public wxDocParentFrame
/// Returns the configure page window
ctOutputWindow* GetConfigurePage() const { return m_configurePage; }
/// Returns the main notebook containing editor and text tabs
/// Returns the main notebook containing editor and text tabs
wxNotebook* GetMainNotebook() const { return m_mainNotebook; }
/// Sets the find dialog for future closing
@ -178,7 +178,7 @@ DECLARE_CLASS(ctOutputWindow)
public:
ctOutputWindow(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
~ctOutputWindow();
~ctOutputWindow(){};
/// Initialise the windows.
void CreateWindows();

View File

@ -65,10 +65,6 @@ ctPropertyEditor::ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoin
CreateControls(this);
}
ctPropertyEditor::~ctPropertyEditor()
{
}
void ctPropertyEditor::CreateControls(wxWindow* parent)
{
m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);

View File

@ -35,7 +35,7 @@ class ctPropertyEditor: public wxPanel
DECLARE_CLASS(ctPropertyEditor)
public:
ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
~ctPropertyEditor();
~ctPropertyEditor(){};
// Event handlers
@ -216,7 +216,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
bool AddControls(wxWindow* parent, const wxString& msg);
wxString GetText() const { return m_text; }
@ -231,7 +231,7 @@ private:
* Special-purpose splitter window for changing sash look and
* also saving sash width
*/
class ctSplitterWindow: public wxSplitterWindow
{
public:

View File

@ -82,9 +82,9 @@ wxString apColourToHexString(const wxColour& col)
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
unsigned int r = wxHexToDec(hex.Mid(0, 2));
unsigned int g = wxHexToDec(hex.Mid(2, 2));
unsigned int b = wxHexToDec(hex.Mid(4, 2));
unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
@ -132,7 +132,7 @@ wxFont apStringToFont(const wxString& str)
pointSize = 8;
if (pointSize == 9)
pointSize = 10;
#endif
#endif
}
else if (i == 1)
family = StringToInt(token);
@ -230,7 +230,7 @@ wxString wxGetTempDir()
wxString envVar(wxGetenv(_T("TEMP")));
dir = envVar;
}
if ( dir.empty() )
{
// default
@ -312,25 +312,25 @@ wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin
}
// Adds a context-sensitive help button, for non-Windows platforms
void apAddContextHelpButton(wxWindow*
void apAddContextHelpButton(wxWindow*
#if defined(__WXGTK__) || defined(__WXMAC__)
parent
#else
WXUNUSED(parent)
#endif
, wxSizer*
, wxSizer*
#if defined(__WXGTK__) || defined(__WXMAC__)
sizer
#else
WXUNUSED(sizer)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerFlags
#else
WXUNUSED(sizerFlags)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerBorder
#else
@ -392,7 +392,7 @@ int wxIconInfo::GetIconId(int state, bool enabled) const
{
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
wxASSERT ( state < m_maxStates );
return m_states[state * 2 + (enabled ? 0 : 1)];
}
@ -401,7 +401,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId)
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
if (state+1 > m_maxStates)
m_maxStates = state+1;
m_states[state * 2 + (enabled ? 0 : 1)] = iconId;
}
@ -426,7 +426,7 @@ void wxIconTable::AppendInfo(wxIconInfo* info)
bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled)
{
wxASSERT (m_imageList != NULL);
wxIconInfo* info = FindInfo(name);
if (!info)
{

View File

@ -57,27 +57,23 @@ ctApp::ctApp()
m_docManager = NULL;
}
ctApp::~ctApp()
{
}
bool ctApp::OnInit(void)
{
#if wxUSE_LOG
wxLog::SetTimestamp(NULL);
#endif // wxUSE_LOG
wxHelpProvider::Set(new wxSimpleHelpProvider);
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
#endif
#if wxUSE_LIBJPEG
wxImage::AddHandler( new wxJPEGHandler );
#endif
#if wxUSE_GIF
wxImage::AddHandler( new wxGIFHandler );
#endif
@ -124,13 +120,13 @@ bool ctApp::OnInit(void)
m_settings.Init();
LoadConfig();
wxString helpFilePathReference(GetFullAppPath(_("wx")));
m_helpControllerReference->Initialize(helpFilePathReference);
wxString helpFilePath(GetFullAppPath(_("configtool")));
m_helpController->Initialize(helpFilePath);
ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(),
GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
@ -194,16 +190,16 @@ bool ctApp::OnInit(void)
doc->SetDocumentSaved(true);
}
}
GetTopWindow()->Show(true);
return true;
}
int ctApp::OnExit(void)
{
SaveConfig();
// Save the file history
{
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("Generic Organisation"));
@ -212,7 +208,7 @@ int ctApp::OnExit(void)
delete m_docManager;
m_docManager = NULL;
return 0;
}
@ -220,7 +216,7 @@ void ctApp::ClearHelpControllers()
{
delete m_helpController;
m_helpController = NULL;
delete m_helpControllerReference;
m_helpControllerReference = NULL;
}
@ -233,7 +229,7 @@ wxString ctApp::GetFullAppPath(const wxString& filename) const
if (path.Last() != wxFILE_SEP_PATH && filename[0] != wxFILE_SEP_PATH)
path += wxFILE_SEP_PATH;
path += filename;
return path;
}

View File

@ -43,7 +43,7 @@ public:
ctApp();
/// Destructor.
~ctApp();
~ctApp(){};
// Accessors

View File

@ -557,9 +557,9 @@ wxString wxColourToHexString(const wxColour& col)
// Convert 6-digit hex string to a colour
wxColour wxHexStringToColour(const wxString& hex)
{
unsigned int r = wxHexToDec(hex.Mid(0, 2));
unsigned int g = wxHexToDec(hex.Mid(2, 2));
unsigned int b = wxHexToDec(hex.Mid(4, 2));
unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}

View File

@ -68,7 +68,8 @@ bool hvApp::OnInit()
int istyle = wxHF_DEFAULT_STYLE;
wxString service, windowName, book[10], titleFormat, argStr;
wxString service, windowName, titleFormat, argStr;
wxString book[10];
int bookCount = 0;
int i;
bool hasService = false;

View File

@ -22,7 +22,7 @@ void DecToHex(int dec, wxChar *buf)
buf[1] = hexArray[secondDigit];
buf[2] = 0;
}
static unsigned int getshort(FILE *fp)
{
int c, c1;
@ -35,7 +35,7 @@ static unsigned long getint(FILE *fp)
int c, c1, c2, c3;
c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp);
return (long)((long) c) +
(((long) c1) << 8) +
(((long) c1) << 8) +
(((long) c2) << 16) +
(((long) c3) << 24);
}
@ -44,20 +44,20 @@ bool GetBMPHeader(FILE *fp, int *Width, int *Height, int *Planes, int *BitsPerPi
{
// Remember about all fields but store only important ones
unsigned long /*
bfSize,
bfOffBits,
biSize,
*/
biWidth,
biHeight,
bfSize,
bfOffBits,
biSize,
*/
biWidth,
biHeight,
biPlanes,
biBitCount
/* ,
biCompression,
biSizeImage,
biXPelsPerMeter,
biYPelsPerMeter,
biClrUsed,
biSizeImage,
biXPelsPerMeter,
biYPelsPerMeter,
biClrUsed,
biClrImportant
*/
;
@ -161,7 +161,7 @@ struct mfPLACEABLEHEADER {
bool GetMetafileHeader(FILE *handle, int *width, int *height)
{
char buffer[40];
mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer;
mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer[0];
fread((void *)theHeader, sizeof(char), sizeof(mfPLACEABLEHEADER), handle);
if (theHeader->key != 0x9AC6CDD7)
{
@ -223,7 +223,7 @@ bool OutputMetafileData(FILE *handle)
int ch;
do
{
ch = getc(handle);
ch = getc(handle);
if (bytesSoFar == scanLineWidth)
{
bytesSoFar = 0;

View File

@ -208,7 +208,7 @@ void ResetContentsLevels(int l)
int i;
for (i = l; i < 5; i++)
ContentsLevels[i] = false;
// There are always books on the top level
ContentsLevels[0] = true;
}
@ -218,7 +218,7 @@ void ResetContentsLevels(int l)
void OutputSectionKeyword(FILE *fd)
{
OutputCurrentSectionToString(wxTex2RTFBuffer);
unsigned int i;
for (i = 0; i < wxStrlen(wxTex2RTFBuffer); i++)
if (wxTex2RTFBuffer[i] == ':')
@ -229,7 +229,7 @@ void OutputSectionKeyword(FILE *fd)
wxFprintf(fd, _T("K{\\footnote {K} "));
wxFprintf(fd, _T("%s"), wxTex2RTFBuffer);
wxFprintf(fd, _T("}\n"));
}
@ -242,12 +242,12 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
int d=0;
while ( (xitle[s]!=0)&&(d<255) )
{
wxChar ch=xitle[s]&0xff;
wxChar ch=wxChar(xitle[s]&0xff);
if (ch==0x5c) {
wxChar ch1=xitle[s+1]&0xff;
wxChar ch2=xitle[s+2]&0xff;
wxChar ch3=xitle[s+3]&0xff;
s+=4; // next character
wxChar ch1=wxChar(xitle[s+1]&0xff);
wxChar ch2=wxChar(xitle[s+2]&0xff);
wxChar ch3=wxChar(xitle[s+3]&0xff);
s+=4; // next character
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('ö'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('ä'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('ü'); }
@ -257,7 +257,7 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
} else {
title[d++]=ch;
s++;
}
}
}
title[d]=0;
@ -267,12 +267,9 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
if (level == 0) // Means we had a Chapter in an article, oops.
return;
ResetContentsLevels(level);
if (!title)
return;
if (winHelp && winHelpContents && WinHelpContentsFile)
{
TexTopic *texTopic = (TexTopic *)TopicTable.Get(topicName);
@ -352,7 +349,7 @@ void GenerateKeywordsForTopic(wxChar *topic)
// Must separate out main entry form subentry (only 1 subentry allowed)
wxChar buf1[100]; wxChar buf2[100];
SplitIndexEntry(s, buf1, buf2);
// Check for ':' which messes up index
unsigned int i;
for (i = 0; i < wxStrlen(buf1) ; i++)
@ -382,7 +379,7 @@ void GenerateKeywordsForTopic(wxChar *topic)
* Output index entry in linear RTF
*
*/
void GenerateIndexEntry(wxChar *entry)
{
if (useWord)
@ -405,7 +402,7 @@ void GenerateIndexEntry(wxChar *entry)
* Write a suitable RTF header.
*
*/
void WriteColourTable(FILE *fd)
{
wxFprintf(fd, _T("{\\colortbl"));
@ -474,7 +471,7 @@ void WriteRTFHeader(FILE *fd)
// Table of contents styles
wxFprintf(fd, _T("{\\s20\\sb300\\tqr\\tldot\\tx8640 \\b\\f2 \\sbasedon0\\snext0 toc 1;}\n"));
wxFprintf(fd, _T("{\\s21\\sb90\\tqr\\tldot\\li400\\tqr\\tx8640 \\f2\\fs20\\sbasedon0\\snext0 toc 2;}\n"));
wxFprintf(fd, _T("{\\s22\\sb90\\tqr\\tldot\\li800\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 3;}\n"));
wxFprintf(fd, _T("{\\s23\\sb90\\tqr\\tldot\\li1200\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 4;}\n"));
@ -522,7 +519,7 @@ void OutputNumberStyle(wxChar *numberStyle)
/*
* Write a Windows help project file
*/
bool WriteHPJ(wxChar *filename)
{
wxChar hpjFilename[256];
@ -537,7 +534,7 @@ bool WriteHPJ(wxChar *filename)
wxStrcpy(rtfFile, helpFile);
wxStrcat(helpFile, _T(".hlp"));
wxStrcat(rtfFile, _T(".rtf"));
FILE *fd = wxFopen(hpjFilename, _T("w"));
if (!fd)
return false;
@ -545,7 +542,7 @@ bool WriteHPJ(wxChar *filename)
wxChar *helpTitle = winHelpTitle;
if (!helpTitle)
helpTitle = _T("Untitled");
wxString thePath = wxPathOnly(InputFile);
if (thePath.IsEmpty())
thePath = _T(".");
@ -703,7 +700,7 @@ void ProcessText2RTF(TexChunk *chunk)
* and before TraverseDocument is called.
*
*/
void Text2RTF(TexChunk *chunk)
{
Tex2RTFYield();
@ -758,7 +755,7 @@ void Text2RTF(TexChunk *chunk)
* Not used yet
*
*/
wxChar browseBuf[10];
static long browseId = 0;
wxChar *GetBrowseString(void)
@ -879,7 +876,7 @@ void OutputRTFHeaderCommands(void)
{
int oldForbidResetPar = forbidResetPar;
forbidResetPar = 0;
if (LeftHeaderEven || CentreHeaderEven || RightHeaderEven)
{
TexOutput(_T("{\\headerl\\fi0 "));
@ -1147,7 +1144,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
// Need to reset the current numbering style, or RTF forgets it.
SetCurrentOutput(Chapters);
OutputNumberStyle(currentNumberStyle);
@ -1168,14 +1165,14 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else SetCurrentOutput(NULL); // No entry in table of contents
}
}
startedSections = true;
// Output heading to contents page
if (!InPopups())
{
OutputCurrentSection();
if (winHelp)
{
wxFprintf(Contents, _T("}{\\v %s}\\pard\\par\n"), topicName);
@ -1187,12 +1184,12 @@ void RTFOnMacro(int macroId, int no_args, bool start)
// From here, just output to chapter
SetCurrentOutput(Chapters);
}
if (winHelp)
{
wxFprintf(Chapters, _T("}\n#{\\footnote %s}\n"), topicName);
wxFprintf(Chapters, _T("+{\\footnote %s}\n"), GetBrowseString());
OutputSectionKeyword(Chapters);
GenerateKeywordsForTopic(topicName);
@ -1318,7 +1315,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
}
else SetCurrentOutput(NULL);
}
}
if (startedSections)
{
@ -1349,7 +1346,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else
wxFprintf(Contents, _T("}\\par\\par\\pard\n"));
}
SetCurrentOutput(winHelp ? Sections : Chapters);
if (winHelp)
@ -1386,7 +1383,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
wxChar *keep = _T("");
if (winHelp && (macroId != ltGLOSS) && !InPopups())
keep = _T("\\keepn\\sa140\\sb140");
wxFprintf(winHelp ? Sections : Chapters, _T("\\pard{%s%s"),
keep, styleCommand);
@ -1490,7 +1487,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
#endif
#endif
}
startedSections = true;
@ -1585,7 +1582,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
}
OutputCurrentSection(); // Repeat section header
// Experimental JACS
TexOutput(_T("\\par\\pard}\n"));
// TexOutput(_T("\\par\\pard}\\par\n"));
@ -1641,7 +1638,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else
SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else
}
if (startedSections)
{
if (winHelp)
@ -1650,7 +1647,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
#endif
#endif
}
startedSections = true;
@ -1668,7 +1665,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
else if ((DocumentStyle == LATEX_ARTICLE) && (macroId != ltSUBSUBSECTIONSTAR))
wxFprintf(Contents, _T("\\par\\pard\n"));
SetCurrentOutput(winHelp ? Subsubsections : Chapters);
if (winHelp)
{
@ -1708,7 +1705,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
WriteHeadingStyle((winHelp ? Subsubsections : Chapters),
(DocumentStyle == LATEX_ARTICLE ? 3 : 4));
wxFprintf(winHelp ? Subsubsections : Chapters, _T(" "));
if (!winHelp)
{
if ((macroId != ltSUBSUBSECTIONSTAR))
@ -2003,7 +2000,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
@ -2072,7 +2069,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
ItemizeStruc *struc = new ItemizeStruc(listType, indentSize2, indentSize1);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\tx%d\\li%d\\sa200"), indentSize1, indentSize2, indentSize2);
PushEnvironmentStyle(buf);
}
@ -2113,7 +2110,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_TWOCOL, indentSize);
itemizeStack.Insert(struc);
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\ri%d"), indentSize, indentSize, TwoColWidthA+TwoColWidthB+oldIndent);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200"), indentSize, indentSize);
PushEnvironmentStyle(buf);
@ -2143,7 +2140,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
OnMacro(ltPAR, 0, true);
OnMacro(ltPAR, 0, false);
}
#endif
#endif
}
break;
}
@ -2266,7 +2263,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
// WriteEnvironmentStyles();
}
#endif
#endif
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\\ri%d\n"), TwoColWidthA,
// TwoColWidthA, TwoColWidthA, TwoColWidthA+TwoColWidthB+oldIndent);
@ -2299,7 +2296,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else issuedNewParagraph = 0;
}
#endif
if (macroId == ltVERBATIM)
wxSnprintf(buf, sizeof(buf), _T("{\\f3\\s10\\fs20\\li720\\sa0 "));
else
@ -2317,7 +2314,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
TexOutput(_T("\\par\n"));
issuedNewParagraph = 1;
#endif
#endif
}
}
break;
@ -2508,7 +2505,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
case ltRMFAMILY:
case ltRM:
{
/*
/*
if (start)
{
TexOutput(_T("{\\plain "));
@ -2585,7 +2582,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
{
TexOutput(_T("\\par\\pard"));
issuedNewParagraph ++;
// Extra par if parskip is more than zero (usually looks best.)
// N.B. JACS 2004-02-21: shouldn't need this for linear RTF if
// we have a suitable set of styles.
@ -2595,7 +2592,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
#endif
#endif
WriteEnvironmentStyles();
}
// 1 is a whole paragraph if ParSkip == 0,
@ -2611,7 +2608,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
#endif
#endif
WriteEnvironmentStyles();
}
/*
@ -3231,7 +3228,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
{
if (!suppressNameDecoration) TexOutput(_T("}"));
}
if (start && (arg_no == 3))
TexOutput(_T("("));
if (!start && (arg_no == 3))
@ -3339,7 +3336,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (start)
{
wxChar *sec = NULL;
wxChar *refName = GetArgData();
if (winHelp || !useWord)
{
@ -3547,10 +3544,10 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
{
if (arg_no == 3)
return false;
static int imageWidth = 0;
static int imageHeight = 0;
if (start && (arg_no == 1))
{
wxChar *imageDimensions = copystring(GetArgData());
@ -3581,7 +3578,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (imageDimensions) // glt
delete [] imageDimensions;
return false;
}
}
else if (start && (arg_no == 2 ))
{
wxChar *filename = copystring(GetArgData());
@ -3702,7 +3699,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
}
else
{
#endif
#endif
TexOutput(_T("[No BMP or WMF for image file "));
TexOutput(filename);
TexOutput(_T("]"));
@ -4476,7 +4473,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (currentNumberStyle) delete[] currentNumberStyle;
currentNumberStyle = copystring(data);
OutputNumberStyle(currentNumberStyle);
TexOutput(_T("\n"));
}
return false;
@ -4687,7 +4684,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
@ -4753,7 +4750,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200 "), indentSize, indentSize);
PushEnvironmentStyle(buf);
TexOutput(buf);
@ -4796,7 +4793,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\lr%d\\sa200\\box%s "), indentSize, indentSize, indentSizeRight,
((macroId == ltCENTEREDBOX) ? _T("\\brdrs") : _T("\\brdrdb")));
PushEnvironmentStyle(buf);
@ -4920,7 +4917,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
// Need to reset the current numbering style, or RTF forgets it.
OutputNumberStyle(currentNumberStyle);
SetCurrentOutput(Contents);
@ -4960,7 +4957,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
wxFileNameFromPath(FileRoot), "Contents");
}
}
SetCurrentOutput(Chapters);
wxChar *styleCommand = _T("");
if (!winHelp && useHeadingStyles)
@ -5171,7 +5168,7 @@ bool RTFGo(void)
startedSections = false;
inVerbatim = false;
browseId = 0;
if (InputFile && OutputFile)
{
// Do some RTF-specific transformations on all the strings,
@ -5218,7 +5215,7 @@ bool RTFGo(void)
wxFprintf(Chapters, _T("\\titlepg\n"));
wxFprintf(Contents, _T("\\par\\pard\\pgnrestart\\sect\\titlepg"));
}
// In WinHelp, Contents title takes font of title.
// In linear RTF, same as chapter headings.
wxFprintf(Contents, _T("{\\b\\fs%d %s}\\par\\par\\pard\n\n"),
@ -5226,7 +5223,7 @@ bool RTFGo(void)
// By default, Swiss, 11 point.
wxFprintf(Chapters, _T("\\f2\\fs22\n"));
PushEnvironmentStyle(_T("\\f2\\fs22\\sa200"));
SetCurrentOutput(Chapters);
@ -5248,7 +5245,7 @@ bool RTFGo(void)
fclose(Header);
PopEnvironmentStyle();
Tex2RTFYield(true);
if (winHelp)
{
@ -5324,7 +5321,7 @@ bool RTFGo(void)
Tex2RTFYield(true);
wxRemoveFile(_T("tmp1.rtf"));
}
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
@ -5335,7 +5332,7 @@ bool RTFGo(void)
wxRemoveFile(_T("chapters.rtf"));
wxRemoveFile(_T("header.rtf"));
if (winHelp)
{
wxRemoveFile(_T("sections.rtf"));

View File

@ -38,7 +38,7 @@ static inline wxChar* copystring(const wxChar* s)
* Variables accessible from clients
*
*/
TexChunk * DocumentTitle = NULL;
TexChunk * DocumentAuthor = NULL;
TexChunk * DocumentDate = NULL;
@ -181,7 +181,7 @@ wxChar *UpNameString = copystring(_T("Up"));
* Section numbering
*
*/
int chapterNo = 0;
int sectionNo = 0;
int subsectionNo = 0;
@ -193,7 +193,7 @@ int tableNo = 0;
* Other variables
*
*/
FILE *CurrentOutput1 = NULL;
FILE *CurrentOutput2 = NULL;
FILE *Inputs[15];
@ -302,7 +302,7 @@ void ForbidWarning(TexMacroDef *def)
break;
}
}
TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBrace)
{
*parseToBrace = true;
@ -359,11 +359,11 @@ TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBra
macroBuf[j-i] = 0;
def = (TexMacroDef *)MacroDefs.Get(macroBuf);
}
if (def)
{
i = j;
// We want to check whether this is a space-consuming macro
// (e.g. {\bf word})
// No brace, e.g. \input thing.tex instead of \input{thing};
@ -492,7 +492,7 @@ bool read_a_line(wxChar *buf)
if ((ch1 == 10) || (ch1 == 13))
{
// Eliminate newline (10) following DOS linefeed
if (ch1 == 13)
if (ch1 == 13)
getc(Inputs[CurrentInputIndex]);
buf[bufIndex] = 0;
IncrementLineNumber();
@ -522,7 +522,7 @@ bool read_a_line(wxChar *buf)
return false;
}
buf[bufIndex] = ch;
buf[bufIndex] = (wxChar)ch;
bufIndex ++;
}
}
@ -537,7 +537,7 @@ bool read_a_line(wxChar *buf)
case 0xfc: // ü
case 0xd6: // Ö
case 0xc4: // Ä
case 0xdc: // Ü
case 0xdc: // Ü
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
@ -556,11 +556,11 @@ bool read_a_line(wxChar *buf)
case 0xfc:buf[bufIndex++]='u';break; // ü
case 0xd6:buf[bufIndex++]='O';break; // Ö
case 0xc4:buf[bufIndex++]='A';break; // Ä
case 0xdc:buf[bufIndex++]='U';break; // Ü
}
case 0xdc:buf[bufIndex++]='U';break; // Ü
}
buf[bufIndex++]='}';
break;
case 0xdf: // ß
case 0xdf: // ß
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
@ -574,7 +574,7 @@ bool read_a_line(wxChar *buf)
buf[bufIndex++]='s';
buf[bufIndex++]='\\';
buf[bufIndex++]='/';
break;
break;
default:
if (bufIndex >= MAX_LINE_BUFFER_SIZE)
{
@ -584,11 +584,11 @@ bool read_a_line(wxChar *buf)
OnError((wxChar *)errBuf.c_str());
return false;
}
// If the current character read in is a '_', we need to check
// If the current character read in is a '_', we need to check
// whether there should be a '\' before it or not
if (ch != '_')
{
buf[bufIndex++] = ch;
buf[bufIndex++] = (wxChar)ch;
break;
}
@ -625,7 +625,7 @@ bool read_a_line(wxChar *buf)
}
}
}
buf[bufIndex++] = ch;
buf[bufIndex++] = (wxChar)ch;
break;
} // switch
} // else
@ -635,7 +635,7 @@ bool read_a_line(wxChar *buf)
buf[bufIndex] = 0;
fclose(Inputs[CurrentInputIndex]);
Inputs[CurrentInputIndex] = NULL;
if (CurrentInputIndex > 0)
if (CurrentInputIndex > 0)
ch = ' '; // No real end of file
CurrentInputIndex --;
@ -687,7 +687,7 @@ bool read_a_line(wxChar *buf)
j -= 5;
buf[j] = 0;
}
if (buf[j-1] == '}')
buf[j-1] = 0; // Ignore final brace
@ -753,7 +753,7 @@ bool read_a_line(wxChar *buf)
buf[j] = 0;
}
if (buf[j-1] == _T('}'))
if (buf[j-1] == _T('}'))
buf[j-1] = 0; // Ignore final brace
// Remove backslashes from name
@ -975,7 +975,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
{
Tex2RTFYield();
if (stopRunning) return pos;
bool eof = false;
BigBuffer[0] = 0;
int buf_ptr = 0;
@ -1005,7 +1005,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
}
}
*/
// If not parsing to brace, just read the next word
// (e.g. \vskip 20pt)
if (!parseToBrace)
@ -1014,7 +1014,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
while (!eof && ch != 13 && ch != 32 && ch != 10 &&
ch != 0 && ch != '{')
{
BigBuffer[buf_ptr] = ch;
BigBuffer[buf_ptr] = (wxChar)ch;
buf_ptr ++;
pos ++;
ch = buffer[pos];
@ -1124,7 +1124,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
children.Append((wxObject *)chunk);
}
pos ++;
// Try matching \end{environment}
if (environment && FindEndEnvironment(buffer, &pos, environment))
{
@ -1190,7 +1190,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
}
else
{
wxTex2RTFBuffer[i] = ch;
wxTex2RTFBuffer[i] = (wxChar)ch;
pos ++;
i ++;
if (ch == 0)
@ -1221,7 +1221,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
if (buffer[pos] == '*')
pos ++;
// Find the delimiter character
// Find the delimiter character
int ch = buffer[pos];
pos ++;
// Now at start of verbatim text
@ -1297,7 +1297,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
}
}
@ -1353,7 +1353,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
}
}
@ -1557,7 +1557,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
* Consume as many arguments as the macro definition specifies
*
*/
int ParseMacroBody(const wxChar *WXUNUSED(macro_name), TexChunk *parent,
int no_args, wxChar *buffer, int pos,
wxChar *environment, bool parseToBrace,
@ -1674,11 +1674,11 @@ bool TexLoadFile(wxChar *filename)
TexPathList.EnsureFileAccessible(filename);
if (line_buffer)
if (line_buffer)
delete line_buffer;
line_buffer = new wxChar[MAX_LINE_BUFFER_SIZE];
Inputs[0] = wxFopen(filename, _T("r"));
LineNumbers[0] = 1;
FileNames[0] = copystring(filename);
@ -1725,7 +1725,7 @@ TexChunk::TexChunk(TexChunk& toCopy)
no_args = toCopy.no_args;
argn = toCopy.argn;
macroId = toCopy.macroId;
// if (toCopy.name)
// name = copystring(toCopy.name);
// else
@ -1736,7 +1736,7 @@ TexChunk::TexChunk(TexChunk& toCopy)
value = copystring(toCopy.value);
else
value = NULL;
optional = toCopy.optional;
wxNode *node = toCopy.children.GetFirst();
while (node)
@ -1776,7 +1776,7 @@ int GetNoArgs(void) // Number of args for this macro
* only!)
*
*/
void GetArgData1(TexChunk *chunk)
{
switch (chunk->type)
@ -2066,7 +2066,7 @@ void TexCleanUp(void)
refNode = TexReferences.Next();
}
TexReferences.Clear();
wxNode* bibNode = BibList.GetFirst();
while (bibNode)
{
@ -2506,7 +2506,7 @@ void DefineDefaultMacros(void)
AddMacroDef(ltUPSHAPE, _T("upshape"), 1);
AddMacroDef(ltURLREF, _T("urlref"), 2);
AddMacroDef(ltUSEPACKAGE, _T("usepackage"), 1);
AddMacroDef(ltVAREPSILON, _T("varepsilon"), 0);
AddMacroDef(ltVARPHI, _T("varphi"), 0);
AddMacroDef(ltVARPI, _T("varpi"), 0);
@ -2570,7 +2570,7 @@ void DefineDefaultMacros(void)
* Default behaviour, should be called by client if can't match locally.
*
*/
// Called on start/end of macro examination
void DefaultOnMacro(int macroId, int no_args, bool start)
{
@ -2691,7 +2691,7 @@ void DefaultOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("(r)"), true);
break;
case ltBACKSLASH:
if (start)
if (start)
TexOutput(_T("\\"), true);
break;
case ltLDOTS:
@ -3174,7 +3174,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
else
{
wxString informBuf;
informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
OnInform((wxChar *)informBuf.c_str());
}
}
@ -3222,7 +3222,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
DocumentStyle = LATEX_LETTER;
else if (wxStrncmp(DocumentStyleString, _T("slides"), 6) == 0)
DocumentStyle = LATEX_SLIDES;
if (StringMatch(_T("10"), DocumentStyleString))
SetFontSizes(10);
else if (StringMatch(_T("11"), DocumentStyleString))
@ -3436,12 +3436,12 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
if (fd)
{
ch = getc(fd);
smallBuf[0] = ch;
smallBuf[0] = (wxChar)ch;
while (ch != EOF)
{
TexOutput(smallBuf);
ch = getc(fd);
smallBuf[0] = ch;
smallBuf[0] = (wxChar)ch;
}
fclose(fd);
}
@ -3515,7 +3515,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxToupper(s[i]);
s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;
@ -3535,7 +3535,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxTolower(s[i]);
s1[i] = (wxChar)wxTolower(s[i]);
TexOutput(s1);
delete[] s1;
return false;
@ -3555,7 +3555,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxToupper(s[i]);
s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;

View File

@ -430,7 +430,7 @@ bool MyApp::OnInit()
ReadCustomMacros((wxChar*)path.c_str());
Go();
if (runTwice)
if (runTwice)
{
Go();
}
@ -1118,7 +1118,7 @@ void OnInform(const wxChar *msg)
/* This whole block of code is just wrong I think. It would behave
completely wrong under anything other than MSW due to the ELSE
with no statement, and the cout calls would fail under MSW, as
the code in this block is compiled if !NO_GUI This code has been
the code in this block is compiled if !NO_GUI This code has been
here since v1.1 of this file too. - gt
else
#ifdef __WXMSW__
@ -1213,10 +1213,6 @@ Tex2RTFConnection::Tex2RTFConnection(wxChar *buf, int size):wxDDEConnection(buf,
{
}
Tex2RTFConnection::~Tex2RTFConnection(void)
{
}
bool SplitCommand(wxChar *data, wxChar *firstArg, wxChar *secondArg)
{
firstArg[0] = 0;

View File

@ -22,7 +22,7 @@
#endif
// Define a new application type
class MyApp: public
class MyApp: public
#ifndef NO_GUI
wxApp
#else
@ -74,7 +74,7 @@ class Tex2RTFConnection: public wxDDEConnection
{
public:
Tex2RTFConnection(wxChar *buf, int size);
~Tex2RTFConnection(void);
~Tex2RTFConnection(void){};
bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
};

View File

@ -88,20 +88,20 @@ void OutputChunkToString(TexChunk *chunk, wxChar *buf)
FILE *tempfd = wxFopen(_T("tmp.tmp"), _T("w"));
if (!tempfd)
return;
FILE *old1 = CurrentOutput1;
FILE *old2 = CurrentOutput2;
CurrentOutput1 = tempfd;
CurrentOutput2 = NULL;
TraverseChildrenFromChunk(chunk);
CurrentOutput1 = old1;
CurrentOutput2 = old2;
fclose(tempfd);
// Read from file into string
tempfd = wxFopen(_T("tmp.tmp"), _T("r"));
if (!tempfd)
@ -177,7 +177,7 @@ wxChar *FindTopicName(TexChunk *chunk)
{
if (forceTopicName)
return forceTopicName;
wxChar *topicName = NULL;
static wxChar topicBuf[100];
@ -216,7 +216,7 @@ wxChar *FindTopicName(TexChunk *chunk)
* Snag is that some save a TexChunk, so don't use yet...
*
*/
void StartSimulateArgument(wxChar *data)
{
wxStrcpy(currentArgData, data);
@ -243,13 +243,13 @@ int ParseUnitArgument(wxChar *unitArg)
if (unitArg[i] == '\\')
unitArg[i] = 0;
len = wxStrlen(unitArg);
if (unitArg && (len > 0) && (isdigit(unitArg[0]) || unitArg[0] == '-'))
{
wxSscanf(unitArg, _T("%f"), &unitValue);
if (len > 1)
{
wxChar units[3];
wxChar units[3];
units[0] = unitArg[len-2];
units[1] = unitArg[len-1];
units[2] = 0;
@ -272,7 +272,7 @@ int ParseUnitArgument(wxChar *unitArg)
* IF one exists. Inserts zero into buffer.
*
*/
void StripExtension(wxChar *buffer)
{
int len = wxStrlen(buffer);
@ -339,18 +339,18 @@ void SetFontSizes(int pointSize)
}
}
/*
* Latex references
*
*/
void AddTexRef(wxChar *name, wxChar *file, wxChar *sectionName,
int chapter, int section, int subsection, int subsubsection)
{
TexRef *texRef = (TexRef *)TexReferences.Get(name);
if (texRef) TexReferences.Delete(name);
wxChar buf[100];
buf[0] = 0;
/*
@ -399,7 +399,7 @@ void WriteTexReferences(wxChar *filename)
wxString name = filename;
wxSTD ofstream ostr((char const *)name.fn_str());
if (ostr.bad()) return;
TexReferences.BeginFind();
wxHashTable::Node *node = TexReferences.Next();
while (node)
@ -467,17 +467,17 @@ void ReadTexReferences(wxChar *filename)
wxString sectionName_string = wxString::FromAscii(sectionName);
wxString section_string = wxString::FromAscii(section);
// gt - needed to trick the hash table "TexReferences" into deleting the key
// gt - needed to trick the hash table "TexReferences" into deleting the key
// strings it creates in the Put() function, but not the item that is
// created here, as that is destroyed elsewhere. Without doing this, there
// were massive memory leaks
TexReferences.DeleteContents(true);
TexReferences.Put(
label_string.c_str(),
label_string.c_str(),
new TexRef(
label_string.c_str(),
file_string.c_str(),
section_string.c_str(),
label_string.c_str(),
file_string.c_str(),
section_string.c_str(),
sectionName_string.c_str()
)
);
@ -495,13 +495,13 @@ void ReadTexReferences(wxChar *filename)
void BibEatWhiteSpace(wxSTD istream& str)
{
char ch = (char)str.peek();
while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == EOF))
while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == (char)EOF))
{
if (ch == 10)
BibLine ++;
str.get(ch);
if ((ch == EOF) || str.eof()) return;
if ((ch == (char)EOF) || str.eof()) return;
ch = (char)str.peek();
}
@ -585,7 +585,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
return;
}
istr.get(ch);
if (ch == '{')
braceCount ++;
@ -617,7 +617,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
buffer[i] = 0;
wxUnusedVar(stopping);
}
bool ReadBib(wxChar *filename)
{
if (!wxFileExists(filename))
@ -1377,7 +1377,7 @@ bool ReadCustomMacros(wxChar *filename)
istr.get(ch);
if (istr.eof())
break;
if (ch != '\\') // Not a macro definition, so must be NAME=VALUE
{
wxChar settingName[100];
@ -1426,7 +1426,7 @@ bool ReadCustomMacros(wxChar *filename)
BibReadValue(istr, macroBody, false, false); // Don't ignore extra braces
if (wxStrlen(macroBody) > 0)
macro->macroBody = copystring(macroBody);
BibEatWhiteSpace(istr);
CustomMacroList.Append(macroName, macro);
AddMacroDef(ltCUSTOM_MACRO, macroName, noArgs);
@ -1437,7 +1437,7 @@ bool ReadCustomMacros(wxChar *filename)
OnInform(mbuf);
return true;
}
CustomMacro *FindCustomMacro(wxChar *name)
{
wxNode *node = CustomMacroList.Find(name);
@ -1458,7 +1458,7 @@ void ShowCustomMacros(void)
OnInform(_T("No custom macros loaded.\n"));
return;
}
wxChar buf[400];
while (node)
{
@ -1506,7 +1506,7 @@ wxChar *ParseMultifieldString(wxChar *allFields, int *pos)
buffer[i] = 0;
if (oldPos == (*pos))
*pos = len + 1;
if (i == 0)
return NULL;
else
@ -1517,7 +1517,7 @@ wxChar *ParseMultifieldString(wxChar *allFields, int *pos)
* Colour tables
*
*/
ColourTableEntry::ColourTableEntry(const wxChar *theName, unsigned int r, unsigned int g, unsigned int b)
{
name = copystring(theName);
@ -1575,7 +1575,7 @@ bool FindColourHTMLString(wxChar *theName, wxChar *buf)
if (wxStrcmp(theName, entry->name) == 0)
{
wxStrcpy(buf, _T("#"));
wxChar buf2[3];
DecToHex(entry->red, buf2);
wxStrcat(buf, buf2);
@ -1591,7 +1591,7 @@ bool FindColourHTMLString(wxChar *theName, wxChar *buf)
return false;
}
void InitialiseColourTable(void)
{
// \\red0\\green0\\blue0;
@ -1602,16 +1602,16 @@ void InitialiseColourTable(void)
// \\red0\\green255\\blue0;
AddColour(_T("green"), 0,255,0);
// \\red255\\green0\\blue255;
AddColour(_T("magenta"), 255,0,255);
// \\red255\\green0\\blue0;
AddColour(_T("red"), 255,0,0);
// \\red255\\green255\\blue0;
AddColour(_T("yellow"), 255,255,0);
// \\red255\\green255\\blue255;}");
AddColour(_T("white"), 255,255,255);
}
@ -1625,10 +1625,10 @@ void Tex2RTFYield(bool force)
{
#ifdef __WXMSW__
static int yieldCount = 0;
if (isSync)
return;
if (force)
yieldCount = 0;
if (yieldCount == 0)
@ -1655,7 +1655,7 @@ void AddKeyWordForTopic(wxChar *topic, wxChar *entry, wxChar *filename)
texTopic->keywords = new wxStringList;
TopicTable.Put(topic, texTopic);
}
if (!texTopic->keywords->Member(entry))
texTopic->keywords->Add(entry);
}
@ -1677,7 +1677,7 @@ void ClearKeyWordTable(void)
/*
* TexTopic structure
*/
TexTopic::TexTopic(wxChar *f)
{
if (f)
@ -1704,17 +1704,17 @@ wxChar *ConvertCase(wxChar *s)
int i;
if (upperCaseNames)
for (i = 0; i < len; i ++)
buf[i] = wxToupper(s[i]);
buf[i] = (wxChar)wxToupper(s[i]);
else
for (i = 0; i < len; i ++)
buf[i] = wxTolower(s[i]);
buf[i] = (wxChar)wxTolower(s[i]);
buf[i] = 0;
return buf;
return buf;
}
#if !WXWIN_COMPATIBILITY_2
// if substring is true, search for str1 in str2
bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool exact)
{
if (subString)
@ -1729,7 +1729,7 @@ bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
return Sstr2.Index(Sstr1) != (size_t)wxNOT_FOUND;
}
else
return exact ? wxString(str2).Cmp(str1) == 0 :
return exact ? wxString(str2).Cmp(str1) == 0 :
wxString(str2).CmpNoCase(str1) == 0;
}
#endif