PureCOLOR library : coloring gadgets (and much more)
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Yesoridan wrote:With the PUREColor Lib, the MenuBar() is considered as a MenuItem().
This is bug?
Can't think of any right now, sorry.oridan wrote:A solution to my problem?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- Enthusiast
- Posts: 746
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
I'm trying to use PureCOLOR to set transparent background to checkboxgadget and panelgadget. I tried both with #PureCOLOR_DontSetBackColor and as well with PureCOLOR_SetGadgetColorEx ( gadget, #Black, #PureCOLOR_DontSetBackColor, ImageId, #PureCOLOR_BackgroundImage )
With Ex my app crashes
Any ideas ?
cheers
KingLestat
With Ex my app crashes
Any ideas ?
cheers
KingLestat
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Here is an example with a transparent checkbox :kinglestat wrote:I'm trying to use PureCOLOR to set transparent background to checkboxgadget and panelgadget.
Code: Select all
;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#Window_0_CheckBox_0
EndEnumeration
;}
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 439, 196, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
If CreateGadgetList(WindowID(#Window_0))
CheckBoxGadget(#Window_0_CheckBox_0, 88, 161, 238, 49, "Gadget_0")
; Gadget Colors
PureCOLOR_SetGadgetColor(#Window_0_CheckBox_0, #PureCOLOR_SystemColor, #PureCOLOR_DontSetBackColor)
; Window Backcolor
PureCOLOR_SetWindowColor(#Window_0, $FF)
EndIf
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #Window_0_CheckBox_0
EndIf
; //////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
Forever
;
;}
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
@gnozal
I have loaded a PB 3.94 source code and i don't remember if i updated my PureColor Lib but as i checked it seems i have the latest.
But when running the source (HUGE PROJECT)
I used your PureCOLOR_SetGadgetColorEx() Command with the
#PureCOLOR_LV_AlternateColors2 Flag.
It ran the code and it did'nt work.
Ran the examples code and it worked.
so i started to play and then i realized
when you update the ListIconGadget the whole setting is going back to default.
So i had to force the PureCOLOR_SetGadgetColorEx() each time i update the list.
Is this suppose to be like that in the recent versions?
Because before i was just needed to assign this command to my ListIcon and thats it.
thanks.
I have loaded a PB 3.94 source code and i don't remember if i updated my PureColor Lib but as i checked it seems i have the latest.
But when running the source (HUGE PROJECT)
I used your PureCOLOR_SetGadgetColorEx() Command with the
#PureCOLOR_LV_AlternateColors2 Flag.
It ran the code and it did'nt work.
Ran the examples code and it worked.
so i started to play and then i realized
when you update the ListIconGadget the whole setting is going back to default.
So i had to force the PureCOLOR_SetGadgetColorEx() each time i update the list.
Is this suppose to be like that in the recent versions?
Because before i was just needed to assign this command to my ListIcon and thats it.
thanks.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
If the listicon receives the #LVM_DELETEALLITEMS message, the gadget colors are cleared.Pantcho!! wrote:I have loaded a PB 3.94 source code and i don't remember if i updated my PureColor Lib but as i checked it seems i have the latest.
when you update the ListIconGadget the whole setting is going back to default.
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:
!?Pantcho!! wrote:I never used that flag.
Even when i add a new item (a new row) to the gadget
boom the colors returns to default.
Do you have some code example ?
Look at the code below (PB3.94) :
Code: Select all
;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#ListIcon_0_Gadget0
EndEnumeration
;}
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 400, 400, #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar, "Window_0")
If CreateGadgetList(WindowID(#Window_0))
ListIconGadget(#ListIcon_0_Gadget0, 11, 5, 382, 382, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetItem(#ListIcon_0_Gadget0, -1, "line 1")
AddGadgetItem(#ListIcon_0_Gadget0, -1, "line 2")
AddGadgetItem(#ListIcon_0_Gadget0, -1, "line 3")
AddGadgetItem(#ListIcon_0_Gadget0, -1, "line 4")
SendMessage_(GadgetID(#ListIcon_0_Gadget0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
; Gadget Colors
PureCOLOR_SetGadgetColorEx(#ListIcon_0_Gadget0, #PureCOLOR_SystemColor, $8000, $80FF, #PureCOLOR_LV_AlternateColors)
EndIf
EndIf
EndProcedure
OpenWindow_Window_0()
;ClearGadgetItemList(#ListIcon_0_Gadget0) ; color is cleared
AddGadgetColumn(#ListIcon_0_Gadget0, 1, "New column", 100) ; color is not cleared
AddGadgetItem(#ListIcon_0_Gadget0, -1, "line 5") ; color is not cleared
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadgetID()
EventType = EventType()
If EventGadget = #ListIcon_0_Gadget0
EndIf
; //////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindowID()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Thanks for you help, you code works fine.
I think i have somthing in my old code that causes it to go back to default
Maybe somthing in my callbacks or maybe because i use Paul purevision gadgets libs also in that project... (as i said its old)
Never mind, just wanted to clear this thing.
Problem in my side.
Thanks.
I think i have somthing in my old code that causes it to go back to default
Maybe somthing in my callbacks or maybe because i use Paul purevision gadgets libs also in that project... (as i said its old)
Never mind, just wanted to clear this thing.
Problem in my side.
Thanks.
-
- Enthusiast
- Posts: 746
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Probablykinglestat wrote:Hi gnozal
I figured out the problem
If I turn off "XP Skin support", it comes out transparent
Is there an incompatibility with XP skins ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- Enthusiast
- Posts: 746
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Did you try PureCOLOR_TEST_10.pb in your \Examples\PureCOLOR directory ?kinglestat wrote:Is there or can somebody provide an example using the PureCOLOR_SetGadgetColorEx function with #PureCOLOR_BackgroundImage as I only managed to crash with trying it out
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).