示例#1
0
def scrollbar_value_changed(nc, scbPtr, sid, addData):
    scbRed = mg.findWndObject(scbPtr, 100)
    scbGreen = mg.findWndObject(scbPtr, 101)
    scbBlue = mg.findWndObject(scbPtr, 102)
    rect = mg.findWndObject(scbPtr, 300)
    label = mg.findWndObject(scbPtr, 301)
    red = scbRed.CurPos
    green = scbGreen.CurPos
    blue = scbBlue.CurPos
    text = "(%d,%d,%d)" % (red, green, blue)
    mg.log(text)
    rect.FillColor = 0xff000000 | red | (green << 8) | (blue << 16)
    label.Text = text
示例#2
0
def check_button_status_changed(nc, ckbtnPtr, btid, addData):
    mg.log("check button status nc=%d,checkbutton ptr: %d,id=%d" %
           (nc, ckbtnPtr, btid))
    ckbtn = mg.wrap(ckbtnPtr)
    label = mg.findWndObject(ckbtnPtr, 200)
    if label:
        label.Text = ckbtn.Text + "State Is:" + str(ckbtn.CheckState)
    else:
        mg.log("cannot get the sub window 200")
示例#3
0
def on_init_list_data(nc, btnPtr, bid, addData):
    listview = mg.findWndObject(btnPtr, 100)
    listview_remove_all(listview)
    i = 0
    for d in list_data1[0]:
        listview.addColumn(i, 100, d)
        i = i + 1
    i = 0
    for d in list_data1[1:]:
        listview.addItem(i, 0, 0, 25, 0, d)
示例#4
0
def on_init_tree_data(nc, btnPtr, bid, addData):
    listview = mg.findWndObject(btnPtr, 100)
    listview_remove_all(listview)
    i = 1
    listview.addColumn(0, 20, "")
    for d in list_data1[0]:
        listview.addColumn(i, 100, d)
    classes = ["Grade1", "Grade2", "Grade3", "Grade4"]
    i = 0
    for d in classes:
        hitem = listview.addItem(i, 0, 0, 25, 0, ["", classes[i]])
        j = 0
        for s in list_data1[1:]:
            listview.addItem(j, 0, hitem, 25, 0, s)
示例#5
0
def on_spinner_changed(nc, spPtr, bid, addData):
    sp = mg.wrap(spPtr)
    progbar = mg.findWndObject(spPtr, 100)
    progbar.CurPos = sp.CurPos
示例#6
0
def on_button_pb_decrease(nc, btnPtr, bid, addData):
    pb = mg.findWndObject(btnPtr, 100)
    pb.increase(-5)
示例#7
0
def on_combobox_sel_changed(nc, cbPtr, cbid, addData):
    cb = mg.wrap(cbPtr)
    sel = cb.getCurSel()
    label = mg.findWndObject(cbPtr, 150)
    label.Text = "CurrentSelect(%d):%s" % (sel, cb.getItem(sel))
示例#8
0
def on_color_changed(nc, cbtPtr, cid, addData):
    cbt = mg.wrap(cbtPtr)
    rect = mg.findWndObject(cbtPtr, 101)
    rect.FillColor = cbt.CurColor
示例#9
0
def on_radio_button_changed(nc, bgPtr, rid, sel_id):
    rect = mg.findWndObject(bgPtr, 300)
    colors = [0xff0000ff, 0xff00ff00, 0xffff0000]
    rect.FillColor = colors[sel_id - 100]
示例#10
0
def month_calendar_changed(nc, mcPtr, cid, addData):
    mc = mg.wrap(mcPtr)
    label = mg.findWndObject(mcPtr, 101)
    label.Text = "Calendar:%d/%d/%d" % (mc.Year, mc.Month, mc.Day)