def insert_header(self, title, subtitle, bmp_file): ''' Inserts a header with image, title and subtitle ''' hbh = 57 hbw = 150 self.header = ui.Panel( self, 0, 0 , self.width, hbh+2) if bmp_file: self.header.image = ui.Bitmap( self.header, 0, 0, hbw, hbh) self.header.image.set_image( os.path.join(unicode(str(self.info.image_dir), 'mbcs'), unicode(str(bmp_file), 'mbcs'))) if title: self.header.title = ui.Label( self.header, hbw + 20, 10, self.width - 200, 16, text = title) self.header.title.set_font(bold=True) if subtitle: self.header.subtitle = ui.Label( self.header, hbw + 20, 26, self.width - 200, 26, text = subtitle) self.header.line = ui.EtchedRectangle(self.header,0, hbh,self.width, 2) self.header.height = hbh + 2 self.header.set_background_color(255,255,255)
def insert_vertical_image(self, bmp_file): self.vertical_image = ui.Bitmap( self, 0, 0, 164, 314) self.vertical_image.set_image( os.path.join(unicode(str(self.info.image_dir), 'mbcs'), unicode(str(bmp_file), 'mbcs'))) self.vertical_image.width = 164
def add_controls_block(self, parent, left, top, bmp, label, is_listbox): picture = ui.Bitmap(parent, left, top + 6, 32, 32) picture.set_image( os.path.join(unicode(str(self.info.image_dir), 'mbcs'), unicode(str(bmp), 'mbcs'))) label = ui.Label(parent, left + 32 + 10, top, 150, 12, label) if is_listbox: combo = ui.ComboBox(parent, left + 32 + 10, top + 20, 150, 200, "") else: combo = None return picture, label, combo