PureCOLOR library : coloring gadgets (and much more)

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

Moderator: gnozal

User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

thanx gnozal - good news !

what about make some new commands, based upon these posts ?

scrollbars :
viewtopic.php?t=14410

and this one, coloring a scrollareagadget :
viewtopic.php?t=13074&highlight=scrollarea+color+colour

containergadgets :
viewtopic.php?p=72952#72952

Best regards
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Flype wrote:thanx gnozal - good news !
Thanks 8)
Flype wrote:what about make some new commands, based upon these posts ?
scrollbars :
viewtopic.php?t=14410
and this one, coloring a scrollareagadget :
viewtopic.php?t=13074&highlight=scrollarea+color+colour
containergadgets :
viewtopic.php?p=72952#72952
Best regards
I never thought about these ! I was planning to add some more listicon and some richedit coloring functions. I will see ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Manolo
User
User
Posts: 75
Joined: Fri Apr 25, 2003 7:06 pm
Location: Spain

Post by Manolo »

gnozal wrote:
Flype wrote:thanx gnozal - good news !
Thanks 8)
Flype wrote:what about make some new commands, based upon these posts ?
scrollbars :
viewtopic.php?t=14410
and this one, coloring a scrollareagadget :
viewtopic.php?t=13074&highlight=scrollarea+color+colour
containergadgets :
viewtopic.php?p=72952#72952
Best regards
I never thought about these ! I was planning to add some more listicon and some richedit coloring functions. I will see ...
And panelgadgets (tabs)???

Thanks gnozal :twisted:
Return to the forum
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

gnozal: Are you planning to add tree gadgets?

-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

LOL

lot's of work gnozal :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

hehe :D
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Flype wrote:LOL
lot's of work gnozal :wink:
Yes, I see :shock:
I have no great plan. I am adding what I need in my apps, that all. And I am glad to add some user requests too, if it isn't to complicated :oops: I am not a professional programmer, it is only a hobby to me :wink:
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes but your libs are quite useful for professional programmers to :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Library update
- new feature : now PureCOLOR_SetGadgetColor() works for ContainerGadget and ScrollAreaGadget (only BackColor is used)
- new function : PureCOLOR_SetColumnHeaderColor()
- new function : PureCOLOR_ClearColumnHeaderColor()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Great job!
Would be great if you state (for each command) the effect in the various Windows version. (I imagine that someone works with XP skinned, some doesnt, perhaps some will not work in systems before W2000 etc...)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Blade wrote:Great job!
Would be great if you state (for each command) the effect in the various Windows version. (I imagine that someone works with XP skinned, some doesnt, perhaps some will not work in systems before W2000 etc...)
I would if I could, but I can't, so I don't :wink:
I can only test the library with Win98SE and NT4, I don't have 2k/XP (yet?).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Very thank you again Gnozal :)
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

This should help you change the colours of the selected row...

Code: Select all

    Case  #WM_NOTIFY
      *lvCD.NMLVCUSTOMDRAW=lparam
      If *lvCD\nmcd\hdr\hwndFrom=ListGadget And *lvCD\nmcd\hdr\code=#NM_CUSTOMDRAW    
        Select *LVCD\nmcd\dwDrawStage
          Case #CDDS_PREPAINT:ProcedureReturn(#CDRF_NOTIFYITEMDRAW) 
          Case #CDDS_ITEMPREPAINT:ProcedureReturn(#CDRF_NOTIFYSUBITEMDRAW) 
          Case #CDDS_ITEMPREPAINT|#CDDS_SUBITEM
            thisItem=*lvCD\nmcd\dwItemSpec 
            column=*lvCD\iSubItem ; possible use in the future
            subItemRect.RECT\left=#LVIR_LABEL 
            subItemRect.RECT\top=*lvCD\iSubItem 
            SendMessage_(ListGadget,#LVM_GETSUBITEMRECT,thisItem,@subItemRect) 
            subItemText$=GetGadgetItemText(#Clients,*lvCD\nmcd\dwItemSpec,*lvCD\iSubItem) 
            sitLen=Len(subItemText$) 
            lvFlags=#DT_END_ELLIPSIS|#DT_WORDBREAK|#DT_VCENTER
            If GetGadgetState(#Clients)=thisItem 
              FillRect_(*lvCD\nmcd\hDC,subItemRect,SelectedBrush) 
              Selected=#True
              ListTextColour=RGB(255,255,255)
            Else 
              FillRect_(*lvCD\nmcd\hDC,subItemRect,BackgroundBrush)
              Selected=#False 
              ListTextColour=RGB(0,128,255)
            EndIf 
            No=*LVCD\nmcd\dwItemSpec
            If No<MaxClients
              No2=No+1
              If ClientTable(No2)\ConnectDate
                If Selected
                  If ClientTable(No2)\Connected
                    ListTextColour=RGB(60,255,90)  ; this is the selected fgnd colour - if connected
                  Else
                    ListTextColour=RGB(255,200,200) ; this is the selected fgnd colour - if NOT connected
                  EndIf
                Else
                  If ClientTable(No2)\Connected
                    ListTextColour=RGB(0,128,0) ; fgnd colour - if connected
                  Else
                    ListTextColour=RGB(255,96,128) ; fgnd colour - if NOT connected
                  EndIf
                EndIf 
              EndIf
            EndIf
            SetTextColor_(*lvCD\nmcd\hDC,ListTextColour)  
            SetBkColor_(*lvCD\nmcd\hDC,BackgroundColour)
          ;  subItemRect\left +3 
          ;  subItemRect\right -3 
          ;  subItemRect\bottom -3
            DrawText_(*lvCD\nmcd\hDC,subItemText$,sitLen,subItemRect,lvFlags)   
            ProcedureReturn(#CDRF_SKIPDEFAULT)
        EndSelect
      EndIf
You may like to integrate it with your library?

-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

If you use the alternate colour flag, the text colour is always black...

Code: Select all

PureCOLOR_SetGadgetColorEx(#Customers,RGB(255,255,255),BackgroundColourGreen,BackgroundColourBlue,#PureCOLOR_LV_AlternateColors)
Gives black (not white) text...

It can be fixed if you:

Code: Select all

PureCOLOR_SetGadgetColor(#Customers,RGB(255,255,255),BackgroundColour)
After it...

But it would be nice if it worked okay... :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

You may like to know that:

Code: Select all

SendMessage_(CustomersGadget,#LVM_SETBKCOLOR,0,BackgroundColour)
will set the colour of the unused background area - this normally stays white with your library.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply