Page 1 of 1

Color for Gadgets ????

Posted: Wed Aug 13, 2003 1:56 pm
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 !

Posted: Fri Aug 15, 2003 3:38 pm
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 ?

Posted: Fri Aug 15, 2003 4:17 pm
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..

Posted: Fri Aug 15, 2003 6:22 pm
by Kale
This has been asked to death :D use the search function of this forum, there are loads of examples about this.

Posted: Sat Aug 16, 2003 12:28 am
by Andre
Or take a look at the Code-Archive on www.purearea.net :wink:

Posted: Wed Aug 20, 2003 12:42 am
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

Posted: Wed Aug 20, 2003 7:32 am
by Rings
@Manne:
there is no need to offense Edwin, he did a good job and no crappy advertisment here.(my opinion)

Posted: Wed Aug 20, 2003 9:24 am
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)

Posted: Wed Aug 20, 2003 2:52 pm
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!