File: RefDisplay.py

package info (click to toggle)
bibus 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,012 kB
  • ctags: 2,804
  • sloc: python: 31,402; sql: 222; makefile: 115; xml: 10; sh: 3
file content (74 lines) | stat: -rw-r--r-- 2,408 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 2004,2005 Pierre Martineau <pmartino@users.sourceforge.net>
# This file is part of Bibus, a bibliographic database that can
# work together with OpenOffice.org to generate bibliographic indexes.
#
# Bibus is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Bibus is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bibus; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
#
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.3.4 on Sat Dec  3 16:25:38 2005

import wx
import BIB

class RefDisplayBase(wx.Panel):
	def __init__(self, *args, **kwds):
		# begin wxGlade: RefDisplayBase.__init__
		kwds["style"] = wx.TAB_TRAVERSAL
		wx.Panel.__init__(self, *args, **kwds)
		self.RefDisplay = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH)

		self.__set_properties()
		self.__do_layout()
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: RefDisplayBase.__set_properties
		pass
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: RefDisplayBase.__do_layout
		sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
		sizer_1.Add(self.RefDisplay, 1, wx.EXPAND, 0)
		self.SetAutoLayout(1)
		self.SetSizer(sizer_1)
		sizer_1.Fit(self)
		sizer_1.SetSizeHints(self)
		# end wxGlade

# end of class RefDisplayBase


class RefDisplay(RefDisplayBase):
	def Clear(self):
		self.RefDisplay.Clear()
		
	def resetFormat(self,format):
		return

	def display(self,ref):
		"""Display the reference ref
		If ref = '' => clear the display
		"""
		self.Clear()
		if ref:
			displayedFields = BIB.EDIT[BIB.BIB_TYPE[int(ref[2])]][0]+("Abstract",)
			for i in displayedFields:
				self.RefDisplay.SetDefaultStyle(wx.TextAttr(BIB.KEY_COLOR))
				self.RefDisplay.AppendText("""%s: """ %BIB.NAME_FIELD[i])
				self.RefDisplay.SetDefaultStyle(wx.TextAttr(BIB.TEXT_COLOR))
				self.RefDisplay.AppendText("""%s\n""" % (ref[BIB.BIBLIOGRAPHIC_FIELDS[i]]))
			self.RefDisplay.ShowPosition(0)