listview gadget over string gadget,can not select item

Just starting out? Need help? Post your questions and find answers here.
andyryu
New User
New User
Posts: 7
Joined: Mon Jul 30, 2007 7:58 am
Location: Shanghai,China

listview gadget over string gadget,can not select item

Post 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?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
liam
User
User
Posts: 38
Joined: Tue Jul 03, 2007 3:48 am
Location: Philippines

Post by liam »

its because your listview gadget is above it.

change:
ListViewGadget(1, 128, 69, 105, 97)
to
ListViewGadget(1, 228, 69, 105, 97)
andyryu
New User
New User
Posts: 7
Joined: Mon Jul 30, 2007 7:58 am
Location: Shanghai,China

Post 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"
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
andyryu
New User
New User
Posts: 7
Joined: Mon Jul 30, 2007 7:58 am
Location: Shanghai,China

Post 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
andyryu
New User
New User
Posts: 7
Joined: Mon Jul 30, 2007 7:58 am
Location: Shanghai,China

got it

Post 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
Post Reply