37 from RtmCompData
import *
52 ID_WINDOW_CENTER_TOP = 5001
53 ID_WINDOW_CENTER_BOTTOM = 5002
54 ID_WINDOW_RIGHT = 5003
60 for item_name, handler
in menulist:
61 if item_name ==
"---":
62 self.menu.AppendSeparator()
65 parent.Bind(wx.EVT_MENU, handler, id=new_id)
66 item = wx.MenuItem(self.
menu, new_id, item_name)
67 self.menu.AppendItem(item)
73 wx.DropTarget.__init__(self)
76 self.
df = wx.CustomDataFormat(
"RTComponent")
78 print "RTComponentDropTarget", self.df.GetId(), self.df.GetType()
79 self.
data = wx.CustomDataObject(self.
df)
80 self.SetDataObject(self.
data)
84 self.window.AppendText(
"OnDragOver\n")
96 data = self.data.GetData()
97 cdata = cPickle.loads(data)
98 self.window.AppendText(cdata +
"\n")
108 menu_list = [(
"&New System", self.
OnNew),
109 (
"&Open System", self.
OnOpen),
110 (
"&Save System", self.
OnSave),
113 (
"&Import Component", self.
OnImport),
114 (
"&Export Component", self.
OnExport),
117 (
"&Print System", self.
OnPrint),
119 (
"&Connect Naming Server", self.
OnConnect),
122 MenuFactory.__init__(self, parent, menu_list)
125 self.parent.OnNewSystemClick(
None)
129 self.parent.drawWin[self.parent.drawCurNum].loadXML()
133 filename =
"System%d.xml" % self.parent.drawCurNum
134 self.parent.drawWin[self.parent.drawCurNum].saveXML(filename)
138 self.parent.drawWin[self.parent.drawCurNum].saveAsXML()
142 self.parent.OnFileOpen(event)
146 self.parent.OnFileOpen(event)
150 dlg = wx.PrintDialog(self.
parent,
None)
151 if dlg.ShowModal() == wx.ID_OK:
152 data = dlg.GetPrintDialogData()
156 self.parent.OnFileOpen(event)
160 self.parent.treepanel.OnConnectNSClick(
None)
165 self.parent.treepanel.threadloop = 0
166 self.parent.close_evt.wait()
167 self.parent.Close(true)
172 menu_list = [(
"&Copy", self.
OnCopy),
173 (
"C&ut", self.
OnCut),
175 MenuFactory.__init__(self, parent, menu_list)
188 menu_list = [(
"Long Name &and Alias", self.
OnAllDisp),
191 MenuFactory.__init__(self, parent, menu_list)
194 self.parent.kindDispMode =
'all' 198 self.parent.kindDispMode =
'long' 202 self.parent.kindDispMode =
'alias' 208 menu_list = [(
"&Help", self.
OnHelp),
211 MenuFactory.__init__(self, parent, menu_list)
228 if text[-1:] ==
'\n':
256 wxMDIParentFrame.__init__(self, parent, -1, title, size = (800, 600),
257 style=wx.DEFAULT_FRAME_STYLE|wx.HSCROLL | wx.VSCROLL
284 self.
toolbar = self.CreateToolBar(wxTB_HORIZONTAL
293 "Exit",
"Exit from rtc-link.")
296 self.toolbar.AddSeparator()
299 self.toolbar.AddSimpleTool(self.
connectID,
302 "Connect to a Naming Server.")
307 "Long Name and Alias",
"Display long name and alias on the naming tree window.")
313 "Long Name",
"Display only long name on the naming tree window.")
318 "Alias",
"Display only alias on the naming tree window.")
323 self.toolbar.AddSeparator()
326 self.toolbar.AddSimpleTool(self.
newsysID,
329 "Open.: Open a new system draw window.")
338 self.toolbar.Realize()
361 style=wx.NO_BORDER|wx.SW_3D)
362 win.SetDefaultSize((200, 600))
363 win.SetOrientation(wxLAYOUT_VERTICAL)
364 win.SetAlignment(wxLAYOUT_LEFT)
365 win.SetBackgroundColour(wxColour(200, 200, 200))
366 win.SetSashVisible(wxSASH_RIGHT,
True)
376 self.Bind(wx.EVT_TOOL,
377 self.treepanel.OnConnectNSClick,
386 style=wx.NO_BORDER|wx.SW_3D)
387 win.SetDefaultSize((200, 600))
388 win.SetOrientation(wxLAYOUT_VERTICAL)
389 win.SetAlignment(wxLAYOUT_RIGHT)
390 win.SetBackgroundColour(wxColour(200, 200, 200))
391 win.SetSashVisible(wxSASH_LEFT,
True)
393 import RtmProfileList
401 win = wxSashLayoutWindow(self, self.
logW_ID,
402 style=wx.NO_BORDER|wx.SW_3D)
403 win.SetDefaultSize((400, 100))
404 win.SetOrientation(wx.LAYOUT_HORIZONTAL)
405 win.SetAlignment(wx.LAYOUT_BOTTOM)
406 win.SetBackgroundColour(wx.Colour(200, 200, 200))
407 win.SetSashVisible(wx.SASH_TOP,
True)
410 style=wx.TE_MULTILINE|wx.SUNKEN_BORDER)
411 self.textWindow.SetValue(
"A sub window")
417 self.GetClientWindow().Bind(
421 self.Bind(wx.EVT_CLOSE, self.
OnClose)
427 self.Bind(wx.EVT_SIZE, self.
OnSize)
442 win = wxMDIChildFrame(self, new_id ,
"System: %d" % self.
winCount)
451 os_check = sys.platform
452 if os_check ==
'win32':
459 curID = event.GetId()
460 for n
in self.drawWinID.keys():
469 curID = event.GetId()
470 for n
in self.drawWinID.keys():
476 wxLayoutAlgorithm().LayoutMDIFrame(self)
480 if event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE:
485 self.treepanelW.SetDefaultSize((event.GetDragRect().width, 200))
488 self.profilepanelW.SetDefaultSize((event.GetDragRect().width, 200))
492 self.logW.SetDefaultSize((1000, event.GetDragRect().height))
494 wx.LayoutAlgorithm().LayoutMDIFrame(self)
495 self.GetClientWindow().Refresh()
499 if hasattr(self,
"treepanel"):
501 self.treepanel.threadloop = 0
502 self.close_evt.wait()
515 menuBar = wxMenuBar()
516 menuBar.Append(menu_file,
"&File");
517 menuBar.Append(menu_edit,
"&Edit");
518 menuBar.Append(menu_disp,
"&Display");
519 menuBar.Append(menu_help,
"&Help");
522 id = menuBar.FindMenuItem(
"Edit",
"Copy")
523 menuBar.FindItemById(id).Enable(false)
524 id = menuBar.FindMenuItem(
"Edit",
"Cut")
525 menuBar.FindItemById(id).Enable(false)
526 id = menuBar.FindMenuItem(
"Edit",
"Paste")
527 menuBar.FindItemById(id).Enable(false)
537 id = menuBar.FindMenuItem(
"File",
"Import Component")
538 menuBar.FindItemById(id).Enable(false)
539 id = menuBar.FindMenuItem(
"File",
"Export Component")
540 menuBar.FindItemById(id).Enable(false)
542 id = menuBar.FindMenuItem(
"File",
"Print Preview")
543 menuBar.FindItemById(id).Enable(false)
544 id = menuBar.FindMenuItem(
"File",
"Print System")
545 menuBar.FindItemById(id).Enable(false)
551 self, message=
"Choose a file", defaultDir=os.getcwd(),
552 defaultFile=
"", wildcard=
"*.*", style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR
555 if dlg.ShowModal() == wx.ID_OK:
574 dc = wx.ClientDC(self.GetClientWindow())
577 sz = self.GetClientSize()
578 w = self.bg_bmp.GetWidth()
579 h = self.bg_bmp.GetHeight()
586 dc.DrawBitmap(self.
bg_bmp, (x, y))
def TimeToQuit(self, event)
def OnDragOver(self, x, y, d)
def OnAliasDisp(self, event)
def WriteText(self, text)
def OnEraseBackground(self, evt)
def OnLongnameDisp(self, event)
def __init__(self, window)
def OnSashDrag(self, event)
def OnChildClose(self, event)
def OnChangeDraw(self, event)
def OnNewSystemClick(self, event)
def OnAllDisp(self, event)
winCount
wx.NO_FULL_REPAINT_ON_RESIZE
def OnData(self, x, y, d)
def getNewRTSystemBitmap()
def __init__(self, parent, ID, title)
def OnFileOpen(self, event)