MICILE EZ_UI Documentation
version: 0.9
A few notes about our documentation:
  • The intentions of this documentation are to keep things simple.
  • Please see the examples at the end of each section for concrete examples of how to use each function.
  • If in doubt how to use a function, experiment!
  • We don't believe in writing more words just to make the documentation look more substantial
  • Quick Reference
    Function List
    Other pages related to the EZ_UI library:
    Front Page      EZ_UI Library      UI_Base      UI_Button      UI_CheckBox      UI_Keyboard      UI_Label      UI_ListBox      UI_MessageBox      UI_MiniKeyboard      UI_Panel      UI_RadioButton      UI_ScrollBar      UI_Spinner      UI_TextBox      UI_Theme     
    Compatible Devices
    Touchscreen and LCD screen built into every tablet

    * Please contact us for information on adding support for a device.


    Functions
    create_panel(left, top, width, height, **kwargs)
    returns a new UI_Panel instance

    Creates a new UI_Panel and returns it.
    Additional property setttings can be passed in through the **kwargs.
    See UI_Panel documentation for more information on the properties that can be set.
    create_spinner(left, top, width, height, **kwargs)
    returns a new UI_Spinner instance

    Creates a new UI_Spinner and returns it.
    Additional property setttings can be passed in through the **kwargs.
    See UI_Spinner documentation for more information on the properties that can be set.
    show_keyboard(default_text, **kwargs)
    Shows the on screen keyboard with starting text of default_text and allow the user to modify the text through the on screen keyboard interface.
    Additional property setttings can be passed in through the **kwargs.
    See UI_Keyboard documentation for more information on the properties that can be set.
    show_messagebox(left, top, width, height, message, buttons, **kwargs)
    Shows a message box on the screen.
    The text displayed in the message box is specified by the message parameter. The buttons displayed in the message box are specified by the list specified by the buttons parameter. When the user clicks one of the buttons, the messagebox will return the text of the button clicked. Additional property setttings can be passed in through the **kwargs.
    See UI_MessageBox documentation for more information on the properties that can be set.
    # --------------------------------------------------
    #   Imports
    # --------------------------------------------------
    from ez_touchscreen_09 import *
    from ez_ui_09 import *
    import time
     
    # --------------------------------------------------
    #   Global Variables
    # --------------------------------------------------
    counter = 0
    panel = None
     
    # --------------------------------------------------
    #   Event Handlers
    # --------------------------------------------------
    def on_btn_clicked(btn):
        global panelcounter
        if btn.text == 'Up':    counter = counter + 1
        if btn.text == 'Down':  counter = counter - 1
        panel.get_control('lbl_counter').text = str(counter)
        
    # --------------------------------------------------
    #   Main
    # --------------------------------------------------
     
    # Create a panel and add some buttons
    panel = create_panel(00get_screen_width()get_screen_height())
    panel.add_button('btn_up',        100,  50100,  40text='Up',     on_click_handler=on_btn_clicked)
    panel.add_button('btn_down',      100100100,  40text='Down',   on_click_handler=on_btn_clicked)
    panel.add_label ('lbl_counter',   100150100,  40text='0',      color_border='lime'text_size=20text_alignment='CENTER_CENTER')
    panel.add_textbox('textbox',      100200275,  40text='I am a TextBox, click me!')
    panel.add_checkbox('chk_first',   250,  50100,  40text='1st',    color_text='purple')
    panel.add_checkbox('chk_second',  250100100,  40text='2nd',    color_border=None)
    panel.add_radiobutton('radio_1',  400,  50100,  40text='First',  color_text='orange')
    panel.add_radiobutton('radio_2',  400100100,  40text='Second'color_text='orange')
    panel.add_radiobutton('radio_3',  400150100,  40text='Third',  color_text='orange')
    panel.add_radiobutton('radio_4',  400200100,  40text='Fourth'color_text='orange')
    panel.add_listbox('listbox',      550,  50200100)
     
    # add some items to the listbox
    panel.get_control('listbox').add_items(['First Item''Second Item''Third Item''Item 4''Item 5''cow''chicken''moose'])
     
    # process touches
    while True:
        point = touchscreen_finger_point()
        panel.process_touch(point)
        time.sleep(0.05)



    ui_panel demo
    # --------------------------------------------------
    #   Imports
    # --------------------------------------------------
    from ez_touchscreen_09 import *
    from ez_ui_09 import *
    import time
     
    # --------------------------------------------------
    #   Global Variables
    # --------------------------------------------------
    exit_flag = False
    panel = None
     
    # --------------------------------------------------
    #   Event Handlers
    # --------------------------------------------------
    def on_btn_keyboard_clicked(btn):
        # set the panel as a global variable
        global panel
        # show the keyboard with default text of text in the label
        s = panel.get_control('lbl_text').text
        s2 = show_keyboard(s)
        # show the output in the label
        panel.get_control('lbl_text').text = s2
     
    def on_btn_messagebox_clicked(btn):
        # set the panel as a global variable
        global panel    
        # show the messagebox
        s = show_messagebox(NoneNone300200'Hello'['OK''CANCEL'])    
        # show the output in the label
        panel.get_control('lbl_text').text = s
     
    def on_btn_spinner_clicked(btn):
        # create a spinner
        spinner = create_spinner(NoneNone200100text='Spinner!')    
        # start spinning
        spinner.start_spinner()
        # do some long running operation here.  We will just sleep in this example
        time.sleep(5)
        # stop the spinner
        spinner.stop_spinner()
        
    def on_btn_exit_clicked(btn):
        # set exit_flag as a global variable
        global exit_flag    
        # set the exit flag so we will exit
        exit_flag = True
     
    # --------------------------------------------------
    #   Main
    # --------------------------------------------------
     
    # Create a panel and add some buttons
    panel = create_panel(00get_screen_width()get_screen_height())
    panel.add_button('btn_msgbox',   10010010040text='MessageBox'on_click_handler=on_btn_messagebox_clicked)
    panel.add_button('btn_spinner',  25010010040text='Spinner',    on_click_handler=on_btn_spinner_clicked)
    panel.add_button('btn_keyboard'40010010040text='Keyboard',   on_click_handler=on_btn_keyboard_clicked)
    panel.add_button('btn_exit',     55010010040text='Exit',       on_click_handler=on_btn_exit_clicked)
    panel.add_label ('lbl_text',     10020020040text='hello',      color_border='red')
     
    # process touches
    while exit_flag == False:
        point = touchscreen_finger_point()
        panel.process_touch(point)
        time.sleep(0.05)
        
    # clear the screen
    set_color('blue')
    fill_rect(00get_screen_width()get_screen_height())
    set_color('white')
    draw_text('Good Bye!'400240)

    ui demo