Ejemplo n.º 1
0
 def __init__(self, parent):
     self.ACCEL_CTRL_KEY, self.ACCEL_CTRL_MOD = Gtk.accelerator_parse("<Ctrl>")
     self.ACCEL_SHFT_KEY, self.ACCEL_SHFT_MOD = Gtk.accelerator_parse("<Shift>")
     self.parent = parent
     self.t = 1
     self.long_verse = None
     self.long_tatwil = None
     self.long_space = None
     self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
     Gtk.Box.__init__(self,spacing=7,orientation=Gtk.Orientation.VERTICAL)
     self.vp = Gtk.VPaned()
     self.view_poem = daw_customs.ViewPoem()
     self.view_poem.set_justification(Gtk.Justification.CENTER)
     self.view_poem.set_cursor_visible(False)
     self.view_poem.set_editable(False)
     self.view_poem.set_right_margin(10)
     self.view_poem.set_left_margin(10)
     self.view_poem_bfr = self.view_poem.get_buffer()
     self.speaker_poem_tag = self.view_poem_bfr.create_tag("speaker")
     self.search_poem_tag = self.view_poem_bfr.create_tag("search")
     scroll = daw_customs.ScrollClass()
     scroll.set_shadow_type(Gtk.ShadowType.IN)
     scroll.add(self.view_poem)
     self.vp.pack1(scroll, False, False)
     
     self.vbox_charh = Gtk.VBox(False, 0)
     self.lab_charh = Gtk.Label()
     self.close_charh = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'tab.png'),
                                             "إخفاء", lambda *a: self.vbox_charh.hide())
     self.save_charh = Gtk.Button("حفظ")
     self.save_charh.connect("clicked", self.save_ta3lik)
     hb = Gtk.HBox(False,7)
     hb.set_border_width(7)
     hb.pack_start(self.lab_charh, False, False, 0)
     hb.pack_end(self.close_charh, False, False, 0)
     hb.pack_end(self.save_charh, False, False, 0)
     self.view_charh = daw_customs.ViewEdit()
     self.view_charh.set_right_margin(5)
     self.view_charh.set_left_margin(5)
     self.view_charh.set_cursor_visible(False)
     self.view_charh.set_editable(False)
     self.view_charh_bfr = self.view_charh.get_buffer()
     scroll = Gtk.ScrolledWindow()
     scroll.set_shadow_type(Gtk.ShadowType.IN)
     scroll.add(self.view_charh)
     scroll.set_size_request(-1, 200)
     self.vbox_charh.pack_start(hb, False, False, 0)
     self.vbox_charh.pack_start(scroll, True, True, 0)
     self.pack_start(self.vp, True, True, 0)
     self.change_font()
Ejemplo n.º 2
0
    def build(self,*a): 
        Gtk.Box.__init__(self,spacing=7,orientation=Gtk.Orientation.VERTICAL)
        hp1 = Gtk.HPaned()
        self.pack_start(hp1, True, True, 0)
        self.tree_poet = daw_customs.TreeClass()
        self.sel_poet = self.tree_poet.get_selection()
        cell = Gtk.CellRendererText()
        cell.set_property("wrap-mode", Pango.WrapMode.WORD_CHAR)
        cell.set_property("wrap-width", 150)
        kal = Gtk.TreeViewColumn('دواوين الشعراء', cell, text=1)
        self.tree_poet.append_column(kal)
        self.store_poet = Gtk.ListStore(int, str, int, int, int)
        self.refresh_poets()
        self.tree_poet.connect("cursor-changed", self.ok_poet)
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.tree_poet)
        scroll.set_size_request(150, -1)
        scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        vb = Gtk.Box(spacing=7,orientation=Gtk.Orientation.VERTICAL)
        try: self.search_poets = Gtk.SearchEntry()
        except: self.search_poets = Gtk.Entry()
        self.search_poets.set_placeholder_text('بحث عن شاعر')
        self.search_poets.connect('changed', self.search_cb)
        vb.pack_start(self.search_poets, False, False, 0)
        vb.pack_start(scroll, True, True, 0)
        hp1.pack1(vb, False, False)
        
        hp2 = Gtk.HPaned()
        hp1.pack2(hp2, True, True)
        self.store_poems = Gtk.ListStore(int, str)
        self.tree_poems = daw_customs.TreeClass()
        self.tree_poems.set_model(self.store_poems)
        self.sel_poem = self.tree_poems.get_selection()
        self.tree_poems.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
        self.tree_poems.connect("cursor-changed", self.ok_poem)
        poems = Gtk.TreeViewColumn('القصائد', Gtk.CellRendererText(), text=1)
        self.tree_poems.append_column(poems)
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.tree_poems)
        scroll.set_size_request(180, -1)
        hp2.pack1(scroll, False, False)
        
        self.notebk = Gtk.Notebook()
        hp2.pack2(self.notebk, True, True)
        self.notebk.set_show_tabs(False)
        self.nbk1 = Gtk.Notebook()
        self.nbk2 = Gtk.Notebook()
        self.view_nasse  = daw_customs.ViewEdit()
        self.view_nasse.set_justification(Gtk.Justification.CENTER)
        self.view_nasse_bfr = self.view_nasse.get_buffer()
        self.view_nasse_bfr.connect('changed', self.change_text)
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_nasse)
        vb = Gtk.VBox(False, 0)
        hb = Gtk.HBox(False, 0)
        lab = Gtk.Label('التشكيل :   ')
        lab.set_alignment(0,0.5)
        hb.pack_start(lab, False, False, 0)
        shadda = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'shadda.png'), 'الشدة', self.tashkeel_cb, daw_araby.SHADDA)
        hb.pack_start(shadda, False, False, 0)
        skon = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'skon.png'), 'السكون',self.tashkeel_cb, daw_araby.SUKUN)
        hb.pack_start(skon, False, False, 0)
        fatha = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha.png'), 'الفتحة',self.tashkeel_cb, daw_araby.FATHA)
        hb.pack_start(fatha, False, False, 0)
        damma = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma.png'), 'الضمة',self.tashkeel_cb, daw_araby.DAMMA)
        hb.pack_start(damma, False, False, 0)
        kasra = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra.png'), 'الكسرة',self.tashkeel_cb, daw_araby.KASRA)
        hb.pack_start(kasra, False, False, 0)
        fatha2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha2.png'), 'الفتحتين',self.tashkeel_cb, daw_araby.FATHATAN)
        hb.pack_start(fatha2, False, False, 0)
        damma2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma2.png'), 'الضمتين',self.tashkeel_cb, daw_araby.DAMMATAN)
        hb.pack_start(damma2, False, False, 0)
        kasra2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra2.png'), 'الكسرتين',self.tashkeel_cb, daw_araby.KASRATAN)
        hb.pack_start(kasra2, False, False, 0)
        vb.pack_start(scroll, True, True, 0)
        
        self.redo = Gtk.ToolButton(stock_id=Gtk.STOCK_REDO)
        self.redo.set_sensitive(False)
        hb.pack_end(self.redo, False, False, 3)
        self.redo.connect('clicked', self.redo_text)
        vb.pack_start(hb, False, False, 0)
        self.nbk1.append_page(vb, Gtk.Label('القصيدة'))
        
        self.view_charh = daw_customs.ViewEdit()
        self.view_charh_bfr = self.view_charh.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_charh)
        self.nbk1.append_page(scroll, Gtk.Label('الشرح'))
        
        vb = Gtk.VBox(False, 7)
        vb.set_border_width(7)
        hb = Gtk.HBox(False, 7)
        la0 = Gtk.Label('اسم القصيدة')
        la0.set_alignment(0,0.5)
        hb.pack_start(la0, False, False, 0)
        self.nm_poem = Gtk.Entry()
        self.nm_poem.set_placeholder_text('إن لم يكن لها اسم ، اكتب صدر أول بيت بدلا من ذلك')
        hb.pack_start(self.nm_poem, True, True, 0)
        vb.pack_start(hb, False, False, 0)
  
        hb, self.naw3 = daw_customs.combo(daw_tools.elnaw3, u'النوع', 0)
        vb.pack_start(hb, False, False, 0)
        self.naw3.connect('changed', self.change_naw3)
        
        hb, self.gharadh = daw_customs.combo(daw_tools.elgharadh, u'الغرض', 0)
        vb.pack_start(hb, False, False, 0)
        self.active_gharadh = Gtk.CheckButton('')
        self.active_gharadh.set_active(True)
        def active_gharadh_cb(widget, *a):
            if self.active_gharadh.get_active():
                self.gharadh.set_sensitive(True)
            else:
                self.gharadh.set_sensitive(False)
                self.gharadh.set_active(-1)
        self.active_gharadh.connect('toggled', active_gharadh_cb)
        hb.pack_start(self.active_gharadh, False, False, 0)

        self.baher_hb, self.baher = daw_customs.combo(daw_tools.elbehor, u'البحر', 0)
        self.baher.connect('changed', self.a3aridh_elbaher)
        vb.pack_start(self.baher_hb, False, False, 0)
        self.active_baher = Gtk.CheckButton('')
        self.active_baher.set_active(True)
        def active_baher_cb(widget, *a):
            if self.active_baher.get_active():
                self.baher.set_sensitive(True)
            else:
                self.baher.set_sensitive(False)
                self.baher.set_active(-1)
        self.active_baher.connect('toggled', active_baher_cb)
        self.baher_hb.pack_start(self.active_baher, False, False, 0)
        
        self.rawi_hb, self.rawi = daw_customs.combo(daw_tools.elrawi, u'الروي', 0)
        vb.pack_start(self.rawi_hb, False, False, 0)
        self.active_rawi = Gtk.CheckButton('')
        self.active_rawi.set_active(True)
        def active_rawi_cb(widget, *a):
            if self.active_rawi.get_active():
                self.rawi.set_sensitive(True)
            else:
                self.rawi.set_sensitive(False)
                self.rawi.set_active(-1)
        self.active_rawi.connect('toggled', active_rawi_cb)
        self.rawi_hb.pack_start(self.active_rawi, False, False, 0)
        
        self.kafia_hb, self.kafia = daw_customs.combo(daw_tools.elkawafi, u'القافية', 0)
        vb.pack_start(self.kafia_hb, False, False, 0)
        self.active_kafia = Gtk.CheckButton('')
        self.active_kafia.set_active(True)
        def active_kafia_cb(widget, *a):
            if self.active_kafia.get_active():
                self.kafia.set_sensitive(True)
            else:
                self.kafia.set_sensitive(False)
                self.kafia.set_active(-1)
        self.active_kafia.connect('toggled', active_kafia_cb)
        self.kafia_hb.pack_start(self.active_kafia, False, False, 0)
        
        self.arodh_hb, self.arodh = daw_customs.combo([], u'العروض وضربها', 0)
        vb.pack_start(self.arodh_hb, False, False, 0)
        self.active_arodh = Gtk.CheckButton('')
        self.active_arodh.set_active(True)
        def active_arodh_cb(widget, *a):
            if self.active_arodh.get_active():
                self.arodh.set_sensitive(True)
            else:
                self.arodh.set_sensitive(False)
                self.arodh.set_active(-1)
        self.active_arodh.connect('toggled', active_arodh_cb)
        self.arodh_hb.pack_start(self.active_arodh, False, False, 0)
        
        la1 = Gtk.Label('سبب النظم')
        la1.set_alignment(0,1)
        vb.pack_start(la1, False, False, 0)
        self.view_sabab = daw_customs.ViewEdit()
        self.view_sabab_bfr = self.view_sabab.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_sabab)
        vb.pack_start(scroll, True, True, 0)
        self.nbk1.append_page(vb, Gtk.Label('معلوماتها'))
        
        self.view_tarjama = daw_customs.ViewEdit()
        self.view_tarjama_bfr = self.view_tarjama.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_tarjama)
        self.nbk2.append_page(scroll, Gtk.Label('الترجمة'))
        
        self.grid_poet = Gtk.Grid()
        self.grid_poet.set_column_spacing(6)
        self.grid_poet.set_row_spacing(6)
        self.grid_poet.set_border_width(6)

        self.grid_poet.attach(Gtk.Label('الاسم المشتهر'), 1, 1, 1, 1)
        self.lak_poet = Gtk.Entry()
        self.grid_poet.attach(self.lak_poet, 2, 1, 3, 1)
        
        self.grid_poet.attach(Gtk.Label('الاسم الحقيقي'), 1, 2, 1, 1)
        self.nm_poet = Gtk.Entry()
        self.grid_poet.attach(self.nm_poet, 2, 2, 3, 1)
        
        hb, self.ages = daw_customs.combo(daw_tools.age_poet, u'العصر', 0)
        self.ages.connect('changed', self.select_age)
        self.grid_poet.attach(hb, 1, 3, 4, 1)
        
        hb, self.lands = daw_customs.combo(daw_tools.elbalad, u'البلد', 0)
        self.grid_poet.attach(hb, 1, 4, 4, 1)
        
        hb, self.sexs = daw_customs.combo(daw_tools.sex_poet, u'الجنس', 0)
        self.grid_poet.attach(hb, 1, 5, 4, 1)
        
        self.grid_poet.attach(Gtk.Label('الوفاة (هـ)'), 1, 6, 1, 1)
        adj = Gtk.Adjustment(1434, -300, 1434, 1, 5.0, 0.0)
        self.dh_poet = Gtk.SpinButton()
        self.dh_poet.set_adjustment(adj)
        self.dh_poet.set_wrap(True)
        self.grid_poet.attach(self.dh_poet, 2, 6, 1, 1)
        self.nbk2.append_page(self.grid_poet, Gtk.Label('معلومات الشاعر'))
        
        vb = Gtk.VBox(False, 7)
        vb.set_border_width(7)
        hb = Gtk.HBox(False, 7)
        move_poem = daw_customs.ButtonClass('نقل القصيدة الحالية إلى ديوان : ')
        move_poem.connect('clicked', self.move_poem_cb)
        hb.pack_start(move_poem, False, False, 0)
        self.poets_entry = Gtk.Entry()
        self.poets_entry.set_placeholder_text('اكتب حرفا لتحصل على التكملة')
        self.completion03 = Gtk.EntryCompletion()
        self.completion03.set_model(self.parent.dawawinpage.store_poet)
        self.completion03.set_text_column(1)
        self.poets_entry.set_completion(self.completion03)
        hb.pack_start(self.poets_entry, True, True, 0)
        vb.pack_start(hb, False, False, 0)
        
        hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        self.del_poem = daw_customs.ButtonClass('حذف قصيدة')
        self.del_poem.connect('clicked',self.remove_poem)
        hbox.pack_start(self.del_poem, False, False, 0)
        vb.pack_start(hbox, False, False, 0)
        self.nbk1.append_page(vb, Gtk.Label('متقدم'))
        
        vb = Gtk.VBox(False, 7)
        vb.set_border_width(7)
        hb = Gtk.HBox(False, 7)
        merge_poet = daw_customs.ButtonClass('دمج الشاعر الحالي مع الشاعر : ')
        merge_poet.connect('clicked', self.merge_poet_cb)
        hb.pack_start(merge_poet, False, False, 0)
        self.poets_entry1 = Gtk.Entry()
        self.poets_entry1.set_placeholder_text('اكتب حرفا لتحصل على التكملة')
        self.completion04 = Gtk.EntryCompletion()
        self.completion04.set_model(self.parent.dawawinpage.store_poet)
        self.completion04.set_text_column(1)
        self.poets_entry1.set_completion(self.completion04)
        hb.pack_start(self.poets_entry1, True, True, 0)
        vb.pack_start(hb, False, False, 0)
        
        hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        self.del_poet = daw_customs.ButtonClass('حذف ديوان')
        self.del_poet.connect('clicked',self.remove_poet)
        hbox.pack_start(self.del_poet, False, False, 0)
        vb.pack_start(hbox, False, False, 0)
        self.nbk2.append_page(vb, Gtk.Label('متقدم'))
        
        vb = Gtk.VBox(False, 7)
        hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        self.modif_poet = daw_customs.ButtonClass('تعديل الشاعر')
        self.modif_poet.connect('clicked',self.modify_poet_cb)
        vb.pack_start(self.nbk2, True, True, 0)
        vb.pack_start(hbox, False, False, 0)
        hbox.pack_start(self.modif_poet, False, False, 0)
        self.notebk.append_page(vb, Gtk.Label(''))
        
        vb = Gtk.VBox(False, 7)
        hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        self.modif_poem = daw_customs.ButtonClass('تعديل القصائد')
        self.modif_poem.connect('clicked',self.modify_data)
        vb.pack_start(self.nbk1, True, True, 0)
        vb.pack_start(hbox, False, False, 0)
        hbox.pack_start(self.modif_poem, False, False, 0)
        self.notebk.append_page(vb, Gtk.Label(''))

        self.show_all()
        
