00001
00002 #include "BesVisLib/BesGMenuTitle.h"
00003
00004 ClassImp(BesGMenuTitle)
00005
00006
00007 BesGMenuTitle::BesGMenuTitle(const TGWindow *p, TGHotString *s, TGPopupMenu *menu,
00008 GContext_t norm, FontStruct_t font, UInt_t options)
00009 : TGMenuTitle(p, s, menu, norm, font, options)
00010 {
00011 fPic = 0;
00012 fPicHL = 0;
00013 }
00014
00015
00016 void BesGMenuTitle::DoRedraw()
00017 {
00018
00019
00020 TGFrame::DoRedraw();
00021
00022 int x, y, max_ascent, max_descent;
00023 x = y = 4;
00024
00025 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
00026
00027 if (fState) {
00028 if (fPicHL) SetBackgroundPixmap(fPicHL);
00029 else SetBackgroundColor(GetDefaultSelectedBackground());
00030 gVirtualX->ClearWindow(fId);
00031 fLabel->Draw(fId, fSelGC, x, y + max_ascent);
00032 } else {
00033 if (fPic) SetBackgroundPixmap(fPic);
00034 else SetBackgroundColor(GetDefaultFrameBackground());
00035 gVirtualX->ClearWindow(fId);
00036 fLabel->Draw(fId, fNormGC, x, y + max_ascent);
00037 }
00038 }