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->s_Password = Password;
p_Dlg->OnInit(); p_Dlg->OnInit();
p_Dlg->Fit(); p_Dlg->Fit();
bool OK = false; bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK) if (p_Dlg->ShowModal() == wxID_OK)
{ {
@@ -252,7 +252,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
{ {
case DB_DATA_TYPE_VARCHAR: case DB_DATA_TYPE_VARCHAR:
wxStrcpy(s_temp,_T("")); 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.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@@ -263,7 +263,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
break; break;
case DB_DATA_TYPE_INTEGER: case DB_DATA_TYPE_INTEGER:
l_temp = 0; 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.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@@ -276,7 +276,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
break; break;
case DB_DATA_TYPE_FLOAT: case DB_DATA_TYPE_FLOAT:
f_temp = 0; 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.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
@@ -289,8 +289,14 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
} }
break; break;
case DB_DATA_TYPE_DATE: 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; t_temp.day = 0;
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb)) 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.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); 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)->pColFor->Format(1,
(cl_BrowserDB+i)->dbDataType, (cl_BrowserDB+i)->dbDataType,
(cl_BrowserDB+i)->sqlDataType, (cl_BrowserDB+i)->sqlDataType,
(cl_BrowserDB+i)->columnSize, (cl_BrowserDB+i)->columnSize,
(cl_BrowserDB+i)->decimalDigits); (cl_BrowserDB+i)->decimalDigits);
} }
return cl_BrowserDB; return cl_BrowserDB;

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,7 @@ class Card {
public: public:
Card(int value, WayUp way_up = facedown); Card(int value, WayUp way_up = facedown);
virtual ~Card(); virtual ~Card(){};
void Draw(wxDC& pDC, int x, int y); void Draw(wxDC& pDC, int x, int y);
static void DrawNullCard(wxDC& pDC, int x, int y); // Draw card place-holder 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; wxColour* FortyApp::m_textColour = 0;
wxBrush* FortyApp::m_backgroundBrush = 0; wxBrush* FortyApp::m_backgroundBrush = 0;
FortyApp::FortyApp()
{
}
FortyApp::~FortyApp() FortyApp::~FortyApp()
{ {
delete m_backgroundColour; delete m_backgroundColour;
@@ -210,10 +206,6 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
} }
FortyFrame::~FortyFrame()
{
}
void FortyFrame::OnCloseWindow(wxCloseEvent& event) void FortyFrame::OnCloseWindow(wxCloseEvent& event)
{ {
if (m_canvas->OnCloseCanvas() ) if (m_canvas->OnCloseCanvas() )
@@ -338,8 +330,8 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
if (file.Exists()) if (file.Exists())
{ {
file.Open(); file.Open();
for ( htmlText = file.GetFirstLine(); for ( htmlText = file.GetFirstLine();
!file.Eof(); !file.Eof();
htmlText << file.GetNextLine() << _T("\n") ) ; 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); wxHtmlWindow* html = new wxHtmlWindow(this, ID_ABOUT_HTML_WINDOW, wxDefaultPosition, htmlSize, borderStyle);
html -> SetBorders(10); html -> SetBorders(10);
html -> SetPage(htmlText); html -> SetPage(htmlText);
//// Start of sizer-based control creation //// Start of sizer-based control creation
wxSizer *item0 = new wxBoxSizer( wxVERTICAL ); wxSizer *item0 = new wxBoxSizer( wxVERTICAL );

View File

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

View File

@@ -861,11 +861,6 @@ bool Base::AcceptCard(Card* card)
return retval; return retval;
} }
Base::~Base()
{
// nothing special at the moment
};
//----------------------------------------------------------------// //----------------------------------------------------------------//
// The Foundation class: holds the cards built up from the ace... // // The Foundation class: holds the cards built up from the ace... //
@@ -895,11 +890,6 @@ bool Foundation::AcceptCard(Card* card)
return retval; return retval;
} }
Foundation::~Foundation()
{
// nothing special at the moment
};
//----------------------------------------------------// //----------------------------------------------------//
// The Discard class: holds cards dealt from the m_pack // // 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++) 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) if (m_topCard > 31)
{ {
@@ -992,9 +982,3 @@ Card* Discard::RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset)
return card; return card;
} }
Discard::~Discard()
{
// nothing special at the moment
};

