PureCOLOR library : coloring gadgets (and much more)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

is it possible to add one more function to your lib, so that we can change the font of a headercolumn to bold or to a new font?

thx and regards,
Nico
Last edited by nicolaus on Wed Jun 28, 2006 3:23 pm, edited 1 time in total.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

gnozal wrote:
Pantcho!! wrote:what is an owner draw? :?
I mean drawing all the stuff by yourself ... instead of only telling windows what color it should use.
Thats why i asked you :wink:
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:@gnozal

is it possible to add one more function to your lib, so that we can change the font of a headercolumn to bold or to a new font?

thx and regards,
Nico
Ok, for the next version.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update V12.20 (both libs : PB3.94 and PB4.0x)

Changes :
- added Font.l argument to PureCOLOR_SetColumnHeaderColor()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

gnozal wrote:Update V12.20 (both libs : PB3.94 and PB4.0x)

Changes :
- added Font.l argument to PureCOLOR_SetColumnHeaderColor()
very thx for the fast insert of the parameter font.l
i love your lib and you do a very nice job!!!
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

you have a bug in the function PureCOLOR_SetColumnHeaderColor().

I have a ListIconGadget in a PanelGadget and if i change the panelitem and go back to the item with the listicongadget it loos all colors and headercolors.
This prob is only if i use the PureCOLOR_SetColumnHeaderColor() function in this listicon.
Without the function PureCOLOR_SetColumnHeaderColor and and only the functions PureCOLOR_SetGadgetColorEx() it works nice.

regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:@gnozal
I have a ListIconGadget in a PanelGadget and if i change the panelitem and go back to the item with the listicongadget it loos all colors and headercolors.
Seems to work here (no problems when changing tabs) :

Code: Select all