Ejemplo n.º 3
0
    def __init__(self, parent):
        self.parent = parent
        self.list_modifieds = []
        self.size_font = int(self.parent.theme.fontch[-2:])
        Gtk.Box.__init__(self,spacing=7, orientation=Gtk.Orientation.VERTICAL)
        self.nbk = Gtk.Notebook()
        
        self.nasse = daw_customs.ViewEdit()
        self.nasse_bfr = self.nasse.get_buffer()
        self.nasse_bfr.connect('changed', self.change_text)
        self.nasse.connect_after("populate-popup", self.populate_popup)
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.nasse)
        vb = Gtk.VBox(False, 0)
        hb = Gtk.HBox(False, 0)
        hb.set_border_width(3)
        lab = Gtk.Label('التشكيل :   ')
        lab.set_alignment(0,0.5)
        hb.pack_start(lab, False, False, 0)
        shadda = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'shadda.png'), 'الشدة', self.tashkeel_cb, daw_araby.SHADDA)
        hb.pack_start(shadda, False, False, 0)
        skon = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'skon.png'), 'السكون',self.tashkeel_cb, daw_araby.SUKUN)
        hb.pack_start(skon, False, False, 0)
        fatha = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha.png'), 'الفتحة',self.tashkeel_cb, daw_araby.FATHA)
        hb.pack_start(fatha, False, False, 0)
        damma = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma.png'), 'الضمة',self.tashkeel_cb, daw_araby.DAMMA)
        hb.pack_start(damma, False, False, 0)
        kasra = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra.png'), 'الكسرة',self.tashkeel_cb, daw_araby.KASRA)
        hb.pack_start(kasra, False, False, 0)
        fatha2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha2.png'), 'الفتحتين',self.tashkeel_cb, daw_araby.FATHATAN)
        hb.pack_start(fatha2, False, False, 0)
        damma2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma2.png'), 'الضمتين',self.tashkeel_cb, daw_araby.DAMMATAN)
        hb.pack_start(damma2, False, False, 0)
        kasra2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra2.png'), 'الكسرتين',self.tashkeel_cb, daw_araby.KASRATAN)
        hb.pack_start(kasra2, False, False, 0)
        
        self.replace = Gtk.ToolButton(stock_id=Gtk.STOCK_FIND_AND_REPLACE)
        hb.pack_end(self.replace, False, False, 3)
        self.replace.connect('clicked', self.replace_all)
        self.ent_replace2 = Gtk.Entry()
        self.ent_replace2.set_placeholder_text('المُستبدَل به')
        hb.pack_end(self.ent_replace2, False, False, 3)
        self.ent_replace1 = Gtk.Entry()
        self.ent_replace1.set_placeholder_text('المُستبدَل')
        hb.pack_end(self.ent_replace1, False, False, 3)
        
        self.reg_exp = Gtk.CheckButton('استعمل "re"')
        hb.pack_end(self.reg_exp, False, False, 0)
        
        self.redo = Gtk.ToolButton(stock_id=Gtk.STOCK_REDO)
        self.redo.set_sensitive(False)
        hb.pack_end(self.redo, False, False, 3)
        self.redo.connect('clicked', self.redo_text)
        
        vb.pack_start(scroll, True, True, 0)
        vb.pack_start(hb, False, False, 0)
        self.nbk.append_page(vb, Gtk.Label('نص القصيدة'))
        
        self.vb_info = Gtk.VBox(False, 6)
        self.vb_info.set_border_width(6)
        hb = Gtk.HBox(False, 7)
        la0 = Gtk.Label('اسم القصيدة')
        la0.set_alignment(0,0.5)
        hb.pack_start(la0, False, False, 0)
        self.name_poem = Gtk.Entry()
        self.name_poem.set_placeholder_text('إن لم يكن لها اسم ، اكتب صدر أول بيت بدلا من ذلك')
        hb.pack_start(self.name_poem, True, True, 0)
        self.vb_info.pack_start(hb, False, False, 0)
        
        hb, self.naw3 = daw_customs.combo(daw_tools.elnaw3, u'النوع', 0)
        self.vb_info.pack_start(hb, False, False, 0)
        self.naw3.connect('changed', self.change_naw3)
        
        hb, self.gharadh = daw_customs.combo(daw_tools.elgharadh, u'الغرض', 0)
        self.vb_info.pack_start(hb, False, False, 0)
        
        hb, self.baher = daw_customs.combo(daw_tools.elbehor, u'البحر', 0)
        self.baher.connect('changed', self.a3aridh_elbaher)
        self.vb_info.pack_start(hb, False, False, 0)
        
        hb, self.rawi = daw_customs.combo(daw_tools.elrawi, u'الروي', 0)
        self.vb_info.pack_start(hb, False, False, 0)
        
        hb, self.kafia = daw_customs.combo(daw_tools.elkawafi, u'القافية', 0)
        self.vb_info.pack_start(hb, False, False, 0)
        
        hb, self.arodh = daw_customs.combo(daw_tools.ela3aridh, u'العروض وضربها', 0)
        self.vb_info.pack_start(hb, False, False, 0)
        
        la1 = Gtk.Label('سبب النظم')
        la1.set_alignment(0,1)
        self.vb_info.pack_start(la1, False, False, 0)
        
        self.sabab = daw_customs.ViewEdit()
        self.sabab_bfr = self.sabab.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.sabab)
        self.vb_info.pack_start(scroll, True, True, 0)
        self.nbk.append_page(self.vb_info, Gtk.Label('معلومات القصيدة'))
        
        self.charh = daw_customs.ViewEdit()
        self.charh_bfr = self.charh.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.charh)
        self.nbk.append_page(scroll, Gtk.Label('شرح القصيدة'))
        
        vbox = Gtk.Box(spacing=7,orientation=Gtk.Orientation.VERTICAL)
        
        hbox = Gtk.Box(spacing=7,orientation=Gtk.Orientation.HORIZONTAL)
        hbox.set_border_width(6)
        self.outsider = Gtk.RadioButton.new_with_label_from_widget(None,'لا يعرف قائله')
        self.outsider.connect('toggled',self.is_poet,'1')
        hbox.pack_start(self.outsider, False, False, 0)
        vbox.pack_start(hbox, False, False, 0)
        
        hbox = Gtk.Box(spacing=7,orientation=Gtk.Orientation.HORIZONTAL)
        hbox.set_border_width(6)
        self.present = Gtk.RadioButton.new_with_label_from_widget(self.outsider,'موجود في قاعدة البيانات')
        self.present.connect('toggled',self.is_poet,'2')
        self.poets = Gtk.Entry()
        self.poets.set_placeholder_text('اكتب حرفا لتحصل على التكملة')
        self.poets.set_sensitive(False)
        self.completion03 = Gtk.EntryCompletion()
        self.completion03.set_model(self.parent.dawawinpage.store_poet)
        self.completion03.set_text_column(1)
        self.poets.set_completion(self.completion03)
        hbox.pack_start(self.present, False, False, 0)
        hbox.pack_start(self.poets, True, True, 0)
        vbox.pack_start(hbox, False, False, 0)
        
        hbox = Gtk.Box(spacing=7,orientation=Gtk.Orientation.HORIZONTAL)
        hbox.set_border_width(6)
        self.nopresent = Gtk.RadioButton.new_with_label_from_widget(self.outsider,'غير موجود في قاعدة البيانات')
        self.nopresent.connect('toggled',self.is_poet,'3')
        hbox.pack_start(self.nopresent, False, False, 0)
        vbox.pack_start(hbox, False, False, 0)
        self.grd = Gtk.Grid()
        self.grd.set_border_width(6)
        self.grd.set_column_spacing(6)
        self.grd.set_row_spacing(6)
        self.grd.set_sensitive(False)
        vbox.pack_start(self.grd, False, False, 0)
        
        self.grd.attach(Gtk.Label('الاسم المشتهر'), 1, 1, 1, 1)
        self.lak_poet = Gtk.Entry()
        self.lak_poet.set_placeholder_text('الفرزدق')
        self.grd.attach(self.lak_poet, 2, 1, 2, 1)
        
        self.grd.attach(Gtk.Label('الاسم الحقيقي'), 4, 1, 1, 1)
        self.nm_poet = Gtk.Entry()
        self.nm_poet.set_placeholder_text('همام بن غالب بن صعصعة التميمي')
        self.grd.attach(self.nm_poet, 5, 1, 4, 1)
        
        hb, self.ages = daw_customs.combo(daw_tools.age_poet, u'العصر', 0)
        self.ages.connect('changed', self.select_age)
        self.grd.attach(hb, 1, 2, 2, 1)
        
        hb, self.lands = daw_customs.combo(daw_tools.elbalad, u'البلد', 0)
        self.grd.attach(hb, 3, 2, 2, 1)
        
        hb, self.sexs = daw_customs.combo(daw_tools.sex_poet, u'الجنس', 0)
        self.grd.attach(hb, 5, 2, 2, 1)
        
        self.death = Gtk.CheckButton('الوفاة (هـ)')
        def is_dh(widget, *a):
            if self.death.get_active():
                self.dh_poet.set_sensitive(True)
            else:
                self.dh_poet.set_sensitive(False)
        self.death.connect('toggled', is_dh)
        self.grd.attach(self.death, 7, 2, 1, 1)
        adj = Gtk.Adjustment(1434, -300, 1434, 1, 5.0, 0.0)
        self.dh_poet = Gtk.SpinButton()
        self.dh_poet.set_sensitive(False)
        self.dh_poet.set_adjustment(adj)
        self.dh_poet.set_wrap(True)
        self.grd.attach(self.dh_poet, 8, 2, 1, 1)
        
        self.tarjama = daw_customs.ViewEdit()
        self.tarjama_bfr = self.tarjama.get_buffer()
        self.tarjama_bfr.set_text('ترجمة الشاعر')
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.tarjama)
        vbox.pack_start(scroll, True, True, 0)
        self.tarjama.set_sensitive(False)
        self.nbk.append_page(vbox, Gtk.Label('الشاعر'))
        
        hbox = Gtk.Box(spacing=7,orientation=Gtk.Orientation.HORIZONTAL)
        self.accept = daw_customs.ButtonClass('إضافة القصيدة')
        self.accept.connect('clicked',self.adding)
        hbox.pack_start(self.accept, False, False, 0)
        
        self.all_poems = Gtk.CheckButton('نمط إضافة عدة قصائد')
        def all_poems_cb(widget, *a):
            if self.all_poems.get_active():
                self.vb_info.set_sensitive(False)
            else:
                self.vb_info.set_sensitive(True)
        self.all_poems.connect('toggled', all_poems_cb)
        hbox.pack_start(self.all_poems, False, False, 0)

        self.pack_start(self.nbk, True, True, 0)
        self.pack_start(hbox, False, False, 0)
        
        self.show_all()
        