View File

@@ -39,7 +39,7 @@ public:
class Base : public Pile { class Base : public Pile {
public: public:
Base(int x, int y); Base(int x, int y);
~Base(); ~Base(){};
bool AcceptCard(Card* card); bool AcceptCard(Card* card);
}; };
@@ -50,7 +50,7 @@ public:
class Foundation : public Pile { class Foundation : public Pile {
public: public:
Foundation(int x, int y); Foundation(int x, int y);
~Foundation(); ~Foundation(){};
bool AcceptCard(Card* card); bool AcceptCard(Card* card);
}; };
@@ -61,7 +61,7 @@ public:
class Discard : public Pile { class Discard : public Pile {
public: public:
Discard(int x, int y); Discard(int x, int y);
~Discard(); ~Discard(){};
void Redraw(wxDC& dc); void Redraw(wxDC& dc);
void GetTopCardPos(int& x, int& y); void GetTopCardPos(int& x, int& y);
Card* RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset); 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; return false;
} }
Pile::~Pile()
{
// nothing special at the moment
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1025,7 +1025,7 @@ void LifeCanvas::OnSize(wxSizeEvent& event)
void LifeCanvas::OnScroll(wxScrollWinEvent& event) void LifeCanvas::OnScroll(wxScrollWinEvent& event)
{ {
WXTYPE type = event.GetEventType(); WXTYPE type = (WXTYPE)event.GetEventType();
int pos = event.GetPosition(); int pos = event.GetPosition();
int orient = event.GetOrientation(); 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)) while (((ch = poem_buffer[i]) != 10) && (ch != 0))
#endif #endif
{ {
line[j] = ch; line[j] = (wxChar)ch;
j ++; j ++;
i ++; i ++;
} }
@@ -661,7 +661,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
TheMainWindow->GetClientSize(&xx, &yy); TheMainWindow->GetClientSize(&xx, &yy);
dc.DrawBitmap(* backingBitmap, 0, 0); dc.DrawBitmap(* backingBitmap, 0, 0);
#if 0 #if 0
wxMemoryDC memDC; wxMemoryDC memDC;
memDC.SelectObject(* backingBitmap); memDC.SelectObject(* backingBitmap);
dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0); dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0);
@@ -851,7 +851,7 @@ bool LoadPoem(wxChar *file_name, long position)
i++; i++;
} }
poem_buffer[i] = ch; poem_buffer[i] = (wxChar)ch;
i ++; i ++;
if (i == buf_size) if (i == buf_size)
@@ -994,7 +994,7 @@ bool Compile(void)
nitems ++; nitems ++;
// Do rest // Do rest
do { do {
ch = getc(file); ch = getc(file);
if (ch == '#') if (ch == '#')

View File

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

View File

@@ -56,7 +56,7 @@ public:
wxString ReadString(); // deprecated: use ReadLine or ReadWord instead wxString ReadString(); // deprecated: use ReadLine or ReadWord instead
wxString ReadLine(); wxString ReadLine();
wxString ReadWord(); 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; } wxString GetStringSeparators() const { return m_separators; }
void SetStringSeparators(const wxString &c) { m_separators = c; } 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; return true;
} }
if (m_data->IsColNull(m_ColInfo[col].DbCol)) if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
{ {
return false; 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")); wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns"));
return NULL; return NULL;
} }
if (m_data->IsColNull(m_ColInfo[col].DbCol)) if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
return NULL; return NULL;
if (typeName == wxGRID_VALUE_DATETIME) if (typeName == wxGRID_VALUE_DATETIME)
@@ -580,7 +580,7 @@ bool wxDbGridTableBase::IsEmptyCell(int row, int col)
wxLogDebug(wxT("IsEmtpyCell on %i,%i"),row,col); wxLogDebug(wxT("IsEmtpyCell on %i,%i"),row,col);
ValidateRow(row); 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 *****/ /***** DEPRECATED: use wxDbTable::wxDbTable() format above *****/
#if WXWIN_COMPATIBILITY_2_4
wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
const wxChar *qryTblName, bool qryOnly, const wxString &tblPath) 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)) if (!initialize(pwxDb, tblName, numColumns, tempQryTblName, qryOnly, tblPath))
cleanup(); cleanup();
} // wxDbTable::wxDbTable() } // wxDbTable::wxDbTable()
#endif // WXWIN_COMPATIBILITY_2_4
/********** wxDbTable::~wxDbTable() **********/ /********** wxDbTable::~wxDbTable() **********/
@@ -1260,7 +1262,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
{ {
// Determine if this column should be included in the WHERE clause // Determine if this column should be included in the WHERE clause
if ((typeOfWhere == DB_WHERE_KEYFIELDS && colDefs[colNo].KeyField) || 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 // Skip over timestamp columns
if (colDefs[colNo].SqlCtype == SQL_C_TIMESTAMP) 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 // Loop through the columns setting each member variable to zero
for (i=0; i < noCols; i++) for (i=0; i < noCols; i++)
ClearMemberVar(i,setToNull); ClearMemberVar((UWORD)i,setToNull);
} // wxDbTable::ClearMemberVars() } // wxDbTable::ClearMemberVars()
@@ -2558,7 +2560,7 @@ bool wxDbTable::SetColNull(const wxString &colName, bool set)
{ {
colDefs[colNo].Null = set; colDefs[colNo].Null = set;
if (set) // Blank out the values in the member variable 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); setCbValueForColumn(colNo);
@@ -2665,7 +2667,7 @@ void wxDbTable::SetRowMode(const rowmode_t rowmode)
wxVariant wxDbTable::GetCol(const int colNo) const wxVariant wxDbTable::GetCol(const int colNo) const
{ {
wxVariant val; wxVariant val;
if ((colNo < noCols) && (!IsColNull(colNo))) if ((colNo < noCols) && (!IsColNull((UWORD)colNo)))
{ {
switch (colDefs[colNo].SqlCtype) switch (colDefs[colNo].SqlCtype)
{ {
@@ -2718,7 +2720,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
//FIXME: Add proper wxDateTime support to wxVariant.. //FIXME: Add proper wxDateTime support to wxVariant..
wxDateTime dateval; wxDateTime dateval;
SetColNull(colNo, val.IsNull()); SetColNull((UWORD)colNo, val.IsNull());
if (!val.IsNull()) if (!val.IsNull())
{ {
@@ -2728,7 +2730,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
{ {
//Returns null if invalid! //Returns null if invalid!
if (!dateval.ParseDate(val.GetString())) if (!dateval.ParseDate(val.GetString()))
SetColNull(colNo, true); SetColNull((UWORD)colNo, true);
} }
switch (colDefs[colNo].SqlCtype) switch (colDefs[colNo].SqlCtype)
@@ -2745,7 +2747,7 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
break; break;
case SQL_C_SHORT: case SQL_C_SHORT:
case SQL_C_SSHORT: case SQL_C_SSHORT:
*(short *)(colDefs[colNo].PtrDataObj) = val.GetLong(); *(short *)(colDefs[colNo].PtrDataObj) = (short)val.GetLong();
break; break;
case SQL_C_ULONG: case SQL_C_ULONG:
*(unsigned long *)(colDefs[colNo].PtrDataObj) = val.GetLong(); *(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(); *(wxChar *)(colDefs[colNo].PtrDataObj) = val.GetChar();
break; break;
case SQL_C_USHORT: case SQL_C_USHORT:
*(unsigned short *)(colDefs[colNo].PtrDataObj) = val.GetLong(); *(unsigned short *)(colDefs[colNo].PtrDataObj) = (unsigned short)val.GetLong();
break; break;
//FIXME: Add proper wxDateTime support to wxVariant.. //FIXME: Add proper wxDateTime support to wxVariant..
case SQL_C_DATE: case SQL_C_DATE:
@@ -2765,9 +2767,9 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
DATE_STRUCT *dataptr = DATE_STRUCT *dataptr =
(DATE_STRUCT *)colDefs[colNo].PtrDataObj; (DATE_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear(); dataptr->year = (SQLSMALLINT)dateval.GetYear();
dataptr->month = dateval.GetMonth()+1; dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
dataptr->day = dateval.GetDay(); dataptr->day = (SQLUSMALLINT)dateval.GetDay();
} }
break; break;
case SQL_C_TIME: case SQL_C_TIME:
@@ -2784,9 +2786,9 @@ void wxDbTable::SetCol(const int colNo, const wxVariant val)
{ {
TIMESTAMP_STRUCT *dataptr = TIMESTAMP_STRUCT *dataptr =
(TIMESTAMP_STRUCT *)colDefs[colNo].PtrDataObj; (TIMESTAMP_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear(); dataptr->year = (SQLSMALLINT)dateval.GetYear();
dataptr->month = dateval.GetMonth()+1; dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
dataptr->day = dateval.GetDay(); dataptr->day = (SQLUSMALLINT)dateval.GetDay();
dataptr->hour = dateval.GetHour(); dataptr->hour = dateval.GetHour();
dataptr->minute = dateval.GetMinute(); dataptr->minute = dateval.GetMinute();
@@ -2841,7 +2843,7 @@ void wxDbTable::SetKey(const GenericKey& k)
{ {
if (colDefs[i].KeyField) if (colDefs[i].KeyField)
{ {
SetColNull(i, false); SetColNull((UWORD)i, false);
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj); memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
blkptr += colDefs[i].SzDataObj; blkptr += colDefs[i].SzDataObj;
} }

View File

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

View File

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

View File

@@ -1126,7 +1126,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
// read the whole file in memory // read the whole file in memory
m_pData = new size_t8[nSize]; 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); wxDELETEA(m_pData);
return false; return false;
} }
@@ -1157,7 +1157,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
Swap(pHeader->ofsOrigTable)); Swap(pHeader->ofsOrigTable));
m_pTransTable = (wxMsgTableEntry *)(m_pData + m_pTransTable = (wxMsgTableEntry *)(m_pData +
Swap(pHeader->ofsTransTable)); Swap(pHeader->ofsTransTable));
m_nSize = nSize; m_nSize = (size_t)nSize;
// now parse catalog's header and try to extract catalog charset and // now parse catalog's header and try to extract catalog charset and
// plural forms formula from it: // 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; wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
if ( traits && !traits->HasStderr() ) 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); } { m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1),valptr->year); }
wxVariantDataDateTime(const TIMESTAMP_STRUCT* valptr) wxVariantDataDateTime(const TIMESTAMP_STRUCT* valptr)
{ m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1), valptr->year, { 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 #endif //ODBC
inline wxDateTime GetValue() const { return m_value; } inline wxDateTime GetValue() const { return m_value; }
@@ -1722,7 +1722,8 @@ wxVariant wxVariant::operator[] (size_t idx) const
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") ); 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 variant;
} }
return wxNullVariant; return wxNullVariant;

View File

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

View File

@@ -669,7 +669,7 @@ int main(int argc, char **argv)
} }
directoryOut = argv[current]; directoryOut = argv[current];
if ( !!directoryOut ) { if ( !directoryOut.IsEmpty() ) {
// terminate with a '/' if it doesn't have it // terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) { switch ( directoryOut.Last() ) {
case '/': case '/':
@@ -729,7 +729,7 @@ int main(int argc, char **argv)
// create a parser object and a visitor derivation // create a parser object and a visitor derivation
CJSourceParser parser; CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite); HelpGenVisitor visitor(directoryOut, overwrite);
if ( !!ignoreFile && mode == Mode_Dump ) if ( !ignoreFile.IsEmpty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile); visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL; spContext *ctxTop = NULL;
@@ -775,7 +775,7 @@ int main(int argc, char **argv)
} }
} }
if ( !!ignoreFile ) if ( !ignoreFile.IsEmpty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile); docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop); docman.DumpDifferences(ctxTop);
@@ -877,10 +877,10 @@ void HelpGenVisitor::CloseClass()
{ {
CloseFunction(); CloseFunction();
if ( m_inClass ) if ( m_inClass )
{ {
size_t count = m_arrayFuncDocs.GetCount(); size_t count = m_arrayFuncDocs.GetCount();
if ( count ) if ( count )
{ {
size_t n; size_t n;
FunctionDocEntry::classname = m_classname; FunctionDocEntry::classname = m_classname;
@@ -1417,7 +1417,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
char *buf = new char[len + 1]; char *buf = new char[len + 1];
buf[len] = '\0'; buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) { if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf; delete [] buf;
return false; return false;
@@ -1988,7 +1988,7 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
char *buf = new char[len + 1]; char *buf = new char[len + 1];
buf[len] = '\0'; buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) { if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf; delete [] buf;
return false; return false;
@@ -2186,6 +2186,9 @@ static const wxString GetVersionString()
/* /*
$Log$ $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 Revision 1.30 2004/06/18 19:25:50 ABX
Small step in making HelpGen up to date unicode application. 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) void ctSettings::operator = (const ctSettings& settings)
{ {
Copy(settings); Copy(settings);
@@ -265,7 +261,7 @@ bool ctSettings::SaveConfig()
// Indicate that we're no longer running, so we know if the program // Indicate that we're no longer running, so we know if the program
// crashed last time around. // crashed last time around.
config.Write(wxT("Misc/RunningProgram"), (long) 0); config.Write(wxT("Misc/RunningProgram"), (long) 0);
{ {
config.SetPath(wxT("FileHistory/")); config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistorySave(config); wxGetApp().GetDocManager()->FileHistorySave(config);

View File

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

View File

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

View File

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

View File

@@ -119,7 +119,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str)
bool bResult = ParseHtml(m_topLevel); 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! // Hint: Check if every open tag has a close tag!
return bResult; return bResult;
@@ -164,7 +164,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
} }
else else
parent->AppendTag(tag); parent->AppendTag(tag);
} }
} }
else if (IsTagStartBracket(GetChar(m_pos))) else if (IsTagStartBracket(GetChar(m_pos)))
{ {
@@ -189,7 +189,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
if(parent->GetParent()) if(parent->GetParent())
parent->GetParent()->AppendTag(tag); parent->GetParent()->AppendTag(tag);
else 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... // empty lines at the end of the file...
} }
} }
@@ -201,7 +201,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text)
{ {
while (!Eof() && GetChar(m_pos) != wxT('<')) while (!Eof() && GetChar(m_pos) != wxT('<'))
{ {
text += GetChar(m_pos); text += (wxChar)GetChar(m_pos);
m_pos ++; m_pos ++;
} }
DecodeSpecialChars(text); 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('=')) while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{ {
str += GetChar(pos); str += (wxChar)GetChar(pos);
pos ++; pos ++;
} }
if (eatIt) 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 // 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) /* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{ {
// XML translation // XML translation
value.Replace(wxT("&gt;"), wxT(">"), true); value.Replace(wxT("&gt;"), wxT(">"), true);
value.Replace(wxT("&lt;"), wxT("<"), true); value.Replace(wxT("&lt;"), wxT("<"), true);
value.Replace(wxT("&quot;"), wxT("\""), true); value.Replace(wxT("&quot;"), wxT("\""), true);
@@ -536,13 +536,13 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
{ {
wxString newvalue = value; 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("&amp;"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), true); newvalue.Replace(wxT(">"), wxT("&gt;"), true);
newvalue.Replace(wxT("<"), wxT("&lt;"), true); newvalue.Replace(wxT("<"), wxT("&lt;"), true);
newvalue.Replace(wxT("\""),wxT("&quot;"), true); newvalue.Replace(wxT("\""),wxT("&quot;"), true);
newvalue.Replace(wxT("'"), wxT("&apos;"), true); newvalue.Replace(wxT("'"), wxT("&apos;"), true);
return newvalue; return newvalue;
} }
@@ -695,7 +695,7 @@ void wxSimpleHtmlTag::RemoveChild(wxSimpleHtmlTag *remove)
{ {
child->m_next = NULL; child->m_next = NULL;
delete child; delete child;
if (prev != NULL) if (prev != NULL)
prev->m_next = next; prev->m_next = next;
else else
@@ -721,7 +721,7 @@ void wxSimpleHtmlTag::AppendTag(wxSimpleHtmlTag* tag)
while (last->m_next) while (last->m_next)
last = last->m_next; last = last->m_next;
last->m_next = tag; last->m_next = tag;
} }
else else
{ {
@@ -823,7 +823,7 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam
return false; 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* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{ {
wxSimpleHtmlTag* tag = m_next; wxSimpleHtmlTag* tag = m_next;
@@ -902,10 +902,10 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
attr->Write(stream); attr->Write(stream);
if (i < GetAttributeCount() - 1) if (i < GetAttributeCount() - 1)
stream << wxT(" "); stream << wxT(" ");
} }
if(!m_children) 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 // so we don't wan't any tabs
stream << wxT(">"); stream << wxT(">");
} }

View File

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

View File

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

View File

@@ -65,10 +65,6 @@ ctPropertyEditor::ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoin
CreateControls(this); CreateControls(this);
} }
ctPropertyEditor::~ctPropertyEditor()
{
}
void ctPropertyEditor::CreateControls(wxWindow* parent) void ctPropertyEditor::CreateControls(wxWindow* parent)
{ {
m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); 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) DECLARE_CLASS(ctPropertyEditor)
public: public:
ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style); ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
~ctPropertyEditor(); ~ctPropertyEditor(){};
// Event handlers // Event handlers
@@ -216,7 +216,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
bool AddControls(wxWindow* parent, const wxString& msg); bool AddControls(wxWindow* parent, const wxString& msg);
wxString GetText() const { return m_text; } wxString GetText() const { return m_text; }
@@ -231,7 +231,7 @@ private:
* Special-purpose splitter window for changing sash look and * Special-purpose splitter window for changing sash look and
* also saving sash width * also saving sash width
*/ */
class ctSplitterWindow: public wxSplitterWindow class ctSplitterWindow: public wxSplitterWindow
{ {
public: public:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -430,7 +430,7 @@ bool MyApp::OnInit()
ReadCustomMacros((wxChar*)path.c_str()); ReadCustomMacros((wxChar*)path.c_str());
Go(); Go();
if (runTwice) if (runTwice)
{ {
Go(); Go();
} }
@@ -1118,7 +1118,7 @@ void OnInform(const wxChar *msg)
/* This whole block of code is just wrong I think. It would behave /* This whole block of code is just wrong I think. It would behave
completely wrong under anything other than MSW due to the ELSE completely wrong under anything other than MSW due to the ELSE
with no statement, and the cout calls would fail under MSW, as 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 here since v1.1 of this file too. - gt
else else
#ifdef __WXMSW__ #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) bool SplitCommand(wxChar *data, wxChar *firstArg, wxChar *secondArg)
{ {
firstArg[0] = 0; firstArg[0] = 0;

View File

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