def author(self): box = BoxLayout(orientation="vertical") box.add_widget( Image( source='images/author.jpg', allow_stretch=False, keep_ratio=False, )) data = "Author :[color=ffff00]Ahmed Mohmed[/color]\nVersion :[color=ffff00]1.0[/color]" lb2 = Label(text=data, markup=True, font_size=30) lb2.font_name = "fonts/DancingScript-Bold.ttf" box.add_widget(lb2) content3 = box title = "About Tic Tac Toc" popup = Popup(title="About Tic Tac Toc", content=content3, size_hint=(None, None), size=(400, 400)) # popup.background_color=[0,1,1,1] popup.background = "images/au.jpg" popup.title_size = 30 popup.title_color = [1, 1, 0, 1] popup.title_font = "fonts/actionis.ttf" popup.open()
def add_protocols(self): """ add protocols """ popup = Popup(background="utilities/blackgreen.jpg", title='Add Protocols', auto_dismiss=False, size_hint=(None, None), size=(800, 800)) popup.title_align = 'center' popup.title_size = '28sp' popup.content = ProtocolsPopup(popup, self) popup.open()
def set_problems(self): """ set problems """ # make a popup for setting problems categories popup = Popup(background="utilities/blackgreen.jpg", title='Set Problems\' Categories', auto_dismiss=False, size_hint=(None, None), size=(800, 800)) popup.title_align = 'center' popup.title_size = '28sp' popup.content = ProblemsPopup(popup, self) popup.open()
def create_popup(popup_title, size_x, size_y, layout, title_size): popup = Popup(title=popup_title) popup.size_hint = (size_x, size_y) popup.content = layout popup.title_size = title_size popup.title_align = 'center' popup.auto_dismiss = False return popup
def open_popup_new_dir(self, path): poupup = Popup(content=PopupNewDir(make_new_dir=self.make_new_dir)) poupup.title = lang['New_Folder'] poupup.title_size = 16 poupup.size_hint = None, None poupup.height = 120 poupup.width = 250 poupup.id = 'pop_new_dir' self.ids['pop_new_dir'] = poupup global path_new_dir self.path_new_dir = path poupup.open()
def open_popup_new_dir(self,path): poupup = Popup(content=PopupNewDir(make_new_dir=self.make_new_dir)) poupup.title = lang['New_Folder'] poupup.title_size = 16 poupup.size_hint = None, None poupup.height = 120 poupup.width = 250 poupup.id = 'pop_new_dir' self.ids['pop_new_dir'] = poupup global path_new_dir self.path_new_dir = path poupup.open()
def create_protocol(self): """ go to creating protocol popup """ popup = Popup(background="utilities/blackgreen.jpg", auto_dismiss=False, size_hint=(None, None), size=(1500, 1000)) popup.title = self.team_one + " vs. " + self.team_two popup.title_align = 'center' popup.title_size = '28sp' popup.content = MatchPopup(popup, self) popup.open()
def create_Popup(self,list): def close(instance): self.remove_widget(nowPopup) nowPopup = Popup(size_hint = (None,None),size = (fullapp.size[0]*0.94,fullapp.size[1]*0.45),pos = (fullapp.size[0]*0.03,fullapp.size[1]*0.3)) nowPopupContent = Widget(size_hint=(None,None),pos=fullapp.pos,size=fullapp.size) nowPopupContent.add_widget(Button(pos=nowPopup.pos,size=nowPopup.size,background_color=(1,1,1,0),on_press=close)) nowPopup.title = '.' nowPopup.title_align = 'center' nowPopup.title_size = fullapp.size[1]*0.035 str_of_nums = '' for i in list: str_of_nums = str_of_nums + str(i) + ', ' str_of_nums = str_of_nums[:len(str_of_nums)-2] nowLabel = Label(markup=True,font_size=fullapp.size[1]*0.03,text_size=(nowPopup.size[0]*0.9,nowPopup.size[1]-nowPopup.title_size),size_hint=(None,None),pos=(nowPopup.pos[0]+nowPopup.size[0]/3.2,nowPopup.pos[1]+nowPopup.size[1]/2-nowPopup.title_size*1.5)) nowLabel.text = '[color=a9a9a9]' + ' (ATX NUM ' + '[color=ffffff][i]' + str_of_nums + '[/i][/color]' + ') ' + '[i]' + '' \ + '[/i]' + ' ' + '[i]' + '.' + '[/i]' nowPopupContent.add_widget(nowLabel) nowPopup.add_widget(nowPopupContent) for i in list: for j in range(len(IlnessBase.Medicine)): if(i in IlnessBase.Medicine[j]): k = j date = datetime.datetime.now() strdate = '' if(date.hour<10): strdate = '0'+str(date.hour)+':' else: strdate = str(date.hour)+":" if(date.minute<10): strdate += '0'+str(date.minute)+' ' else: strdate += str(date.minute)+" " if(date.day<10): strdate += '0'+str(date.day)+'.' else: strdate += str(date.day)+"." if(date.month<10): strdate += '0'+str(date.month)+'.' else: strdate += str(date.month)+"." strdate+=str(date.year) fullapp.notes.append({'type':'request','undertype':'med','state':'inprogress','idinIlnessBase':k,'idnum':int(random.random()*10000),'date':strdate}) return nowPopup
def control(self): box = BoxLayout(orientation="vertical") box.add_widget( Image( source='images/gamepad.jpg', allow_stretch=False, keep_ratio=False, )) content3 = box popup = Popup(title="Controlling", content=content3, size_hint=(None, None), size=(500, 500)) # popup.background_color=[0,1,1,1] popup.background = "images/au.jpg" popup.title_size = 30 popup.title_color = [1, 1, 0, 1] popup.title_font = "fonts/actionis.ttf" popup.open()
def create_Popup(self,instance): def close(instance): self.remove_widget(nowPopup) date = datetime.datetime.now() strdate = '' if(date.hour<10): strdate = '0'+str(date.hour)+':' else: strdate = str(date.hour)+":" if(date.minute<10): strdate += '0'+str(date.minute)+' ' else: strdate += str(date.minute)+" " if(date.day<10): strdate += '0'+str(date.day)+'.' else: strdate += str(date.day)+"." if(date.month<10): strdate += '0'+str(date.month)+'.' else: strdate += str(date.month)+"." strdate+=str(date.year) instancetext = instance.text[17:] fullapp.notes.append({'type':'request','undertype':'ser','state':'inprogress','name':instancetext,'idnum':int(random.random()*10000),'date':strdate}) nowPopup = Popup(size_hint = (None,None),size = (fullapp.size[0]*0.94,fullapp.size[1]*0.45),pos = (fullapp.size[0]*0.03,fullapp.size[1]*0.3)) nowPopupContent = Widget(size_hint=(None,None),pos=fullapp.pos,size=fullapp.size) nowPopupContent.add_widget(Button(pos=nowPopup.pos,size=nowPopup.size,background_color=(1,1,1,0),on_press=close)) nowPopup.title = 'Requaets is dowload.' nowPopup.title_align = 'center' nowPopup.title_size = fullapp.size[1]*0.035 nowLabel = Label(markup=True,font_size=fullapp.size[1]*0.03,text_size=(nowPopup.size[0]*0.9,nowPopup.size[1]-nowPopup.title_size),size_hint=(None,None),pos=(nowPopup.pos[0]+nowPopup.size[0]/3.2,nowPopup.pos[1]+nowPopup.size[1]/2.5-nowPopup.title_size*1.5)) nowLabel.text = '[color=a9a9a9]' + ' ' + '[/color][i]' + instancetext + '[/color][/i][color=a9a9a9]' + ' ' + '[i]' + '' \ + '[/i]' + ' ' + '[i]' + 'Pushers.' + '[/i]' nowPopupContent.add_widget(nowLabel) nowPopup.add_widget(nowPopupContent) return nowPopup
def _return_popup( self, title: AnyStr, content: Widget, size: Tuple = (500, 100), size_hint=(None, None) ) -> Popup: """ This method is for creating a unified Popup which will have a similar design throughout the application :param title: Title of the popup :type title: str :param content: content to be put in the popup :type content: Widget :param size: size of the Popup :type size: tuple :param size_hint: size hint of the Popup wrt to the parent :type size_hint: tuple; default=(500, 100) :return: the generated Popup :rtype: Popup """ popup = Popup(title=f"{self.constants.name} - {title}", content=content, size=size, size_hint=size_hint, title_align='center') # popup_background = ModalView() # popup_background.add_widget(Image(source=self.constants.rocket_image)) # popup.background = self.constants.rocket_image popup.background_color = [0, 255, 220, 0.9] popup.title_size = 18 # size in sp 255 0 120 popup.title_color = [1, 255, 0, 1] # rgba (pink) popup.separator_color = [1, 0, 255, 255] # rgba (cyan) popup.separator_height = 5 return popup
def notify(self): def exit(instance): self.remove_widget(NotePopup) self.scrollsize = fullapp.size[0]*0.8,fullapp.size[1]*0.6 self.scrollpos = fullapp.size[0]*0.095,fullapp.size[1]*0.185 self.size_of_note = (self.scrollsize[0],fullapp.size[1]*0.25) NotePopup = Popup(size_hint=(None,None),size=(fullapp.size[0]*0.9,fullapp.size[1]*0.8)) NotePopup.pos = (fullapp.size[0]/2 - NotePopup.size[0]/2,fullapp.size[1]/2 - NotePopup.size[1]/2) NotePopup.title = 'view pushers.' NotePopup.title_align = 'center' NotePopup.separator_color = (0.3,0.3,1,1) NotePopup.title_size = fullapp.size[1]*0.03 NoteScroll = ScrollView() NoteScroll.size_hint = (None,None) NoteScroll.size = self.scrollsize NoteScroll.pos =self.scrollpos NoteBox = Widget() NoteBox.size_of_note = self.size_of_note NoteBox.spacing = fullapp.size[1]*0.006 NoteBox.size = (self.scrollsize[0],(NoteBox.spacing+NoteBox.size_of_note[1])*len(fullapp.notes)-NoteBox.spacing) NoteBox.size_hint_y = None for i in range(len(fullapp.notes)): b = Button(size=self.size_of_note,pos=(-2,i*(NoteBox.spacing+NoteBox.size_of_note[1]))) if(fullapp.notes[i]['type'] == 'request'): b.add_widget(Label(markup=True,text='[color=cccccc]'+'ok request number '+ '[b][/color]' + str(fullapp.notes[i]['idnum']) + '[/b]',font_size=fullapp.size[1]*0.03,color=(1,1,1,1),pos=(fullapp.size[0]*0.19,fullapp.size[1]*0.126+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) if(fullapp.notes[i]['undertype']=='med'): preparate = IlnessBase.Medicine[fullapp.notes[i]['idinIlnessBase']] print(preparate) b.add_widget(Label(text_size=(self.size_of_note[0]*0.97,self.size_of_note[1]*0.7),markup=True,text='to adding preparate '+ '[b][i]' + preparate[:preparate.find(':')]\ + '[/b][/i]'+' seems ' + '[b][i]' + preparate[preparate.find(':')+1:] + '[/b][/i]'+' by systemATX.',font_size=fullapp.size[1]*0.03,color=(1,1,1,1),pos=(fullapp.size[0]*0.244,fullapp.size[1]*0.086+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) if(fullapp.notes[i]['state']=='inprogress'): b.add_widget(Label(text='[color=cccccc]Poss: [/color][b][color=adaddf]cheking[/color][b]',font_size=fullapp.size[1]*0.03,markup=True,pos=(fullapp.size[0]*0.184,-fullapp.size[1]*0.046+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) b.add_widget(Label(text='[color=353535]from '+ fullapp.notes[i]['date'],markup=True,font_size=fullapp.size[1]*0.025,pos=(fullapp.size[0]*0.384,-fullapp.size[1]*0.076+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) elif(fullapp.notes[i]['undertype']=='ser'): service = fullapp.notes[i]['name'] print(service) b.add_widget(Label(text_size=(self.size_of_note[0],self.size_of_note[1]*0.7),markup=True,text='To add new usluga '+ '[b][i]' + service\ + '[/b][/i]'+ '[/b][/i]'+'. Check info to usluga.',font_size=fullapp.size[1]*0.03,color=(1,1,1,1),pos=(fullapp.size[0]*0.244,fullapp.size[1]*0.056+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) if(fullapp.notes[i]['state']=='inprogress'): b.add_widget(Label(text='[color=cccccc]Statust: [/color][b][color=adaddf]checking[/color][b]',font_size=fullapp.size[1]*0.03,markup=True,pos=(fullapp.size[0]*0.184,-fullapp.size[1]*0.046+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) b.add_widget(Label(text='[color=353535]from '+ fullapp.notes[i]['date'],markup=True,font_size=fullapp.size[1]*0.025,pos=(fullapp.size[0]*0.384,-fullapp.size[1]*0.076+i*(NoteBox.spacing+NoteBox.size_of_note[1])))) NoteBox.add_widget(b) DefendWidget = Widget(size=fullapp.size,pos=fullapp.pos,size_hint=(None,None)) NoteScroll.add_widget(NoteBox) DefendWidget.add_widget(NoteScroll) DefendWidget.add_widget(Button(size_hint=(None,None),pos=(fullapp.size[0]*0.11,fullapp.size[1]*0.13),size=(25,25),background_normal='47.png',on_press=exit)) if(len(fullapp.notes)==0): DefendWidget.add_widget(Label(text='Non pushers',pos=(self.scrollpos[0]+self.scrollsize[0]/3.6,self.scrollpos[1]+self.scrollsize[1]/2),font_size=fullapp.size[1]*0.04)) else: DefendWidget.add_widget(Label(text_size=(fullapp.size[0]*0.7,100),text='[color=010101]view in [b] http://www.sechenovclinic.ru/[/color][/b]',font_size=fullapp.size[1]*0.02,pos=(self.scrollpos[0]+self.scrollsize[0]/2.7,self.scrollpos[1]-fullapp.size[1]*0.047),markup=True)) NotePopup.add_widget(DefendWidget) self.add_widget(NotePopup)
def winner(self, obj): pdata = "" title = "" sound = SoundLoader.load("sound/Sax.ogg") box = BoxLayout(orientation="vertical") box.add_widget( Image( source='images/gamepad3.png', allow_stretch=False, keep_ratio=False, )) if lista == standx or listb == standx or listc == standx or listd == standx or liste == standx or listf == standx or listg == standx or listh == standx: pdata = "[color=00ff00]Game over[/color]: [color=0000ff] player 1 win[/color]" title = "Congratulations player1" lb1 = Label(text=pdata, markup=True, font_size=25) lb1.font_name = "fonts/DroidSans-Bold.ttf" lb1.bold = True butt1 = Button(text="Play Again") box.add_widget(lb1) box.add_widget(butt1) content2 = box popup = Popup(title=title, content=content2, size_hint=(None, None), size=(400, 400)) popup.background = "images/au.jpg" popup.title_size = 30 popup.title_color = [1, 1, 0, 1] popup.title_font = "fonts/actionis.ttf" butt1.background_color = [1, 1, 0, 1] butt1.bind(on_release=self.reset) butt1.bind(on_release=popup.dismiss) popup.open() anim = Animation(x=50) + Animation(size=(300, 300), duration=2.) anim.start(popup) sound.play() Clock.unschedule(self.winner, .1) lista.clear(), listb.clear(), listc.clear(), listd.clear( ), liste.clear(), listf.clear(), listg.clear(), listh.clear() elif lista == stando or listb == stando or listc == stando or listd == stando or liste == stando or listf == stando or listg == stando or listh == stando: pdata = "[color=00ff00]Game over[/color]:[color=ff0000] player 2 win[/color]" title = "Congratulations player2" lb1 = Label(text=pdata, markup=True, font_size=25) lb1.font_name = "fonts/DroidSans-Bold.ttf" lb1.bold = True butt1 = Button(text="Play Again") box.add_widget(lb1) box.add_widget(butt1) content2 = box popup = Popup(title=title, content=content2, size_hint=(None, None), size=(400, 400)) popup.background = "images/au.jpg" popup.title_size = 30 popup.title_color = [1, 1, 0, 1] popup.title_font = "fonts/actionis.ttf" butt1.background_color = [1, 1, 0, 1] butt1.bind(on_release=self.reset) butt1.bind(on_release=popup.dismiss) popup.open() anim = Animation(x=50) + Animation(size=(300, 300), duration=2.) anim.start(popup) sound.play() lista.clear(), listb.clear(), listc.clear(), listd.clear( ), liste.clear(), listf.clear(), listg.clear(), listh.clear() elif self.ids.click1.disabled == True and self.ids.click2.disabled == True and self.ids.click3.disabled == True and self.ids.click4.disabled == True and self.ids.click5.disabled == True and self.ids.click6.disabled == True and self.ids.click7.disabled == True and self.ids.click8.disabled == True and self.ids.click9.disabled == True: pdata = "[color=00ff00]Game over[/color]: [color=f0ff00] Drwa [/color]" title = "No Winner" lb1 = Label(text=pdata, markup=True, font_size=25) lb1.font_name = "fonts/DroidSans-Bold.ttf" lb1.bold = True butt1 = Button(text="Play Again") box.add_widget(lb1) box.add_widget(butt1) content2 = box popup = Popup(title=title, content=content2, size_hint=(None, None), size=(400, 400)) popup.background = "images/au.jpg" popup.title_size = 30 popup.title_color = [1, 1, 0, 1] popup.title_font = "fonts/actionis.ttf" butt1.background_color = [1, 1, 0, 1] butt1.bind(on_release=self.reset) butt1.bind(on_release=popup.dismiss) popup.open() anim = Animation(x=50) + Animation(size=(300, 300), duration=2.) anim.start(popup) sound.play() lista.clear(), listb.clear(), listc.clear(), listd.clear( ), liste.clear(), listf.clear(), listg.clear(), listh.clear()