Page 25 of 35

Posted: Mon Feb 04, 2008 1:05 pm
by kinglestat
yes, you are right (as usual)
I guess I am too dependant on your update prog :(

Posted: Mon Feb 04, 2008 2:10 pm
by gnozal
kinglestat wrote:yes, you are right (as usual)
I guess I am too dependant on your update prog :(
It should download the PureCOLOR 4.10 library if you checked 'For PB 4.1x' ?

Posted: Wed Feb 20, 2008 9:16 pm
by Xombie
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!

Posted: Thu Feb 21, 2008 8:43 am
by gnozal
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.
Did you try using the cell coloring callback ?

Code: Select all

PureCOLOR_SetCellColorCallback(WindowNumber.l, *ProcedureAddress)
It is much faster than the specialized functions and should (I hope) not show the same issues with sorting.
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
 ;
EndProcedure
So you can colorize / change font any cell / row / column.
Of 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.

Posted: Fri Feb 22, 2008 8:51 pm
by Xombie
gnozal,

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?

Posted: Sat Feb 23, 2008 8:44 am
by gnozal
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?
Did you 'register' the listicon before setting the callback ? If not, PureCOLOR doesn't subclass the gadget nor it's parents.

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
ForEver

Posted: Mon Feb 25, 2008 5:10 pm
by Xombie
Argh, yeah. That was exactly what was needed.

Thanks again for your help and patience, gnozal!

Posted: Tue Feb 26, 2008 3:58 pm
by gnozal
Update V14.01

Changes :
- fixed some issues with XP themes

Posted: Sat Apr 12, 2008 10:13 am
by gnozal
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.

Posted: Sun Apr 13, 2008 3:53 am
by Rook Zimbabwe
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:
Image

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.

Image

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?

8)

Posted: Mon Apr 14, 2008 9:11 am
by gnozal
Rook Zimbabwe wrote:Gnozal... this is soooo much better! I am truly imnpressed.
I simply fixed a bug ... DrawText_() almost does it all.
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?
I am doing 2 things :
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.

Posted: Mon Apr 14, 2008 10:22 am
by gnozal
Update V14.03

Changes :
- improved multiline support for colored buttons (again)

Posted: Mon Apr 14, 2008 2:37 pm
by Rook Zimbabwe
OK that seems to have it working...

Now, two things:

#1. What installer are you using for this program, looks interesting?
#2. Where is the donate link on that web page of yours!
8)

Posted: Mon Apr 14, 2008 2:41 pm
by gnozal
Rook Zimbabwe wrote:#1. What installer are you using for this program, looks interesting?
It's a custom made library installer : http://www.purebasic.fr/english/viewtopic.php?t=18514
Rook Zimbabwe wrote:#2. Where is the donate link on that web page of yours!
There isn't. No paypal account.
But thank you very much.

Posted: Mon Apr 14, 2008 2:44 pm
by Rook Zimbabwe
This is what it looks like now. I can stand the ellipses on that button.

Image

Gnozal... You need a donate link. I haven't made much with mine but people are using that silly little FREEPOS and the restaurant POS and some have even donated $5 - $11

It bought me a beer for my work!

8)