Ejemplo n.º 4
0
    def build(self,*a):
        self.detoggled = Gtk.ToggleButton("")
        self.set_title("دواوين العرب  ({})".format(daw_customs.version,))
        self.set_icon_name('dawawin')
        self.maximize()
        self.connect("delete_event", self.quit_app)
        self.connect("destroy", self.quit_app)
        self.agr = Gtk.AccelGroup()
        self.add_accel_group(self.agr)
        #self.set_size_request(900,600)
        self.box = Gtk.Box(spacing=0, orientation=Gtk.Orientation.VERTICAL)
        self.hbox = Gtk.Box(spacing=7, orientation=Gtk.Orientation.HORIZONTAL)
        self.hbox.set_border_width(7)
        self.hb = Gtk.Box(spacing=7, orientation=Gtk.Orientation.HORIZONTAL)
        self.vbox = Gtk.Box(spacing=3, orientation=Gtk.Orientation.VERTICAL)
        self.vbox.set_size_request(150, -1)
        
        img = Gtk.Image()
        self.img_item = Gtk.ToolItem.new()
        self.img_item.add(img)
        self.img_item.set_size_request(160, -1)
        img.set_from_file(join(daw_customs.ICON_DIR, 'title.png'))
        
        self.toolbar = Gtk.Toolbar()
        self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)
        self.toolbar.set_icon_size(Gtk.IconSize.SMALL_TOOLBAR)

        self.box.pack_start(self.toolbar, False, False, 0)
        
        self.toolbar.insert(self.img_item, 0)
        
        self.prev = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'prev.png'), 'السابق\nاستعمل التحكم والسهم الأيمن', lambda *a: self.move_in_page(-1))
        self.toolbar.insert(self.prev, 1)
        self.prev.add_accelerator("clicked",self.axl, Gdk.KEY_Right, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        
        self.next = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'next.png'), 'التالي\nاستعمل التحكم والسهم الأيسر', lambda *a: self.move_in_page(1))
        self.toolbar.insert(self.next, 2)
        self.next.add_accelerator("clicked",self.axl, Gdk.KEY_Left, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 3)
        
        self.near = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'near.png'), 'كبّر الخط\nاستعمل التحكم وعلامة الجمع', lambda *a: self.near_page(1))
        self.toolbar.insert(self.near, 4)
        self.near.add_accelerator("clicked",self.axl,Gdk.KEY_equal, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        self.near.add_accelerator("clicked",self.axl,Gdk.KEY_plus, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        self.near.add_accelerator("clicked",self.axl,Gdk.KEY_KP_Add, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        
        self.far = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'far.png'), 'صغّر الخط\nاستعمل التحكم وعلامة الطرح', lambda *a: self.near_page(-1))
        self.toolbar.insert(self.far, 5)
        self.far.add_accelerator("clicked",self.axl,Gdk.KEY_minus, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        self.far.add_accelerator("clicked",self.axl,Gdk.KEY_KP_Subtract, ACCEL_CTRL_MOD, Gtk.AccelFlags.VISIBLE)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 6)
        
        try: self.entry_search = Gtk.SearchEntry()
        except: self.entry_search = Gtk.Entry()
        self.entry_search.set_placeholder_text('بحث ضبابي')
        self.entry_search_item = Gtk.ToolItem.new()
        self.entry_search_item.add(self.entry_search)
        self.entry_search.connect('changed', self.search_on_page)
        self.entry_search.connect('activate', self.search_on_page)
        self.toolbar.insert(self.entry_search_item, 7)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 8)
        
        self.mark = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'marks.png'), 'تصفح المواضع المحفوظة', lambda *a: SavedMarks(self))
        self.toolbar.insert(self.mark, 9)
        
        self.save_result = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'save_result.png'), 'نتائج البحث المحفوظة', lambda *a: SavedResult(self))
        self.toolbar.insert(self.save_result, 10)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 11)
        
        self.search = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'search.png'), 'نافذة البحث', self.show_win_searh)
        self.toolbar.insert(self.search, 12)
        
        self.pref = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'pref.png'), 'تفضيلات', 
                                     lambda *a: self.preference_win.show_all())
        self.toolbar.insert(self.pref, 13)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 14)
        
        self.about = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'about.png'), 'لمحة عن البرنامج', lambda *a: About(self))
        self.toolbar.insert(self.about, 15)
        
        self.toolbar.insert(Gtk.SeparatorToolItem(), 16)
        
        self.close = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'close.png'), 'إغلاق البرنامج', self.quit_app)
        self.toolbar.insert(self.close, 17)
        
        self.dawawin_page = daw_customs.ToggleButtonClass('الدواوين')
        self.vbox.pack_start(self.dawawin_page, True, True, 0)
        self.dawawin_page.connect("toggled", self.show_page, "الدواوين",1)
        
        self.poems_page = daw_customs.ToggleButtonClass('القصائد')
        self.vbox.pack_start(self.poems_page, True, True, 0)
        self.poems_page.connect("toggled", self.show_page, "القصائد", 2)
        self.poems_page.set_sensitive(False)
        
        self.filter_page = daw_customs.ToggleButtonClass('التصفية')
        self.vbox.pack_start(self.filter_page, True, True, 0)
        self.filter_page.connect("toggled", self.show_page, "التصفية", 3)
        
        self.fav_page = daw_customs.ToggleButtonClass('المفضلة')
        self.vbox.pack_start(self.fav_page, True, True, 0)
        self.fav_page.connect("toggled", self.show_page, "المفضلة", 4)
        
        self.abiaty_page = daw_customs.ToggleButtonClass('أبياتي')
        self.vbox.pack_start(self.abiaty_page, True, True, 0)
        self.abiaty_page.connect("toggled", self.show_page, "أجمل الأبيات", 5)
        
        self.recite_page = daw_customs.ToggleButtonClass('التسجيلات')
        self.vbox.pack_start(self.recite_page, True, True, 0)
        self.recite_page.connect("toggled", self.show_page, "التسجيلات", 6)
        
        self.dicty_page = daw_customs.ToggleButtonClass('المعاجم')
        self.vbox.pack_start(self.dicty_page, True, True, 0)
        self.dicty_page.connect("toggled", self.show_page, "المعجم", 7)
        
        self.wazn_page = daw_customs.ToggleButtonClass('العَروض')
        self.vbox.pack_start(self.wazn_page, True, True, 0)
        self.wazn_page.connect("toggled", self.show_page, "العروض", 8)
        
        self.fun_page = daw_customs.ToggleButtonClass('التسلية')
        self.vbox.pack_start(self.fun_page, True, True, 0)
        self.fun_page.connect("toggled", self.show_page, "التسلية",9)
        
        self.search_result_page = daw_customs.ToggleButtonClass('البحوث')
        self.vbox.pack_start(self.search_result_page, True, True, 0)
        self.search_result_page.connect("toggled", self.show_page, "نتائج البحث", 10)
        self.search_result_page.set_sensitive(False)
        
        self.reg_page = daw_customs.ToggleButtonClass('التعديل')
        self.vbox.pack_start(self.reg_page, True, True, 0)
        self.reg_page.connect("toggled", self.show_page, "التعديل",11)
        
        self.addpoem_page = daw_customs.ToggleButtonClass('الإضافة')
        self.vbox.pack_start(self.addpoem_page, True, True, 0)
        self.addpoem_page.connect("toggled", self.show_page, "إضافة قصيدة", 12)
        
        self.in_out_page = daw_customs.ToggleButtonClass('المشاركة')
        self.vbox.pack_start(self.in_out_page, True, True, 0)
        self.in_out_page.connect("toggled", self.show_page, "استيراد وتصدير", 13)
        
        self.help_page = daw_customs.ToggleButtonClass('المساعدة')
        self.vbox.pack_start(self.help_page, True, True, 0)
        self.help_page.connect("toggled", self.show_page, "المساعدة", 14)
        
        self.main_notebook = Gtk.Notebook()
        self.box.pack_start(self.hbox, True, True, 0)
        self.hbox.pack_start(self.vbox, False, False, 0)
        self.hbox.pack_start(self.main_notebook, True, True, 0)
        self.main_notebook.set_scrollable(True)
        self.main_notebook.set_show_tabs(False)
        
        self.main_notebook.append_page(MyFace(self), Gtk.Label("الواجهة"))
        self.main_notebook.append_page(self.dawawinpage,Gtk.Label("دواوين"))
        self.main_notebook.append_page(self.viewerpoem, Gtk.Label("قصائد"))
        self.main_notebook.append_page(FilterPoem(self), Gtk.Label('صفحة التصفية'))
        self.main_notebook.append_page(self.favorite, Gtk.Label('المفضلة'))
        self.main_notebook.append_page(MyAbiat(self), Gtk.Label('أبياتي'))
        self.main_notebook.append_page(self.recite, Gtk.Label('التسجيلات'))
        self.main_notebook.append_page(self.dictpage, Gtk.Label('المعجم'))
        self.main_notebook.append_page(Metrics(self), Gtk.Label('صفحة العروض'))
        self.main_notebook.append_page(MyFun(self), Gtk.Label('التسلية'))
        self.main_notebook.append_page(self.resultsearch, Gtk.Label('نتائج البحث'))
        self.main_notebook.append_page(self.organizepage, Gtk.Label('صفحة التعديل'))
        self.main_notebook.append_page(AddPoem(self), Gtk.Label('إضافة قصيدة'))
        self.main_notebook.append_page(ImportExport(self), Gtk.Label('استيراد'))
        self.main_notebook.append_page(Halper(self), Gtk.Label('صفحة المساعدة'))
        self.main_notebook.append_page(self.countpage, Gtk.Label('صفحة الإحصاء'))
        
        self.axl.connect(Gdk.KEY_F1, 0, Gtk.AccelFlags.VISIBLE, lambda *a: self.help_page.set_active(True))
        self.axl.connect(Gdk.KEY_F9, 0, Gtk.AccelFlags.VISIBLE, self.hide_btns)
        self.axl.connect(Gdk.KEY_F11, 0, Gtk.AccelFlags.VISIBLE, self.full_screen)
        self.axl.connect(Gdk.KEY_F5, 0, Gtk.AccelFlags.VISIBLE, self.refrech)
        self.axl.connect(Gdk.KEY_F6, 0, Gtk.AccelFlags.VISIBLE, self.show_win_searh)
        self.axl.connect(Gdk.KEY_F8, 0, Gtk.AccelFlags.VISIBLE, lambda *a: self.preference_win.show_all())
        
        self.add(self.box)
        self.vbox.show_all()
        self.toolbar.show_all()
        self.main_notebook.show()
        self.hbox.show()
        self.box.show()
        self.show()
        daw_customs.greet.destroy()
