Page 6 of 35

Posted: Wed Apr 06, 2005 1:26 pm
by gnozal
DoubleDutch wrote:This code should demonstrate the drawing...
Oh yes, with drawing you can do everything ... I am using it for the buttons, but I hate it :D (feels not 'clean' to me) ...

Here are some (working) examples :
viewtopic.php?t=14334&start=0&postdays= ... r+selected
viewtopic.php?t=13226&start=0&postdays= ... r+selected

I will see if I can do it for the next version.

Posted: Sat Apr 09, 2005 9:12 pm
by Shannara
1.) The coloring of string gadget does not work for me if string gadget is borderless and read-only.

2.) The alternating coloring of cells/rows does not work over here.

This is using the newest PB/Win, XP Pro (themes disabled).

Posted: Mon Apr 11, 2005 7:43 am
by gnozal
Shannara wrote:1.) The coloring of string gadget does not work for me if string gadget is borderless and read-only.

2.) The alternating coloring of cells/rows does not work over here.

This is using the newest PB/Win, XP Pro (themes disabled).
Any code please ?

Posted: Wed Apr 13, 2005 7:52 am
by gnozal
Library update
- new feature : added ProgressBarGadget and EditorGadget support for PureCOLOR_SetGadgetColor()

Code: Select all

Procedure.l WindowCallBack(WindowId.l, Message.l, wParam.l, lParam.l)
  ReturnValue = #PB_ProcessPureBasicEvents
  ;
  ReturnValue = PureCOLOR_CallBack(WindowId, Message, wParam, lParam, ReturnValue)
  ;
  ProcedureReturn ReturnValue
EndProcedure
Enumeration
  #Window
  #Gadget
  #Edit
EndEnumeration
If OpenWindow(#Window, 200, 200, 300, 200, #PB_Window_SystemMenu  | #PB_Window_TitleBar , "ProgressBar & RichEdit")
  If CreateGadgetList(WindowID())
    ProgressBarGadget(#Gadget, 50, 10, 190, 20, 0, 100 ,#PB_ProgressBar_Smooth)
    PureCOLOR_SetGadgetColor(#Gadget, RGB(51, 100, 153), RGB(255, 204, 51))
    SetGadgetState(#Gadget, 50)
    EditorGadget(#Edit, 10, 40, 280, 140)
    SetGadgetText(#Edit, "This is text!")
    PureCOLOR_SetGadgetColor(#Edit, RGB(255, 255, 255), RGB(255, 0, 255))
  EndIf
  Repeat
    Event  = WaitWindowEvent()
  Until Event  = #PB_EventCloseWindow
EndIf

Posted: Wed Apr 13, 2005 10:43 am
by DoubleDutch
nice :D

Posted: Sat Apr 23, 2005 8:10 pm
by Flype
just a little bug ( or missing feature ) :

the function PureCOLOR_SetGadgetColorEx(#Gadget,$000000,$FFFFFF,0,#PureCOLOR_LTV_SelectedItem) doesn't work when applied on a ListIconGadget() created with the flag #PB_ListIcon_AlwaysShowSelection.

Posted: Sat Apr 23, 2005 10:04 pm
by Le Soldat Inconnu
an other bug, the textgadget is not colored if it's in a panelgadget

just text this :

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, 250, #PB_Window_SystemMenu, "PureCOLOR test") 
SetWindowCallback(@WindowCallBack()) 
If CreateGadgetList(WindowID()) 
  PanelGadget(10, 0, 0, 400, 250)
  AddGadgetItem(10, 0, "Test")
  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)
  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_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

Posted: Sat Apr 23, 2005 10:44 pm
by Flype
soldat inconnu:
this one works for me with the lastest PureCOLOR.zip :roll:

Posted: Mon Apr 25, 2005 9:59 am
by gnozal
Flype wrote:soldat inconnu:
this one works for me with the lastest PureCOLOR.zip :roll:
It works for me too :roll:

Posted: Mon Apr 25, 2005 10:54 am
by gnozal
Flype wrote:just a little bug ( or missing feature ) : the function PureCOLOR_SetGadgetColorEx(#Gadget,$000000,$FFFFFF,0,#PureCOLOR_LTV_SelectedItem) doesn't work when applied on a ListIconGadget() created with the flag #PB_ListIcon_AlwaysShowSelection.
You are right :( I haven't tested this one.
Fixed (almost :wink:) : the selected item is now colored but the selection is not shown if the gadget has not the focus (uItemState is not #CDIS_SELECTED / #CDIS_FOCUS).

Posted: Fri May 20, 2005 1:42 am
by Phant0m``

Code: Select all

AppColors.s="RGB(128,0,0).$000000.$F1FCE3.$000000"

PureCOLOR_SetGadgetColor(#Gadget,$000000,StringField(AppColors,3,"."))
I’m stumped to why the use of StringField(AppColors,3,".") is giving PureCOLOR problems using correct hex colors.

:?

Posted: Fri May 20, 2005 7:57 am
by gnozal
Phant0m`` wrote:

Code: Select all

AppColors.s="RGB(128,0,0).$000000.$F1FCE3.$000000"

PureCOLOR_SetGadgetColor(#Gadget,$000000,StringField(AppColors,3,"."))
I’m stumped to why the use of StringField(AppColors,3,".") is giving PureCOLOR problems using correct hex colors.
:?
It is not a bug.
PureCOLOR _SetGadgetColor() expects a LONG, not a STRING, and StringField() returns a string ...

Posted: Fri May 20, 2005 12:56 pm
by Phant0m``
I tried everything all yesterday to change it to LONG, but it all messy up on me, so it is impossible to extract from a variable and use as a LONG?

Posted: Fri May 20, 2005 2:39 pm
by Phant0m``
I came up with a workaround, little bit of additional code involved, but she works all the same. :lol:

Posted: Wed Jun 08, 2005 8:44 pm
by Pantcho!!
:shock: :shock: :shock: :shock: :shock:

What about transparent Background Color?

an important factor to such a great special library!!

(great for stringgadget's)