
A 'PopupList' control (implemented with OOP).
Hi,
is there any chance to get it work with Gnozals PureColor?
The MenuItems disappears....
Best regards
Marco
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
Marco
PureBasic for Windows
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!Marco2007 wrote:YES!!
Thanx a lot!!
Fixed a problem without using PureColor...
I may look like a mule, but I'm not a complete ass.
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.

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.
I may look like a mule, but I'm not a complete ass.
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.
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.
I may look like a mule, but I'm not a complete ass.
Doesn't have one; it uses one of those fiddly finger buttony type scrollers.
http://images.google.co.uk/images?um=1& ... inkpad+x30
http://images.google.co.uk/images?um=1& ... inkpad+x30
I may look like a mule, but I'm not a complete ass.