Page 2 of 2
Posted: Fri Feb 01, 2008 5:19 pm
by Dare
Posted: Fri Feb 01, 2008 8:13 pm
by Marco2007
Hi,
is there any chance to get it work with Gnozals PureColor?
The MenuItems disappears....
Code: Select all
;/////////////////////////////////////////////////////////////////////////////////
;Demo of the OOP class for implementing PopupLists.
;By Stephen Rodriguez.
;Demonstrates some of the methods exposed by the 'PopupList' class.
;/////////////////////////////////////////////////////////////////////////////////
XIncludeFile "PopupList.pbi"
;Open a window upon which to place the PopupList control.
If OpenWindow(0, 0, 400, 270, 140, "PopupList class demo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
If CreateMenu(0, WindowID(0))
MenuTitle("File")
PureCOLOR_MenuItem(0, 1,"New"+Chr(9)+"Ctrl+N")
PureCOLOR_MenuItem(0, 2,"&Open"+Chr(9)+"Ctrl+O")
EndIf
;Create an instance of a PopupList control.
MyPopupListObject.PopupListObject
MyPopupListObject = NewPopupList(20,0,100,240)
;Add some items.
For i = 0 To 5
MyPopupListObject\AddItem(-1, "Item "+Str(i))
Next
;Set some colors.
MyPopupListObject\SetColor(#PB_Gadget_BackColor, RGB(252, 134, 0))
Repeat
eventID = WaitWindowEvent()
Select eventID
Case #WM_RBUTTONDOWN
MyPopupListObject\Resize(WindowMouseX(0), WindowMouseY(0), #PB_Ignore, #PB_Ignore)
MyPopupListObject\Show()
item = MyPopupListObject\GetState()
Select item
Case -1
MessageRequester("PopupList", "Selection cancelled!")
Default
MessageRequester("PopupList", "Selected item "+Str(item))
EndSelect
EndSelect
Until eventID = #PB_Event_CloseWindow
;Destroy the PopupList object when no longer required.
MyPopupListObject\Destroy()
EndIf
Best regards
Marco
Posted: Fri Feb 01, 2008 8:41 pm
by srod
Ah, there can only be one reason for that!
Hang on...
Posted: Fri Feb 01, 2008 8:45 pm
by srod
Marco, the PureColor problem should be fixed. I can't test because I don't use PureColor so if you wouldn't mind checking the latest update for me I would be grateful.
The download link is in the first post.
Posted: Fri Feb 01, 2008 9:08 pm
by Marco2007
YES!!
Thanx a lot!!
Fixed a problem without using PureColor...

Posted: Fri Feb 01, 2008 9:13 pm
by srod
Marco2007 wrote:YES!!
Thanx a lot!!
Fixed a problem without using PureColor...

With the problem you described, the only possible cause was for my #WM_DRAWITEM handler to be swallowing such messages intended for other controls or ownerdrawn menus etc. Looking at my code, this was indeed what was happening!
Posted: Fri Feb 01, 2008 9:59 pm
by srod
Update - Jan 1st 2008.
Bug fixed.
The PopupList control was destroying all other ownerdrawn controls placed on the same window! Doh!
Please see the first post for the download link.
Posted: Fri Feb 01, 2008 10:13 pm
by Trond
I assume you already know that if you use the scroll wheel the selection isn't updated until you move the mouse?
Posted: Fri Feb 01, 2008 10:22 pm
by srod
I have no mousewheel, so no!
Then again, I'm just using a combobox gadget and haven't interfered with the scrolling or keyboard input at all, so I am guessing that what you are seeing is just normal combobox behaviour.
Would you mind trying it out on a normal combobox gadget Trond? See if you get the same behaviour?
Thanks.
Posted: Fri Feb 01, 2008 10:27 pm
by Trond
Normal comboboxes don't have hot-tracking, so they can't have the same problem.
Posted: Fri Feb 01, 2008 10:29 pm
by srod
Right, just used my brother's computer which has a mousewheel. That is normal behaviour for a combobox Trond. The listbox scrolls but only highlights an item when you mouseover the item. The same is true for any combo even those without scrollbars.
I've compared the PopupList control with a normal combo and they both operate in an identical fashion as far as the scrollwheel is concerned.
Posted: Fri Feb 01, 2008 10:33 pm
by Trond
Well, it's good in a sense as well, as it doesn't change things unnecessarily. (You should get a scroll wheel. When you're used to it, working without one feels like you're missing an arm.)
Posted: Fri Feb 01, 2008 10:38 pm
by srod
Aye, I do miss not having one I must admit. Then again I love this little thinkpad so much. The damn thing is stronger than Conan Powell!
Posted: Fri Feb 01, 2008 10:44 pm
by Trond
You can't get the side of the touchpad to be treated as a scrollbar?
Posted: Fri Feb 01, 2008 10:47 pm
by srod
Doesn't have one; it uses one of those fiddly finger buttony type scrollers.
http://images.google.co.uk/images?um=1& ... inkpad+x30