~ubuntu-branches/ubuntu/precise/ginkgocadx/precise

« back to all changes in this revision

Viewing changes to src/cadxcore/wx/thumbnailctrl/thumbnailctrl.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2011-09-09 08:39:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: package-import@ubuntu.com-20110909083926-iktecd132cnku5cd
Tags: 2.5.4.0~rc-1
New upstream version (patches were applied)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  
3
 
 *  $Id: thumbnailctrl.cpp 3822 2011-05-04 08:34:50Z carlos $
 
3
 *  $Id: thumbnailctrl.cpp 4056 2011-08-03 09:10:43Z tovar $
4
4
 *  Ginkgo CADx Project
5
5
 *
6
6
 *
1565
1565
        fRect.width = rect.width - 2*margin;
1566
1566
        fRect.height = (rect.height - imageRect.height) - margin;
1567
1567
 
 
1568
                  wxString tmp;
 
1569
                  if (wxFileExists(filename)) {
 
1570
                          tmp = wxFileNameFromPath(filename);
 
1571
                  } else {
 
1572
                          tmp = filename;
 
1573
                  }
 
1574
 
1568
1575
        wxCoord textW, textH;
1569
 
        dc.GetTextExtent(filename, & textW, & textH);
 
1576
        dc.GetTextExtent(tmp, & textW, & textH);
1570
1577
 
1571
1578
        dc.SetClippingRegion(fRect);
1572
1579
        int x = fRect.x + wxMax(0, (fRect.width - textW)/2);
1573
1580
        int y = fRect.y ;
1574
 
        dc.DrawText(filename, x, y);
 
1581
                 
 
1582
        dc.DrawText(tmp, x, y);
1575
1583
        dc.DestroyClippingRegion();
1576
1584
    }
1577
1585
    if (!filename.IsEmpty())