Thanks for advertising
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:
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
New version compiled with PB4.40 beta 1 : http://freenet-homepage.de/gnozal/PureCOLOR_440.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
@gnozal,
if i compile in threadsafe mode the example module "PUREColor_Test.pb", i obtain the error "unresolved external symbol _PBStringBasePosition" : can you verify ?
if i compile in threadsafe mode the example module "PUREColor_Test.pb", i obtain the error "unresolved external symbol _PBStringBasePosition" : can you verify ?
PB Registered User, Egrid Registered User
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
-
superloupiot
- New User

- Posts: 3
- Joined: Sat Jan 02, 2010 3:11 pm
Problem with PureCOLOR
Hi,
I'm new to the use of PureBasic (3 days ago).
I've started to use it and quiclky came to the point where I would like to change the background color a the button gadget.
Apparently, the PureCOLOR library authorizes that feature.
Hence, I have installed the PureCOLOR library version 4.4.
When I try to compile the example code PureCOLOR_Test.pb, I get the following error message:
POLINK:fatal error: Corrupt library:.\PureCOLOR_Lib_14.lib
I'm working under Windows7 - 64 bit.
The version of PureBasic is 4.40 (x64)
The version of PureCOLOR is 4.40 : PureCOLOR_440.zip
Could some one help me here?
Thanks.
I'm new to the use of PureBasic (3 days ago).
I've started to use it and quiclky came to the point where I would like to change the background color a the button gadget.
Apparently, the PureCOLOR library authorizes that feature.
Hence, I have installed the PureCOLOR library version 4.4.
When I try to compile the example code PureCOLOR_Test.pb, I get the following error message:
POLINK:fatal error: Corrupt library:.\PureCOLOR_Lib_14.lib
I'm working under Windows7 - 64 bit.
The version of PureBasic is 4.40 (x64)
The version of PureCOLOR is 4.40 : PureCOLOR_440.zip
Could some one help me here?
Thanks.
-
superloupiot
- New User

- Posts: 3
- Joined: Sat Jan 02, 2010 3:11 pm
Re: Problem with PureCOLOR
OK, I have remove the 64-bit version of PureBasic and installed the32-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.
-
superloupiot
- New User

