Ejemplo n.º 1
0
 def _set(self,hd):
     "set by a component handle"
     #set M,N
     name=kcs_draft.subpicture_name_get(self.Handle)
     self.M,self.N=[int(i) for i in name[2:].split('X')]
     #set Text and Rectangle
     ees=ktDraft.GetSubElements(hd)
     for ee in ees:
         if kcs_draft.element_is_text(ee):
             tempText=Text()
             kcs_draft.text_properties_get(ee,tempText)
             self.String=tempText.String
     self.Rect=kcs_draft.element_extent_get(hd)
Ejemplo n.º 2
0
             compName=kcs_draft.subpicture_name_get(comp)
             if compName.startswith("NOTE_"):
                 hNoteList.append(comp)
         except:
             break
 except Exception,e:
     kcs_ui.message_noconfirm(e.message)
     return
 sList=Stringlist("ok") #获得批注内容列表
 for hNote in hNoteList: 
     noteName=kcs_draft.subpicture_name_get(hNote)
     #找到文字
     try:
         ee=kcs_draft.element_child_first_get(hNote)
         txt=Text()
         if kcs_draft.element_is_text(ee):
             txt=kcs_draft.text_properties_get(ee,txt)
             sList.AddString(noteName+" : "+txt.GetString())
             continue
         while True:
             ee=kcs_draft.element_sibling_next_get(ee)
             if kcs_draft.element_is_text(ee):
                 txt=kcs_draft.text_properties_get(ee.txt)
                 sList.AddString(noteName+" : "+txt.GetString())
                 break
     except Exception,e:
         kcs_ui.message_noconfirm(e.message)
 sList.StrList=sList.StrList[1:]
 res=kcs_ui.string_select("批注","批注列表","请选择批注",sList) #显示批注列表
 if res[0]==kcs_util.ok():
     index=res[1]