74 #include "RConfigure.h"
77 const TGGC *TGPopupMenu::fgDefaultGC = 0;
78 const TGGC *TGPopupMenu::fgDefaultSelectedGC = 0;
79 const TGGC *TGPopupMenu::fgDefaultSelectedBackgroundGC = 0;
80 const TGFont *TGPopupMenu::fgDefaultFont = 0;
81 const TGFont *TGPopupMenu::fgHilightFont = 0;
83 const TGGC *TGMenuTitle::fgDefaultGC = 0;
84 const TGGC *TGMenuTitle::fgDefaultSelectedGC = 0;
85 const TGFont *TGMenuTitle::fgDefaultFont = 0;
108 fPopup->HandleTimer(0);
203 menuTitle->
GetMenu()->
Connect(
"PoppedUp()",
"TGMenuBar",
this,
"PopupConnection()");
224 beforeMenu = beforeMenuTitle->
GetMenu();
272 ULong_t hints = tmpLayout->GetLayoutHints();
293 const char* signal_name = connlist->GetName();
294 TIter next2(connlist);
296 const char* slot_name = conn->GetName();
297 void* receiver = conn->GetReceiver();
314 const char* signal_name = connlist->GetName();
315 if (strcmp(signal_name,
"Activated(int)") == 0) {
316 TIter next2(connlist);
319 const char* slot_name = conn->GetName();
320 const char* class_name = conn->GetClassName();
321 void* receiver = conn->GetReceiver();
384 if (!main || !main->
InheritsFrom(
"TGMainFrame"))
return;
504 Error(
"AddFrameBefore",
"may only add TGMenuTitle objects to a menu bar");
599 dummy, dummy, wtarget);
632 dummy, dummy, wtarget);
696 gVirtualX->LookupString(event, tmp,
sizeof(tmp), keysym);
707 if (el == 0) target = 0;
730 while ( currentEntry ) {
732 currentMenu = currentEntry->
GetPopup();
733 if ( currentEntry != currentMenu->
GetCurrent() )
744 if (!hot || (hot != keysym))
continue;
1015 UInt_t tw, ph = 0, pw = 0;
1027 Int_t max_ascent, max_descent;
1028 nw->
fEw = tw + pw +18+12;
1110 UInt_t tw, ph = 0, pw = 0;
1118 Int_t max_ascent, max_descent;
1119 nw->
fEw = tw + pw +18+12;
1176 Int_t max_ascent, max_descent;
1177 nw->
fEw = tw + pw+18+12;
1312 gClient->UnregisterPopup(
this);
1385 static Int_t twice = 0;
1513 int max_ascent, max_descent;
1514 gVirtualX->GetFontProperties(font, max_ascent, max_descent);
1515 int tx = entry->
fEx +
fXl;
1517 int offset = (entry->
fEh - (max_ascent + max_descent)) / 2;
1518 int ty = entry->
fEy + max_ascent + offset - 1;
1522 switch (entry->
fType) {
1538 if (entry->
fPic != 0)
1558 if (entry->
fPic != 0)
1594 if (
gClient->GetStyle() > 0) {
1624 int m = (t + b) >> 1;
1643 t = (t + b - 8) >> 1; ++
t;
1662 t = (t + b - 5) >> 1; ++
t;
1663 l = (l + r - 5) >> 1; ++
l;
2031 Int_t max_ascent, max_descent;
2036 Resize(tw + 8, max_ascent + max_descent + 7);
2056 0, 0, ax, ay, wdummy);
2080 int x,
y, max_ascent, max_descent;
2087 if (
gClient->GetStyle() > 1) {
2102 if (
gClient->GetStyle() > 1) {
2166 out <<
" TGPopupMenu *";
2167 out <<
GetName() <<
" = new TGPopupMenu(gClient->GetDefaultRoot()"
2171 Int_t r_first, r_last, r_active;
2172 r_active = r_first = r_last = -1;
2179 Int_t i, lentext, hotpos;
2188 outext =
new char[lentext+2];
2190 while (text && lentext) {
2191 if (i == hotpos-1) {
2196 i++; text++; lentext--;
2203 memset(shortcut, 0, 80);
2206 out <<
" " <<
GetName() <<
"->AddEntry(" << quote
2214 out <<
",gClient->GetPicture(" << quote
2218 out <<
");" << std::endl;
2223 out <<
" // cascaded menu " << quote << mentry->
GetName() << quote <<std::endl;
2228 outext =
new char[lentext+2];
2230 while (text && lentext) {
2231 if (i == hotpos-1) {
2236 i++; text++; lentext--;
2240 out <<
" " <<
GetName() <<
"->AddPopup(" << quote
2242 <<
");" << std::endl;
2246 out <<
" " <<
GetName() <<
"->AddLabel(" << quote
2247 << mentry->
GetName() << quote;
2249 out <<
",gClient->GetPicture(" << quote
2253 out <<
");" << std::endl;
2256 out <<
" " <<
GetName() <<
"->AddSeparator();" << std::endl;
2262 <<
");" << std::endl;
2266 <<
");" << std::endl;
2270 <<
");" << std::endl;
2274 <<
");" << std::endl;
2286 }
else if (hasradio) {
2287 out <<
" " <<
GetName() <<
"->RCheckEntry(" << r_active <<
"," << r_first
2288 <<
"," << r_last <<
");" << std::endl;
2290 r_active = r_first = r_last = -1;
2303 out <<
" // " << quote <<
fLabel->
GetString() << quote <<
" menu" << std::endl;
2310 char *outext =
new char[lentext+2];
2313 if (i == hotpos-1) {
2318 i++; text++; lentext--;
2321 out <<
" " <<
fParent->
GetName() <<
"->AddPopup(" << quote << outext
2333 out <<
" // menu bar" << std::endl;
2335 out <<
" TGMenuBar *";
2338 if (option && strstr(option,
"keep_names"))
2339 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
2349 out <<
");" << std::endl;
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
const TGWindow * GetParent() const
const Mask_t kKeyMod2Mask
void Reset()
Reset the timer.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
const Mask_t kKeyShiftMask
virtual void RemoveBind(const TGWindow *w, Int_t keycode, Int_t modifier) const
Remove key binding.
const Mask_t kKeyMod1Mask
Int_t GetPadRight() const
static const TGGC & GetHilightGC()
Get highlight color graphics context.
const Mask_t kLeaveWindowMask
virtual TList * GetList() const
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void Layout()
Layout the elements of the composite frame.
virtual void AddLast(TObject *obj)
Add object at the end of the list.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
void Draw(Option_t *="")
Default Draw method for all objects.
const Mask_t kPointerMotionMask
const char * Data() const
virtual void DoRedraw()
Redraw the frame.
void RegisterPopup(TGWindow *w)
Add a popup menu to the list of popups.
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
const Mask_t kKeyLockMask
if(pyself &&pyself!=Py_None)
const char * GetName() const
Returns name of object.
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TList * GetListOfSignals() const
virtual void RequestFocus()
ULong_t GetLayoutHints() const
const Mask_t kButtonPressMask
virtual Int_t MustCleanup() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Named parameter, streamable and storable.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a frame widget as a C++ statement(s) on output stream out.
R__EXTERN TSystem * gSystem
const Mask_t kWASaveUnder
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual UInt_t GetDefaultWidth() const
virtual Bool_t HandleMotion(Event_t *)
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
TQConnection class is an internal class, used in the object communication mechanism.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TObject * Remove(TObject *obj)
Remove object from the list.
static TGLayoutHints * fgDefaultHints
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw a hot string and underline the hot character.
Handles synchronous and a-synchronous timer events.
void Reset(Detail::TBranchProxy *x)
static const TGGC & GetBlackGC()
Get black graphics context.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
TGWindow * GetWindowById(Window_t sw) const
Find a TGWindow via its handle. If window is not found return 0.
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
TString & Remove(Ssiz_t pos)
const Mask_t kEnterWindowMask
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
virtual Int_t GetSize() const
const TGResourcePool * GetResourcePool() const
const Mask_t kButtonReleaseMask
TGDimension GetSize() const
const Mask_t kWAOverrideRedirect
static RooMathCoreReg dummy
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Cursor_t GetGrabCursor() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Pixel_t GetBackground() const
virtual void UnmapWindow()
FontStruct_t GetFontStruct() const
virtual void Add(TObject *obj)
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Short_t Max(Short_t a, Short_t b)
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
const char * GetString() const
virtual Pixel_t GetForeground() const
Return frame foreground color.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
const Mask_t kAnyModifier
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
double norm(double *x, double *p)
const Mask_t kButton1Mask
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static const TGGC & GetShadowGC()
Get shadow color graphics context.
static const TGGC & GetBckgndGC()
Get background color graphics context.
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
virtual void DestroyWindow()
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.