- Posts: 3
- Joined: Sat Jan 02, 2010 3:11 pm
Button gadget and multiline flag
Hello,
When the Button_MultiLine flag is set and when a PureColor is applied to the button gadget, the background color is as expected but the text background color is white.
Is there a way to change the text background color to the same color as the button background color.
Here after is the code that shows the problem.
Thanks.
When the Button_MultiLine flag is set and when a PureColor is applied to the button gadget, the background color is as expected but the text background color is white.
Is there a way to change the text background color to the same color as the button background color.
Here after is the code that shows the problem.
Thanks.
- ;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#Button_0
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(#Button_0, 100, 75, 160, 135, "Gadget_0", #PB_Button_MultiLine)
; Gadget Colors
PureCOLOR_SetButtonColor(#Button_0, #PureCOLOR_SystemColor, $FF, #PureCOLOR_SystemColor, $8080FF)
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #Button_0
EndIf
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
Forever
;
;}
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Problem with PureCOLOR
Yes, all my apps / libs / tools are 32bits (x86) only.superloupiot wrote:OK, I have remove the 64-bit version of PureBasic and installed the32-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Button gadget and multiline flag
Congratulations !
You found a bug.
I am using API functions for multiline buttons, and these functions and PB's '2DDrawing' library don't mix well since PB4.40.
You found a bug.
I am using API functions for multiline buttons, and these functions and PB's '2DDrawing' library don't mix well since PB4.40.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
Update v14.06 (PB4.40 version)
Changes :
- this build should fix the multiline button issue posted by superloupiot
Changes :
- this build should fix the multiline button issue posted by superloupiot
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureCOLOR library : coloring gadgets (and much more)
hi gnozal
if you can help me.
how to set SystemColor color to Frame3DGadget like PureColor without use the PureColor Lib?
i use x64 and PureColor not support x64.
if you can help me.
how to set SystemColor color to Frame3DGadget like PureColor without use the PureColor Lib?
i use x64 and PureColor not support x64.
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
To set colors without PureCOLOR, this should work I guess (tested on XP x86 (themes disabled)) :
Some other code : http://www.purebasic.fr/english/viewtopic.php?t=24919
Code: Select all
Global textBackground = CreateSolidBrush_(#red)
Global textForeground = #White
Procedure WinProc(hwnd,msg,wParam,lParam)
result = #PB_ProcessPureBasicEvents
If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1)
SetBkMode_(wParam, #TRANSPARENT)
SetTextColor_(wParam, textForeground)
result = textBackground
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Frame3DGadget(1,20,20,150,70,"Some text")
SetWindowCallback(@WinProc())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
DeleteObject_(textBackground)For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureCOLOR library : coloring gadgets (and much more)
Big thanks gnozalgnozal wrote:To set colors without PureCOLOR, this should work I guess (tested on XP x86 (themes disabled)) :Some other code : http://www.purebasic.fr/english/viewtopic.php?t=24919Code: Select all
Global textBackground = CreateSolidBrush_(#red) Global textForeground = #White Procedure WinProc(hwnd,msg,wParam,lParam) result = #PB_ProcessPureBasicEvents If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1) SetBkMode_(wParam, #TRANSPARENT) SetTextColor_(wParam, textForeground) result = textBackground EndIf ProcedureReturn result EndProcedure OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) Frame3DGadget(1,20,20,150,70,"Some text") SetWindowCallback(@WinProc()) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow DeleteObject_(textBackground)
Re: PureCOLOR library : coloring gadgets (and much more)
Aloha Gnozal,
I found a strange bug using PureColor and font-enabling for gadgets.
Try this code please:
(PB 4.40 final, PureColour 4.40, downloaded today)
I wannt to colour the buttons background and set a bold font for the button text.
All went okay. but if I disable and re-enable the buttons then a wrong fontsize/font will be displayed.
As you can see in the example above, in disabled mode the fontsize is correct. but after enabling the buttons the size is too big.
The code is extracted from a PureForm generated code, so no "manual" coding in the example except of some minor adjustments. If it's a logicallly failure, then PureFORM generate wrong code I guess.
Can you help me quickly with this problem? My current development/release stops because of this issue.
Thank you very much in advance.
Edit: It's not a PureBasic bug, because if you comment out the two PureCOLOR lines, then the bug does not appear.
I found a strange bug using PureColor and font-enabling for gadgets.
Try this code please:
(PB 4.40 final, PureColour 4.40, downloaded today)
Code: Select all
Window_Main = OpenWindow(#PB_Any, 200, 200, 300, 60, "Test", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_TitleBar|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget)
If Window_Main
SmartWindowRefresh(Window_Main, #True)
TestButton1 = ButtonGadget(#PB_Any, 10, 10, 135, 40, "Long long long text", #PB_Button_MultiLine)
TestButton2 = ButtonGadget(#PB_Any, 155, 10, 140, 40, "Long long long text", #PB_Button_MultiLine)
PureRESIZE_SetGadgetResize(TestButton1, 1, 0, 0, 1)
PureRESIZE_SetGadgetResize(TestButton2, 1, 0, 0, 1)
SetGadgetFont(TestButton1, LoadFont(0, "Arial", 8, 272))
SetGadgetFont(TestButton2, LoadFont(1, "Arial", 8, 272))
PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)
EndIf
DisableGadget(TestButton1, 1)
DisableGadget(TestButton2, 1)
Repeat
Delay (10)
i+1
If i = 100
DisableGadget(TestButton1, 0)
DisableGadget(TestButton2, 0)
ElseIf i = 200
DisableGadget(TestButton1, 1)
DisableGadget(TestButton2, 1)
i=0
EndIf
Until WindowEvent() = #PB_Event_CloseWindowAll went okay. but if I disable and re-enable the buttons then a wrong fontsize/font will be displayed.
As you can see in the example above, in disabled mode the fontsize is correct. but after enabling the buttons the size is too big.
The code is extracted from a PureForm generated code, so no "manual" coding in the example except of some minor adjustments. If it's a logicallly failure, then PureFORM generate wrong code I guess.
Can you help me quickly with this problem? My current development/release stops because of this issue.
Thank you very much in advance.
Edit: It's not a PureBasic bug, because if you comment out the two PureCOLOR lines, then the bug does not appear.
Code: Select all
; PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
; PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)
PB 6.12 x64, OS: Win 11 24H2 x64, Desktopscaling: 150%, CPU: I7 12700 H, RAM: 32 GB, GPU: Intel(R) Iris(R) Xe Graphics | NVIDIA GeForce RTX 3070, User age in 2025: 57y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"

