Example #1
0
def test_info_popup():
    global i
    alignment = {'LeftVTop': appuifw.EHLeftVTop,
                 'LeftVCenter': appuifw.EHLeftVCenter,
                 'LeftVBottom': appuifw.EHLeftVBottom,
                 'CenterVTop': appuifw.EHCenterVTop,
                 'CenterVCenter': appuifw.EHCenterVCenter,
                 'CenterVBottom': appuifw.EHCenterVBottom,
                 'RightVTop': appuifw.EHRightVTop,
                 'RightVCenter': appuifw.EHRightVCenter,
                 'RightVBottom': appuifw.EHRightVBottom}
    i = appuifw.InfoPopup()
    for x, item in enumerate(alignment):
        i.show(u"Tip position: " + item, (50, 50), 5000, 0, alignment[item])
        e32.ao_sleep(6)
    def menu_reset_sensor(self):
        ''' Start sensor zero level reset '''
        global running, sensor_stab, s_zero1, s_zero2

        if not SENSOR_ACC:
            return
        old_run = running
        running = ~RUN_PLAY
        sensor_stab = 10
        s_zero1 = s_zero2 = 0
        sensor_acc.connect(self.sensor_stabilizer)
        running = old_run
        i = appuifw.InfoPopup()
        i.show(u"Ready")
        e32.ao_yield()
Example #3
0
import appuifw
i = appuifw.InfoPopup()
i.show(u"Here is the tip.", (0, 0), 5000, 0, appuifw.EHRightVCenter)
'''
EHLeftVTop水平方向左对齐,垂直方向顶端对齐EHLeftVCenter水平方向左对齐,垂直方向居中EHLeftVBottom水平方向左对齐,垂直方向底端对齐EHCenterVTop水平方向居中,垂直方向顶端对齐EHCenterVCenter水平方向居中,垂直方向居中EHCenterVBottom水平方向居中,垂直方向底端对齐EHRightVTop水平方向右对齐,垂直方向顶端对齐EHRightVCenter水平方向右对齐,垂直方向居中EHRightVBottom水平方向右对齐,垂直方向底端对齐
hide()立即隐藏弹出窗体
'''
Example #4
0
        UI_flag = 0
    elif UI_flag == 3 : 
        scroll(1)
        UI_flag = 2
    elif UI_flag == 7 : 
        longimgRead()
        paint_all()
        UI_flag = 0
        won = 0
    global UI_flag, won


import appuifw as ap
canvas = ap.Canvas(redraw_callback = redraw, event_callback = execute)
showLoading()
info = ap.InfoPopup()
t01 = Tile(1)
t02 = Tile(2)
t03 = Tile(3)
t04 = Tile(4)
t05 = Tile(5)
t06 = Tile(6)
t07 = Tile(7)
t08 = Tile(8)
t09 = Tile(9)
t10 = Tile(10)
t11 = Tile(11)
t12 = Tile(12)
t13 = Tile(13)
t14 = Tile(14)
t15 = Tile(15)
Example #5
0
import httplib
import urllib
import socket

try:
    import appuifw2 as appuifw
    import appuifw as appuifw_
    import e32
    import audio
    
except:
    pass
    
import time
from util import *
infoPopup = appuifw_.InfoPopup()
progress = 0
writeprogress = 0
def downProg(n,s,t):
    global progress
    pc = n*s*100/t
    if pc > 100:
        pc=100
    if pc != progress:
        infoPopup.show(cn('↓  ') + u'%s %%' % pc,(0,0), 1000,0, appuifw_.EHCenterVTop)
    progress = pc
    e32.ao_yield()
    
def writeProg(n,s,t):
    global writeprogress
    pc = n*s*100/t
Example #6
0
 def _send_request(self, msg):
     i = appuifw.InfoPopup()
     i.show(self._loc(u'Please wait, sending is ongoing.'), (0, 0), 60000,
            0, appuifw.EHRightVCenter)
     SMS.send(msg)
     i.hide()
