~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/tools/imageexporttool.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-10-24 21:28:17 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20131024212817-ej1skb9og09d3ht6
Tags: 3.5.0.1137.31+dfsg-1
New upstream release [October 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  
3
 
 *  $Id: showhistorytool.cpp $
4
 
 *  Ginkgo CADx Project
5
 
 *
6
 
 *  Copyright 2008-12 MetaEmotion S.L. All rights reserved.
7
 
 *  http://ginkgo-cadx.com
8
 
 *
9
 
 *  This file is licensed under LGPL v3 license.
10
 
 *  See License.txt for details
11
 
 *
12
 
 *
13
 
 */
14
 
#include "imageexporttool.h"
15
 
#include <api/ivista.h>
 
1
/*
 
2
 *  
 
3
 *  $Id: showhistorytool.cpp $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-14 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
#include "imageexporttool.h"
 
15
#include <api/ivista.h>
16
16
#include <export/contracts/iimageexportcontract.h>
17
 
#include <main/gui/toolsystem/wxmenuitemtool.h>
18
 
#include <main/gui/export/wxwizardexportacionginkgo.h>
19
 
 
20
 
 
21
 
//----------------------------------------------------------------------
 
17
#include <main/gui/toolsystem/wxmenuitemtool.h>
 
18
#include <main/gui/export/wxwizardexportacionginkgo.h>
 
19
 
 
20
 
 
21
//----------------------------------------------------------------------
22
22
namespace GNC {
23
23
        namespace GUI {
24
24
                class wxImageExportEventHandler: public wxDefaultEvtHandlerTool
34
34
                        }
35
35
 
36
36
                        virtual void OnUpdateUI(wxUpdateUIEvent &event)
37
 
                        {
38
 
                                wxDefaultEvtHandlerTool::OnUpdateUI(event);
39
 
                                if (event.GetEnabled()) {
 
37
                        {
 
38
                                wxDefaultEvtHandlerTool::OnUpdateUI(event);
 
39
                                if (event.GetEnabled()) {
40
40
                                        event.Enable(m_pImageExport->IsEnabled());
41
41
                                }
42
42
                        }
44
44
                };
45
45
 
46
46
        }
47
 
}
48
 
 
 
47
}
 
48
 
49
49
GNC::GCS::ITool* GNC::ImageExportTool::NewTool()
50
50
{
51
51
        return new GNC::ImageExportTool();
59
59
}
60
60
                
61
61
bool GNC::ImageExportTool::ExecuteAction()
62
 
{       
63
 
        GNC::GCS::Ptr<GNC::GCS::IImageExportDelegate> pDelegate(ExportContract->GetNewExportDelegate());
64
 
        GNC::GUI::wxWidzardExportacionGinkgo dlg(ExportContract->GetView()->GetWindow(), pDelegate);
 
62
{       
 
63
        GNC::GCS::Ptr<GNC::GCS::IImageExportDelegate> pDelegate(ExportContract->GetNewExportDelegate());
 
64
        GNC::GUI::wxWidzardExportacionGinkgo dlg(ExportContract->GetView()->GetWindow(), pDelegate);
65
65
        if (ExportContract->GetView()->GetWindow() != NULL) {
66
66
                //set position relative to view window...
67
67
                wxPoint position = ExportContract->GetView()->GetWindow()->GetPosition();
81
81
                pMenu->Append(new GNC::GUI::wxMenuItemTool(pMenu, ID, wxString::FromUTF8(Name.c_str()),Icon, evtHandler));
82
82
        }
83
83
}
84
 
 
85
 
bool GNC::ImageExportTool::IsEnabled()
86
 
{
87
 
        return ExportContract->CanBeExported();
 
84
 
 
85
bool GNC::ImageExportTool::IsEnabled()
 
86
{
 
87
        return ExportContract->CanBeExported();
88
88
}