Ejemplo n.º 5
0
    def build(self, *a):
        
        #a صفحة تقطيع الأبيات الشعرية--------------------------------------------
        vb3 = Gtk.VBox(False, 3)
        info = '''
        - يجب تشكيل البيت شكلا تاما
        - الحرف العاري عن التشكيل يعتبر ساكنا
        - يجب حذف جميع الرموز والأعداد
        - الكتابة العروضية هي كتابة الأحرف الملفوظة
        - الحرف إن كان ملفوظا ولم يكن في الكتابة العروضية
           فهو خطأ قديكون بسبب عدم تشكيله إن كان متحركا
           أوعدم تشكيل الحرف الذي يليه إن كان ساكنا 
        - قد يشبع البرنامج ما لا يستحق الإشباع لذلك ينصح
           باختيار الإشباع يدويا وتقوم بزيادة حرف المد
           إلى ما يستحق الإشباع دون غيره
        '''
        hb = Gtk.HBox(False, 10)
        vbox = Gtk.VBox(False, 1)
        self.verse_dictation = daw_customs.ViewEdit()
        self.verse_dictation_bfr = self.verse_dictation.get_buffer()
        self.verse_dictation.override_font(Pango.FontDescription('Simplified Naskh 22'))
        self.verse_dictation.set_size_request(-1, 64)
        hb.pack_start(self.verse_dictation, True, True, 0)
        scan_btn = daw_customs.ButtonClass('تقطيع البيت')
        scan_btn.connect('clicked', self.scan_cb)
        vbox.pack_start(scan_btn, False, False, 0)
        info_btn = daw_customs.ButtonClass('إرشادات')
        info_btn.connect('clicked', lambda *a: self.view_scan_bfr.set_text(info))
        vbox.pack_start(info_btn, False, False, 0)
        hb.pack_start(vbox, False, False, 0)
        vb3.pack_start(hb, False, False, 3)
        
        hb = Gtk.HBox(False, 0)
        lab = Gtk.Label('التشكيل :   ')
        lab.set_alignment(0,0.5)
        hb.pack_start(lab, False, False, 0)
        shadda = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'shadda.png'), 'الشدة', self.tashkeel_cb, daw_araby.SHADDA)
        hb.pack_start(shadda, False, False, 0)
        skon = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'skon.png'), 'السكون',self.tashkeel_cb, daw_araby.SUKUN)
        hb.pack_start(skon, False, False, 0)
        fatha = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha.png'), 'الفتحة',self.tashkeel_cb, daw_araby.FATHA)
        hb.pack_start(fatha, False, False, 0)
        damma = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma.png'), 'الضمة',self.tashkeel_cb, daw_araby.DAMMA)
        hb.pack_start(damma, False, False, 0)
        kasra = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra.png'), 'الكسرة',self.tashkeel_cb, daw_araby.KASRA)
        hb.pack_start(kasra, False, False, 0)
        fatha2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'fatha2.png'), 'الفتحتين',self.tashkeel_cb, daw_araby.FATHATAN)
        hb.pack_start(fatha2, False, False, 0)
        damma2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'damma2.png'), 'الضمتين',self.tashkeel_cb, daw_araby.DAMMATAN)
        hb.pack_start(damma2, False, False, 0)
        kasra2 = daw_customs.tool_button(join(daw_customs.ICON_DIR, 'kasra2.png'), 'الكسرتين',self.tashkeel_cb, daw_araby.KASRATAN)
        hb.pack_start(kasra2, False, False, 0)
        
        self.ishbaa_m = Gtk.CheckButton('معالجة إشباع ميم وهاء الضمير يدويا')
        hb.pack_start(self.ishbaa_m, False, False, 15)
        vb3.pack_start(hb, False, False, 3)
        
        self.view_scan = daw_customs.ViewClass()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add_with_viewport(self.view_scan)
        self.view_scan_bfr = self.view_scan.get_buffer()
        self.view_scan_bfr.set_text(info)
        self.title_tag2 = self.view_scan_bfr.create_tag("title")
        self.title_tag2.set_property('foreground', self.parent.theme.coloran) 
        vb3.pack_start(scroll, True, True, 0)
        self.append_page(vb3, Gtk.Label("تقطيع الأبيات"))
        
        #a صفحة المقدمات العروضية--------------------------------------
        self.store_mekaddima = Gtk.ListStore(str, int)
        mekadimat = self.myhelp.titles_mekadimat()
        for a in mekadimat:
            self.store_mekaddima.append([a[1], a[0]])
        hp0 = Gtk.HPaned()
        self.tree_mekaddima = daw_customs.TreeClass()
        self.sel_mekaddima = self.tree_mekaddima.get_selection()
        cell = Gtk.CellRendererText()
        kal = Gtk.TreeViewColumn('الفهرس', cell, text=0)
        self.tree_mekaddima.append_column(kal)
        self.tree_mekaddima.set_model(self.store_mekaddima)
        scroll = Gtk.ScrolledWindow()
        scroll.set_size_request(200, -1)
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add_with_viewport(self.tree_mekaddima)
        self.tree_mekaddima.connect("cursor-changed", self.show_page_mekadimat)
        hp0.pack1(scroll, False, False)
        self.prescript = daw_customs.ViewClass()
        self.prescript_bfr = self.prescript.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.prescript)
        hp0.pack2(scroll, True, True)
        self.append_page(hp0, Gtk.Label("مقدمات مهمة"))
        
        #a صفحة البحور الشعرية--------------------------------------------
        hb1 = Gtk.Box(spacing=6,orientation=Gtk.Orientation.HORIZONTAL)
        self.tree_behor = daw_customs.TreeClass()
        self.sel_behor = self.tree_behor.get_selection()
        cell = Gtk.CellRendererText()
        kal = Gtk.TreeViewColumn('البحور', cell, text=0)
        self.tree_behor.append_column(kal)
        self.store_behor = Gtk.ListStore(str, int)
        behor = self.myhelp.titles_behor()
        for a in behor:
            self.store_behor.append([a[1], a[0]])
        self.tree_behor.set_model(self.store_behor)
        scroll = Gtk.ScrolledWindow()
        scroll.set_size_request(150, -1)
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add_with_viewport(self.tree_behor)
        self.tree_behor.connect("cursor-changed", self.show_page_behor)
        scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        hb1.pack_start(scroll, False, False, 0)
        self.view_info = daw_customs.ViewClass()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add_with_viewport(self.view_info)
        self.view_info_bfr = self.view_info.get_buffer()
        hb1.pack_start(scroll, True, True, 0)
        self.append_page(hb1, Gtk.Label("بحور الشعر"))
        
        #a صفحة الزحافات والعلل--------------------------------------------
        vb4 = Gtk.VBox(False, 0)    
        hbox = Gtk.HBox(False, 12)
        ls = [] 
        for a in [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]:
            ls.append([a, daw_scan.Taf3ilat[a]])
        hb, self.taf3ila = daw_customs.combo(ls, u'التفعيلة', 0)
        hbox.pack_start(hb, False, False, 0)
        self.taf3ila.connect('changed', self.change_taf3ila)

        self.ls_takiir = [] 
        hb, self.takiir = daw_customs.combo(self.ls_takiir, u'التغيير', 0)
        hbox.pack_start(hb, False, False, 0)
        self.takiir.connect('changed', self.change_takiir)

        self.ls_sabab = [] 
        hb, self.sabab = daw_customs.combo(self.ls_sabab, u'السبب', 0)
        hbox.pack_start(hb, False, False, 0)
        self.sabab.connect('changed', self.change_sabab)
        
        self.zihaf_info = daw_customs.ViewClass()
        self.zihaf_info_bfr = self.zihaf_info.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.zihaf_info)
        vb4.pack_start(hbox, False, False, 7)
        vb4.pack_start(scroll, True, True, 0)
        self.append_page(vb4, Gtk.Label("الزحافات والعلل"))
        
        self.show_all()