Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
admin.module_boards.Boards Class Reference
Inheritance diagram for admin.module_boards.Boards:
Inheritance graph
[legend]
Collaboration diagram for admin.module_boards.Boards:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def start
def stop
def position
def init
def get_module_name
def start

Public Attributes

 rootitem
 con
 cur
 module_name
 module_label
 canvas
 selector_color
 outline_color
 module_panel_ofset
 root_select_item
 select_item

Detailed Description

Administrating GCompris Boards

Definition at line 36 of file module_boards.py.


Constructor & Destructor Documentation

def admin.module_boards.Boards.__init__ (   self,
  canvas 
)

Definition at line 40 of file module_boards.py.

00040 
00041   def __init__(self, canvas):
00042     print("Gcompris_administration __init__ boards panel.")
00043     module.Module.__init__(self, canvas, "boards", _("Boards"))


Member Function Documentation

def admin.module.Module.get_module_name (   self) [inherited]

Definition at line 107 of file module.py.

00107 
00108     def get_module_name(self):
00109         return self.module_name

def admin.module.Module.init (   self,
  index,
  select_area,
  callback 
) [inherited]

Definition at line 48 of file module.py.

00048 
00049     def init(self, index, select_area, callback):
00050         print("Gcompris_administration init panel.")
00051 
00052         height = 80
00053         gap = 35
00054         x   = select_area[0] + (select_area[2] - select_area[0]) / 2
00055         y1  = select_area[1] + height * index + 2
00056         y2  = select_area[1] + height * (index + 1) + 1
00057 
00058         # Create our rootitem. We put each canvas item in it so at the end we
00059         # only have to kill it. The canvas deletes all the items it contains automaticaly.
00060 
00061         self.root_select_item = self.canvas.add(
00062             gnomecanvas.CanvasGroup,
00063             x=0.0,
00064             y=0.0
00065             )
00066 
00067         self.select_item = self.root_select_item.add(
00068             gnomecanvas.CanvasRect,
00069             x1=select_area[0]+2,
00070             y1=y1,
00071             x2=select_area[2]-2,
00072             y2=y2,
00073             fill_color="white",
00074             outline_color="white",
00075             width_units=1.0
00076             )
00077         self.select_item.connect("event", callback, self)
00078 
00079         y1 += 30
00080         print "config_" + self.module_name + ".png"
00081         print gcompris.skin.image_to_skin("config_" +
00082                                           self.module_name +
00083                                           ".png")
00084         item = self.root_select_item.add(
00085             gnomecanvas.CanvasPixbuf,
00086             pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("config_" +
00087                                                                             self.module_name +
00088                                                                             ".png")),
00089             x = x,
00090             y = y1,
00091             anchor=gtk.ANCHOR_CENTER,
00092             )
00093         item.connect("event", callback, self)
00094 
00095         y1 += gap
00096 
00097         item = self.root_select_item.add (
00098             gnomecanvas.CanvasText,
00099             text=_(self.module_label),
00100             font=gcompris.skin.get_font("gcompris/tiny"),
00101             x = x,
00102             y = y1,
00103             fill_color="black"
00104             )
00105         item.connect("event", callback, self)
00106 

def admin.module.Module.position (   self) [inherited]

Reimplemented in admin.module_users.Users, admin.module_groups.Groups, and admin.module_profiles.Profiles.

Definition at line 45 of file module.py.

00045 
00046     def position(self):
00047         return 999

def admin.module_boards.Boards.start (   self,
  area 
)

Definition at line 44 of file module_boards.py.

00044 
00045   def start(self, area):
00046     print "starting boards panel"
00047 
00048     # Create our rootitem. We put each canvas item in it so at the end we
00049     # only have to kill it. The canvas deletes all the items it contains automaticaly.
00050 
00051     self.rootitem = self.canvas.add(
00052         gnomecanvas.CanvasGroup,
00053         x=0.0,
00054         y=0.0
00055         )
00056 
00057     module.Module.start(self)
00058 
00059     # Connect to our database
00060     self.con = sqlite.connect(gcompris.get_database())
00061     self.cur = self.con.cursor()
00062 
00063     frame = gtk.Frame(_("Boards"))
00064     frame.show()
00065 
00066     self.rootitem.add(
00067       gnomecanvas.CanvasWidget,
00068       widget=frame,
00069       x=area[0]+self.module_panel_ofset,
00070       y=area[1]+self.module_panel_ofset,
00071       width=area[2]-area[0]-2*self.module_panel_ofset,
00072       height=area[3]-area[1]-2*self.module_panel_ofset,
00073       anchor=gtk.ANCHOR_NW,
00074       size_pixels=False)
00075 
00076     board_list.Board_list(self.con, self.cur,
00077                           frame)

def admin.module.Module.start (   self) [inherited]

Definition at line 110 of file module.py.

00110 
00111     def start(self):
00112         self.select_item.set(
00113             fill_color_rgba=self.selector_color,
00114             outline_color_rgba=self.outline_color
00115             )

Reimplemented from admin.module.Module.

Definition at line 78 of file module_boards.py.

00078 
00079   def stop(self):
00080     print "stopping boards panel"
00081     module.Module.stop(self)
00082 
00083     # Remove the root item removes all the others inside it
00084     self.rootitem.destroy()
00085 
00086     # Close the database
00087     self.cur.close()
00088     self.con.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 36 of file module.py.

Definition at line 59 of file module_boards.py.

Definition at line 60 of file module_boards.py.

Definition at line 35 of file module.py.

Definition at line 34 of file module.py.

Definition at line 40 of file module.py.

Definition at line 39 of file module.py.

Definition at line 60 of file module.py.

Definition at line 50 of file module_boards.py.

Definition at line 66 of file module.py.

Definition at line 38 of file module.py.


The documentation for this class was generated from the following file: