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

« back to all changes in this revision

Viewing changes to src/cadxcore/main/managers/widgetsmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-01-09 07:37:09 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20140109073709-rpuh5x3p3finvtze
Tags: 3.6.0.1228.33+dfsg-1
New upstream release [December 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <api/globals.h>
22
22
#include <api/icontexto.h>
23
23
#include <api/iwidgetsrenderer.h>
 
24
#include <api/iannotator.h>
24
25
 
25
26
#include <eventos/modificacionwidget.h>
26
27
 
74
75
        double                     m_Frecuencia;
75
76
};
76
77
 
77
 
GNC::WidgetsManager::WidgetsManager(GNC::GCS::IVista* pVista):GNC::GCS::IWidgetsManager(pVista) {
 
78
GNC::WidgetsManager::WidgetsManager(GNC::GCS::IVista* pVista):GNC::GCS::IWidgetsManager(pVista), m_pAnnotator(new GNC::GCS::IAnnotator(pVista))
 
79
{
78
80
        m_pRendererActivo = NULL;
79
81
        m_cursor = GNC::GCS::Widgets::CUR_FLECHA;
80
82
        m_mouseDerechoDown = false;
81
83
        m_mouseIzquierdoDown = false;
82
84
        m_pTimerAnimation = new TimerAnimation(this);
 
85
 
 
86
        GNC::GCS::Widgets::WAnotador* pW = new GNC::GCS::Widgets::WAnotador(this,-1,"",-1);
 
87
        InsertarWidget(pW);
 
88
        GNC::GCS::Widgets::WAnotacionPosicion* pPosicion = new GNC::GCS::Widgets::WAnotacionPosicion(this,-1,"",-1);
 
89
        InsertarWidget(pPosicion);
 
90
        GNC::GCS::Widgets::WStaticRule* pStaticRule = new GNC::GCS::Widgets::WStaticRule(this,-1,"",-1);
 
91
        InsertarWidget(pStaticRule);
83
92
}
84
93
 
85
94
GNC::WidgetsManager::~WidgetsManager() {
952
961
 
953
962
//----------------------------------------------------------------------------------------------------
954
963
//region "Interfaz general"
955
 
void GNC::WidgetsManager::CrearWidgetAnotador(GNC::GCS::IAnotador* pAnotador)
956
 
{
957
 
        GNC::GCS::Widgets::WAnotador* pW = new GNC::GCS::Widgets::WAnotador(pAnotador,this,-1,"",-1);
958
 
        InsertarWidget(pW);
959
 
        GNC::GCS::Widgets::WAnotacionPosicion* pPosicion = new GNC::GCS::Widgets::WAnotacionPosicion(pAnotador,this,-1,"",-1);
960
 
        InsertarWidget(pPosicion);
961
 
        GNC::GCS::Widgets::WStaticRule* pStaticRule = new GNC::GCS::Widgets::WStaticRule(this,-1,"",-1);
962
 
        InsertarWidget(pStaticRule);
963
 
}
964
 
 
965
 
void GNC::WidgetsManager::EnableAnotacionDinamica(bool /*enable*/)
966
 
{
967
 
        //buscamos los widgets anotadores y los establecemos el modo
968
 
        for( GNC::GCS::ListaWidgets::iterator it = m_Widgets.begin(); it != m_Widgets.end(); ++it) {
969
 
                GNC::GCS::Widgets::IWidget* w = *it;
970
 
                if (w->GetVID() == -1 && w->GetGID() == -1) {
971
 
                        //GNC::GCS::Widgets::WAnotador* pAnotador = dynamic_cast<GNC::GCS::Widgets::WAnotador*> (w);
972
 
                }
973
 
        }
974
 
}
975
 
 
976
 
void GNC::WidgetsManager::MostrarOcultarAnotador()
 
964
 
 
965
void GNC::WidgetsManager::SetAnnotator(const GNC::GCS::Ptr<GNC::GCS::IAnnotator>& pAnnotador)
 
966
{
 
967
        m_pAnnotator = pAnnotador;
 
968
        Modificado();
 
969
        Render();
 
970
}
 
971
 
 
972
const GNC::GCS::Ptr<GNC::GCS::IAnnotator>& GNC::WidgetsManager::GetAnnotator()
 
973
{
 
974
        return m_pAnnotator;
 
975
}
 
976
 
 
977
void GNC::WidgetsManager::ShowAnnotations(bool show)
977
978
{
978
979
        //buscamos los widgets anotadores y los establecemos el modo
979
980
        for( GNC::GCS::ListaWidgets::iterator it = m_Widgets.begin(); it != m_Widgets.end(); ++it) {
981
982
                if (w->GetVID() == -1 && w->GetGID() == -1) {
982
983
                        GNC::GCS::Widgets::WAnotador* pAnotador = dynamic_cast<GNC::GCS::Widgets::WAnotador*> (w);
983
984
                        if (pAnotador != NULL) {
984
 
                                pAnotador->Ocultar(!pAnotador->EstaOculto());
 
985
                                pAnotador->Ocultar(!show);
985
986
                        } else {
986
987
                                GNC::GCS::Widgets::WStaticRule* pStaticRule = dynamic_cast<GNC::GCS::Widgets::WStaticRule*> (w);
987
988
                                if (pStaticRule != NULL) {
988
 
                                        pStaticRule->Ocultar(!pStaticRule->EstaOculto());
 
989
                                        pStaticRule->Ocultar(!show);
989
990
                                }
990
991
                        }
991
992
                }
992
993
        }
993
994
}
994
995
 
995
 
bool GNC::WidgetsManager::IsVisibleAnotador()
 
996
bool GNC::WidgetsManager::IsShownAnnotations()
996
997
{
997
998
        for( GNC::GCS::ListaWidgets::iterator it = m_Widgets.begin(); it != m_Widgets.end(); ++it) {
998
999
                GNC::GCS::Widgets::IWidget* w = *it;