#include once "gui.bas"

dim shared as qform f
dim shared as qbutton b(3)
dim shared as qstatic st
dim shared as qpicture pic

pic.transparent=1
pic.loadfromfile("..\res\marks.bmp")

f.parent=0

sub b0click(v as QObject)
    st.style=ws_child or ws_visible or ss_blackframe
    'st.recreate
    setwindowpos(st.handle,0,0,0,0,0,swp_nosize or swp_nomove or swp_framechanged)
end sub

sub b1click(v as QObject)
    st.style=ws_child or ws_visible or ss_sunken
    'st.recreate
     setwindowpos(st.handle,0,0,0,0,0,swp_nosize or swp_nomove or swp_framechanged)
end sub

sub b2click(v as QObject)
    st.style=ws_child or ws_visible or ss_bitmap or ss_centerimage or ss_sunken
    'st.recreate
       ? @v,@b(2),sendmessage(st.handle,stm_setimage,image_bitmap,cint(pic.handle))
     setwindowpos(st.handle,0,0,0,0,0,swp_nosize or swp_nomove or swp_framechanged)
end sub

for i as integer=0 to ubound(b)-1
    b(i).parent=f
    b(i).top=i*36
    b(i).left=100
    b(i).visible=1
    select case i
    case 0:b(i).onclick=@b0click
    case 1:b(i).onclick=@b1click
    case 2:b(i).onclick=@b2click
    end select
next
st.parent=f
st.height=100
st.text="ok"
st.visible=1

f.visible=1
application.run
    
    