I guess I am too dependant on your update prog
PureCOLOR library : coloring gadgets (and much more)
Moderator: gnozal
- 
				kinglestat
 - Enthusiast

 - Posts: 746
 - Joined: Fri Jul 14, 2006 8:53 pm
 - Location: Malta
 - Contact:
 
yes, you are right (as usual)
I guess I am too dependant on your update prog
			
			
									
									I guess I am too dependant on your update prog
I may not help with your coding
Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
						Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
It should download the PureCOLOR 4.10 library if you checked 'For PB 4.1x' ?kinglestat wrote:yes, you are right (as usual)
I guess I am too dependant on your update prog
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						gnozal,
I'm using your purecolor and purelvsort libraries. I color the lines with PureCOLOR_SetRowColor() and I use both sorting and filtering.
I noticed two things. One, if the listicon is currently showing colored lines and the user types something in the filterbar, the colors will disappear.
Second, in the same situation as above, sorting does not keep the row colors with the row. The rows sort but the colored lines don't move.
I'm using 4.10 because (a different issue) seems to prevent me from using the filtering function in 4.20.
Thanks!
			
			
									
									
						I'm using your purecolor and purelvsort libraries. I color the lines with PureCOLOR_SetRowColor() and I use both sorting and filtering.
I noticed two things. One, if the listicon is currently showing colored lines and the user types something in the filterbar, the colors will disappear.
Second, in the same situation as above, sorting does not keep the row colors with the row. The rows sort but the colored lines don't move.
I'm using 4.10 because (a different issue) seems to prevent me from using the filtering function in 4.20.
Thanks!
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
Did you try using the cell coloring callback ?Xombie wrote:I noticed two things. One, if the listicon is currently showing colored lines and the user types something in the filterbar, the colors will disappear.
Second, in the same situation as above, sorting does not keep the row colors with the row. The rows sort but the colored lines don't move.
Code: Select all
PureCOLOR_SetCellColorCallback(WindowNumber.l, *ProcedureAddress)The callback procedure is like this :
Code: Select all
Procedure MyCellColorCallback(GadgetNumber.l, CellRow.l, CellColumn.l, *TextColor.LONG, *BackColor.LONG, *FontID.LONG)
 ;
 ; Do Stuff
 ;
EndProcedureOf course, after sorting the rows may have changed and this is not traced by PureLVSORT nor by PureCOLOR.
Note : there are some issues with PB 4.20 beta and 'tailbiten' user librairies. I hope they will be fixed.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
Did you 'register' the listicon before setting the callback ? If not, PureCOLOR doesn't subclass the gadget nor it's parents.Xombie wrote:I tried that and it worked great. .... until I had to move the listicon into a containergadget->panelgadget. Now it seems like the callback isn't being called anymore. Are you aware of any issues for when the listicon is not using the actual window as it's immediate parent?
Code: Select all
Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Panel_0
  #ListIcon_1
EndEnumeration
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Procedure MyCellColorCallback(GadgetNumber.l, CellRow.l, CellColumn.l, *TextColor.Long, *BackColor.Long, *FontID.Long) 
  Debug "MyCellColorCallback() !"
  *BackColor\l = #Blue
  *TextColor\l = #White
