ColorRequester
Is there a way to preload/preset the 16 "Custom colours" options? Any idea where these are stored?
Preload ColorRequester options
Re: Preload ColorRequester options
You can take a look at this thread Better ColorRequester()
Re: Preload ColorRequester options
I also learned from that thread above, and wrote this IncludeFile:
https://github.com/kenmo-pb/includes/bl ... sterEx.pbi
which simplifies it to
https://github.com/kenmo-pb/includes/bl ... sterEx.pbi
which simplifies it to
Code: Select all
SetColorReqExRecent(Index, Color) ; index 0 through 15
choice = ColorRequesterEx()
Re: Preload ColorRequester options
Nicely written, as usual, I appreciatekenmo wrote: ↑Thu Jan 20, 2022 3:57 am I also learned from that thread above, and wrote this IncludeFile:
https://github.com/kenmo-pb/includes/bl ... sterEx.pbi
In addition, it can be interesting, as I did in my project, to use the last custom colour as a backup point.
It allows to restore, if needed, after trying another colour, to return to the original colour, the one in parameter (ex: Color = ColorRequesterEx(RGB(255, 0, 255), #ColorReq_UseFile, WindowID(0)).
It can be done by adding, in line 135
Code: Select all
If (Color = #PB_Default)
Color = __ColorReq_Recent(0)
Else
__ColorReq_Recent(15) = Color
EndIf
Still impressive the lack of reply from the requester, here or elsewhere
Re: Preload ColorRequester options
Thank you.
So if I understand it correctly the 'ChooseColor' function is actually a windows command that PB has wrapped. And that "Better ColorRequester" uses that command instead of the wrapped PB version ("ColorRequester")?
So if I understand it correctly the 'ChooseColor' function is actually a windows command that PB has wrapped. And that "Better ColorRequester" uses that command instead of the wrapped PB version ("ColorRequester")?
Re: Preload ColorRequester options
Yes you're right, the PureBasic ColorRequester() is internally calling the Windows ChooseColor_() function. And if you want to access Windows' extra options, like the pre-loaded colors, you have to do a little extra work using ChooseColor_() directly (which is what the linked code takes care of)