Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
admin.module.Module Class Reference
Inheritance diagram for admin.module.Module:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Public Attributes

 module_name
 module_label
 canvas
 selector_color
 outline_color
 module_panel_ofset
 root_select_item
 select_item

Detailed Description

GCompris Administrative Module

Definition at line 30 of file module.py.


Constructor & Destructor Documentation

def admin.module.Module.__init__ (   self,
  canvas,
  module_name,
  module_label 
)

Definition at line 33 of file module.py.

00033 
00034     def __init__(self, canvas, module_name, module_label):
00035         self.module_name = module_name
00036         self.module_label = module_label
00037         self.canvas = canvas
00038 
00039         self.selector_color = 0xC5D2DDFFL
00040         self.outline_color  = 0XD8B09AFFL
00041         self.module_panel_ofset = 3


Member Function Documentation

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 
)

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 

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.Module.start (   self)

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             )

def admin.module.Module.stop (   self)

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

Definition at line 116 of file module.py.

00116 
00117     def stop(self):
00118         self.select_item.set(
00119             fill_color="white",
00120             outline_color="white"
00121             )
00122 

Here is the caller graph for this function:


Member Data Documentation

Definition at line 36 of file module.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 66 of file module.py.

Definition at line 38 of file module.py.


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