awtk/design/default/ui/main_fscript.xml
2023-08-22 16:43:32 +08:00

61 lines
2.8 KiB
XML

<window closable="no" text="Desktop" anim_hint="htranslate" single_instance="true">
<property name="on:global_key_down">
print("global keydown:", key, "alt=", alt, "ctrl=", ctrl, "cmd=", cmd, "menu=", menu);
</property>
<property name="on:global_key_up">
print("global keyup:", key, "alt=", alt, "ctrl=", ctrl, "cmd=", cmd, "menu=", menu);
</property>
<property name="on:global_key_long_press">
print("global key_long_press:", key, "alt=", alt, "ctrl=", ctrl, "cmd=", cmd, "menu=", menu);
</property>
<property name="on:window_open">
global.is_show_fps = false;
</property>
<view x="0" y="0" w="100%" h="100%" children_layout="default(c=2,r=10,m=5,s=5)">
<button focusable="true" focused="true" on:click="open('test_fscript')" text="Test Fscript"/>
<button focusable="true" on:click="open('animator_fscript')" text="Widget Animator"/>
<button focusable="true" on:click="open('button_fscript')" text="Buttons"/>
<button focusable="true" on:click="open('basic_fscript')" text="Basic"/>
<button focusable="true" on:click="open('text_selector_fscript')" text="Text Selector"/>
<button focusable="true" tr_text="<&quot;en&amp;zh&quot;>">
<property name="on:click">
<![CDATA[
a = locale_get()
b = object_get(a, 'language')
if (b == 'en') {
locale_set('zh', 'CN')
} else {
locale_set('en', 'US')
}
]]>
</property>
</button>
<button focusable="true" text="Change Theme">
<property name="on:click">
<![CDATA[
a = theme_get()
if (a == 'default') {
theme_set('dark')
} else {
theme_set('default')
}
]]>
</property>
</button>
<button focusable="true" on:click="var files=choose_files('.c', './');print(files.size)"
text="Choose Files"/>
<button focusable="true" on:click="var file=choose_file('.c', './');print(file)"
text="Choose File"/>
<button focusable="true" on:click="var file=choose_file_for_save('.c', './');print(file)"
text="Choose File Save"/>
<button focusable="true" on:click="var file=choose_folder('./');print(file)"
text="Choose Folder"/>
<button focusable="true" on:click="var ret = dialog_info('awtk','hello');print(ret)" text="Info"/>
<button focusable="true" on:click="var ret = dialog_warn('awtk','hello');print(ret)" text="Warn"/>
<button focusable="true" on:click="var ret = dialog_confirm('awtk','hello');print(ret)" text="Confirm"/>
<button focusable="true" on:click="var ret = dialog_toast('awtk',2000);print(ret)" text="Toast"/>
<button focusable="true" on:click="global.is_show_fps = !global.is_show_fps;show_fps(global.is_show_fps)" text="Show FPS"/>
<button focusable="true" on:click="quit()" text="Quit"/>
</view>
</window>