Re: [ROOT] Changing button colors

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Mon Mar 05 2001 - 18:17:29 MET


Hello Craig

There is no common solution for all ROOT platforms
On another hand I see you are working with Windows version.
>From your compiled code you can get an access to WIN32 windows handle
and then use WIN32 API directly:

#include "TControlBar.h"
#include "TWin32ControlBarImp.h"

  // How to get a handle to "TOOLBARCLASSNAME" WIN32 windows

  TControlBar *bar = new TControlBar( . . . );
  TControBarImp *imp = bar->GetControlBarImp();
  TWin32ControlBarImp *win32Imp = (TWin32ControlBarImp *)imp;

  HWND barHandle = win32Imp ->fHwndTB;

  Int_t Bmp_Image_Idx = 
    SendMessage(barHandle, TB_ADDBITMAP, (WPARAM) NUM_BUTTON_BITMAPS,
                                       (LPARAM) . . . );
  // Now we can use TB_CHANGEBITMAP message as follows

  SendMessage(barHandle,TB_CHANGEBITMAP, (WPARAM) NUM_BUTTONS,
                                           (LPARAM)Bmp_Image_Idx);

  See your WIN32 SDK for further explanation on SendMessage messages 
  involved above.

  Hope this helps,
                              Valeri



> Craig Everton wrote:
> > 
> > I'm using TControlBar to create a button pad with 10 buttons. I would like
> > if possible to change the colours of some of the buttons. Eg make my
> > "go" button green whilst leaving the rest of the buttons the same colour.
> > Does anyone know how to do this ?
> > 
> > Thanks in advance
> > 
> > Craig
> > 
> > -======================================================
> > Craig Everton
> > Experimental Particle Physics (EPP)
> > School of Physics
> > University of Melbourne,  Victoria
> > AUSTRALIA    3010
> > Phone : (work)   (613) 9344 5075
> >         (home)   (613) 9387 6726
> > Fax :            (613) 9347 4783
> > Email : everton@liszt.ph.unimelb.edu.au
> > ======================================================
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:38 MET