Color for Gadgets ????

Working on new editor enhancements?
sputnik
New User
New User
Posts: 1
Joined: Wed Aug 13, 2003 1:47 pm

Color for Gadgets ????

Post by sputnik »

How can I get color on my Gadgets? I don't know , is there an option at the Visual Designer? If not, can I get an Update, and where?
Is there an other posibility ?

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

Post by Flype »

we can do some cosmetic things on windows and gadgets through the MS API. I prepared for you a little example but it doesn't work on gagdet at this step... If someone else can have a look at it and complete it, it would be nice :

Code: Select all

;----------

Procedure Colorize( object.l, color.l )
  If object <> #NULL
    hBrush.l = CreateSolidBrush_( color )
    If hBrush <> #NULL
      SetClassLong_( object, #GCL_HBRBACKGROUND, hBrush )
      InvalidateRect_( object, 0, #TRUE )
    EndIf
  EndIf
EndProcedure

Procedure ColorizeFree( object.l )
  If object <> #NULL
    hBrush.l = GetClassLong_( object, #GCL_HBRBACKGROUND )
    If hBrush <> #NULL
      DeleteObject_( hBrush )
    EndIf
  EndIf
EndProcedure

;----------

hWnd.l = OpenWindow(0,200,200,200,100,#PB_Window_SystemMenu,"")
If hWnd = #NULL : End : EndIf
If CreateGadgetList( hWnd ) = #NULL : End : EndIf

;----------

hGad.l = ButtonGadget( 0, 10, 10, 180, 80, "BackColor Test" )
Colorize( hWnd, RGB(200,200,100) )
Colorize( hGad, RGB(100,200,200) )

;----------

While WaitWindowEvent() <> #WM_CLOSE : Wend

;----------

ColorizeFree( hGad )
ColorizeFree( hWnd )
End

;----------
i guess we must use gadget callbacks to do it, no ?
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
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

I know of a tool which does that :)

You can copy the color message part from a generated piece of course.
No copyright on that..
See below..
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

This has been asked to death :D use the search function of this forum, there are loads of examples about this.
--Kale

Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2148
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

Or take a look at the Code-Archive on www.purearea.net :wink:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Manne
User
User
Posts: 30
Joined: Mon Apr 28, 2003 8:49 pm

Post by Manne »

I know of a tool which does that
Visit the Powerbasic, IBasic or Purebasic Forum, Edwin is everywhere and offers his tools.
Your tools might be good Edwin but, is there a need to post this regular?
If anybody is interested to test or buy your soft he/she can visit your Homepage.
I think this is a board to discuss problems and share code and not a barbershop. :wink:

Manne
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

@Manne:
there is no need to offense Edwin, he did a good job and no crappy advertisment here.(my opinion)
SPAMINATOR NR.1
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Yes, usually i really try to avoid that.

I know someone which seems to do that all the time and it disturbs me too.
However, i mentioned the generated code but i think i better not mention it in a way like this.

It's 50/50..
8)
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

@ Anyone having a problem with commercial software

*steps on soapbox*

Please stop flaming people for advertising their product when their product provides a service someone *requests*!

If he were blatantly spamming the forum every day then I too would ask him to stop, but he's not doing that.

If someone were asking me for a language to develop windows apps in I would suggest PureBasic every time - and you would probably do the same. Edwin is doing nothing different. When people ask about something he has or provides he informs them - it's not random spamming.

I think it's excellent when people give away software for free but until we have a Star Trek like existence where everything is handed to us we all must make some money. Lets not give those people trying to make an honest dollar (or pound or peso or whatever) a hard time!

*steps off soapbox*

I'll apologize up front for the rant. I just dislike seeing people made to feel bad for trying to make an honest living. Commercial software is not evil!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply