MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / OnStateChange

Method OnStateChange

gui/toggle_panel.py:102–120  ·  view source on GitHub ↗
(self, sz)

Source from the content-addressed store, hash-verified

100 return self._toggled
101
102 def OnStateChange(self, sz):
103 self.SetSize(sz)
104
105 self.parent.GetSizer().SetSizeHints(self.parent)
106
107 if not self._toggled:
108 if self.parent.GetSizer():
109 # we have just set the size hints...
110 sz = self.parent.GetSizer().CalcMin()
111
112 # use SetClientSize() and not SetSize() otherwise the size for
113 # e.g. a wxFrame with a menubar wouldn't be correctly set
114 self.parent.SetClientSize(sz)
115 else:
116 self.parent.Layout()
117 else:
118 # force our parent to "fit", i.e. expand so that it can honor
119 # our minimal size
120 self.parent.Fit()
121
122 def ToggleContent(self, event):
123 # self.Freeze()

Callers 2

__init__Method · 0.95
ToggleContentMethod · 0.95

Calls 1

SetSizeMethod · 0.80

Tested by

no test coverage detected