p_Dlg->s_Password = Password;
p_Dlg->OnInit();
p_Dlg->Fit();
-
+
bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK)
{
{
case DB_DATA_TYPE_VARCHAR:
wxStrcpy(s_temp,_T(""));
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_dbDataType),&s_temp[0],sizeof(s_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
break;
case DB_DATA_TYPE_INTEGER:
l_temp = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&l_temp,sizeof(l_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
break;
case DB_DATA_TYPE_FLOAT:
f_temp = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&f_temp,sizeof(f_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
}
break;
case DB_DATA_TYPE_DATE:
- t_temp.day = t_temp.month = t_temp.year = t_temp.hour = t_temp.minute = t_temp.second = t_temp.fraction = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb))
+ t_temp.day = 0;
+ t_temp.month = 0;
+ t_temp.year = 0;
+ t_temp.hour = 0;
+ t_temp.minute = 0;
+ t_temp.second = 0;
+ t_temp.fraction = 0;
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&t_temp,sizeof(t_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
(cl_BrowserDB+i)->pColFor->Format(1,
(cl_BrowserDB+i)->dbDataType,
(cl_BrowserDB+i)->sqlDataType,
- (cl_BrowserDB+i)->columnSize,
+ (cl_BrowserDB+i)->columnSize,
(cl_BrowserDB+i)->decimalDigits);
}
return cl_BrowserDB;
: mpContent( 0 )
{}
-//---------------------------------------------------------------------------
-twTabInfo::~twTabInfo()
-{
- // FOR NOW:: nothing
-}
-
//---------------------------------------------------------------------------
int twTabInfo::ImgWidth()
{
wxTabbedWindow::~wxTabbedWindow()
{
wxObjectList::compatibility_iterator pTab = mTabs.GetFirst();
-
+
while( pTab )
{
delete ((twTabInfo*)pTab->GetData());
{
wxObjectList::compatibility_iterator pTabNode = mTabs.GetFirst();
size_t n = 0;
-
+
while( pTabNode )
{
twTabInfo& info = *((twTabInfo*)pTabNode->GetData());
-
+
if ( n == mActiveTab )
{
//wxSizeEvent evt;
//info.mpContent->GetEventHandler()->ProcessEvent( evt );
-
+
info.mpContent->SetSize( x, y, width, height, 0 );
info.mpContent->Show(true);
info.mpContent->Refresh();
-
+
}
else
{
info.mpContent->Show(false);
}
-
+
pTabNode = pTabNode->GetNext();
++n;
}
wxBitmapType imageType )
{
twTabInfo* pTab = new twTabInfo();
-
+
pTab->mpContent = pContent;
pTab->mText = tabText;
-
+
if ( wxFileExists( imageFileName ) &&
-
+
pTab->mBitMap.LoadFile( imageFileName, imageType ) )
{
pTab->mImageFile = imageFileName;
pTab->mImageType = imageType;
}
-
-
+
+
if ( pContent->GetParent() == NULL )
pContent->Create( this, wxID_ANY );
-
+
mTabs.Append( (wxObject*)pTab );
-
+
RecalcLayout(true);
-
+
OnTabAdded( pTab );
}
wxString tabText, wxBitmap* pImage )
{
twTabInfo* pTab = new twTabInfo();
-
+
pTab->mpContent = pContent;
pTab->mText = tabText;
-
+
if ( pImage )
pTab->mBitMap = *pImage;
-
+
if ( pContent->GetParent() == NULL )
pContent->Create( this, wxID_ANY );
-
+
mTabs.Append( (wxObject*)pTab );
RecalcLayout(true);
OnTabAdded( pTab );
)
{
// darw the lightened upper-left sides of the rectangle
-
+
dc.SetPen( upperPen );
dc.DrawLine( x,y, x, y + height - 1 ); // vert
dc.DrawLine( x,y, x + width - 1, y ); // horiz
-
+
// draw the unenlightened lower-right sides of the rectangle
-
+
dc.SetPen( lowerPen );
dc.DrawLine( x + width - 1, y, x + width - 1, y + height - 1 ); // vert
dc.DrawLine( x, y + height - 1, x + width, y + height - 1 ); // horiz
// but not including the point specified by last position.
// This way Windows draws lines, not sure how Motif and Gtk
// prots behave...
-
+
int width, height;
GetClientSize( &width, &height );
-
+
// check if there's at least a bit of space to draw things
-
+
if ( width < mHorizGap*2 + BORDER_SZ*2+1 ||
height < mVertGap*2 + BORDER_SZ*2+1 + mTitleHeight
)
return;
-
+
// step #1 - draw border around the tab content area
-
+
// setup position for kind of "pencil"
int curX = mHorizGap;
int curY = mVertGap;
-
+
int xSize = width - mHorizGap*2;
int ySize = height - mVertGap *2 - mTitleHeight;
-
+
// layer 1 (upper white)
DrawShadedRect( curX+0, curY+0, xSize-0, ySize-0,
mWhitePen, mBlackPen, dc );
-
+
// layer 2 (upper gray)
DrawShadedRect( curX+1, curY+1, xSize-2-1, ySize-2-1,
mGrayPen, mGrayPen, dc );
-
+
// layer 3 (upper darkGray)
DrawShadedRect( curX+2, curY+2, xSize-3-2, ySize-3-2,
mDarkPen, mWhitePen, dc );
-
+
// layer 4 (upper black)
DrawShadedRect( curX+3, curY+3, xSize-4-3, ySize-4-3,
mBlackPen, mGrayPen, dc );
-
+
// add non-siemtric layer from the lower-right side (confroming to MFC-look)
-
+
dc.SetPen( mDarkPen );
dc.DrawLine( curX+1, curY + ySize - 2, curX + xSize - 1, curY + ySize - 2 ); // horiz
dc.DrawLine( curX + xSize - 2, curY + 1, curX + xSize - 2, curY + ySize - 2 ); // vert
-
+
// step #2 - draw tab title bars
-
+
curX = mFirstTitleGap;
curY = height - mVertGap - mTitleHeight;
-
+
size_t tabNo = 0;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
-
+
while( pNode )
{
// "hard-coded metafile" for decorations
-
+
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
xSize = tab.mDims.x;
ySize = mTitleHeight;
-
+
if ( tabNo == mActiveTab )
{
dc.SetPen( mGrayPen );
dc.DrawLine( curX+1, curY-2, curX+xSize-2, curY-2 );
dc.DrawLine( curX+1, curY-1, curX+xSize-2, curY-1 );
}
-
+
dc.SetPen( mWhitePen );
-
+
if ( tabNo == mActiveTab )
dc.DrawLine( curX, curY-2, curX, curY+ySize-2 );
else
dc.DrawLine( curX, curY, curX, curY+ySize-2 );
-
+
dc.SetPen( mDarkPen );
dc.DrawLine( curX+1, curY+ySize-3, curX+1, curY+ySize-1 ); // to pix down
dc.DrawLine( curX+2, curY+ySize-2, curX+xSize-2, curY+ySize-2 );
dc.DrawLine( curX+xSize-2, curY+ySize-3, curX+xSize-2, curY-3 );
else
dc.DrawLine( curX+xSize-2, curY+ySize-3, curX+xSize-2, curY-1 );
-
+
dc.SetPen( mBlackPen );
dc.DrawLine( curX+xSize-1, curY, curX+xSize-1, curY+ySize-2 );
dc.DrawLine( curX+xSize-2, curY+ySize-2, curX+xSize-3, curY+ySize-2 );
dc.DrawLine( curX+xSize-3, curY+ySize-1, curX+1, curY+ySize-1 );
-
+
pNode = pNode->GetNext();
++tabNo;
-
+
// darw image and (or without) text centered within the
// title bar rectangle
-
+
if ( mLayoutType != wxTITLE_BORDER_ONLY && tab.HasImg() )
{
wxMemoryDC tmpDc;
tmpDc.SelectObject( tab.GetImg() );
-
+
dc.Blit( curX + mTitleHorizGap,
curY + ( ySize - tab.ImgHeight() ) / 2,
tab.ImgWidth(),
&tmpDc, 0, 0, wxCOPY
);
}
-
+
if ( mLayoutType == wxTITLE_IMG_AND_TEXT && tab.HasText() )
{
long x,w,h;
-
+
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
-
+
dc.SetTextBackground( GetBackgroundColour() );
-
+
dc.GetTextExtent(tab.mText, &w, &h );
-
+
x = curX + mTitleHorizGap +
tab.ImgWidth() + tab.ImageToTxtGap(mImageTextGap);
-
+
dc.DrawText( tab.GetText(), x, curY + ( ySize - h ) / 2 );
}
curX += xSize;
-
+
} // end of `while (pNode)'
} // wxTabbedWindow::DrawDecorations()
{
int width, height;
GetClientSize( &width, &height );
-
+
int curX = mFirstTitleGap;
int curY = height - mVertGap - mTitleHeight;
-
+
int tabNo = 0;
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
// hit test rectangle of the currnet tab title bar
if ( pos.x >= curX && pos.x < curX + tab.mDims.x &&
pos.y >= curY && pos.y < curY + tab.mDims.y
{
return tabNo;
}
-
+
curX += tab.mDims.x;
-
+
pNode = pNode->GetNext();
++tabNo;
}
-
+
return -1;
} // wxTabbedWindow::HitTest()
{
if ( !andRepaint )
return;
-
+
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
size_t tabNo = 0;
-
+
while( pNode )
{
if ( tabNo != mActiveTab )
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mpContent->Show(false);
}
-
+
pNode = pNode->GetNext();
++tabNo;
}
#else
font.SetFamily( wxSWISS );
#endif
-
+
font.SetStyle(40);
font.SetWeight(40);
font.SetPointSize( 8 );
-
+
#ifdef __WINDOWS__
font.RealizeResource();
#endif
-
+
return font;
} // wxTabbedWindow::GetLabelingFont()
void wxTabbedWindow::RecalcLayout(bool andRepaint)
{
HideInactiveTabs(andRepaint);
-
+
// resetup position of the active tab
-
+
int width, height;
GetClientSize( &width, &height );
-
+
int curX = mHorizGap + BORDER_SZ;
int curY = mVertGap + BORDER_SZ;
-
+
int xSize = width - mHorizGap*2 - BORDER_SZ*2-1;
int ySize = height - mVertGap*2 - BORDER_SZ*2-1 - mTitleHeight;
-
+
SizeTabs( curX, curY, xSize, ySize, andRepaint );
-
+
// pass #1 - try to layout assuming it's wxTITLE_IMG_AND_TEXT
-
+
mLayoutType = wxTITLE_IMG_AND_TEXT;
-
+
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
-
+
curX = mFirstTitleGap; // the left-side gap
mTitleHeight = 0;
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
wxWindowDC dc(this);
-
+
long w,h;
-
+
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
-
+
dc.GetTextExtent(tab.mText, &w, &h );
-
+
tab.mDims.x = w + tab.ImageToTxtGap(mImageTextGap) +
tab.ImgWidth() + mTitleHorizGap*2;
-
+
tab.mDims.y = wxMax( h, tab.ImgHeight() ) + mTitleVertGap*2;
mTitleHeight = wxMax( mTitleHeight, tab.mDims.y );
-
+
curX += tab.mDims.x;
-
+
pNode = pNode->GetNext();
}
-
+
curX += mHorizGap; // the right-side gap
-
+
// make all title bars of equel height
-
+
pNode = mTabs.GetFirst();
-
+
while( pNode )
{
((twTabInfo*)(pNode->GetData()))->mDims.y = mTitleHeight;;
pNode = pNode->GetNext();
}
-
+
// if curX has'nt ran out of bounds, leave TITLE_IMG layout and return
if ( curX < width - mHorizGap )
return;
-
+
// pass #2 - try to layout assuming wxTITLE_IMG_ONLY
-
+
mLayoutType = wxTITLE_IMG_ONLY;
-
+
pNode = mTabs.GetFirst();
-
+
curX = mFirstTitleGap; // the left-side gap
-
+
int denomiator = mTabs.GetCount();
if ( denomiator == 0 )
++denomiator;
-
+
mBorderOnlyWidth = (width - mFirstTitleGap - mHorizGap) / denomiator;
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
if ( tab.HasImg() )
{
tab.mDims.x = tab.ImgWidth() + mTitleHorizGap*2;
tab.mDims.x = mBorderOnlyWidth;
tab.mDims.y = mTitleHeight;
}
-
+
curX += tab.mDims.x;
-
+
pNode = pNode->GetNext();
}
-
+
curX += mHorizGap; // the right-side gap
-
+
// if curX has'nt ran out of bounds, leave IMG_ONLY layout and return
if ( curX < width - mHorizGap )
return;
-
+
// pass #3 - set the narrowest layout wxTITLE_BORDER_ONLY
-
+
mLayoutType = wxTITLE_BORDER_ONLY;
-
+
pNode = mTabs.GetFirst();
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
tab.mDims.x = mBorderOnlyWidth;
tab.mDims.y = mTitleHeight;
-
+
pNode = pNode->GetNext();
}
} // wxTabbedWindow::RecalcLayout()
// floats, why?
int x = (int)event.m_x;
int y = (int)event.m_y;
-
+
int tabNo = HitTest( wxPoint(x,y) );
-
+
if ( tabNo != -1 )
{
SetActiveTab( tabNo );
mNoVertScroll = true; // Horizontale Scroll abschalten
}
-//---------------------------------------------------------------------------
-wxPagedWindow::~wxPagedWindow()
-{
- // nothing (base class handles destruction)
-}
-
//---------------------------------------------------------------------------
wxFont wxPagedWindow::GetLabelingFont()
{
wxFont font;
-
+
#ifdef __WINDOWS__
font.SetFaceName(_T("Comic Sans MS"));
#else
font.SetFamily( wxSWISS );
#endif
-
+
font.SetStyle(40);
font.SetWeight(40);
font.SetPointSize( 8 );
-
+
return font;
}
void wxPagedWindow::OnTabAdded( twTabInfo* WXUNUSED(pInfo) )
{
int units = GetWholeTabRowLen() / 20;
-
+
mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
}
int wxPagedWindow::GetWholeTabRowLen()
{
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
-
+
int len = 0;
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
len += tab.mDims.x;
pNode = pNode->GetNext();
}
-
+
return len;
} // wxPagedWindow::GetWholeTabRowLen()
wxBrush& brush, wxPen& pen, wxDC& dc )
{
wxPoint poly[4];
-
+
// draw organizer-style paper outlet
-
+
poly[0].x = x - mTabTrianGap;
poly[0].y = y;
-
+
poly[1].x = x + mTabTrianGap;
poly[1].y = y + tab.mDims.y-1;
-
+
poly[2].x = x + tab.mDims.x - mTabTrianGap;
poly[2].y = y + tab.mDims.y-1;
-
+
poly[3].x = x + tab.mDims.x + mTabTrianGap;
poly[3].y = y;
-
+
dc.SetPen( pen );
dc.SetBrush( brush );
-
+
dc.DrawPolygon( 4, poly );
-
+
long w,h;
-
+
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
-
+
dc.SetTextBackground( brush.GetColour() );
-
+
dc.GetTextExtent(tab.mText, &w, &h );
-
+
if ( tab.HasImg() )
{
wxMemoryDC tmpDc;
tmpDc.SelectObject( tab.GetImg() );
-
+
dc.Blit( x + mTitleHorizGap,
y + ( tab.mDims.y - tab.ImgHeight() ) / 2,
tab.ImgWidth(),
&tmpDc, 0, 0, wxCOPY
);
}
-
+
if ( tab.HasText() )
{
int tx = x + mTitleHorizGap +
tab.ImgWidth() + tab.ImageToTxtGap(mImageTextGap);
-
+
dc.DrawText( tab.GetText(), tx, y + ( tab.mDims.y - h ) / 2 );
}
} // wxPagedWindow::DrawPaperBar()
pNode = pNode->GetNext();
++tabNo;
}
-
+
// finally, draw the active tab (white-filled)
-
+
pNode = mTabs.GetFirst();
tabNo = 0;
-
+
curX = mTabTrianGap;
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
if ( tabNo == mActiveTab )
{
DrawPaperBar( tab, curX, curY, mWhiteBrush, mBlackPen, tmpDc );
-
+
tmpDc.SetPen( mWhitePen );
-
+
tmpDc.DrawLine( curX - mTabTrianGap+1, curY,
curX + tab.mDims.x + mTabTrianGap, curY );
break;
}
curX += tab.mDims.x;
-
+
pNode = pNode->GetNext();
++tabNo;
}
-
+
// back to initial device origin
-
+
tmpDc.SetDeviceOrigin( 0, 0 );
-
+
// draw resize-hint-stick
-
+
curX = mTitleRowLen - 6;
-
+
DrawShadedRect( curX+0, 0+0, 6, mTitleHeight, mGrayPen, mBlackPen, tmpDc );
DrawShadedRect( curX+1, 0+1, 6-2, mTitleHeight-2, mWhitePen, mDarkPen, tmpDc );
DrawShadedRect( curX+2, 0+2, 6-4, mTitleHeight-4, mGrayPen, mGrayPen, tmpDc );
-
-
-
+
+
+
dc.Blit( mTitleRowStart,
height - mVertGap - BORDER_SZ - mTitleHeight,
mTitleRowLen, mTitleHeight,
void wxPagedWindow::RecalcLayout(bool andRepaint)
{
mTitleRowLen = mAdjustableTitleRowLen;
-
+
if ( int(mpTabScroll) == -1 ) return;
-
+
// scroll bars should be created after Create() for this window is called
if ( !mpTabScroll )
{
mpTabScroll =
new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
-
+
mpHorizScroll =
new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
if (!mNoVertScroll) // Vertical Scroll (Original)
mpVertScroll = new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
}
-
+
{
int units = GetWholeTabRowLen() / 20;
-
+
mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
}
-
+
// resetup position of the active tab
-
+
int thumbLen = 16; // FOR NOW:: hardcoded
-
+
int width, height;
GetClientSize( &width, &height );
-
+
mTitleHeight = thumbLen;
-
+
int curX = mHorizGap + BORDER_SZ;
int curY = mVertGap + BORDER_SZ;
-
+
int xSize;
if (!mNoVertScroll) // Vertical Scroll (Original)
xSize = width - mHorizGap*2 - BORDER_SZ*2 - thumbLen;
else
xSize = width - mHorizGap*2 - BORDER_SZ*2;
-
+
int ySize = height - mVertGap*2 - BORDER_SZ*2 - mTitleHeight;
-
+
SizeTabs( curX, curY, xSize, ySize, andRepaint );
-
+
// setup title bar LINES's horizontal scroll bar
-
+
curY = height - mVertGap - BORDER_SZ - thumbLen;
-
+
mpTabScroll->SetSize( curX, curY, thumbLen*2, thumbLen );
-
+
// setup view's HORIZONTAL scroll bar
curX += thumbLen*2;
-
+
mTitleRowStart = curX;
mFirstTitleGap = curX + mCurentRowOfs + mTabTrianGap;
-
+
mTitleRowLen = wxMin( mAdjustableTitleRowLen,
width - mHorizGap - BORDER_SZ - thumbLen*4 - curX );
-
+
curX += mTitleRowLen;
-
+
if (!mNoVertScroll) // Vertical Scroll (Original)
mpHorizScroll->SetSize( curX, curY,width - curX - mHorizGap - BORDER_SZ - thumbLen, thumbLen );
else
mpHorizScroll->SetSize( curX, curY,width - curX - mHorizGap - BORDER_SZ-4, thumbLen );
-
+
// setup view's VERTICAL scroll bar
if (!mNoVertScroll) // Vertical Scroll (Original)
{
mpVertScroll->SetSize( curX, curY, thumbLen,height - curY - mVertGap - BORDER_SZ - thumbLen);
}
// layout tab title bars
-
+
mLayoutType = wxTITLE_IMG_AND_TEXT;
-
+
wxObjectList::compatibility_iterator pNode = mTabs.GetFirst();
-
+
while( pNode )
{
twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
-
+
wxWindowDC dc(this);
-
+
long w,h;
-
+
// set select default font of the window into it's device context
//dc.SetFont( GetLabelingFont() );
dc.GetTextExtent(tab.mText, &w, &h );
-
+
tab.mDims.x = w + tab.ImageToTxtGap(mImageTextGap) +
tab.ImgWidth() + mTitleHorizGap*2;
-
+
tab.mDims.y = mTitleHeight;
-
+
pNode = pNode->GetNext();
}
-
+
// disable title-bar scroller if there's nowhere to scroll to
-
+
mpTabScroll->Enable( mTitleRowLen < GetWholeTabRowLen() || mCurentRowOfs < 0 );
}
{
mIsDragged = true;
mDagOrigin = event.m_x;
-
+
mOriginalTitleRowLen = mAdjustableTitleRowLen;
-
+
CaptureMouse();
}
else
mIsDragged = false;
mCursorChanged = false;
SetCursor( mNormalCursor );
-
+
ReleaseMouse();
}
} // wxPagedWindow::OnLButtonUp()
{
int width, height;
GetClientSize( &width, &height );
-
+
if ( !mIsDragged )
{
int y = height - mVertGap - BORDER_SZ - mTitleHeight;
int x = mTitleRowStart + mTitleRowLen - 6;
-
+
if ( event.m_x >= x && event.m_y >= y &&
event.m_x < x + 6 &&
event.m_y < y + mTitleHeight
if ( !mCursorChanged )
{
SetCursor( mResizeCursor );
-
+
mCursorChanged = true;
}
}
if ( mCursorChanged )
{
SetCursor( mNormalCursor );
-
+
mCursorChanged = false;
}
}
if ( mIsDragged )
{
mAdjustableTitleRowLen = mOriginalTitleRowLen + ( event.m_x - mDagOrigin );
-
+
// FOR NOW:: fixed
if ( mAdjustableTitleRowLen < 6 ) mAdjustableTitleRowLen = 6;
-
+
wxWindowDC dc(this);
DrawDecorations( dc );
-
+
RecalcLayout(false);
-
+
//Refresh();
}
}
// wxMessageBox("wxPagedWindow::OnScroll","-I->");
if ( pSender == mpTabScroll )
{
-
+
int maxUnits = GetWholeTabRowLen() / 20;
-
+
mCurentRowOfs = -event.GetPosition()*maxUnits;
-
+
mFirstTitleGap = mTitleRowStart + mCurentRowOfs + mTabTrianGap;
-
+
// let' it automatically disable itself if it's time
mpTabScroll->Enable( mTitleRowLen < GetWholeTabRowLen() || mCurentRowOfs < 0 );
-
+
// repaint title bars
wxWindowDC dc(this);
DrawDecorations( dc );
if ( !mScrollEventInProgress )
{
mScrollEventInProgress = true;
-
+
GetActiveTab()->GetEventHandler()->ProcessEvent( event );
}
else
{
// event bounced back to us, from here we
// know that it has traveled the loop - thus it's processed!
-
+
mScrollEventInProgress = false;
}
}
virtual void AddTab( wxWindow* pContent,
wxString tabText,
- wxBitmap* pImage = NULL );
+ wxBitmap* pImage );
virtual void RemoveTab( int tabNo );
public:
wxPagedWindow();
- ~wxPagedWindow();
+ ~wxPagedWindow(){};
// NOTE:: use public methods of the base class
// to add "pages" to this window
DECLARE_DYNAMIC_CLASS( twTabInfo )
public:
twTabInfo();
- ~twTabInfo();
+ ~twTabInfo(){};
int ImgWidth();
int ImgHeight();
m_height = int(70*scale);
}
-//+-------------------------------------------------------------+
-//| Card::~Card() |
-//+-------------------------------------------------------------+
-//| Description: |
-//| Destructor - nothing to do at present. |
-//+-------------------------------------------------------------+
-Card::~Card()
-{
-}
-
-
//+-------------------------------------------------------------+
//| Card::Erase() |
//+-------------------------------------------------------------+
// Draw the value
dc.Blit((wxCoord)(x + m_scale*3),
(wxCoord)(y + m_scale*3),
- valuewidth,
+ valuewidth,
valueheight,
- &memoryDC,
- valuewidth * (m_pipValue - 1),
- valuepos,
+ &memoryDC,
+ valuewidth * (m_pipValue - 1),
+ valuepos,
wxCOPY);
- dc.Blit((wxCoord)(x + m_width - m_scale*3 - valuewidth),
+ dc.Blit((wxCoord)(x + m_width - m_scale*3 - valuewidth),
(wxCoord)(y + m_height - valueheight - m_scale*3),
- valuewidth,
+ valuewidth,
valueheight,
- &memoryDC,
- valuewidth * (m_pipValue - 1),
- valuepos+valueheight,
+ &memoryDC,
+ valuewidth * (m_pipValue - 1),
+ valuepos+valueheight,
wxCOPY);
// Draw the pips
- dc.Blit((wxCoord)(x + m_scale*3 + valuewidth+2),
- (wxCoord)(y + m_scale*3),
- pipsize,
+ dc.Blit((wxCoord)(x + m_scale*3 + valuewidth+2),
+ (wxCoord)(y + m_scale*3),
pipsize,
- &memoryDC,
- pipsize * m_suit,
- pippos,
+ pipsize,
+ &memoryDC,
+ pipsize * m_suit,
+ pippos,
wxCOPY);
- dc.Blit((wxCoord)(x + m_width - m_scale*3-valuewidth-pipsize-2),
+ dc.Blit((wxCoord)(x + m_width - m_scale*3-valuewidth-pipsize-2),
(wxCoord)(y + m_height - pipsize - m_scale*3),
- pipsize,
pipsize,
- &memoryDC,
- pipsize * m_suit,
- pipsize+pippos,
+ pipsize,
+ &memoryDC,
+ pipsize * m_suit,
+ pipsize+pippos,
wxCOPY);
switch (m_pipValue)
{
case 1:
- dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - m_scale*5 + m_height / 2),
- symsize,
+ dc.Blit((wxCoord)(x - symdist + m_width / 2),
+ (wxCoord)(y - m_scale*5 + m_height / 2),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
break;
case 3:
- dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + m_height / 2),
- symsize,
+ dc.Blit((wxCoord)(x - symdist + m_width / 2),
+ (wxCoord)(y - symdist + m_height / 2),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
case 2:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
break;
case 5:
- dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + m_height / 2),
- symsize,
+ dc.Blit((wxCoord)(x - symdist + m_width / 2),
+ (wxCoord)(y - symdist + m_height / 2),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
case 4:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
break;
case 8:
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
- (wxCoord)(y - symdist + 5 * m_height / 8),
- symsize,
+ (wxCoord)(y - symdist + 5 * m_height / 8),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
case 7:
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
- (wxCoord)(y - symdist + 3 * m_height / 8),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 8),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
case 6:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + m_height / 4),
+ symsize,
symsize,
&memoryDC, symsize * m_suit, sympos, wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + m_height / 2),
- symsize,
+ (wxCoord)(y - symdist + m_height / 2),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + m_height / 4),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + m_height / 2),
- symsize,
+ (wxCoord)(y - symdist + m_height / 2),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
break;
case 10:
dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + 2 * m_height / 3),
- symsize,
+ (wxCoord)(y - symdist + 2 * m_height / 3),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
case 9:
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist2 + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist2 + m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist2 + 5 * m_height / 12),
- symsize,
+ (wxCoord)(y - symdist2 + 5 * m_height / 12),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + 7 * m_height / 12),
- symsize,
+ (wxCoord)(y - symdist + 7 * m_height / 12),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist2 + m_height / 4),
- symsize,
+ (wxCoord)(y - symdist2 + m_height / 4),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist2 + 5 * m_height / 12),
- symsize,
+ (wxCoord)(y - symdist2 + 5 * m_height / 12),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + 7 * m_height / 12),
- symsize,
+ (wxCoord)(y - symdist + 7 * m_height / 12),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
- (wxCoord)(y - symdist + 3 * m_height / 4),
- symsize,
+ (wxCoord)(y - symdist + 3 * m_height / 4),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
dc.Blit((wxCoord)(x - symdist + m_width / 2),
- (wxCoord)(y - symdist + m_height / 3),
- symsize,
+ (wxCoord)(y - symdist + m_height / 3),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
break;
case 11:
case 13:
memoryDC.SelectObject(*m_pictureBmap);
int picwidth = 40,picheight = 45;
- dc.Blit((wxCoord)(x + (m_width-picwidth)/2),
+ dc.Blit((wxCoord)(x + (m_width-picwidth)/2),
(wxCoord)(y - picheight/2 + m_height/2),
- picwidth,
+ picwidth,
picheight,
- &memoryDC,
- picwidth * (m_pipValue - 11),
- 0,
+ &memoryDC,
+ picwidth * (m_pipValue - 11),
+ 0,
wxCOPY);
memoryDC.SelectObject(*m_symbolBmap);
dc.Blit((wxCoord)(x + m_width-(m_width-picwidth)/2-symsize-3),
- (wxCoord)(y - picheight/2+m_height/2+1),
- symsize,
+ (wxCoord)(y - picheight/2+m_height/2+1),
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos,
+ symsize,
+ &memoryDC,
+ symsize * m_suit,
+ sympos,
wxCOPY);
dc.Blit((wxCoord)(x + (m_width-picwidth)/2+2),
- (wxCoord)(y + picheight/2 + m_height/2-symsize),
- symsize,
+ (wxCoord)(y + picheight/2 + m_height/2-symsize),
+ symsize,
symsize,
- &memoryDC,
- symsize * m_suit,
- sympos2,
+ &memoryDC,
+ symsize * m_suit,
+ sympos2,
wxCOPY);
break;
}
public:
Card(int value, WayUp way_up = facedown);
- virtual ~Card();
+ virtual ~Card(){};
void Draw(wxDC& pDC, int x, int y);
static void DrawNullCard(wxDC& pDC, int x, int y); // Draw card place-holder
wxColour* FortyApp::m_textColour = 0;
wxBrush* FortyApp::m_backgroundBrush = 0;
-FortyApp::FortyApp()
-{
-}
-
FortyApp::~FortyApp()
{
delete m_backgroundColour;
#endif // wxUSE_STATUSBAR
}
-FortyFrame::~FortyFrame()
-{
-}
-
void FortyFrame::OnCloseWindow(wxCloseEvent& event)
{
if (m_canvas->OnCloseCanvas() )
if (file.Exists())
{
file.Open();
- for ( htmlText = file.GetFirstLine();
- !file.Eof();
+ for ( htmlText = file.GetFirstLine();
+ !file.Eof();
htmlText << file.GetNextLine() << _T("\n") ) ;
}
}
wxHtmlWindow* html = new wxHtmlWindow(this, ID_ABOUT_HTML_WINDOW, wxDefaultPosition, htmlSize, borderStyle);
html -> SetBorders(10);
html -> SetPage(htmlText);
-
+
//// Start of sizer-based control creation
wxSizer *item0 = new wxBoxSizer( wxVERTICAL );
class FortyApp: public wxApp
{
public:
- FortyApp();
+ FortyApp(){};
~FortyApp();
bool OnInit();
class FortyFrame: public wxFrame
{
public:
- FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
- virtual ~FortyFrame();
+ FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
+ virtual ~FortyFrame(){};
void OnCloseWindow(wxCloseEvent& event);
DECLARE_EVENT_TABLE()
private:
- enum MenuCommands {
- NEW_GAME = 10,
+ enum MenuCommands {
+ NEW_GAME = 10,
SCORES,
- UNDO,
+ UNDO,
REDO,
- RIGHT_BUTTON_UNDO,
- HELPING_HAND,
+ RIGHT_BUTTON_UNDO,
+ HELPING_HAND,
LARGE_CARDS
};
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE );
-
+
bool AddControls(wxWindow* parent);
private:
return retval;
}
-Base::~Base()
-{
-// nothing special at the moment
-};
-
//----------------------------------------------------------------//
// The Foundation class: holds the cards built up from the ace... //
return retval;
}
-Foundation::~Foundation()
-{
-// nothing special at the moment
-};
-
//----------------------------------------------------//
// The Discard class: holds cards dealt from the m_pack //
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)
{
return card;
}
-
-
-Discard::~Discard()
-{
-// nothing special at the moment
-};
class Base : public Pile {
public:
Base(int x, int y);
- ~Base();
+ ~Base(){};
bool AcceptCard(Card* card);
};
class Foundation : public Pile {
public:
Foundation(int x, int y);
- ~Foundation();
+ ~Foundation(){};
bool AcceptCard(Card* card);
};
class Discard : public Pile {
public:
Discard(int x, int y);
- ~Discard();
+ ~Discard(){};
void Redraw(wxDC& dc);
void GetTopCardPos(int& x, int& y);
Card* RemoveTopCard(wxDC& dc, int m_xOffset, int m_yOffset);
}
return false;
}
-
-
-Pile::~Pile()
-{
-// nothing special at the moment
-}
class Pile {
public:
Pile(int x, int y, int dx = 0, int dy = 0);
- virtual ~Pile();
+ virtual ~Pile(){};
// General functions
virtual void ResetPile() { m_topCard = -1; }
CentreOnParent();
}
-PlayerSelectionDialog::~PlayerSelectionDialog()
-{
-}
-
void PlayerSelectionDialog::OnSize(wxSizeEvent& WXUNUSED(event))
{
Layout();
{
public:
PlayerSelectionDialog(wxWindow* parent, ScoreFile* file);
- virtual ~PlayerSelectionDialog();
+ virtual ~PlayerSelectionDialog(){};
const wxString& GetPlayersName();
void ButtonCallback(wxCommandEvent& event);
CentreOnParent();
}
-ScoreDialog::~ScoreDialog()
-{
-}
-
void ScoreDialog::Display()
{
ShowModal();
{
public:
ScoreDialog(wxWindow* parent, ScoreFile* file);
- virtual ~ScoreDialog();
+ virtual ~ScoreDialog(){};
void Display();
void LifeCanvas::OnScroll(wxScrollWinEvent& event)
{
- WXTYPE type = event.GetEventType();
+ WXTYPE type = (WXTYPE)event.GetEventType();
int pos = event.GetPosition();
int orient = event.GetOrientation();
while (((ch = poem_buffer[i]) != 10) && (ch != 0))
#endif
{
- line[j] = ch;
+ line[j] = (wxChar)ch;
j ++;
i ++;
}
TheMainWindow->GetClientSize(&xx, &yy);
dc.DrawBitmap(* backingBitmap, 0, 0);
-#if 0
+#if 0
wxMemoryDC memDC;
memDC.SelectObject(* backingBitmap);
dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0);
i++;
}
- poem_buffer[i] = ch;
+ poem_buffer[i] = (wxChar)ch;
i ++;
if (i == buf_size)
nitems ++;
// Do rest
-
+
do {
ch = getc(file);
if (ch == '#')
const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
const wxString &tblPath=wxEmptyString);
- // DEPRECATED
- wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
- const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
- const wxString &tblPath=wxEmptyString);
+#if WXWIN_COMPATIBILITY_2_4
+ wxDEPRECATED(
+ wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
+ const wxChar *qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY,
+ const wxString &tblPath=wxEmptyString)
+ );
+#endif // WXWIN_COMPATIBILITY_2_4
virtual ~wxDbTable();
wxString ReadString(); // deprecated: use ReadLine or ReadWord instead
wxString ReadLine();
wxString ReadWord();
- wxChar GetChar() { wxChar c = NextChar(); return c != wxEOT ? c : 0; }
+ wxChar GetChar() { wxChar c = NextChar(); return (wxChar)(c != wxEOT ? c : 0); }
wxString GetStringSeparators() const { return m_separators; }
void SetStringSeparators(const wxString &c) { m_separators = c; }
return true;
}
- if (m_data->IsColNull(m_ColInfo[col].DbCol))
+ if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
{
return false;
}
wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns"));
return NULL;
}
- if (m_data->IsColNull(m_ColInfo[col].DbCol))
+ if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol))
return NULL;
if (typeName == wxGRID_VALUE_DATETIME)
wxLogDebug(wxT("IsEmtpyCell on %i,%i"),row,col);
ValidateRow(row);
- return m_data->IsColNull(m_ColInfo[col].DbCol);
+ return m_data->IsColNull((UWORD)m_ColInfo[col].DbCol);
}
/***** DEPRECATED: use wxDbTable::wxDbTable() format above *****/
+#if WXWIN_COMPATIBILITY_2_4
wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns,
const wxChar *qryTblName, bool qryOnly, const wxString &tblPath)
{
if (!initialize(pwxDb, tblName, numColumns, tempQryTblName, qryOnly, tblPath))
cleanup();
} // wxDbTable::wxDbTable()
+#endif // WXWIN_COMPATIBILITY_2_4
/********** wxDbTable::~wxDbTable() **********/
{
// Determine if this column should be included in the WHERE clause
if ((typeOfWhere == DB_WHERE_KEYFIELDS && colDefs[colNo].KeyField) ||
- (typeOfWhere == DB_WHERE_MATCHING && (!IsColNull(colNo))))
+ (typeOfWhere == DB_WHERE_MATCHING && (!IsColNull((UWORD)colNo))))
{
// Skip over timestamp columns
if (colDefs[colNo].SqlCtype == SQL_C_TIMESTAMP)
// Loop through the columns setting each member variable to zero
for (i=0; i < noCols; i++)
- ClearMemberVar(i,setToNull);
+ ClearMemberVar((UWORD)i,setToNull);
} // wxDbTable::ClearMemberVars()
{
colDefs[colNo].Null = set;
if (set) // Blank out the values in the member variable
- ClearMemberVar(colNo,false); // Must call with false here, or infinite recursion will happen
+ ClearMemberVar((UWORD)colNo,false); // Must call with false here, or infinite recursion will happen
setCbValueForColumn(colNo);
wxVariant wxDbTable::GetCol(const int colNo) const
{
wxVariant val;
- if ((colNo < noCols) && (!IsColNull(colNo)))
+ if ((colNo < noCols) && (!IsColNull((UWORD)colNo)))
{
switch (colDefs[colNo].SqlCtype)
{
//FIXME: Add proper wxDateTime support to wxVariant..
wxDateTime dateval;
- SetColNull(colNo, val.IsNull());
+ SetColNull((UWORD)colNo, val.IsNull());
if (!val.IsNull())
{
{
//Returns null if invalid!
if (!dateval.ParseDate(val.GetString()))
- SetColNull(colNo, true);
+ SetColNull((UWORD)colNo, true);
}
switch (colDefs[colNo].SqlCtype)
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
- *(short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
+ *(short *)(colDefs[colNo].PtrDataObj) = (short)val.GetLong();
break;
case SQL_C_ULONG:
*(unsigned long *)(colDefs[colNo].PtrDataObj) = val.GetLong();
*(wxChar *)(colDefs[colNo].PtrDataObj) = val.GetChar();
break;
case SQL_C_USHORT:
- *(unsigned short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
+ *(unsigned short *)(colDefs[colNo].PtrDataObj) = (unsigned short)val.GetLong();
break;
//FIXME: Add proper wxDateTime support to wxVariant..
case SQL_C_DATE:
DATE_STRUCT *dataptr =
(DATE_STRUCT *)colDefs[colNo].PtrDataObj;
- dataptr->year = dateval.GetYear();
- dataptr->month = dateval.GetMonth()+1;
- dataptr->day = dateval.GetDay();
+ dataptr->year = (SQLSMALLINT)dateval.GetYear();
+ dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
+ dataptr->day = (SQLUSMALLINT)dateval.GetDay();
}
break;
case SQL_C_TIME:
{
TIMESTAMP_STRUCT *dataptr =
(TIMESTAMP_STRUCT *)colDefs[colNo].PtrDataObj;
- dataptr->year = dateval.GetYear();
- dataptr->month = dateval.GetMonth()+1;
- dataptr->day = dateval.GetDay();
+ dataptr->year = (SQLSMALLINT)dateval.GetYear();
+ dataptr->month = (SQLUSMALLINT)(dateval.GetMonth()+1);
+ dataptr->day = (SQLUSMALLINT)dateval.GetDay();
dataptr->hour = dateval.GetHour();
dataptr->minute = dateval.GetMinute();
{
if (colDefs[i].KeyField)
{
- SetColNull(i, false);
+ SetColNull((UWORD)i, false);
memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj);
blkptr += colDefs[i].SzDataObj;
}
*s = _T('/');
#ifdef __WXMSW__
else
- *s = wxTolower (*s); // Case INDEPENDENT
+ *s = (wxChar)wxTolower (*s); // Case INDEPENDENT
#endif
s++;
}
(wxUint16)a[3] << 16 |
(wxUint16)a[4] << 8 |
a[5];
- wxUint16 port = (wxUint16)a[0] << 8 | a[1];
+ wxUint16 port = (wxUint16)(a[0] << 8 | a[1]);
wxIPV4address addr;
addr.Hostname(hostaddr);
// read the whole file in memory
m_pData = new size_t8[nSize];
- if ( fileMsg.Read(m_pData, nSize) != (size_t)nSize ) {
+ if ( fileMsg.Read(m_pData, (size_t)nSize) != (size_t)nSize ) {
wxDELETEA(m_pData);
return false;
}
Swap(pHeader->ofsOrigTable));
m_pTransTable = (wxMsgTableEntry *)(m_pData +
Swap(pHeader->ofsTransTable));
- m_nSize = nSize;
+ m_nSize = (size_t)nSize;
// now parse catalog's header and try to extract catalog charset and
// plural forms formula from it:
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
if ( traits && !traits->HasStderr() )
{
- wxMessageOutputDebug().Printf(_T("%s"), str.c_str());
+ wxMessageOutputDebug dbgout;
+ dbgout.Printf(_T("%s"), str.c_str());
}
}
}
{ m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1),valptr->year); }
wxVariantDataDateTime(const TIMESTAMP_STRUCT* valptr)
{ m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1), valptr->year,
- valptr->hour, valptr->minute, valptr->second, valptr->fraction ); }
+ valptr->hour, valptr->minute, valptr->second, (wxDateTime::wxDateTime_t)valptr->fraction ); }
#endif //ODBC
inline wxDateTime GetValue() const { return m_value; }
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
- wxVariant variant( wxString( (const wxChar*) (data->GetValue().Item(idx)->GetData()) ));
+ wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) );
+ wxVariant variant( str );
return variant;
}
return wxNullVariant;
return;
wxClientDC dc(this);
- singleCustomColour.Set(redSlider->GetValue(), singleCustomColour.Green(), singleCustomColour.Blue());
+ singleCustomColour.Set((unsigned char)redSlider->GetValue(), singleCustomColour.Green(), singleCustomColour.Blue());
PaintCustomColour(dc);
}
return;
wxClientDC dc(this);
- singleCustomColour.Set(singleCustomColour.Red(), greenSlider->GetValue(), singleCustomColour.Blue());
+ singleCustomColour.Set(singleCustomColour.Red(), (unsigned char)greenSlider->GetValue(), singleCustomColour.Blue());
PaintCustomColour(dc);
}
return;
wxClientDC dc(this);
- singleCustomColour.Set(singleCustomColour.Red(), singleCustomColour.Green(), blueSlider->GetValue());
+ singleCustomColour.Set(singleCustomColour.Red(), singleCustomColour.Green(), (unsigned char)blueSlider->GetValue());
PaintCustomColour(dc);
}
}
}
- m_size = buff.st_size;
+ m_size = (long)buff.st_size;
m_dateTime = buff.st_mtime;
}
directoryOut = argv[current];
- if ( !!directoryOut ) {
+ if ( !directoryOut.IsEmpty() ) {
// terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) {
case '/':
// create a parser object and a visitor derivation
CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite);
- if ( !!ignoreFile && mode == Mode_Dump )
+ if ( !ignoreFile.IsEmpty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL;
}
}
- if ( !!ignoreFile )
+ if ( !ignoreFile.IsEmpty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop);
{
CloseFunction();
- if ( m_inClass )
+ if ( m_inClass )
{
size_t count = m_arrayFuncDocs.GetCount();
- if ( count )
+ if ( count )
{
size_t n;
FunctionDocEntry::classname = m_classname;
char *buf = new char[len + 1];
buf[len] = '\0';
- if ( file.Read(buf, len) == wxInvalidOffset ) {
+ if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
char *buf = new char[len + 1];
buf[len] = '\0';
- if ( file.Read(buf, len) == wxInvalidOffset ) {
+ if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
/*
$Log$
+ Revision 1.31 2004/10/05 15:38:29 ABX
+ Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
+
Revision 1.30 2004/06/18 19:25:50 ABX
Small step in making HelpGen up to date unicode application.
}
-ctSettings::~ctSettings()
-{
-}
-
void ctSettings::operator = (const ctSettings& settings)
{
Copy(settings);
// Indicate that we're no longer running, so we know if the program
// crashed last time around.
config.Write(wxT("Misc/RunningProgram"), (long) 0);
-
+
{
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistorySave(config);
ctSettings(const ctSettings& settings);
/// Destructor.
- ~ctSettings();
+ ~ctSettings(){};
// Operations
END_EVENT_TABLE()
-ctConfigToolView::ctConfigToolView()
-{
-}
-
// What to do when a view is created. Creates actual
// windows for displaying the view.
bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
if (!treeCtrl)
return;
-
+
wxASSERT (doc != NULL);
-
+
ctConfigItem* selItem = NULL;
-
+
wxTreeItemId sel = treeCtrl->GetSelection();
if (sel.IsOk())
{
if (data)
selItem = data->GetConfigItem() ;
}
-
+
ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
int hintOp = ctNoHint;
if (hint)
hintOp = hint->m_op;
-
+
switch (hintOp)
{
case ctInitialUpdate:
}
}
break;
- case ctSelChanged:
+ case ctSelChanged:
{
if (selItem)
{
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
- }
+ }
}
break;
case ctAllSaved:
treeCtrl->DeleteAllItems();
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
break;
- }
+ }
case ctValueChanged:
{
// ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
- }
+ }
break;
-
+
default:
break;
}
wxGetApp().GetDocManager()->ActivateView(this, false);
Activate(false);
-
+
wxGetApp().GetMainFrame()->SetDocument(NULL);
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
parent = sel->GetParent();
insertBefore = sel->FindNextSibling();
}
-
+
ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
newItem->InitProperties();
{
ctConfigItem* parent = sel;
ctConfigItem* insertBefore = NULL;
-
+
ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
NULL, newItem, parent, insertBefore);
wxString oldType = property->GetVariant().GetType();
wxString oldEditorType = property->GetEditorType();
wxArrayString oldChoices = property->GetChoices();
-
+
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
wxID_ANY, _("Edit custom property"));
dialog.SetPropertyName(oldName);
wxString editorType = dialog.GetEditorType();
wxArrayString choices = dialog.GetChoices();
wxString descr = dialog.GetPropertyDescription();
-
+
if (name != oldName && sel->GetProperties().FindProperty(name))
{
wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
if (descr != oldDescription)
property->SetDescription(descr);
-
+
editor->ShowItem(sel);
OnChangeFilename();
}
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
-
+
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Setup File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
-
+
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
}
stream << setupStr;
- }
+ }
}
void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
-
+
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Configure Command File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
-
+
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
}
stream << configureStr;
- }
+ }
}
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)
{
DECLARE_DYNAMIC_CLASS(ctConfigToolView)
public:
- ctConfigToolView();
- ~ctConfigToolView() {};
-
+ ctConfigToolView(){};
+ ~ctConfigToolView(){};
+
//// Overrides
bool OnCreate(wxDocument *doc, long flags);
// constructors and destructors
ctFindReplaceDialog( wxWindow* parent, const wxString& title,
long style = 0 );
-
+
void OnFind(wxFindDialogEvent& event);
void OnClose(wxFindDialogEvent& event);
bool bResult = ParseHtml(m_topLevel);
- wxASSERT(bResult); // Failed to parse the TAGs.
+ wxASSERT(bResult); // Failed to parse the TAGs.
// Hint: Check if every open tag has a close tag!
return bResult;
}
else
parent->AppendTag(tag);
- }
+ }
}
else if (IsTagStartBracket(GetChar(m_pos)))
{
if(parent->GetParent())
parent->GetParent()->AppendTag(tag);
else
- parent->AppendTag(tag); // When this occurs it is probably the
+ parent->AppendTag(tag); // When this occurs it is probably the
// empty lines at the end of the file...
}
}
{
while (!Eof() && GetChar(m_pos) != wxT('<'))
{
- text += GetChar(m_pos);
+ text += (wxChar)GetChar(m_pos);
m_pos ++;
}
DecodeSpecialChars(text);
while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{
- str += GetChar(pos);
+ str += (wxChar)GetChar(pos);
pos ++;
}
if (eatIt)
// See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{
- // XML translation
+ // XML translation
value.Replace(wxT(">"), wxT(">"), true);
value.Replace(wxT("<"), wxT("<"), true);
value.Replace(wxT("""), wxT("\""), true);
{
wxString newvalue = value;
- // XML translation
+ // XML translation
newvalue.Replace(wxT("&"), wxT("&"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT(">"), true);
newvalue.Replace(wxT("<"), wxT("<"), true);
newvalue.Replace(wxT("\""),wxT("""), true);
newvalue.Replace(wxT("'"), wxT("'"), true);
-
+
return newvalue;
}
{
child->m_next = NULL;
delete child;
-
+
if (prev != NULL)
prev->m_next = next;
else
while (last->m_next)
last = last->m_next;
- last->m_next = tag;
+ last->m_next = tag;
}
else
{
return false;
}
-// Search forward from this tag until we find a tag with this name & attribute
+// Search forward from this tag until we find a tag with this name & attribute
wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{
wxSimpleHtmlTag* tag = m_next;
attr->Write(stream);
if (i < GetAttributeCount() - 1)
stream << wxT(" ");
- }
+ }
if(!m_children)
{
- sbUseTab = false; // We're putting the open a close tag on the same line,
+ sbUseTab = false; // We're putting the open a close tag on the same line,
// so we don't wan't any tabs
stream << wxT(">");
}
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MINIMIZED ;
else
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_NORMAL ;
-
+
// Must delete this now since the DLL loading library will be
// uninitialised by the time the app object is deleted
wxGetApp().ClearHelpControllers();
-
+
if (!IsMaximized() && !IsIconized())
{
wxGetApp().GetSettings().m_frameSize = GetRect();
{
// Make a menubar
wxMenu *fileMenu = new wxMenu;
-
+
wxGetApp().GetFileHistory().UseMenu(fileMenu);
-
+
fileMenu->Append(wxID_NEW, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
-
+
wxMenu *editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
helpMenu->Append(wxID_HELP_CONTEXT, wxT("&What's this?"), wxT("Show help on the clicked item"));
helpMenu->AppendSeparator();
helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("Show details about this application"));
-
+
wxMenuBar *menuBar = new wxMenuBar;
-
+
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(editMenu, wxT("&Edit"));
menuBar->Append(viewMenu, wxT("&View"));
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWidgets"));
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistoryLoad(config);
- }
+ }
return menuBar;
}
CreateWindows();
}
-ctOutputWindow::~ctOutputWindow()
-{
-}
-
/// Initialise the windows.
void ctOutputWindow::CreateWindows()
{
wxMessageBox(_("Sorry, could not open the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION|wxOK);
return;
}
-
+
wxString value(m_codeCtrl->GetValue());
#ifdef __WXMSW__
value.Replace(_T("\n"), _T("\r\n"));
#endif
wxTextDataObject *data = new wxTextDataObject( value );
-
+
if (!wxTheClipboard->SetData( data ))
{
wxTheClipboard->Close();
class ctMainFrame: public wxDocParentFrame
{
DECLARE_CLASS(ctMainFrame)
- public:
+public:
/// Constructor.
ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
/// Returns the configure page window
ctOutputWindow* GetConfigurePage() const { return m_configurePage; }
- /// Returns the main notebook containing editor and text tabs
+ /// Returns the main notebook containing editor and text tabs
wxNotebook* GetMainNotebook() const { return m_mainNotebook; }
/// Sets the find dialog for future closing
public:
ctOutputWindow(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
- ~ctOutputWindow();
+ ~ctOutputWindow(){};
/// Initialise the windows.
void CreateWindows();
CreateControls(this);
}
-ctPropertyEditor::~ctPropertyEditor()
-{
-}
-
void ctPropertyEditor::CreateControls(wxWindow* parent)
{
m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
DECLARE_CLASS(ctPropertyEditor)
public:
ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
- ~ctPropertyEditor();
+ ~ctPropertyEditor(){};
// Event handlers
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
-
+
bool AddControls(wxWindow* parent, const wxString& msg);
wxString GetText() const { return m_text; }
* Special-purpose splitter window for changing sash look and
* also saving sash width
*/
-
+
class ctSplitterWindow: public wxSplitterWindow
{
public:
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
- unsigned int r = wxHexToDec(hex.Mid(0, 2));
- unsigned int g = wxHexToDec(hex.Mid(2, 2));
- unsigned int b = wxHexToDec(hex.Mid(4, 2));
+ unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
+ unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
+ unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
pointSize = 8;
if (pointSize == 9)
pointSize = 10;
-#endif
+#endif
}
else if (i == 1)
family = StringToInt(token);
wxString envVar(wxGetenv(_T("TEMP")));
dir = envVar;
}
-
+
if ( dir.empty() )
{
// default
}
// Adds a context-sensitive help button, for non-Windows platforms
-void apAddContextHelpButton(wxWindow*
+void apAddContextHelpButton(wxWindow*
#if defined(__WXGTK__) || defined(__WXMAC__)
parent
#else
WXUNUSED(parent)
#endif
- , wxSizer*
+ , wxSizer*
#if defined(__WXGTK__) || defined(__WXMAC__)
sizer
#else
WXUNUSED(sizer)
#endif
- , int
+ , int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerFlags
#else
WXUNUSED(sizerFlags)
#endif
- , int
+ , int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerBorder
#else
{
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
wxASSERT ( state < m_maxStates );
-
+
return m_states[state * 2 + (enabled ? 0 : 1)];
}
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
if (state+1 > m_maxStates)
m_maxStates = state+1;
-
+
m_states[state * 2 + (enabled ? 0 : 1)] = iconId;
}
bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled)
{
wxASSERT (m_imageList != NULL);
-
+
wxIconInfo* info = FindInfo(name);
if (!info)
{
m_docManager = NULL;
}
-ctApp::~ctApp()
-{
-}
-
bool ctApp::OnInit(void)
{
#if wxUSE_LOG
wxLog::SetTimestamp(NULL);
#endif // wxUSE_LOG
-
+
wxHelpProvider::Set(new wxSimpleHelpProvider);
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
#endif
-
+
#if wxUSE_LIBJPEG
wxImage::AddHandler( new wxJPEGHandler );
#endif
-
+
#if wxUSE_GIF
wxImage::AddHandler( new wxGIFHandler );
#endif
m_settings.Init();
LoadConfig();
-
+
wxString helpFilePathReference(GetFullAppPath(_("wx")));
m_helpControllerReference->Initialize(helpFilePathReference);
-
+
wxString helpFilePath(GetFullAppPath(_("configtool")));
m_helpController->Initialize(helpFilePath);
-
+
ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(),
GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
doc->SetDocumentSaved(true);
}
}
-
+
GetTopWindow()->Show(true);
-
+
return true;
}
int ctApp::OnExit(void)
{
SaveConfig();
-
+
// Save the file history
{
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("Generic Organisation"));
delete m_docManager;
m_docManager = NULL;
-
+
return 0;
}
{
delete m_helpController;
m_helpController = NULL;
-
+
delete m_helpControllerReference;
m_helpControllerReference = NULL;
}
if (path.Last() != wxFILE_SEP_PATH && filename[0] != wxFILE_SEP_PATH)
path += wxFILE_SEP_PATH;
path += filename;
-
+
return path;
}
ctApp();
/// Destructor.
- ~ctApp();
+ ~ctApp(){};
// Accessors
// Convert 6-digit hex string to a colour
wxColour wxHexStringToColour(const wxString& hex)
{
- unsigned int r = wxHexToDec(hex.Mid(0, 2));
- unsigned int g = wxHexToDec(hex.Mid(2, 2));
- unsigned int b = wxHexToDec(hex.Mid(4, 2));
+ unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
+ unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
+ unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
int istyle = wxHF_DEFAULT_STYLE;
- wxString service, windowName, book[10], titleFormat, argStr;
+ wxString service, windowName, titleFormat, argStr;
+ wxString book[10];
int bookCount = 0;
int i;
bool hasService = false;
buf[1] = hexArray[secondDigit];
buf[2] = 0;
}
-
+
static unsigned int getshort(FILE *fp)
{
int c, c1;
int c, c1, c2, c3;
c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp);
return (long)((long) c) +
- (((long) c1) << 8) +
+ (((long) c1) << 8) +
(((long) c2) << 16) +
(((long) c3) << 24);
}
{
// Remember about all fields but store only important ones
unsigned long /*
- bfSize,
- bfOffBits,
- biSize,
- */
- biWidth,
- biHeight,
+ bfSize,
+ bfOffBits,
+ biSize,
+ */
+ biWidth,
+ biHeight,
biPlanes,
biBitCount
/* ,
biCompression,
- biSizeImage,
- biXPelsPerMeter,
- biYPelsPerMeter,
- biClrUsed,
+ biSizeImage,
+ biXPelsPerMeter,
+ biYPelsPerMeter,
+ biClrUsed,
biClrImportant
*/
;
bool GetMetafileHeader(FILE *handle, int *width, int *height)
{
char buffer[40];
- mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer;
+ mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer[0];
fread((void *)theHeader, sizeof(char), sizeof(mfPLACEABLEHEADER), handle);
if (theHeader->key != 0x9AC6CDD7)
{
int ch;
do
{
- ch = getc(handle);
+ ch = getc(handle);
if (bytesSoFar == scanLineWidth)
{
bytesSoFar = 0;
int i;
for (i = l; i < 5; i++)
ContentsLevels[i] = false;
-
+
// There are always books on the top level
ContentsLevels[0] = true;
}
void OutputSectionKeyword(FILE *fd)
{
OutputCurrentSectionToString(wxTex2RTFBuffer);
-
+
unsigned int i;
for (i = 0; i < wxStrlen(wxTex2RTFBuffer); i++)
if (wxTex2RTFBuffer[i] == ':')
wxFprintf(fd, _T("K{\\footnote {K} "));
wxFprintf(fd, _T("%s"), wxTex2RTFBuffer);
-
+
wxFprintf(fd, _T("}\n"));
}
int d=0;
while ( (xitle[s]!=0)&&(d<255) )
{
- wxChar ch=xitle[s]&0xff;
+ wxChar ch=wxChar(xitle[s]&0xff);
if (ch==0x5c) {
- wxChar ch1=xitle[s+1]&0xff;
- wxChar ch2=xitle[s+2]&0xff;
- wxChar ch3=xitle[s+3]&0xff;
- s+=4; // next character
+ wxChar ch1=wxChar(xitle[s+1]&0xff);
+ wxChar ch2=wxChar(xitle[s+2]&0xff);
+ wxChar ch3=wxChar(xitle[s+3]&0xff);
+ s+=4; // next character
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('ö'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('ä'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('ü'); }
} else {
title[d++]=ch;
s++;
- }
+ }
}
title[d]=0;
if (level == 0) // Means we had a Chapter in an article, oops.
return;
-
+
ResetContentsLevels(level);
-
- if (!title)
- return;
-
+
if (winHelp && winHelpContents && WinHelpContentsFile)
{
TexTopic *texTopic = (TexTopic *)TopicTable.Get(topicName);
// Must separate out main entry form subentry (only 1 subentry allowed)
wxChar buf1[100]; wxChar buf2[100];
SplitIndexEntry(s, buf1, buf2);
-
+
// Check for ':' which messes up index
unsigned int i;
for (i = 0; i < wxStrlen(buf1) ; i++)
* Output index entry in linear RTF
*
*/
-
+
void GenerateIndexEntry(wxChar *entry)
{
if (useWord)
* Write a suitable RTF header.
*
*/
-
+
void WriteColourTable(FILE *fd)
{
wxFprintf(fd, _T("{\\colortbl"));
// Table of contents styles
wxFprintf(fd, _T("{\\s20\\sb300\\tqr\\tldot\\tx8640 \\b\\f2 \\sbasedon0\\snext0 toc 1;}\n"));
-
+
wxFprintf(fd, _T("{\\s21\\sb90\\tqr\\tldot\\li400\\tqr\\tx8640 \\f2\\fs20\\sbasedon0\\snext0 toc 2;}\n"));
wxFprintf(fd, _T("{\\s22\\sb90\\tqr\\tldot\\li800\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 3;}\n"));
wxFprintf(fd, _T("{\\s23\\sb90\\tqr\\tldot\\li1200\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 4;}\n"));
/*
* Write a Windows help project file
*/
-
+
bool WriteHPJ(wxChar *filename)
{
wxChar hpjFilename[256];
wxStrcpy(rtfFile, helpFile);
wxStrcat(helpFile, _T(".hlp"));
wxStrcat(rtfFile, _T(".rtf"));
-
+
FILE *fd = wxFopen(hpjFilename, _T("w"));
if (!fd)
return false;
wxChar *helpTitle = winHelpTitle;
if (!helpTitle)
helpTitle = _T("Untitled");
-
+
wxString thePath = wxPathOnly(InputFile);
if (thePath.IsEmpty())
thePath = _T(".");
* and before TraverseDocument is called.
*
*/
-
+
void Text2RTF(TexChunk *chunk)
{
Tex2RTFYield();
* Not used yet
*
*/
-
+
wxChar browseBuf[10];
static long browseId = 0;
wxChar *GetBrowseString(void)
{
int oldForbidResetPar = forbidResetPar;
forbidResetPar = 0;
-
+
if (LeftHeaderEven || CentreHeaderEven || RightHeaderEven)
{
TexOutput(_T("{\\headerl\\fi0 "));
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
-
+
// Need to reset the current numbering style, or RTF forgets it.
SetCurrentOutput(Chapters);
OutputNumberStyle(currentNumberStyle);
else SetCurrentOutput(NULL); // No entry in table of contents
}
}
-
+
startedSections = true;
// Output heading to contents page
if (!InPopups())
{
OutputCurrentSection();
-
+
if (winHelp)
{
wxFprintf(Contents, _T("}{\\v %s}\\pard\\par\n"), topicName);
// From here, just output to chapter
SetCurrentOutput(Chapters);
}
-
+
if (winHelp)
{
wxFprintf(Chapters, _T("}\n#{\\footnote %s}\n"), topicName);
wxFprintf(Chapters, _T("+{\\footnote %s}\n"), GetBrowseString());
-
+
OutputSectionKeyword(Chapters);
GenerateKeywordsForTopic(topicName);
}
}
else SetCurrentOutput(NULL);
- }
+ }
if (startedSections)
{
else
wxFprintf(Contents, _T("}\\par\\par\\pard\n"));
}
-
+
SetCurrentOutput(winHelp ? Sections : Chapters);
if (winHelp)
wxChar *keep = _T("");
if (winHelp && (macroId != ltGLOSS) && !InPopups())
keep = _T("\\keepn\\sa140\\sb140");
-
+
wxFprintf(winHelp ? Sections : Chapters, _T("\\pard{%s%s"),
keep, styleCommand);
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
-#endif
+#endif
}
startedSections = true;
}
}
OutputCurrentSection(); // Repeat section header
-
+
// Experimental JACS
TexOutput(_T("\\par\\pard}\n"));
// TexOutput(_T("\\par\\pard}\\par\n"));
else
SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else
}
-
+
if (startedSections)
{
if (winHelp)
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
-#endif
+#endif
}
startedSections = true;
}
else if ((DocumentStyle == LATEX_ARTICLE) && (macroId != ltSUBSUBSECTIONSTAR))
wxFprintf(Contents, _T("\\par\\pard\n"));
-
+
SetCurrentOutput(winHelp ? Subsubsections : Chapters);
if (winHelp)
{
WriteHeadingStyle((winHelp ? Subsubsections : Chapters),
(DocumentStyle == LATEX_ARTICLE ? 3 : 4));
wxFprintf(winHelp ? Subsubsections : Chapters, _T(" "));
-
+
if (!winHelp)
{
if ((macroId != ltSUBSUBSECTIONSTAR))
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
-
+
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
ItemizeStruc *struc = new ItemizeStruc(listType, indentSize2, indentSize1);
itemizeStack.Insert(struc);
-
+
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\tx%d\\li%d\\sa200"), indentSize1, indentSize2, indentSize2);
PushEnvironmentStyle(buf);
}
ItemizeStruc *struc = new ItemizeStruc(LATEX_TWOCOL, indentSize);
itemizeStack.Insert(struc);
-
+
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\ri%d"), indentSize, indentSize, TwoColWidthA+TwoColWidthB+oldIndent);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200"), indentSize, indentSize);
PushEnvironmentStyle(buf);
OnMacro(ltPAR, 0, true);
OnMacro(ltPAR, 0, false);
}
-#endif
+#endif
}
break;
}
// WriteEnvironmentStyles();
}
-#endif
+#endif
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\\ri%d\n"), TwoColWidthA,
// TwoColWidthA, TwoColWidthA, TwoColWidthA+TwoColWidthB+oldIndent);
else issuedNewParagraph = 0;
}
#endif
-
+
if (macroId == ltVERBATIM)
wxSnprintf(buf, sizeof(buf), _T("{\\f3\\s10\\fs20\\li720\\sa0 "));
else
#if 0
TexOutput(_T("\\par\n"));
issuedNewParagraph = 1;
-#endif
+#endif
}
}
break;
case ltRMFAMILY:
case ltRM:
{
-/*
+/*
if (start)
{
TexOutput(_T("{\\plain "));
{
TexOutput(_T("\\par\\pard"));
issuedNewParagraph ++;
-
+
// Extra par if parskip is more than zero (usually looks best.)
// N.B. JACS 2004-02-21: shouldn't need this for linear RTF if
// we have a suitable set of styles.
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
-#endif
+#endif
WriteEnvironmentStyles();
}
// 1 is a whole paragraph if ParSkip == 0,
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
-#endif
+#endif
WriteEnvironmentStyles();
}
/*
{
if (!suppressNameDecoration) TexOutput(_T("}"));
}
-
+
if (start && (arg_no == 3))
TexOutput(_T("("));
if (!start && (arg_no == 3))
if (start)
{
wxChar *sec = NULL;
-
+
wxChar *refName = GetArgData();
if (winHelp || !useWord)
{
{
if (arg_no == 3)
return false;
-
+
static int imageWidth = 0;
static int imageHeight = 0;
-
+
if (start && (arg_no == 1))
{
wxChar *imageDimensions = copystring(GetArgData());
if (imageDimensions) // glt
delete [] imageDimensions;
return false;
- }
+ }
else if (start && (arg_no == 2 ))
{
wxChar *filename = copystring(GetArgData());
}
else
{
-#endif
+#endif
TexOutput(_T("[No BMP or WMF for image file "));
TexOutput(filename);
TexOutput(_T("]"));
if (currentNumberStyle) delete[] currentNumberStyle;
currentNumberStyle = copystring(data);
OutputNumberStyle(currentNumberStyle);
-
+
TexOutput(_T("\n"));
}
return false;
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
-
+
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
-
+
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200 "), indentSize, indentSize);
PushEnvironmentStyle(buf);
TexOutput(buf);
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
-
+
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\lr%d\\sa200\\box%s "), indentSize, indentSize, indentSizeRight,
((macroId == ltCENTEREDBOX) ? _T("\\brdrs") : _T("\\brdrdb")));
PushEnvironmentStyle(buf);
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
-
+
// Need to reset the current numbering style, or RTF forgets it.
OutputNumberStyle(currentNumberStyle);
SetCurrentOutput(Contents);
wxFileNameFromPath(FileRoot), "Contents");
}
}
-
+
SetCurrentOutput(Chapters);
wxChar *styleCommand = _T("");
if (!winHelp && useHeadingStyles)
startedSections = false;
inVerbatim = false;
browseId = 0;
-
+
if (InputFile && OutputFile)
{
// Do some RTF-specific transformations on all the strings,
wxFprintf(Chapters, _T("\\titlepg\n"));
wxFprintf(Contents, _T("\\par\\pard\\pgnrestart\\sect\\titlepg"));
}
-
+
// In WinHelp, Contents title takes font of title.
// In linear RTF, same as chapter headings.
wxFprintf(Contents, _T("{\\b\\fs%d %s}\\par\\par\\pard\n\n"),
// By default, Swiss, 11 point.
wxFprintf(Chapters, _T("\\f2\\fs22\n"));
-
+
PushEnvironmentStyle(_T("\\f2\\fs22\\sa200"));
SetCurrentOutput(Chapters);
fclose(Header);
PopEnvironmentStyle();
-
+
Tex2RTFYield(true);
if (winHelp)
{
Tex2RTFYield(true);
wxRemoveFile(_T("tmp1.rtf"));
}
-
+
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
wxRemoveFile(_T("chapters.rtf"));
wxRemoveFile(_T("header.rtf"));
-
+
if (winHelp)
{
wxRemoveFile(_T("sections.rtf"));
* Variables accessible from clients
*
*/
-
+
TexChunk * DocumentTitle = NULL;
TexChunk * DocumentAuthor = NULL;
TexChunk * DocumentDate = NULL;
* Section numbering
*
*/
-
+
int chapterNo = 0;
int sectionNo = 0;
int subsectionNo = 0;
* Other variables
*
*/
-
+
FILE *CurrentOutput1 = NULL;
FILE *CurrentOutput2 = NULL;
FILE *Inputs[15];
break;
}
}
-
+
TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBrace)
{
*parseToBrace = true;
macroBuf[j-i] = 0;
def = (TexMacroDef *)MacroDefs.Get(macroBuf);
}
-
+
if (def)
{
i = j;
-
+
// We want to check whether this is a space-consuming macro
// (e.g. {\bf word})
// No brace, e.g. \input thing.tex instead of \input{thing};
if ((ch1 == 10) || (ch1 == 13))
{
// Eliminate newline (10) following DOS linefeed
- if (ch1 == 13)
+ if (ch1 == 13)
getc(Inputs[CurrentInputIndex]);
buf[bufIndex] = 0;
IncrementLineNumber();
return false;
}
- buf[bufIndex] = ch;
+ buf[bufIndex] = (wxChar)ch;
bufIndex ++;
}
}
case 0xfc: // ü
case 0xd6: // Ö
case 0xc4: // Ä
- case 0xdc: // Ü
+ case 0xdc: // Ü
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
case 0xfc:buf[bufIndex++]='u';break; // ü
case 0xd6:buf[bufIndex++]='O';break; // Ö
case 0xc4:buf[bufIndex++]='A';break; // Ä
- case 0xdc:buf[bufIndex++]='U';break; // Ü
- }
+ case 0xdc:buf[bufIndex++]='U';break; // Ü
+ }
buf[bufIndex++]='}';
break;
- case 0xdf: // ß
+ case 0xdf: // ß
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
buf[bufIndex++]='s';
buf[bufIndex++]='\\';
buf[bufIndex++]='/';
- break;
+ break;
default:
if (bufIndex >= MAX_LINE_BUFFER_SIZE)
{
OnError((wxChar *)errBuf.c_str());
return false;
}
- // If the current character read in is a '_', we need to check
+ // If the current character read in is a '_', we need to check
// whether there should be a '\' before it or not
if (ch != '_')
{
- buf[bufIndex++] = ch;
+ buf[bufIndex++] = (wxChar)ch;
break;
}
}
}
}
- buf[bufIndex++] = ch;
+ buf[bufIndex++] = (wxChar)ch;
break;
} // switch
} // else
buf[bufIndex] = 0;
fclose(Inputs[CurrentInputIndex]);
Inputs[CurrentInputIndex] = NULL;
- if (CurrentInputIndex > 0)
+ if (CurrentInputIndex > 0)
ch = ' '; // No real end of file
CurrentInputIndex --;
j -= 5;
buf[j] = 0;
}
-
+
if (buf[j-1] == '}')
buf[j-1] = 0; // Ignore final brace
buf[j] = 0;
}
- if (buf[j-1] == _T('}'))
+ if (buf[j-1] == _T('}'))
buf[j-1] = 0; // Ignore final brace
// Remove backslashes from name
{
Tex2RTFYield();
if (stopRunning) return pos;
-
+
bool eof = false;
BigBuffer[0] = 0;
int buf_ptr = 0;
}
}
*/
-
+
// If not parsing to brace, just read the next word
// (e.g. \vskip 20pt)
if (!parseToBrace)
while (!eof && ch != 13 && ch != 32 && ch != 10 &&
ch != 0 && ch != '{')
{
- BigBuffer[buf_ptr] = ch;
+ BigBuffer[buf_ptr] = (wxChar)ch;
buf_ptr ++;
pos ++;
ch = buffer[pos];
children.Append((wxObject *)chunk);
}
pos ++;
-
+
// Try matching \end{environment}
if (environment && FindEndEnvironment(buffer, &pos, environment))
{
}
else
{
- wxTex2RTFBuffer[i] = ch;
+ wxTex2RTFBuffer[i] = (wxChar)ch;
pos ++;
i ++;
if (ch == 0)
if (buffer[pos] == '*')
pos ++;
- // Find the delimiter character
+ // Find the delimiter character
int ch = buffer[pos];
pos ++;
// Now at start of verbatim text
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
-
+
// delete chunk; // Might delete children
}
}
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
-
+
// delete chunk; // Might delete children
}
}
* Consume as many arguments as the macro definition specifies
*
*/
-
+
int ParseMacroBody(const wxChar *WXUNUSED(macro_name), TexChunk *parent,
int no_args, wxChar *buffer, int pos,
wxChar *environment, bool parseToBrace,
TexPathList.EnsureFileAccessible(filename);
- if (line_buffer)
+ if (line_buffer)
delete line_buffer;
line_buffer = new wxChar[MAX_LINE_BUFFER_SIZE];
-
+
Inputs[0] = wxFopen(filename, _T("r"));
LineNumbers[0] = 1;
FileNames[0] = copystring(filename);
no_args = toCopy.no_args;
argn = toCopy.argn;
macroId = toCopy.macroId;
-
+
// if (toCopy.name)
// name = copystring(toCopy.name);
// else
value = copystring(toCopy.value);
else
value = NULL;
-
+
optional = toCopy.optional;
wxNode *node = toCopy.children.GetFirst();
while (node)
* only!)
*
*/
-
+
void GetArgData1(TexChunk *chunk)
{
switch (chunk->type)
refNode = TexReferences.Next();
}
TexReferences.Clear();
-
+
wxNode* bibNode = BibList.GetFirst();
while (bibNode)
{
AddMacroDef(ltUPSHAPE, _T("upshape"), 1);
AddMacroDef(ltURLREF, _T("urlref"), 2);
AddMacroDef(ltUSEPACKAGE, _T("usepackage"), 1);
-
+
AddMacroDef(ltVAREPSILON, _T("varepsilon"), 0);
AddMacroDef(ltVARPHI, _T("varphi"), 0);
AddMacroDef(ltVARPI, _T("varpi"), 0);
* Default behaviour, should be called by client if can't match locally.
*
*/
-
+
// Called on start/end of macro examination
void DefaultOnMacro(int macroId, int no_args, bool start)
{
TexOutput(_T("(r)"), true);
break;
case ltBACKSLASH:
- if (start)
+ if (start)
TexOutput(_T("\\"), true);
break;
case ltLDOTS:
else
{
wxString informBuf;
- informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
+ informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
OnInform((wxChar *)informBuf.c_str());
}
}
DocumentStyle = LATEX_LETTER;
else if (wxStrncmp(DocumentStyleString, _T("slides"), 6) == 0)
DocumentStyle = LATEX_SLIDES;
-
+
if (StringMatch(_T("10"), DocumentStyleString))
SetFontSizes(10);
else if (StringMatch(_T("11"), DocumentStyleString))
if (fd)
{
ch = getc(fd);
- smallBuf[0] = ch;
+ smallBuf[0] = (wxChar)ch;
while (ch != EOF)
{
TexOutput(smallBuf);
ch = getc(fd);
- smallBuf[0] = ch;
+ smallBuf[0] = (wxChar)ch;
}
fclose(fd);
}
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxToupper(s[i]);
+ s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxTolower(s[i]);
+ s1[i] = (wxChar)wxTolower(s[i]);
TexOutput(s1);
delete[] s1;
return false;
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxToupper(s[i]);
+ s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;
ReadCustomMacros((wxChar*)path.c_str());
Go();
- if (runTwice)
+ if (runTwice)
{
Go();
}
/* This whole block of code is just wrong I think. It would behave
completely wrong under anything other than MSW due to the ELSE
with no statement, and the cout calls would fail under MSW, as
- the code in this block is compiled if !NO_GUI This code has been
+ the code in this block is compiled if !NO_GUI This code has been
here since v1.1 of this file too. - gt
else
#ifdef __WXMSW__
{
}
-Tex2RTFConnection::~Tex2RTFConnection(void)
-{
-}
-
bool SplitCommand(wxChar *data, wxChar *firstArg, wxChar *secondArg)
{
firstArg[0] = 0;
#endif
// Define a new application type
-class MyApp: public
+class MyApp: public
#ifndef NO_GUI
wxApp
#else
{
public:
Tex2RTFConnection(wxChar *buf, int size);
- ~Tex2RTFConnection(void);
+ ~Tex2RTFConnection(void){};
bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
};
FILE *tempfd = wxFopen(_T("tmp.tmp"), _T("w"));
if (!tempfd)
return;
-
+
FILE *old1 = CurrentOutput1;
FILE *old2 = CurrentOutput2;
-
+
CurrentOutput1 = tempfd;
CurrentOutput2 = NULL;
-
+
TraverseChildrenFromChunk(chunk);
-
+
CurrentOutput1 = old1;
CurrentOutput2 = old2;
-
+
fclose(tempfd);
-
+
// Read from file into string
tempfd = wxFopen(_T("tmp.tmp"), _T("r"));
if (!tempfd)
{
if (forceTopicName)
return forceTopicName;
-
+
wxChar *topicName = NULL;
static wxChar topicBuf[100];
* Snag is that some save a TexChunk, so don't use yet...
*
*/
-
+
void StartSimulateArgument(wxChar *data)
{
wxStrcpy(currentArgData, data);
if (unitArg[i] == '\\')
unitArg[i] = 0;
len = wxStrlen(unitArg);
-
+
if (unitArg && (len > 0) && (isdigit(unitArg[0]) || unitArg[0] == '-'))
{
wxSscanf(unitArg, _T("%f"), &unitValue);
if (len > 1)
{
- wxChar units[3];
+ wxChar units[3];
units[0] = unitArg[len-2];
units[1] = unitArg[len-1];
units[2] = 0;
* IF one exists. Inserts zero into buffer.
*
*/
-
+
void StripExtension(wxChar *buffer)
{
int len = wxStrlen(buffer);
}
}
-
+
/*
* Latex references
*
*/
-
+
void AddTexRef(wxChar *name, wxChar *file, wxChar *sectionName,
int chapter, int section, int subsection, int subsubsection)
{
TexRef *texRef = (TexRef *)TexReferences.Get(name);
if (texRef) TexReferences.Delete(name);
-
+
wxChar buf[100];
buf[0] = 0;
/*
wxString name = filename;
wxSTD ofstream ostr((char const *)name.fn_str());
if (ostr.bad()) return;
-
+
TexReferences.BeginFind();
wxHashTable::Node *node = TexReferences.Next();
while (node)
wxString sectionName_string = wxString::FromAscii(sectionName);
wxString section_string = wxString::FromAscii(section);
- // gt - needed to trick the hash table "TexReferences" into deleting the key
+ // gt - needed to trick the hash table "TexReferences" into deleting the key
// strings it creates in the Put() function, but not the item that is
// created here, as that is destroyed elsewhere. Without doing this, there
// were massive memory leaks
TexReferences.DeleteContents(true);
TexReferences.Put(
- label_string.c_str(),
+ label_string.c_str(),
new TexRef(
- label_string.c_str(),
- file_string.c_str(),
- section_string.c_str(),
+ label_string.c_str(),
+ file_string.c_str(),
+ section_string.c_str(),
sectionName_string.c_str()
)
);
void BibEatWhiteSpace(wxSTD istream& str)
{
char ch = (char)str.peek();
-
- while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == EOF))
+
+ while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == (char)EOF))
{
if (ch == 10)
BibLine ++;
str.get(ch);
- if ((ch == EOF) || str.eof()) return;
+ if ((ch == (char)EOF) || str.eof()) return;
ch = (char)str.peek();
}
return;
}
istr.get(ch);
-
+
if (ch == '{')
braceCount ++;
buffer[i] = 0;
wxUnusedVar(stopping);
}
-
+
bool ReadBib(wxChar *filename)
{
if (!wxFileExists(filename))
istr.get(ch);
if (istr.eof())
break;
-
+
if (ch != '\\') // Not a macro definition, so must be NAME=VALUE
{
wxChar settingName[100];
BibReadValue(istr, macroBody, false, false); // Don't ignore extra braces
if (wxStrlen(macroBody) > 0)
macro->macroBody = copystring(macroBody);
-
+
BibEatWhiteSpace(istr);
CustomMacroList.Append(macroName, macro);
AddMacroDef(ltCUSTOM_MACRO, macroName, noArgs);
OnInform(mbuf);
return true;
}
-
+
CustomMacro *FindCustomMacro(wxChar *name)
{
wxNode *node = CustomMacroList.Find(name);
OnInform(_T("No custom macros loaded.\n"));
return;
}
-
+
wxChar buf[400];
while (node)
{
buffer[i] = 0;
if (oldPos == (*pos))
*pos = len + 1;
-
+
if (i == 0)
return NULL;
else
* Colour tables
*
*/
-
+
ColourTableEntry::ColourTableEntry(const wxChar *theName, unsigned int r, unsigned int g, unsigned int b)
{
name = copystring(theName);
if (wxStrcmp(theName, entry->name) == 0)
{
wxStrcpy(buf, _T("#"));
-
+
wxChar buf2[3];
DecToHex(entry->red, buf2);
wxStrcat(buf, buf2);
return false;
}
-
+
void InitialiseColourTable(void)
{
// \\red0\\green0\\blue0;
// \\red0\\green255\\blue0;
AddColour(_T("green"), 0,255,0);
-
+
// \\red255\\green0\\blue255;
AddColour(_T("magenta"), 255,0,255);
// \\red255\\green0\\blue0;
AddColour(_T("red"), 255,0,0);
-
+
// \\red255\\green255\\blue0;
AddColour(_T("yellow"), 255,255,0);
-
+
// \\red255\\green255\\blue255;}");
AddColour(_T("white"), 255,255,255);
}
{
#ifdef __WXMSW__
static int yieldCount = 0;
-
+
if (isSync)
return;
-
+
if (force)
yieldCount = 0;
if (yieldCount == 0)
texTopic->keywords = new wxStringList;
TopicTable.Put(topic, texTopic);
}
-
+
if (!texTopic->keywords->Member(entry))
texTopic->keywords->Add(entry);
}
/*
* TexTopic structure
*/
-
+
TexTopic::TexTopic(wxChar *f)
{
if (f)
int i;
if (upperCaseNames)
for (i = 0; i < len; i ++)
- buf[i] = wxToupper(s[i]);
+ buf[i] = (wxChar)wxToupper(s[i]);
else
for (i = 0; i < len; i ++)
- buf[i] = wxTolower(s[i]);
+ buf[i] = (wxChar)wxTolower(s[i]);
buf[i] = 0;
- return buf;
+ return buf;
}
#if !WXWIN_COMPATIBILITY_2
// if substring is true, search for str1 in str2
-bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
+bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool exact)
{
if (subString)
return Sstr2.Index(Sstr1) != (size_t)wxNOT_FOUND;
}
else
- return exact ? wxString(str2).Cmp(str1) == 0 :
+ return exact ? wxString(str2).Cmp(str1) == 0 :
wxString(str2).CmpNoCase(str1) == 0;
}
#endif