Page 7 of 35

Posted: Thu Jun 09, 2005 8:01 am
by gnozal
Pantcho!! wrote:What about transparent Background Color?
an important factor to such a great special library!! (great for stringgadget's)
You mean StringGadget backcolor = window background color ?

Posted: Thu Jun 09, 2005 12:43 pm
by Pantcho!!
Ok maybe i didnt explain myself so good, lets say i setup a windowbackground IMAGE doesnt matter which color i will use in textgadget it will do a box around the window image background.

in short:
i have a window background image
set the textgadget background color transparent so only the foreground color will show with my nice window background.

if this is possible this lib is perfect.

Posted: Thu Jun 09, 2005 3:08 pm
by gnozal
Pantcho!! wrote:set the textgadget background color transparent so only the foreground color will show with my nice window background.
if this is possible this lib is perfect.
Transparent is not possible I think, but it is possible to set the textgadget background color accordingly to the image color (so it looks transparent).
Maybe for the next version.

Posted: Fri Jun 10, 2005 9:34 am
by Pantcho!!
gnozal wrote:Maybe for the next version.
:P :lol:

Posted: Tue Jul 05, 2005 2:47 pm
by oldBear
Wow - I'm new to purebasic and had noticed in the documentation that font colors were not supported.

This routine is fantastic :P

Many thanks for the support. I hope this is indicative of user base support. If so, I'll be a happy camper.

cheers
oldBear

Posted: Tue Jul 05, 2005 2:54 pm
by gnozal
oldBear wrote:This routine is fantastic :P
Many thanks for the support. I hope this is indicative of user base support. If so, I'll be a happy camper.
Thank you 8)
And wellcome to Purebasic !

Posted: Wed Aug 10, 2005 10:22 pm
by TerryHough
Question: When I change the color of the window, the background color
of text gadgets, frame labels, and string gadgets (at least) does not change.

You can see this by running a slightly modifed version of your example:

Code: Select all

;
;             PureCOLOR library test file 1
;
; --------------------------------------------------------
;
; Set CallBack
Procedure.l WindowCallBack(WindowID.l, Message.l, wParam.l, lParam.l) 
  ReturnValue.l = #PB_ProcessPureBasicEvents
  ;
  ReturnValue = PureCOLOR_CallBack(WindowID, Message, wParam, lParam, ReturnValue) ; <-------- add this line in your window callback
  ;
  ProcedureReturn ReturnValue 
EndProcedure
; Create Window
OpenWindow(0, 100, 300, 400, 200, #PB_Window_SystemMenu, "PureCOLOR test") 
SetWindowCallback(@WindowCallBack()) 
If CreateGadgetList(WindowID()) 
  StringGadget(1, 10, 10, 90, 20, "StringGadget 1")
  ListIconGadget(2, 10, 40, 150, 100, "", 146, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect)
  AddGadgetItem(2, -1, "ListIconGadget 2-1")
  AddGadgetItem(2, -1, "ListIconGadget 2-2")
  AddGadgetItem(2, -1, "ListIconGadget 2-3")
  AddGadgetItem(2, -1, "ListIconGadget 2-4")
  AddGadgetItem(2, -1, "ListIconGadget 2-5")
  TextGadget(3, 10, 160, 300, 30, "TextGadget 3", #PB_Text_Center)
  DisableGadget(3,#TRUE)
  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")
EndIf
; Adding colors
PureCOLOR_SetWindowColor(0, RGB(249, 248, 158)) 

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_AlternateColors)
;PureCOLOR_SetGadgetColor(3, RGB(255,0,0), RGB(0,0,0))
PureCOLOR_SetButtonColor(4, RGB(255,0,0), RGB(0,255,0))
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_ClearGadgetColor(2)
;
Repeat 
Until WaitWindowEvent() = #PB_EventCloseWindow 
;
End
and looking at the TextGadget(3)

Is there a way using PureCOLOR to make the background default to
transparent instead of grey?

Thanks
Terry

Posted: Thu Aug 11, 2005 8:48 am
by gnozal
TerryHough wrote:Is there a way using PureCOLOR to make the background default to transparent instead of grey? Thanks Terry
In the current version, no.
However, in the current beta, if you specify BackColor = #PureCOLOR_DontSetBackColor, the gadget back color is the current window color, so it simulates transparency.

Posted: Fri Aug 12, 2005 7:42 am
by gnozal
Library update

Whats new :
- PureCOLOR_SetGadgetColor : if BackColor = #PureCOLOR_DontSetBackColor, BackColor is the parent window color (simulates transparency)
- PureCOLOR_SetGadgetColorEx : new flag #PureCOLOR_BackgroundImage : gadget's backcolor is image color (simulates transparency)

Special Terry version ;-)

Posted: Fri Aug 12, 2005 5:27 pm
by TerryHough
Thanks for the update.

It even works with Frame3DGadget() better than I had been able to
accomplish, a bonus.

Posted: Thu Sep 08, 2005 1:19 pm
by gnozal
Library update

What's new :
- new function : PureCOLOR_SetPopupMenuBackColor()
- new function : PureCOLOR_ClearAllColorsForGadget()
- new function : PureCOLOR_RedrawGadgetAfterColor()
- new feature : column headers now also use dynamic coordinates
- new feature : PureCOLOR_SetButtonColor() has extra colors (when button is pushed) and #PB_Button_Toggle support

Code: Select all

; Create Window 
OpenWindow(0, 100, 300, 310, 40, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "PureCOLOR button test") 
If CreateGadgetList(WindowID()) 
  ButtonGadget(3, 10, 10, 80, 20, "Normal") 
  ButtonGadget(4, 210, 10, 80, 20, "Extra + Toggle", #PB_Button_Toggle) 
  ButtonGadget(6, 110, 10, 80, 20, "Extra Colors") 
EndIf 
; Adding colors 
PureCOLOR_SetButtonColor(3, RGB(255,0,255), RGB(0,255,255)) 
PureCOLOR_SetButtonColor(4, RGB(255,0,0), RGB(0,255,0), RGB(255,127,0), RGB(255,255,0)) 
;PureCOLOR_SetButtonColor(6, RGB(255,0,0), RGB(0,255,0), RGB(255,127,0), RGB(255,255,0)) 
PureCOLOR_SetButtonColor(6, RGB(255,0,0), #PureCOLOR_SystemColor, RGB(255,0,0), #PureCOLOR_SystemColor) 
; 
Repeat 
Until WaitWindowEvent() = #PB_EventCloseWindow 
End

Posted: Thu Sep 08, 2005 10:59 pm
by DoubleDutch
Will you be adding colouring to menus?

Posted: Fri Sep 09, 2005 7:42 am
by gnozal
DoubleDutch wrote:Will you be adding colouring to menus?
PureCOLOR_SetPopupMenuBackColor() may also work for menu (I didn't test it). If not, I will fix it.
If you mean full color support (menu textcolor, etc...), probably not ; but who knows ?

Posted: Fri Sep 09, 2005 10:23 am
by DoubleDutch
I mean menu text colour, if you want i can try to provide some code to do it if it helps?

Posted: Fri Sep 09, 2005 10:41 am
by gnozal
DoubleDutch wrote:I mean menu text colour, if you want i can try to provide some code to do it if it helps?
You mean owner draw menus ?
They don't seem to work very well under Win9x or WinNT4, and I don't have Win2k/XP (yet ?). Of course, if you have some code that works with older OS, I could use it.