Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 33 additions & 31 deletions Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ def OnPaint(self, event):
# Initialize the wx.BufferedPaintDC, assigning a background
# colour and a foreground colour (to draw the text)
backColour = self.GetBackgroundColour()
backBrush = wx.Brush(backColour, wx.PENSTYLE_SOLID)
backBrush = wx.Brush(backColour, wx.BRUSHSTYLE_SOLID)
pdc.SetBackground(backBrush)
pdc.Clear()

Expand Down Expand Up @@ -2531,48 +2531,50 @@ def DiagramModified(self):
from window where modifications are performed to DEVSimPy main window.
"""

if self.diagram.modify:
### window where modification is performed
win = self.GetTopLevelParent()

if isinstance(win, DetachedFrame):
### main window
mainW = wx.GetApp().GetTopWindow()
if not self.diagram.modify:
return

if not isinstance(mainW, DetachedFrame):
nb2 = mainW.GetDiagramNotebook()
s = nb2.GetSelection()
canvas = nb2.GetPage(s)
diagram = canvas.GetDiagram()
### modifying propagation
diagram.modify = True
### update general shapes
canvas.UpdateShapes()
### window where modification is performed
win = self.GetTopLevelParent()

label = nb2.GetPageText(s)
if isinstance(win, DetachedFrame):
### main window
mainW = wx.GetApp().GetTopWindow()

### modified windows dictionary
D = {win.GetTitle(): win, label: mainW}
else:
D={}
else:
nb2 = win.GetDiagramNotebook()
if not isinstance(mainW, DetachedFrame) and hasattr(mainW, 'GetDiagramNotebook'):
nb2 = mainW.GetDiagramNotebook()
s = nb2.GetSelection()
canvas = nb2.GetPage(s)
diagram = canvas.GetDiagram()
### modifying propagation
diagram.modify = True
### update general shapes
canvas.UpdateShapes()

label = nb2.GetPageText(s)

D = {label : win}
### modified windows dictionary
D = {win.GetTitle(): win, label: mainW}
else:
D={}
else:
nb2 = win.GetDiagramNotebook()
s = nb2.GetSelection()
canvas = nb2.GetPage(s)
diagram = canvas.GetDiagram()
diagram.modify = True
label = nb2.GetPageText(s)

D = {label : win}

#nb.SetPageText(nb.GetSelection(), "*%s"%label.replace('*',''))
#nb.SetPageText(nb.GetSelection(), "*%s"%label.replace('*',''))

### statusbar printing
for string,win in list(D.items()):
printOnStatusBar(win.statusbar, {0:"%s %s"%(string ,_("modified")), 1:os.path.basename(diagram.last_name_saved), 2:''})
### statusbar printing
for string,win in list(D.items()):
printOnStatusBar(win.statusbar, {0:"%s %s"%(string ,_("modified")), 1:os.path.basename(diagram.last_name_saved), 2:''})

tb = win.GetToolBar()
tb.EnableTool(Menu.ID_SAVE, self.diagram.modify)
tb = win.GetToolBar()
tb.EnableTool(Menu.ID_SAVE, self.diagram.modify)

###
def OnMotion(self, event):
Expand Down
2 changes: 1 addition & 1 deletion Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import gettext
_ = gettext.gettext

if wx.VERSION_STRING > '4.0.1': wx.NewId = wx.NewIdRef
if wx.VERSION_STRING > '4.0.1': wx.NewId = wx.ID_ANY

#File menu identifiers
ID_NEW = wx.ID_NEW
Expand Down
4 changes: 2 additions & 2 deletions PropertiesGridCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def Draw(self, grid, attr, dc, rect, row, col, isSelected):
fg = attr.GetTextColour()
dc.SetTextBackground(bg)
dc.SetTextForeground(fg)
dc.SetBrush(wx.Brush(bg, wx.PENSTYLE_SOLID))
dc.SetBrush(wx.Brush(bg, wx.BRUSHSTYLE_SOLID))
dc.SetPen(wx.TRANSPARENT_PEN)
dc.DrawRectangleRect(rect) if wx.VERSION_STRING < '4.0' else wx.DC.DrawRectangle(dc, rect)
grid.DrawTextRectangle(dc, text, rect, hAlign, vAlign)
Expand Down Expand Up @@ -497,7 +497,7 @@ def GetAttr(self, row, col, kind):
#attr.SetBackgroundColour("light blue")
elif col == 2:
attr.SetReadOnly(True)
attr.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTFAMILY_ITALIC, wx.FONTWEIGHT_NORMAL))
attr.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL))
else:
### load color in cell for pen and fill
if isinstance(val, list):
Expand Down