Page 1 of 1
listview gadget over string gadget,can not select item
Posted: Mon Jul 30, 2007 8:08 am
by andyryu
Code: Select all
OpenWindow(0, 216, 0, 600, 300, "i can't select test3" )
CreateGadgetList(WindowID(0))
StringGadget(0, 96, 91, 131, 20, "")
ListViewGadget(1, 128, 69, 105, 97)
AddGadgetItem(1,-1,"test1")
AddGadgetItem(1,-1,"test2")
AddGadgetItem(1,-1,"test3")
Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
End
i can't select test3,anyone help me?
Posted: Mon Jul 30, 2007 8:41 am
by gnozal
Reduce the StringGadget width ?
Code: Select all
OpenWindow(0, 216, 0, 600, 300, "i can't select test3" )
CreateGadgetList(WindowID(0))
StringGadget(0, 96, 91, 31, 20, "")
ListViewGadget(1, 128, 69, 105, 97)
AddGadgetItem(1,-1,"test1")
AddGadgetItem(1,-1,"test2")
AddGadgetItem(1,-1,"test3")
Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
End
Posted: Mon Jul 30, 2007 8:43 am
by liam
its because your listview gadget is above it.
change:
ListViewGadget(1, 128, 69, 105, 97)
to
ListViewGadget(1, 228, 69, 105, 97)
Posted: Mon Jul 30, 2007 8:59 am
by andyryu
sorry,but i only want place these gadgets like this,because i won't let the listview gadget always shown,but when they are all on screen,i can not select "test3"
Posted: Mon Jul 30, 2007 9:06 am
by gnozal
andyryu wrote:sorry,but i only want place these gadgets like this,because i won't let the listview gadget always shown,but when they are all on screen,i can not select "test3"
1. Place ListView above StringGadget
Code: Select all
OpenWindow(0, 216, 0, 600, 300, "i can't select test3" )
CreateGadgetList(WindowID(0))
ListViewGadget(1, 128, 69, 105, 97)
StringGadget(0, 96, 91, 131, 20, "")
AddGadgetItem(1,-1,"test1")
AddGadgetItem(1,-1,"test2")
AddGadgetItem(1,-1,"test3")
Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
End
2. Disable (or hide) StringGadget while displaying ListView
Code: Select all
OpenWindow(0, 216, 0, 600, 300, "i can't select test3" )
CreateGadgetList(WindowID(0))
StringGadget(0, 96, 91, 131, 20, "")
DisableGadget(0, #True)
ListViewGadget(1, 128, 69, 105, 97)
AddGadgetItem(1,-1,"test1")
AddGadgetItem(1,-1,"test2")
AddGadgetItem(1,-1,"test3")
Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
End
Posted: Mon Jul 30, 2007 9:23 am
by andyryu
the 2 ways are all not good enough,when the listview cover half of string gadget ,it looks strange
i try pureform and other tools,and try z-order,but i can't get result i want
so i drop it and give up
thank you
got it
Posted: Tue Jul 31, 2007 5:11 am
by andyryu
haha,i got it
1、hide ListViewGadget
2、set z-order of the 2 gadget ,listviewgadget insert after stringgadget
*if the z-order is correct,ignore this step
3、freeze the #wm_paint of stringgadget
4、show ListViewGadget
5、unfreeze the #wm_paint of stringgadget
ok