EndProcedure
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      PanelGadget(#Panel_0, 25, 35, 365, 300)
        AddGadgetItem(#Panel_0, -1, "Tab #1")
        ListIconGadget(#ListIcon_1, 5, 15, 345, 250, "Gadget_1", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
        AddGadgetColumn(#ListIcon_1, 1, "Column #2", 100)
        AddGadgetColumn(#ListIcon_1, 2, "Column #3", 100)
        SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
        SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
        SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
        AddGadgetItem(#ListIcon_1, -1, "A" + Chr(10) + "B" + Chr(10) + "C")
        AddGadgetItem(#ListIcon_1, -1, "A" + Chr(10) + "B" + Chr(10) + "C")
        AddGadgetItem(#ListIcon_1, -1, "A" + Chr(10) + "B" + Chr(10) + "C")
        AddGadgetItem(#ListIcon_1, -1, "A" + Chr(10) + "B" + Chr(10) + "C")
      CloseGadgetList()
    EndIf
  EndIf
EndProcedure
OpenWindow_Window_0()
PureCOLOR_SetGadgetColor(#ListIcon_1, #PureCOLOR_SystemColor, #PureCOLOR_SystemColor) ; just to register the gadget !!!
PureCOLOR_SetCellColorCallback(#Window_0,  @MyCellColorCallback())
Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEverFor free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
Update V14.02
Changes :
- fixed WM_SETTEXT event for colored buttons
- enhanced multiline support for colored buttons : lines are automatically broken between words if a word would extend past the edge of the button. A CrLf also breaks the line. Note that the button must have the #PB_Button_MultiLine style.
			
			
									
									Changes :
- fixed WM_SETTEXT event for colored buttons
- enhanced multiline support for colored buttons : lines are automatically broken between words if a word would extend past the edge of the button. A CrLf also breaks the line. Note that the button must have the #PB_Button_MultiLine style.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						- Rook Zimbabwe
 - Addict

 - Posts: 4322
 - Joined: Tue Jan 02, 2007 8:16 pm
 - Location: Cypress TX
 - Contact:
 
Gnozal... this is soooo much better! I am truly imnpressed.
I do see some sort of issue in the text placement. It is not always set off at the same angle or placement.
Look at this uncolored example:

When the buttons are colored the text moves around and not in the same way. Some text is truncated with a "..." hyperbole mark. Some text is exactly the same, and some text has an invisible line at the top.

I clear all color from the buttons before coloring them because the button text determines the color (at the moment.) then I simply check button text and color certain buttons. Is there something I can do to justify the text better?
 
			
			
									
									
						I do see some sort of issue in the text placement. It is not always set off at the same angle or placement.
Look at this uncolored example:

When the buttons are colored the text moves around and not in the same way. Some text is truncated with a "..." hyperbole mark. Some text is exactly the same, and some text has an invisible line at the top.

I clear all color from the buttons before coloring them because the button text determines the color (at the moment.) then I simply check button text and color certain buttons. Is there something I can do to justify the text better?
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
I simply fixed a bug ... DrawText_() almost does it all.Rook Zimbabwe wrote:Gnozal... this is soooo much better! I am truly imnpressed.
I am doing 2 things :Rook Zimbabwe wrote:I do see some sort of issue in the text placement. It is not always set off at the same angle or placement.
When the buttons are colored the text moves around and not in the same way. Some text is truncated with a "..." hyperbole mark. Some text is exactly the same, and some text has an invisible line at the top.
Is there something I can do to justify the text better?
1. I am using DrawText_() with this flags :
DT_WORDBREAK : lines are automatically broken between words if a word would extend past the edge of the button. A CrLf also breaks the line.
DT_END_ELLIPSIS : replace characters at the end of the string with ellipses if necessary, so that the result fits in the available space
2. Additionally, I do a vertical centering based on the number of lines. Maybe I can improve this one.
A hint : in order to have the same text placement for colored and uncolored buttons, you could color the uncolored buttons with #PureCOLOR_SystemColor.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						- Rook Zimbabwe
 - Addict

 - Posts: 4322
 - Joined: Tue Jan 02, 2007 8:16 pm
 - Location: Cypress TX
 - Contact:
 
- 
				gnozal
 - PureBasic Expert

 - Posts: 4229
 - Joined: Sat Apr 26, 2003 8:27 am
 - Location: Strasbourg / France
 - Contact:
 
It's a custom made library installer : http://www.purebasic.fr/english/viewtopic.php?t=18514Rook Zimbabwe wrote:#1. What installer are you using for this program, looks interesting?
There isn't. No paypal account.Rook Zimbabwe wrote:#2. Where is the donate link on that web page of yours!
But thank you very much.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
						- Rook Zimbabwe
 - Addict

 - Posts: 4322
 - Joined: Tue Jan 02, 2007 8:16 pm
 - Location: Cypress TX
 - Contact:
 

