Page 19 of 35

Posted: Fri May 04, 2007 5:11 pm
by kinglestat
me dumb, you thanks

cheers

Posted: Thu May 24, 2007 2:52 pm
by gnozal
Update

Extra version for PB4.10 : http://freenet-homepage.de/gnozal/PureCOLOR__.zip

Posted: Fri May 25, 2007 2:12 pm
by GG
Is PB 4.10 out ?

Posted: Fri May 25, 2007 2:21 pm
by DoubleDutch
Shhhhh... Little pigs have big ears! ;)

Edit: May 31st - Its out now!!!

Posted: Fri Jun 01, 2007 9:18 am
by dige
Using PureColorLib for PB4.10

and

PureCOLOR_SetGadgetColor(GadgetID, $A00000, $E0E0E0)

results a PoLink Error:

Image

PB 4.10 Compiler Options:

[x] ThreadSafe
[x] OnError Support
[x] XP-Skin

Posted: Fri Jun 01, 2007 12:02 pm
by gnozal
dige wrote:Using PureColorLib for PB4.10

and

PureCOLOR_SetGadgetColor(GadgetID, $A00000, $E0E0E0)

results a PoLink Error:


PB 4.10 Compiler Options:

[x] ThreadSafe
[x] OnError Support
[x] XP-Skin
Seems to work here.
Did you enabled the 'UserLibThreadSafe' subsystem ?

Posted: Fri Jun 01, 2007 12:43 pm
by dige
I guess not ... 've just enabled the [x] Threadsafe checkbox ... :?

Posted: Fri Jun 01, 2007 12:51 pm
by gnozal
dige wrote:I guess not ... 've just enabled the [x] Threadsafe checkbox ... :?
Are you using jaPBe or PB IDE ?
jaPBe should automatically restart the compiler to enable the 'UserLibThreadSafe' subsystem if you compile a threadsafe executable (you get a 'PB4 Flags : /UserLibThreadSafe' message in the log).
With PB IDE, you have to enable it manually I guess.

Posted: Fri Jun 01, 2007 1:20 pm
by dige
Yes! With jaPBe it works fine.

But how to use a SubSystem with PB-IDE?
Seems not mentioned in the help docs ...

Posted: Fri Jun 01, 2007 1:51 pm
by gnozal
dige wrote:Yes! With jaPBe it works fine.

But how to use a SubSystem with PB-IDE?
Seems not mentioned in the help docs ...
PureCOLOR help :
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.
In PB IDE, add "UserLibThreadSafe" to the 'Library subsystem :' stringadget in 'Compiler options' and it should work.

Posted: Fri Jun 01, 2007 3:07 pm
by Pantcho!!
@Gnozal

Remember my little problem with #PureCOLOR_LV_AlternateColors?

Well here is a simple code to show you what happens

PB4 code (the same happens with pb 3.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, "okok" , #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    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 = EventGadget()
      EventType = EventType()
      If EventGadget = #ListIcon_0_Gadget0
        MessageRequester("","check this out")
        ClearGadgetItemList(#ListIcon_0_Gadget0)
        For x = 1 To 10
          AddGadgetItem(#ListIcon_0_Gadget0,-1,"line " + Str(x))
        Next
        MessageRequester("","Colors are gone")
      EndIf
      
      ; //////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver
;
;}
Thanks.

Posted: Fri Jun 01, 2007 3:21 pm
by gnozal
Pantcho!! wrote:@Gnozal

Remember my little problem with #PureCOLOR_LV_AlternateColors?

Well here is a simple code to show you what happens
Sure.
I also remember my answer :wink: :
gnozal wrote:
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.
Explanation : ClearGadgetItemList() sends a #LVM_DELETEALLITEMS message
Workaround : define the colors again after ClearGadgetItemList().

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, "okok" , #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar) 
    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 = EventGadget() 
      EventType = EventType() 
      If EventGadget = #ListIcon_0_Gadget0 
        MessageRequester("","check this out") 
        ClearGadgetItemList(#ListIcon_0_Gadget0) 
        ; gnozal
        PureCOLOR_SetGadgetColorEx(#ListIcon_0_Gadget0, #PureCOLOR_SystemColor, $8000, $80FF, #PureCOLOR_LV_AlternateColors)
        ;
        For x = 1 To 10 
          AddGadgetItem(#ListIcon_0_Gadget0,-1,"line " + Str(x)) 
        Next 
        MessageRequester("","Colors are not gone") 
      EndIf 
      
      ; ////////////////////// 
    Case #PB_Event_CloseWindow 
      EventWindow = EventWindow() 
      If EventWindow = #Window_0 
        CloseWindow(#Window_0) 
        Break 
      EndIf 
  EndSelect 
ForEver 
; 
;}

Posted: Fri Jun 01, 2007 4:22 pm
by Pantcho!!
Any chance to add Alternate3 and Alternate4 to make it when you clear the list it wont happen?

Just if you can or want.

Posted: Fri Jun 01, 2007 4:25 pm
by gnozal
Pantcho!! wrote:Any chance to add Alternate3 and Alternate4 to make it when you clear the list it wont happen?
You just have to add one little line ...

Posted: Fri Jun 01, 2007 10:20 pm
by Pantcho!!
I understand that but just to make it clear,
this was not the case in earlier versions of purecolor right?
cuz all my projects i use these flags just happen to get the colors cleared
and i have many procedures that updates the list and clearing it (i am talking about projects with 3 - 6 include files).

so adding this line after each clear will be a huge work to do but if there is no choice :)

again thanks for your great libs!