最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Android QPython3 可視化-輸出窗體:Output.py

2020-10-04 07:58 作者:乘著船  | 我要投稿

#需要BaseWindow.py? https://www.bilibili.com/read/cv8680125


from BaseWindow import *

XML="""<?xml version="1.0" encoding="utf-8"?>

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#9f5f00"

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical"

android:layout_weight="20">

<ScrollView? ?

? ? ? ? android:layout_width="fill_parent"? ?

? ? ? ? android:layout_height="fill_parent" >?

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical"

android:layout_weight="20">

? ? <EditText

android:id="@+id/editNew"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:textSize="8dp"

android:text=""

android:textColor="#0000ff"

android:layout_weight="1"

/>

<EditText

android:id="@+id/editOld"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:textSize="8dp"

android:text=""

android:textColor="#ff0000"

android:layout_weight="1"

/>

</LinearLayout>

</ScrollView>

? ? </LinearLayout>

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="100dp"

android:orientation="horizontal"

android:layout_weight="8">

<Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="繼續(xù)(保留)"

android:id="@+id/but_conf"

android:textSize="8dp"

android:background="#2f3f8f"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

<Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="復(fù)制"

android:id="@+id/but_copy"

android:textSize="8dp"

android:background="#7f7f00"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

<Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="繼續(xù)(清除)"

android:id="@+id/but_canc"

android:textSize="8dp"

android:background="#6f1f6f"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

</LinearLayout>

</LinearLayout>"""

class MainScreen(Layout):

? ? def on_show(self):

? ? ? ? self.views.but_conf.add_event(click_EventHandler(self.views.but_conf,self.conf))

? ? ? ? self.views.but_copy.add_event(click_EventHandler(self.views.but_copy,self.copy))

? ? ? ? self.views.but_canc.add_event(click_EventHandler(self.views.but_canc,self.canc))

? ? ? ? self.views.editNew.text=clbr(self.New)

? ? ? ? global First

? ? ? ? if First:

? ? ? ? ? ? self.views.editOld.text=First

? ? ? ? ? ? First=None

? ? ? ? else:

? ? ? ? ? ? self.views.editOld.text=clbr(self.Old)

? ? ? ? MainScreen.Old=self.Old+self.New

? ? ? ? MainScreen.New=''

? ? def on_close(self):

? ? ? ? pass

? ? def copy(self,view,dummy):

? ? ? ? droid.setClipboard(self.Old)

? ? ? ? droid.makeToast("文本已復(fù)制")

? ? def conf(self,view,dummy):

? ? ? ? FullScreenWrapper2App.close_layout()

? ? def canc(self,view,dummy):

? ? ? ? MainScreen.Old=''

? ? ? ? FullScreenWrapper2App.close_layout()

? ? Old='';New=''

def clbr(x):

#去掉頭尾空行

? ? t=True

? ? while t:

? ? ? ? t=False

? ? ? ? if x and x[0]=='\n':

? ? ? ? ? ? x=x[1:]

? ? ? ? ? ? t=True

? ? ? ? if x and x[-1]=='\n':

? ? ? ? ? ? x=x[:-1]

? ? ? ? ? ? t=True

? ? return x

First='上/藍(lán):最新輸出\n下/紅:歷史輸出\n這是標(biāo)準(zhǔn)輸出窗口\n此提示只顯示一次'

def Output(Content=''):#主函數(shù)

#輸出窗體(內(nèi)容str)

#不會(huì)自動(dòng)換行

#輸出:None

? ? MainScreen.New=Content

? ? FullScreenWrapper2App.show_layout(MainScreen(XML,'Output'))

? ? FullScreenWrapper2App.eventloop()

__all__=('Output','droid')


Output('測(cè)試\n內(nèi)容')


作者:乘著船@Bilibili

更多文章+下載鏈接:https://www.bilibili.com/read/readlist/rl321663


Android QPython3 可視化-輸出窗體:Output.py的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
绥阳县| 南投市| 隆尧县| 房产| 顺平县| 曲沃县| 文登市| 迁西县| 津南区| 蒙阴县| 德庆县| 措美县| 邓州市| 中山市| 宣威市| 兴宁市| 湖州市| 三明市| 靖西县| 永兴县| 错那县| 久治县| 油尖旺区| 泰安市| 永福县| 广元市| 思南县| 胶州市| 修武县| 阳江市| 珲春市| 女性| 射洪县| 枞阳县| 古田县| 南通市| 通辽市| 枞阳县| 张北县| 葫芦岛市| 武宁县|