Example #7
0
    def post_txt(self, tpye='sj'):  #发送文章
        if self.setting[2]:  #检测SID是否有
            if tpye == 'sj':  #检测发帖区域为手机高手
                if self.setting[3]:  #检测高手区论坛ID是否设置好
                    p_ = self.setting[3].split(',')  #从配置中获取论坛ID设置
                    p_id = [i.split(':')[0] for i in p_]  #获取论坛ID列表
                    p_tx = [i.split(':')[1] for i in p_]  #获取论坛名称列表
                    x = ui.popup_menu(p_tx, cn('选择目的论坛'))
                    if x != None:
                        if self.t.len() > 9:
                            t = ui.query(cn('定个题目哦(^m^)'), 'text')
                            if t and len(t) > 3:
                                cid = ui.popup_menu(
                                    [cn('默认'),
                                     cn('综合'),
                                     cn('提问'),
                                     cn('原创')], cn('选择帖子类型'))
                                if cid == 1: cid = '5'
                                elif cid == 2: cid = '1'
                                elif cid == 3: cid = '11'
                                else: cid = '0'
                                score = ui.query(cn('要设悬赏分吗?'), 'text', u'10')
                                if score == None: score = "0"

                                note = ui.InfoPopup()
                                note.show(cn('正在发送文章...\n请稍后'), (10, 100),
                                          100000, 0, ui.EHCenterVCenter)
                                pid = p_id[x]
                                url = 'http://sjgs3.lexun.com/writetextapp.aspx?write_Type=1&topic_page=1&lxt=%s&ForumId=%s' % (
                                    self.setting[2], pid)
                                from urllib import urlencode
                                self.rep()
                                s = self.t.get()
                                self.rerep()
                                data = urlencode({
                                    'Content': en(s),
                                    'Title': en(t),
                                    'cid': en(cid),
                                    'score': en(score)
                                })
                                res = self.send(data, url)
                                if res[0] == 200:
                                    if res[2].find('成功') != -1:
                                        note.hide()
                                        ui.note(cn('文章成功发布!'))
                                    else:
                                        note.hide()
                                        ui.note(cn('文章发布失败!原因可能是权限和屏蔽问题!'))
                                else:
                                    note.hide()
                                    ui.note(cn('文章发布失败!原因可能是网络中断!'))
                            else:
                                ui.note(cn('标题太短'))
                        else:
                            ui.note(cn('正文字数不够9个'), 'info')
                    else:
                        ui.note(cn('操作已取消'), 'info')
                else:
                    ui.note(cn('你没有设置论坛ID'), 'info')
            elif tpye == 'bbs':  #检测发帖区域为社区论坛
                if self.setting[4]:  #检测高手区论坛ID是否设置好
                    p_ = self.setting[4].split(',')  #从配置中获取论坛ID设置
                    p_id = [i.split(':')[0] for i in p_]  #获取论坛ID列表
                    p_tx = [i.split(':')[1] for i in p_]  #获取论坛名称列表
                    x = ui.popup_menu(p_tx, cn('选择目的论坛'))
                    if x != None:
                        if self.t.len() > 9:
                            t = ui.query(cn('必须定个题目哦(^m^)'), 'text')
                            if t and len(t) > 3:
                                note = ui.InfoPopup()
                                note.show(cn('正在发送文章...\n请稍后'), (10, 100),
                                          100000, 0, ui.EHCenterVCenter)
                                pid = p_id[x]
                                url = 'http://f3.lexun.com/writeapp.aspx?lxt=%s&bid=%s&wtype=1' % (
                                    self.setting[2], pid)
                                from urllib import urlencode
                                self.rep()
                                s = self.t.get()
                                self.rerep()
                                data = urlencode({
                                    'Content': en(s),
                                    'Title': en(t)
                                })
                                res = self.send(data, url)
                                if res[0] == 200:
                                    if res[2].find('成功') != -1:
                                        note.hide()
                                        ui.note(cn('文章成功发布!'))
                                    else:
                                        note.hide()
                                        ui.note(cn('文章发布失败!原因可能是权限和屏蔽问题!'))
                                else:
                                    note.hide()
                                    ui.note(cn('文章发布失败!原因可能是网络中断!'))
                            else:
                                ui.note(cn('标题太短'))
                        else:
                            ui.note(cn('正文字数不够9个'), 'info')
                    else:
                        ui.note(cn('操作已取消'), 'info')
                else:
                    ui.note(cn('你没有设置论坛ID'), 'info')
            else:
                pass
        else:  #没有SID的时候提示设置SID
            ui.note(cn('请先设置帐号LXT值和论坛ID值'), 'info')
            if ui.query(cn('需要联网获取LXT值吗?'), 'query'):
                self.get_sid()