plugins/svgui/svgui.py
changeset 186 ed2a408d79b6
parent 181 f01bcc3c9157
child 189 48ba1ae12ffd
equal deleted inserted replaced
185:042ab0643b28 186:ed2a408d79b6
   207             if block_id == None:
   207             if block_id == None:
   208                 raise ValueError, "No corresponding block found"
   208                 raise ValueError, "No corresponding block found"
   209             type = block.gettypeName()
   209             type = block.gettypeName()
   210             block_infos = GetBlockType(type)
   210             block_infos = GetBlockType(type)
   211             current_location = ".".join(map(str, self.GetCurrentLocation()))
   211             current_location = ".".join(map(str, self.GetCurrentLocation()))
   212             if not generator.ComputedBlocks.get(name, False) and not order:
   212             if not generator.ComputedBlocks.get(block, False) and not order:
   213                 generator.ComputedBlocks[block] = True
   213                 generator.ComputedBlocks[block] = True
   214                 for num, variable in enumerate(block.inputVariables.getvariable()):
   214                 for num, variable in enumerate(block.inputVariables.getvariable()):
   215                     connections = variable.connectionPointIn.getconnections()
   215                     connections = variable.connectionPointIn.getconnections()
   216                     if connections and len(connections) == 1:
   216                     if connections and len(connections) == 1:
   217                         parameter = "%sQ%s%s.%d.%d"%("%", TYPECONVERSION[block_infos["inputs"][num][1]], current_location, block_id, num+1)
   217                         parameter = "%sQ%s%s.%d.%d"%("%", TYPECONVERSION[block_infos["inputs"][num][1]], current_location, block_id, num+1)
   254                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none")], 
   254                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none")], 
   255                     "outputs" : [],
   255                     "outputs" : [],
   256                     "comment" : "SVGUI Container",
   256                     "comment" : "SVGUI Container",
   257                     "generate" : generate_svgui_block, "initialise" : initialise_block},
   257                     "generate" : generate_svgui_block, "initialise" : initialise_block},
   258                 {"name" : "Button", "type" : "functionBlock", "extensible" : False, 
   258                 {"name" : "Button", "type" : "functionBlock", "extensible" : False, 
   259                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none"),("Toggle","BOOL","none")], 
   259                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none"),("Value","BOOL","none")], 
   260                     "outputs" : [("State","BOOL","none")],
   260                     "outputs" : [("State","BOOL","none")],
   261                     "comment" : "SVGUI Button",
   261                     "comment" : "SVGUI Button",
   262                     "generate" : generate_svgui_block, "initialise" : initialise_block},
   262                     "generate" : generate_svgui_block, "initialise" : initialise_block},
   263                 {"name" : "TextCtrl", "type" : "functionBlock", "extensible" : False, 
   263                 {"name" : "TextCtrl", "type" : "functionBlock", "extensible" : False, 
   264                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none"),("SetText","STRING","none")], 
   264                     "inputs" : [("Show","BOOL","none"),("Enable","BOOL","none"),("SetText","STRING","none")], 
   492   if (m_svgCtrl->LoadFiles(wxT("%s"), wxT("%s")))
   492   if (m_svgCtrl->LoadFiles(wxT("%s"), wxT("%s")))
   493   {
   493   {
   494     Show(true);
   494     Show(true);
   495     m_svgCtrl->SetFocus();
   495     m_svgCtrl->SetFocus();
   496     m_svgCtrl->SetFitToFrame(true);
   496     m_svgCtrl->SetFitToFrame(true);
   497     m_svgCtrl->RefreshScale();
       
   498     m_svgCtrl->InitScrollBars();
   497     m_svgCtrl->InitScrollBars();
   499     m_svgCtrl->Initialize();
   498     m_svgCtrl->Initialize();
   500     m_svgCtrl->Update();
   499     m_svgCtrl->Update();
   501   }
   500   }
   502   else
   501   else
   720             elif element_type == ITEM_TEXT:
   719             elif element_type == ITEM_TEXT:
   721                 text += "  beremiz__IB%(location)s_%(id)d_1 = _copy__IB%(location)s_%(id)d_1 = ((SVGUITextCtrl*)element)->GetValue();\n"%texts
   720                 text += "  beremiz__IB%(location)s_%(id)d_1 = _copy__IB%(location)s_%(id)d_1 = ((SVGUITextCtrl*)element)->GetValue();\n"%texts
   722             elif element_type == ITEM_SCROLLBAR:
   721             elif element_type == ITEM_SCROLLBAR:
   723                 text += "  beremiz__IW%(location)s_%(id)d_1 = _copy__IW%(location)s_%(id)d_1 = ((SVGUIScrollBar*)element)->GetThumbPosition();\n"%texts
   722                 text += "  beremiz__IW%(location)s_%(id)d_1 = _copy__IW%(location)s_%(id)d_1 = ((SVGUIScrollBar*)element)->GetThumbPosition();\n"%texts
   724             elif element_type == ITEM_ROTATING:
   723             elif element_type == ITEM_ROTATING:
   725                 text += "   beremiz__ID%(location)s_%(id)d_1 = _copy__ID%(location)s_%(id)d_1 = ((SVGUIRotatingCtrl*)element)->GetAngle();\n"%texts
   724                 text += "  beremiz__ID%(location)s_%(id)d_1 = _copy__ID%(location)s_%(id)d_1 = ((SVGUIRotatingCtrl*)element)->GetAngle();\n"%texts
   726             elif element_type == ITEM_NOTEBOOK:
   725             elif element_type == ITEM_NOTEBOOK:
   727                 text += "  beremiz__IB%(location)s_%(id)d_1 = _copy__IB%(location)s_%(id)d_1 = ((SVGUINoteBook*)element)->GetCurrentPage();\n"%texts
   726                 text += "  beremiz__IB%(location)s_%(id)d_1 = _copy__IB%(location)s_%(id)d_1 = ((SVGUINoteBook*)element)->GetCurrentPage();\n"%texts
   728             elif element_type == ITEM_TRANSFORM:
   727             elif element_type == ITEM_TRANSFORM:
   729                 text += "  beremiz__QD%(location)s_%(id)d_3 = _copy__QD%(location)s_%(id)d_3 = ((SVGUITransform*)element)->GetX();\n"%texts
   728                 text += "  beremiz__QD%(location)s_%(id)d_3 = _copy__QD%(location)s_%(id)d_3 = ((SVGUITransform*)element)->GetX();\n"%texts
   730                 text += "  beremiz__QD%(location)s_%(id)d_4 = _copy__QD%(location)s_%(id)d_4 = ((SVGUITransform*)element)->GetY();\n"%texts
   729                 text += "  beremiz__QD%(location)s_%(id)d_4 = _copy__QD%(location)s_%(id)d_4 = ((SVGUITransform*)element)->GetY();\n"%texts
   731                 text += "  beremiz__QD%(location)s_%(id)d_5 = _copy__QD%(location)s_%(id)d_5 = ((SVGUITransform*)element)->GetXScale();\n"%texts
   730                 text += "  beremiz__QD%(location)s_%(id)d_5 = _copy__QD%(location)s_%(id)d_5 = ((SVGUITransform*)element)->GetXScale();\n"%texts
   732                 text += "  beremiz__QD%(location)s_%(id)d_6 = _copy__QD%(location)s_%(id)d_6 = ((SVGUITransform*)element)->GetYScale();\n"%texts
   731                 text += "  beremiz__QD%(location)s_%(id)d_6 = _copy__QD%(location)s_%(id)d_6 = ((SVGUITransform*)element)->GetYScale();\n"%texts
   733                 text += "  beremiz__QD%(location)s_%(id)d_7 = _copy__QD%(location)s_%(id)d_7 = ((SVGUITransform*)element)->GetAngle();\n"%texts
   732                 text += "  beremiz__QD%(location)s_%(id)d_7 = _copy__QD%(location)s_%(id)d_7 = ((SVGUITransform*)element)->GetAngle();\n"%texts
   734                 text += "  beremiz__ID%(location)s_%(id)d_1 = _copy__ID%(location)s_%(id)d_1 = ((SVGUITransform*)element)->GetX();\n"%texts
   733                 text += "  beremiz__ID%(location)s_%(id)d_1 = _copy__ID%(location)s_%(id)d_1 = ((SVGUITransform*)element)->GetX();\n"%texts
   735                 text += "  beremiz__ID%(location)s_%(id)d_2 = _copy__ID%(location)s_%(id)d_2 = ((SVGUITransform*)element)->GetY();\n"%texts
   734                 text += "  beremiz__ID%(location)s_%(id)d_2 = _copy__ID%(location)s_%(id)d_2 = ((SVGUITransform*)element)->GetY();\n"%texts
   736                 text += "  MyInitSem.Post();\n"
   735         
   737         text += "}\n\n"
   736         text += "\n  MyInitSem.Post();\n}\n\n"
   738         
       
   739         return text
   737         return text