PureCOLOR library : coloring gadgets (and much more)
Moderator: gnozal
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
i see, i will try find some code that works okay on pre-xp machines, maybe someone reading this thread may also have some info.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Ok, I have some code wich works well on Win9x, but not on WinNT4. As PureCOLOR_SetPopupMenuBackColor() don't work with NT4 either, I will add some owner drawn menu functions to the next library version.DoubleDutch wrote:i see, i will try find some code that works okay on pre-xp machines, maybe someone reading this thread may also have some info.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal - thanks a lot for the great libraries. I was looking for a way to color individual lines in listicons but had quite a bit of trouble getting it to work correctly with callbacks. Worked but not well. Your lib saved me a lot of time :D I'm also using your purelvsort library for another project. Very nice.
Thanks!
Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Library update
What's new :
- new function : PureCOLOR_SetMenuColors() ; see example below.
What's new :
- new function : PureCOLOR_SetMenuColors() ; see example below.
Code: Select all
Procedure.l WindowCallBack(WindowId.l, message.l, wParam.l, lParam.l)
ReturnValue.l = #PB_ProcessPureBasicEvents
;
ReturnValue = PureCOLOR_CallBack(WindowId, message, wParam, lParam, ReturnValue)
;
ProcedureReturn ReturnValue
EndProcedure
;
If OpenWindow(0, 10, 10, 300, 200, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "Ownerdraw Menu Demo")
SetWindowCallback(@WindowCallBack())
If CreateMenu(0, WindowID())
MenuTitle("Menu 1")
MenuItem(1, "Menu item 1")
MenuItem(2, "Menu item 2")
MenuItem(3, "Menu item 3")
MenuItem(4, "Exit")
MenuTitle("Menu 2")
MenuItem(5, "Menu item 1")
MenuItem(6, "Menu item 2 (longer)")
MenuItem(7, "Menu item 3")
MenuTitle("Extra menu")
MenuItem(8, "Extra long menu item")
OpenSubMenu("The level 1 submenu")
MenuItem(9, "The pure power !")
OpenSubMenu("The level 2 submenu")
MenuItem(10, "What ?")
MenuItem(11, "Hello ...")
CloseSubMenu()
CloseSubMenu()
EndIf
;
; MENU COLORS
; -------------
; Owner drawn :
; -------------
PureCOLOR_SetMenuColors(0, #Red, RGB(200, 255, 200), #Red, RGB(100, 255, 100))
PureCOLOR_SetWindowColor(0, RGB(200, 255, 200))
; -------------
; or not (but then only backcolor) :
; -------------
;PureCOLOR_SetPopupMenuBackColor(0, RGB(200, 255, 200))
; -------------
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
End
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi,
1. Thank you for a very useful and effective library, I have used it in two projects and find that subtle colour use can be a very good way to provide emphasis.
2. I have tried the sample code in your posting of today and find that the menu text and the sub-menu arrows crash. Its OK in background colour only mode. I'm using XP Pro; fully up to date.
Regards,
Richard
1. Thank you for a very useful and effective library, I have used it in two projects and find that subtle colour use can be a very good way to provide emphasis.
2. I have tried the sample code in your posting of today and find that the menu text and the sub-menu arrows crash. Its OK in background colour only mode. I'm using XP Pro; fully up to date.
Regards,
Richard
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Sadly I don't have XP, so I can't test it. It works well with Win98SE, and there is no text with NT4 (but no crash (missing API I think)).RichardL wrote:I have tried the sample code in your posting of today and find that the menu text and the sub-menu arrows crash. Its OK in background colour only mode. I'm using XP Pro; fully up to date.
- Do you use themes ?
- Do you have default system font for the menus ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Yes, probably. It seems to work with my defaut system font (Win98), but at this time it's not very accurate. I will try do better.RichardL wrote:Possibly an error in determining the text length in pixels?
What is your menu font ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Great addition. 
Is it possible to add a feature to colour individual menu items?
-Anthony

Is it possible to add a feature to colour individual menu items?
-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
OK:
The menu font is Tahona.
Windoze XP can use XP display mode or Classic display mode.
I run my machine in classic mode and the clash problem occurs.
I just switched it to XP mode and there was NO problem.
I then switched back to Classic and there was NO clash. Strange.
I will re-boot in classic mode and report back.
The menu font is Tahona.
Windoze XP can use XP display mode or Classic display mode.
I run my machine in classic mode and the clash problem occurs.
I just switched it to XP mode and there was NO problem.
I then switched back to Classic and there was NO clash. Strange.
I will re-boot in classic mode and report back.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Is it possible soon? 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system