OpenWindow(0, 100, 300, 400, 250, "PureCOLOR test", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
If CreateGadgetList(WindowID(0))
  PanelGadget(10, 0, 0, 400, 250)
  AddGadgetItem(10, -1, "Test 1")
  ; Tab 1
  StringGadget(1, 10, 10, 90, 20, "StringGadget 1")
  ListIconGadget(2, 10, 40, 150, 100, "1", 100, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
  AddGadgetColumn(2, 1, "2", 50)
  AddGadgetColumn(2, 2, "3", 50)
  AddGadgetItem(2, -1, "ListIconGadget 2-1" + Chr(10) + "A" + Chr(10) + "F")
  AddGadgetItem(2, -1, "ListIconGadget 2-2" + Chr(10) + "B" + Chr(10) + "G")
  AddGadgetItem(2, -1, "ListIconGadget 2-3" + Chr(10) + "C" + Chr(10) + "H")
  AddGadgetItem(2, -1, "ListIconGadget 2-4" + Chr(10) + "D" + Chr(10) + "I")
  AddGadgetItem(2, -1, "ListIconGadget 2-5" + Chr(10) + "E" + Chr(10) + "J")
  TextGadget(3, 10, 160, 300, 30, "TextGadget 3", #PB_Text_Center)
  ButtonGadget(4, 200, 10, 80, 20, "Button 4")
  ;PureRESIZE_SetGadgetResize(4, #True, #True, #True, #True)
  ComboBoxGadget(5, 295, 10, 100, 100)
  AddGadgetItem(5, -1, "ComboBox 5-1")
  AddGadgetItem(5, -1, "ComboBox 5-2")
  SetGadgetState(5, 0)
  CheckBoxGadget(6, 110, 10, 80, 20, "CheckBox 6")
  ListViewGadget(7, 160, 40, 150, 100, #PB_ListIcon_GridLines)
  AddGadgetItem(7, -1, "ListViewGadget 7-1")
  AddGadgetItem(7, -1, "ListViewGadget 7-2")
  AddGadgetItem(7, -1, "ListViewGadget 7-3")
  ; Tab 2
  AddGadgetItem(10, -1, "Test 2")
  CloseGadgetList()
EndIf
; Adding colors
PureCOLOR_SetGadgetColor(1, RGB(255,0,0), -1)
PureCOLOR_SetGadgetColorEx(2, RGB(0,0,0), RGB(255, 255, 255), RGB(255, 255, 223), #PureCOLOR_LV_AlternateColors2)
PureCOLOR_SetGadgetColor(3, RGB(255,0,0), RGB(0,0,0))
PureCOLOR_SetButtonColor(4, RGB(255,0,0), RGB(0,255,0), #Green, #Yellow)
PureCOLOR_SetGadgetColor(5, RGB(255,0,0), RGB(255,255,0))
PureCOLOR_SetGadgetColor(6, RGB(255,255,0), -1)
PureCOLOR_SetGadgetColor(7, RGB(255,0,0), RGB(100,100,0))
PureCOLOR_SetGadgetColorEx(2, RGB(255,0,0), RGB(0,255,0), 0, #PureCOLOR_LTV_SelectedItem)
PureCOLOR_SetColumnHeaderColor(2, 0, RGB(255,0,0), RGB(100,100,0), LoadFont(0, "Courrier New", 8, #PB_Font_Bold))
;
Repeat 
  EventID = WaitWindowEvent() 
Until EventID = #PB_Event_CloseWindow 
;
End
Or maybe I misunderstood ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

nicolaus, are you using the up-to-date, current version of pb4? There were some refresh problems with panels in earlier versions of pb4 and we had to write manual refreshes (Force windows to do a repaint) to make them work.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

i have the same prob if i have the listicon in a conatinergadget().
If i have hide the container and reshow it the color settings are loost.

Here you can see a small avi video with the prob
PureCOLOR prob

regrads,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:@gnozal

i have the same prob if i have the listicon in a conatinergadget().
If i have hide the container and reshow it the color settings are loost.

Here you can see a small avi video with the prob
PureCOLOR prob

regrads,
Nico
Sorry, I could not play the AVI (missing codecs ?).
Does the above posted code work for you (listicon inside a panel) ?
A peace of code would sure help.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

I have the ListIcon in a ContainerGadget() not in a PanelGadget sorry.

Ok now i hafe the video as a flashmovie in a html-page so that you can see wat i mean.
here is the link:
PureColor prob

[EDIT]All the colors aof the listicons are set with you lib PureCOLOR[/EDIT]

regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

@nicolaus
I still can't reproduce the problem.
Have a look at this code :

Code: Select all

OpenWindow(0, 100, 300, 400, 250, "PureCOLOR test", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
If CreateGadgetList(WindowID(0))
  StringGadget(1, 10, 10, 90, 20, "StringGadget 1")
  ContainerGadget(11, 10, 40, 150, 100, #PB_Container_Raised)
  ListIconGadget(2, 0, 0, 150, 100, "1", 100, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
  AddGadgetColumn(2, 1, "2", 50)
  AddGadgetColumn(2, 2, "3", 50)
  AddGadgetItem(2, -1, "ListIconGadget 2-1" + Chr(10) + "A" + Chr(10) + "F")
  AddGadgetItem(2, -1, "ListIconGadget 2-2" + Chr(10) + "B" + Chr(10) + "G")
  AddGadgetItem(2, -1, "ListIconGadget 2-3" + Chr(10) + "C" + Chr(10) + "H")
  AddGadgetItem(2, -1, "ListIconGadget 2-4" + Chr(10) + "D" + Chr(10) + "I")
  AddGadgetItem(2, -1, "ListIconGadget 2-5" + Chr(10) + "E" + Chr(10) + "J")
  CloseGadgetList()
  TextGadget(3, 10, 160, 300, 30, "TextGadget 3", #PB_Text_Center)
  ButtonGadget(4, 200, 10, 80, 20, "Button 4")
  ComboBoxGadget(5, 295, 10, 100, 100)
  AddGadgetItem(5, -1, "ComboBox 5-1")
  AddGadgetItem(5, -1, "ComboBox 5-2")
  SetGadgetState(5, 0)
  CheckBoxGadget(6, 110, 10, 80, 20, "CheckBox 6")
  ListViewGadget(7, 160, 40, 150, 100, #PB_ListIcon_GridLines)
  AddGadgetItem(7, -1, "ListViewGadget 7-1")
  AddGadgetItem(7, -1, "ListViewGadget 7-2")
  AddGadgetItem(7, -1, "ListViewGadget 7-3")
  CloseGadgetList() 
EndIf
; Adding colors
PureCOLOR_SetGadgetColor(1, RGB(255,0,0), -1)
;_PureCOLOR_SetGadgetColor(2, RGB(0,255,0), -1)
PureCOLOR_SetGadgetColorEx(2, RGB(0,0,0), RGB(255, 255, 255), RGB(255, 255, 223), #PureCOLOR_LV_AlternateColors2)
PureCOLOR_SetGadgetColor(3, RGB(255,0,0), RGB(0,0,0))
PureCOLOR_SetButtonColor(4, RGB(255,0,0), RGB(0,255,0), #Green, #Yellow)
PureCOLOR_SetGadgetColor(5, RGB(255,0,0), RGB(255,255,0))
PureCOLOR_SetGadgetColor(6, RGB(255,255,0), #PureCOLOR_DontSetBackColor)
PureCOLOR_SetGadgetColor(7, RGB(255,0,0), RGB(100,100,0))
PureCOLOR_SetGadgetColorEx(2, RGB(255,0,0), RGB(0,255,0), 0, #PureCOLOR_LTV_SelectedItem)
PureCOLOR_SetColumnHeaderColor(2, 0, RGB(255,0,0), RGB(100,100,0))
PureCOLOR_SetCellColor(2, 1, 1, #Red, #Black)
;
Repeat 
  EventID = WaitWindowEvent() 
  If EventID = #PB_Event_Gadget
    If EventGadget() = 4
      toggle ! 1
      HideGadget(11, toggle)
    EndIf
  EndIf
Until EventID = #PB_Event_CloseWindow 
;
End
The listicon is in a container. Press the button to hide/show the container. The colors are not lost (at least on my Windows 98SE system) when showing the listicon after it was hidden it.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update (PB4.00 lib only)

- PB4.00 code was out of synch : it's now the same as the PB3.94 lib (except for the PB4.00 specificities).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Hi Gnozal, any chances to add this feature to your lib?

http://www.purebasic.fr/english/viewtopic.php?t=22557

Thanks.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Inf0Byt3 wrote:Hi Gnozal, any chances to add this feature to your lib?

http://www.purebasic.fr/english/viewtopic.php?t=22557

Thanks.
Did you download the latest version of PureCOLOR and tried #PureCOLOR_DontSetBackColor as BackColor for your TextGagdet ?
If it don't work, please post a code example.
Note that some features don't work with XP themes.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply