五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

Android QPython3 可視化-三鍵按鈕:ButtonText.py

2020-09-18 07:44 作者:乘著船  | 我要投稿

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


from BaseWindow import *

BT="""

? ? <Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="%s"

android:id="@+id/but_yes"

android:textSize="8dp"

android:background="#3f3f7f"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

""","""

<Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="%s"

android:id="@+id/but_can"

android:textSize="8dp"

android:background="#7f3f3f"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

""","""

<Button

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:text="%s"

android:id="@+id/but_noo"

android:textSize="8dp"

android:background="#7f7f00"

android:textColor="#ffffffff"

android:layout_weight="1"

android:gravity="center"/>

"""

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

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#007f7f"

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/editTitle"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:textSize="8dp"

android:text=""

android:textColor="#0000ff"

android:layout_weight="1"

android:gravity="center"

/>

<EditText

android:id="@+id/editText"

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">

""","""

</LinearLayout>

</LinearLayout>"""

class MainScreen(Layout):

? ? def on_show(self):

? ? ? ? #if self.Count>=0:

? ? ? ? self.views.but_yes.add_event(click_EventHandler(self.views.but_yes,self.yes))

? ? ? ? if self.Count>1:

? ? ? ? ? ? self.views.but_noo.add_event(click_EventHandler(self.views.but_noo,self.noo))

? ? ? ? if self.Count>2:

? ? ? ? ? ? self.views.but_can.add_event(click_EventHandler(self.views.but_can,self.can))

? ? ? ? self.views.editTitle.text=self.Title

? ? ? ? self.views.editText.text=self.Text

? ? def on_close(self):

? ? ? ? pass

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

? ? ? ? MainScreen.Text=1

? ? ? ? FullScreenWrapper2App.close_layout()

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

? ? ? ? MainScreen.Text=-1

? ? ? ? FullScreenWrapper2App.close_layout()

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

? ? ? ? MainScreen.Text=0

? ? ? ? FullScreenWrapper2App.close_layout()

YNC=('是','否','取消')

def ButtonText(Title='',Text='',button=YNC):#主函數(shù)

#三按鈕對(duì)話框(標(biāo)題,內(nèi)容,("是"按鈕文本,"否"按鈕文本,"取消"按鈕文本))

#返回:是=1,否=-1,取消=0

#省按鈕(button)格式:默認(rèn)為("是","否","取消")

#三按鈕(button)格式:("是"按鈕文本,"否"按鈕文本,"取消"按鈕文本)

#二按鈕(button)格式:("是"按鈕文本,"否"按鈕文本)

#單按鈕(button)格式:("是"按鈕文本,)

#空按鈕(button)格式:(),等價(jià)于單按鈕("OK",)

? ? MainScreen.Title=Title

? ? MainScreen.Text=Text

? ? b=[XML[0]]

? ? MainScreen.Count=l=len(button)

? ? if l==3:

? ? ? ? a=(button[0],button[2],button[1])

? ? elif l==2:

? ? ? ? a=(button[0],'',button[1])

? ? elif l==1:

? ? ? ? a=(button[0],'','')

? ? else:#l==0

? ? ? ? a=('OK','','')

? ? for i in range(3):

? ? ? ? if a[i]:

? ? ? ? ? ? b.append(BT[i]%a[i])

? ? b.append(XML[1])

? ? b=''.join(b)

? ? FullScreenWrapper2App.show_layout(MainScreen(b,'Button'))

? ? FullScreenWrapper2App.eventloop()

? ? b=MainScreen.Text

? ? del MainScreen.Title,MainScreen.Text,MainScreen.Count

? ? return b

__all__=('ButtonText','droid')


==========說明==========


ButtonText('標(biāo)題','多行\(zhòng)n內(nèi)容')

返回:是=1,否=-1,取消=0

Android 5.0 系統(tǒng)以上,遇到Button英文全部自動(dòng)變?yōu)榇髮懡鉀Q方案:

Button繼承至TextView,把Button改成TextView打回原形就可以了。

例如:

<Button

#其他內(nèi)容#? />

改為:

<TextView

android:clickable="true"

#其他內(nèi)容#? />

作者:乘著船@Bilibili

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



Android QPython3 可視化-三鍵按鈕:ButtonText.py的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
广灵县| 汝南县| 获嘉县| 咸丰县| 威信县| 榆树市| 南丰县| 荃湾区| 新巴尔虎右旗| 福贡县| 栾城县| 台州市| 高淳县| 封开县| 富顺县| 泸定县| 赤水市| 白玉县| 新泰市| 淮北市| 海原县| 闵行区| 惠水县| 富顺县| 留坝县| 通江县| 辽源市| 临西县| 高台县| 巫溪县| 信丰县| 遵义市| 湘阴县| 新乡县| 青州市| 凤冈县| 南部县| 青浦区| 满洲里市| 永寿县| 宁阳县|