~ubuntu-branches/ubuntu/trusty/ginkgocadx/trusty

« back to all changes in this revision

Viewing changes to src/cadxcore/main/gui/history3/wxhistoryimagethumbnail.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-07-21 11:58:53 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: package-import@ubuntu.com-20130721115853-44e7n1xujqglu78e
Tags: 3.4.0.928.29+dfsg-1
* New upstream release [July 2013]
  + new B-D: "libjsoncpp-dev".
  + new patch "unbundle-libjsoncpp.patch" to avoid building bundled
    "libjsoncpp-dev".
  + new patch "fix-wx.patch" to avoid FTBFS due to missing
    "-lwx_gtk2u_html-2.8".
* Removed unnecessary versioned Build-Depends.
* Removed obsolete lintian override.
* Reference get-orig-source implementation for orig.tar clean-up and
  DFSG-repackaging.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include <resources/ginkgoresourcesmanager.h>
14
14
namespace GNC {
15
15
        namespace GUI {
16
 
                wxHistoryImageThumbnailItem::wxHistoryImageThumbnailItem(const wxString& filename, TItemType type, long series_pk, long file_pk, bool linked):wxImageThumbnailItem(filename)
 
16
                wxHistoryImageThumbnailItem::wxHistoryImageThumbnailItem(const wxString& filename, TItemType type, long series_pk, long file_pk, GNC::GCS::IHistoryController::TLocation source):wxImageThumbnailItem(filename)
17
17
                {
18
18
                        m_type = type;
19
19
                        m_filepk = file_pk;
20
20
                        m_seriespk = series_pk;
21
 
                        isLinked = linked;
 
21
                        m_source = source;
22
22
                }
23
23
 
24
24
                bool wxHistoryImageThumbnailItem::Draw(wxDC& dc, wxThumbnailCtrl* ctrl, const wxRect& rect, int style)
25
25
                {
26
26
                        wxImageThumbnailItem::Draw(dc, ctrl, rect, style);
27
 
                        if (isLinked) {
28
 
                                wxBitmap tagBitmap = GinkgoResourcesManager::History::GetIcoLinked();
29
 
                                if (tagBitmap.Ok())
30
 
                                {
31
 
                                        int x = rect.x + ctrl->GetThumbnailMargin();
32
 
                                        int y = rect.y + ctrl->GetThumbnailMargin();
33
 
                                        dc.DrawBitmap(tagBitmap, x, y, true);
34
 
                                }
 
27
                        wxBitmap bmp;
 
28
                        switch (m_source) {
 
29
                                case GNC::GCS::IHistoryController::TL_LocalDatabase:
 
30
                                        bmp = GinkgoResourcesManager::History::GetIcoLocalFile();
 
31
                                        break;
 
32
                                case GNC::GCS::IHistoryController::TL_LocalLinked:
 
33
                                        bmp = GinkgoResourcesManager::History::GetIcoLocalLinked();
 
34
                                        break;
 
35
                                case GNC::GCS::IHistoryController::TL_WadoLinked:
 
36
                                        bmp = GinkgoResourcesManager::History::GetIcoWadoLinked();
 
37
                                        break;
 
38
                                default:
 
39
                                        ;
 
40
                        }
 
41
                        if (bmp.IsOk()) {
 
42
                                int x = rect.x + ctrl->GetThumbnailMargin();
 
43
                                int y = rect.y + ctrl->GetThumbnailMargin();
 
44
                                dc.DrawBitmap(bmp, x, y, true);
35
45
                        }
36
46
                        return true;
37
47
                }