Page 18 of 35

Posted: Mon Jan 29, 2007 12:23 pm
by Inf0Byt3
Hello Gnozal, thanks for the quick reply... Sorry i haven't read the manual, i was used to the old coloring system. Thank you very much for the help!

Posted: Wed Feb 28, 2007 6:27 pm
by oridan
With the PUREColor Lib, the MenuBar() is considered as a MenuItem().
This is bug?
A solution to my problem?

Image with Lib and without Lib
ImageImage

Posted: Thu Mar 01, 2007 9:46 am
by gnozal
oridan wrote:With the PUREColor Lib, the MenuBar() is considered as a MenuItem().
This is bug?
Yes
oridan wrote:A solution to my problem?
Can't think of any right now, sorry.

Posted: Thu Mar 01, 2007 10:00 am
by oridan
gnozal wrote:Can't think of any right now, sorry.
OK, I will wait! Thank you.

Posted: Tue May 01, 2007 11:24 am
by kinglestat
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

Posted: Wed May 02, 2007 7:38 am
by gnozal
kinglestat wrote:I'm trying to use PureCOLOR to set transparent background to checkboxgadget and panelgadget.
Here is an example with a transparent checkbox :

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
;
;}
Note that this feature should only be used with gadgets using the #WM_CTLCOLORSTATIC message like Text/Option/Checkbox.

Posted: Wed May 02, 2007 9:14 am
by Pantcho!!
@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.

Posted: Wed May 02, 2007 10:06 am
by gnozal
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.
If the listicon receives the #LVM_DELETEALLITEMS message, the gadget colors are cleared.

Posted: Wed May 02, 2007 11:11 am
by Pantcho!!
I never used that flag.

Even when i add a new item (a new row) to the gadget

boom the colors returns to default.

Posted: Wed May 02, 2007 12:06 pm
by gnozal
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
;
;}
The color is only cleared if you use ClearGadgetItemList(), not if you use AddGadgetColumn() or AddGadgetItem().

Posted: Wed May 02, 2007 12:53 pm
by Pantcho!!
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.

Posted: Thu May 03, 2007 8:45 am
by kinglestat
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 ?

Posted: Thu May 03, 2007 9:10 am
by gnozal
kinglestat 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 ?
Probably

Posted: Fri May 04, 2007 8:26 am
by kinglestat
hmmmmmm
fair enough
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

cheers

Posted: Fri May 04, 2007 2:38 pm
by gnozal
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
Did you try PureCOLOR_TEST_10.pb in your \Examples\PureCOLOR directory ?