PureCOLOR library : coloring gadgets (and much more)
Moderator: gnozal
@gnozal, settings the colors for Frame3DGadget and OptionGadget don't work very well when xp theme is enabled: is possibile to do anything ?
Thanks in advance.
Thanks in advance.
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
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I fear not.magicjo wrote:@gnozal, settings the colors for Frame3DGadget and OptionGadget don't work very well when xp theme is enabled: is possibile to do anything ?
Because :
- I don't have XP to test (yet) ...
- M$ is not compliant with it's own specifications when it comes to XP themes (some API calls don't function correctly).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Yeha, I've waited for this feature!
But, how to instal and use the Lib? I wish, that I only have to enable "Compiler Threadsafe". I don't want to use the Subsystem things. Or do I have to?
But, how to instal and use the Lib? I wish, that I only have to enable "Compiler Threadsafe". I don't want to use the Subsystem things. Or do I have to?
PB 4.30
Code: Select all
onErrorGoto(?Fred)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
AND51 wrote:But, how to instal and use the Lib?
PureCOLOR.chm wrote:This library exists in several versions :
- the standard version, located in %Purebasic%\PureLibraries\UserLibraries\ ;
- the thread-safe version, located in %Purebasic%\SubSystems\UserLibThreadSafe\PureLibraries\ .
- the unicode version, located in %Purebasic%\SubSystems\UserLibUnicode\PureLibraries\ .
- the unicode + thread-safe version, located in %Purebasic%\SubSystems\UserLibunicodeThreadSafe\PureLibraries\ .
In order to use this library in thread-safe mode (compiler option /THREAD), you have to enable the
subsystem 'UserLibThreadSafe' in the PB IDE, or add '/SUBSYSTEM UserLibThreadSafe' to the
PBCompiler arguments. In jaPBe, do nothing : it will automatically enable the 'UserLibThreadSafe'
subsystem to use the threadsafe versions of the installed userlibraries.
It's the same logic for unicode and unicode + thread-safe modes.
I you use jaPBe V3, you don't have to (it's automatic).AND51 wrote:But, how to instal and use the Lib?. I don't want to use the Subsystem things. Or do I have to?
If you use the PBIDE, enable the subsystem you need : if you need threadsafe, add "UserLibThreadSafe" in the "Library Subsystem" stringgadget in the "Compiler Options" window.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Scanned all 17 pages but maybe I missed it.
I have the latest lib.
PureColor doesn't work on a multiline button?
result = ButtonGadget(#MenuBar_0_SelectAll, 5, 435, 40, 40, "Select"+Chr(10)+" All",#PB_Button_MultiLine|#BS_FLAT)
Tried several variations on that theme but can't get it to work.
Fine without PureColor.
Is it me? Is it possible?
cheers
I have the latest lib.
PureColor doesn't work on a multiline button?
result = ButtonGadget(#MenuBar_0_SelectAll, 5, 435, 40, 40, "Select"+Chr(10)+" All",#PB_Button_MultiLine|#BS_FLAT)
Tried several variations on that theme but can't get it to work.
Fine without PureColor.
Is it me? Is it possible?
cheers
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
You are right, multiline buttons are not supported. I don't use multiline buttons myself, so I never thought of supporting them.rsts wrote:PureColor doesn't work on a multiline button?
I will see what I can do when I have some time.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
BACKGROUND
=========
I have an array of buttons that double up as string gadgets that report values input via RS232.
The user can click once on a button and this becomes the target for data received from external hardware and I colour it to show the selected item. Then, if the external hardware sends a value it goes to the button, the button background colour is cleared and the text shown in RED.
If the user clicks twice then an editor pops up and he can enter data manually, the background is removed and the value is shown in BLUE.
After the end of the test you can see how many results were supplied automatically or manually.
This all works fine, thanks to your library, and the users like the ability to gain a quick appreciation of how a test sequence is progressing.
The only problem I have left is when the user clicks twice on a RED result, accidently goes into the editor, exits without editing (which I can detect) and I need to re-instate the original RED.
All my problems would go away if I could read back the colours from a button. I cannot think of a better solution... overall its quite a complex program and runs on a tablet PC and there are actually many more interactions than outlined above.
REQUEST
======
Please could PureCOLOR_SetButtonColor() be matched with PureCOLOR_GetButtonColor() ?
If not, could you kindly suggest a less elegant way of getting the colours set into a ButtonGadget().
Thanks in advance...
=========
I have an array of buttons that double up as string gadgets that report values input via RS232.
The user can click once on a button and this becomes the target for data received from external hardware and I colour it to show the selected item. Then, if the external hardware sends a value it goes to the button, the button background colour is cleared and the text shown in RED.
If the user clicks twice then an editor pops up and he can enter data manually, the background is removed and the value is shown in BLUE.
After the end of the test you can see how many results were supplied automatically or manually.
This all works fine, thanks to your library, and the users like the ability to gain a quick appreciation of how a test sequence is progressing.
The only problem I have left is when the user clicks twice on a RED result, accidently goes into the editor, exits without editing (which I can detect) and I need to re-instate the original RED.
All my problems would go away if I could read back the colours from a button. I cannot think of a better solution... overall its quite a complex program and runs on a tablet PC and there are actually many more interactions than outlined above.
REQUEST
======
Please could PureCOLOR_SetButtonColor() be matched with PureCOLOR_GetButtonColor() ?
If not, could you kindly suggest a less elegant way of getting the colours set into a ButtonGadget().
Thanks in advance...
Last edited by RichardL on Fri Oct 27, 2006 3:00 pm, edited 1 time in total.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Ok, on the to-do list.RichardL wrote:REQUEST
======
Please could PureCOLOR_SetButtonColor() be matched with PureCOLOR_GetButtonColor() ?
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:
Update (Both versions)
Changes :
- new function PureCOLOR_GetGadgetColor() ;
- multiline buttons should now be colored correctly (note that PureCOLOR assumes that buttons with #BS_Multiline style are centered (no #BS_Left or #BS_Right style).
Changes :
- new function PureCOLOR_GetGadgetColor() ;
- multiline buttons should now be colored correctly (note that PureCOLOR assumes that buttons with #BS_Multiline style are centered (no #BS_Left or #BS_Right style).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi! I've got a problem with the menu coloring. When activation PureColor for the menu, the MenuItem resets. Maybe i'm missing something.
Here's a quick example that should debug 1,2,3,4,5,6,7,8, etc. But it only debugs from 1 to 3...
Here's a quick example that should debug 1,2,3,4,5,6,7,8, etc. But it only debugs from 1 to 3...
Code: Select all
If OpenWindow(0, 10, 10, 300, 200, "Ownerdraw Menu Demo", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
If CreateMenu(0, WindowID(0))
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()
If event = #PB_Event_Menu
Debug EventMenu()
EndIf
Until event = #PB_Event_CloseWindow
EndIf
End
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
As stated in the help file, PureCOLOR uses it's own menu numbering (see help topics for PureCOLOR_SetMenuItemColors() and PureCOLOR_EventMenuID()). To get the correct event menu id, you have to use PureCOLOR_EventMenuID(). Sorry for this inconvenience.Inf0Byt3 wrote:Hi! I've got a problem with the menu coloring. When activation PureColor for the menu, the MenuItem resets. Maybe i'm missing something.
Here's a quick example that should debug 1,2,3,4,5,6,7,8, etc. But it only debugs from 1 to 3...
Code: Select all
If OpenWindow(0, 10, 10, 300, 200, "Ownerdraw Menu Demo", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
If CreateMenu(0, WindowID(0))
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()
If event = #PB_Event_Menu
Debug EventMenu()
Debug PureCOLOR_EventMenuID()
EndIf
Until event = #PB_Event_CloseWindow
EndIf
End
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).