Exemple #1
0
	def _setup_wnd(self, wnd, icon):
		""" Setup window.

		Args:
			icon: name of icon; if empty try to use icon from parent window.
		"""
		if not icon:
			parent = wnd.GetParent()
			if parent and hasattr(parent, 'GetIcon'):
				wnd.SetIcon(parent.GetIcon())
		else:
			wnd.SetIcon(iconprovider.get_icon(icon))
		_fix_panels(wnd)
		if wx.Platform == '__WXMSW__':
			wnd.SetBackgroundColour(wx.SystemSettings.GetColour(
					wx.SYS_COLOUR_ACTIVEBORDER))
		if self._save_pos:
			size = self._appconfig.get(self._dialog_name, 'size', (400, 300))
			if size:
				wnd.SetSize(size)
			position = self._appconfig.get(self._dialog_name, 'position')
			if position:
				wnd.Move(position)
		else:
			wnd.Centre()
		wnd.SetFocus()
		wnd.SetEscapeId(wx.ID_CLOSE)
Exemple #2
0
	def _setup_wnd(self, wnd):
		if self._window_icon:
			wnd.SetIcon(iconprovider.get_icon(self._window_icon))

		if wx.Platform == '__WXMSW__':
			# fix controls background
			bgcolor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVEBORDER)
			wnd.SetBackgroundColour(bgcolor)
			#_update_color(wnd, bgcolor)

		wnd.SetExtraStyle(wx.WS_EX_VALIDATE_RECURSIVELY)
		self._set_size_pos()