135 "ROOT macros",
"*.C",
154 :
TGWindow(p, 0, 0, w,
h, 0, 0, 0, 0, 0, options)
235 gVirtualX->GetWindowAttributes(
id, attributes);
456 switch (event->
fType) {
495 fgDbx =
event->fXRoot;
496 fgDby =
event->fYRoot;
497 fgDbw =
event->fWindow;
519 fgDbx =
event->fXRoot;
520 fgDby =
event->fYRoot;
521 fgDbw =
event->fWindow;
646 event.fWindow = w->GetId();
647 event.fUser[0] = msg;
648 event.fUser[1] = parm1;
649 event.fUser[2] = parm2;
653 gVirtualX->SendEvent(w->GetId(), &event);
794 std::cout <<
" x=" <<
fX <<
" y=" <<
fY;
795 std::cout <<
" w=" <<
fWidth <<
" h=" <<
fHeight << std::endl;
998 Error(
"SetLayoutManager",
"no layout manager specified");
1088 if (!
fList)
return 0;
1148 f->SetFrameElement(0);
1304 if (!
fList)
return this;
1327 if (child ==
this) {
1341 if (el->
fFrame == child) {
1467 fMWMValue = kMWMDecorAll;
1468 fMWMFuncs = kMWMFuncAll;
1469 fMWMInput = kMWMInputModeless;
1470 gVirtualX->SetMWMHints(fId, fMWMValue, fMWMFuncs, fMWMInput);
1474 TGCompositeFrame *frame;
1475 if (p && p->InheritsFrom(TGCompositeFrame::Class())) {
1476 frame = (TGCompositeFrame*)p;
1477 frame->AddFrame(this, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
1480 if (gDragManager && gDragManager->IsPasting()) {
1481 gDragManager->SetPasteFrame(this);
1487 fDNDTypeList =
new Atom_t[3];
1490 fDNDTypeList[2] = 0;
1543 repeat_save = (retval ==
kMBRetry);
1545 }
while (repeat_save);
1563 main->SaveSource(fname.
Data(),
"");
1568 }
else if (fname.
EndsWith(
".png")) {
1570 }
else if (fname.
EndsWith(
".jpg")) {
1572 }
else if (fname.
EndsWith(
".tiff")) {
1574 }
else if (fname.
EndsWith(
".xpm")) {
1587 Error(
"SaveFrameAsCodeOrImage",
"File cannot be saved with this extension");
1607 if (
m->fKeyCode == event->
fCode) {
1609 if (w->HandleKey(event))
return kTRUE;
1617 gVirtualX->LookupString(event, str,
sizeof(str), keysym);
1619 if ((keysym & ~0x20) ==
kKey_S) {
1636 list =
main->GetBindList();
1658 if (
m->fKeyCode == (
UInt_t) keycode) {
1711 return gDNDManager->HandleSelectionRequest(event);
1725 Emit(
"CloseWindow()");
1744 event.fWindow =
GetId();
1840 Warning(
"SetIconPixmap",
"Failed to set window icon from xpm array.");
1854 gVirtualX->SetClassHints(
fId, (
char *)className, (
char *)resourceName);
1910 gVirtualX->SetWMSizeHints(
fId, wmin, hmin, wmax, hmax, winc, hinc);
1999 x,
y, ax, ay, wdummy);
2000 if (!
gVirtualX->InheritsFrom(
"TGWin32")) {
2003 else if (ax +
fWidth + 10 > dw)
2008 else if (ay +
fHeight + 50 > dh)
2081 int max_ascent, max_descent;
2100 int max_ascent, max_descent;
2126 fText->GetLength()) + 24;
2130 return tw>dim.fWidth ?
TGDimension(tw, dim.fHeight) : dim;
2220 Int_t x,
y,
l, t,
r,
b, gl,
gr, sep, max_ascent, max_descent;
2226 t = (max_ascent + max_descent + 2) >> 1;
2239 UInt_t rr = 5 + (sep << 1) + tw;
2252 gr = gl + tw + (sep << 1);
2303 Warning(
"SetTitle",
"title cannot be 0, try \"\"");
2319 Error(
"SetTitle",
"title cannot be 0, try \"\"");
2384 if ( event->
fY > 0 &&
2385 event->
fY <= (
Int_t) this->GetHeight() ) {
2416 if ( event->
fY > 0 &&
2417 event->
fY <= (
Int_t) this->GetHeight() ) {
2443 if ( event->
fY > 0 &&
2444 event->
fY <= (
Int_t) this->GetHeight() ) {
2475 out <<
"\n ULong_t ucolor; // will reflect user color changes\n";
2478 if (option && !strcmp(option,
"slider"))
2484 out <<
" gClient->GetColorByName(\"" << ucolorname <<
"\", ucolor);\n";
2515 auto add = [
this, &str](
Int_t bit,
const char *
name) {
2517 if (str.Length() > 0)
2524 str =
"kChildFrame";
2552 if (hints.
Length() == 0) hints =
"kMWMDecorAll";
2553 else hints +=
" | kMWMDecorAll";
2556 if (hints.
Length() == 0) hints =
"kMWMDecorBorder";
2557 else hints +=
" | kMWMDecorBorder";
2560 if (hints.
Length() == 0) hints =
"kMWMDecorResizeH";
2561 else hints +=
" | kMWMDecorResizeH";
2564 if (hints.
Length() == 0) hints =
"kMWMDecorTitle";
2565 else hints +=
" | kMWMDecorTitle";
2568 if (hints.
Length() == 0) hints =
"kMWMDecorMenu";
2569 else hints +=
" | kMWMDecorMenu";
2572 if (hints.
Length() == 0) hints =
"kMWMDecorMinimize";
2573 else hints +=
" | kMWMDecorMinimize";
2576 if (hints.
Length() == 0) hints =
"kMWMDecorMaximize";
2577 else hints +=
" | kMWMDecorMaximize";
2593 if (hints.
Length() == 0) hints =
"kMWMFuncAll";
2594 else hints +=
" | kMWMFuncAll";
2597 if (hints.
Length() == 0) hints =
"kMWMFuncResize";
2598 else hints +=
" | kMWMFuncResize";
2601 if (hints.
Length() == 0) hints =
"kMWMFuncMove";
2602 else hints +=
" | kMWMFuncMove";
2605 if (hints.
Length() == 0) hints =
"kMWMFuncMinimize";
2606 else hints +=
" | kMWMFuncMinimize";
2609 if (hints.
Length() == 0) hints =
"kMWMFuncMaximize";
2610 else hints +=
" | kMWMFuncMaximize";
2613 if (hints.
Length() == 0) hints =
"kMWMFuncClose";
2614 else hints +=
" | kMWMFuncClose";
2627 if (
fMWMInput == 0) hints =
"kMWMInputModeless";
2629 if (
fMWMInput == 1) hints =
"kMWMInputPrimaryApplicationModal";
2631 if (
fMWMInput == 2) hints =
"kMWMInputSystemModal";
2633 if (
fMWMInput == 3) hints =
"kMWMInputFullApplicationModal";
2644 out <<
" " <<
GetName() <<
"->SetLayoutBroken(kTRUE);\n";
2659 if ((!(el->fState &
kIsVisible)) && (el->fFrame->GetParent() !=
this))
2664 if (el->fFrame->InheritsFrom(
"TGVSplitter")) {
2668 }
else if (el->fFrame->InheritsFrom(
"TGHSplitter")) {
2673 el->fFrame->SavePrimitive(out, option);
2674 out <<
" " <<
GetName() <<
"->AddFrame(" << el->fFrame->GetName();
2675 el->fLayout->SavePrimitive(out, option);
2678 out <<
" " << el->fFrame->GetName() <<
"->MoveResize(" << el->fFrame->GetX() <<
"," << el->fFrame->GetY()
2679 <<
"," << el->fFrame->GetWidth() <<
"," << el->fFrame->GetHeight() <<
");\n";
2689 out <<
",kTRUE);\n";
2691 out <<
",kFALSE);\n";
2697 out <<
",kTRUE);\n";
2699 out <<
",kFALSE);\n";
2708 auto signalslist = el->fFrame->GetListOfSignals();
2711 auto connlist =
static_cast<TList *
>(signalslist->Last());
2713 auto conn =
static_cast<TQConnection *
>(connlist->Last());
2715 TString signal_name = connlist->GetName();
2716 TString slot_name = conn->GetName();
2720 slot_name.
Remove(eq, rb - eq);
2721 if ((signal_name ==
"ColorSelected(unsigned long)") && el->fFrame->InheritsFrom(
"TGColorSelect"))
2722 signal_name =
"ColorSelected(Pixel_t)";
2724 out <<
" " << el->fFrame->GetName() <<
"->Connect(\"" << signal_name <<
"\", 0, 0, \"" << slot_name
2727 TList *lsl = (
TList *)
gROOT->GetListOfSpecials()->FindObject(
"ListOfSlots");
2752 out <<
"\n // composite frame\n";
2753 out <<
" TGCompositeFrame *" <<
GetName() <<
" = new TGCompositeFrame(" <<
fParent->GetName() <<
"," <<
GetWidth()
2754 <<
"," <<
GetHeight() << extra_args <<
");\n";
2756 if (option && strstr(option,
"keep_names"))
2757 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
2765 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
2785 gROOT->ResetClassSaved();
2792 while ((
c2 = (
TClass *)nextc2())) {
2793 if (
c1==
c2)
continue;
2795 c3 =
c2->GetBaseClass(
c1);
2806 ilist->
SetName(
"ListOfIncludes");
2807 gROOT->GetListOfSpecials()->Add(ilist);
2812 while ((
c2 = (
TClass *)nextdo())) {
2818 iname =
c2->GetDeclFileName();
2819 if (iname[0] && strstr(iname,
".h")) {
2820 const char *lastsl = strrchr(iname,
'/');
2821 if (lastsl) iname = lastsl + 1;
2822 char *tname =
new char[strlen(iname)+1];
2824 while (*iname !=
'.') {
2836 if (strstr(tname,
"TRootCanvas")) {
2852 TString ff = filename && strlen(filename) ? filename :
"Rootappl.C";
2856 Int_t lenfname = strlen(fname);
2857 char *sname =
new char[lenfname+1];
2860 while ((*fname !=
'.') && (i < lenfname)) {
2868 out.open(ff.
Data(), std::ios::out);
2870 Error(
"SaveSource",
"cannot open file: %s", ff.
Data());
2876 ilist = (
TList *)
gROOT->GetListOfSpecials()->FindObject(
"ListOfIncludes");
2885 out <<
"// Mainframe macro generated from application: "<<
gApplication->Argv(0) << std::endl;
2886 out <<
"// By ROOT version "<<
gROOT->GetVersion() <<
" on "<<t.
AsSQLString()<< std::endl;
2891 out <<
"#include \"" << inc->GetString() <<
".h\"\n";
2892 if (strstr(inc->GetString(),
"TRootEmbeddedCanvas"))
2893 out <<
"#include \"TCanvas.h\"\n";
2895 out <<
"\n#include \"Riostream.h\"\n\n";
2897 gROOT->GetListOfSpecials()->Remove(ilist);
2903 out <<
"void " << sname <<
"()" << std::endl;
2904 out <<
"{"<< std::endl;
2911 lSlots->
SetName(
"ListOfSlots");
2912 gROOT->GetListOfSpecials()->Add(lSlots);
2918 << quote <<
"," << quote <<
fResourceName << quote <<
");" << std::endl;
2923 out <<
" " <<
GetName() <<
"->SetMWMHints(";
2950 out <<
" " <<
GetName()<<
"->MapSubwindows();" << std::endl;
2953 while (
auto fhidden =
static_cast<TGFrame *
>(nexth())) {
2954 out <<
" " << fhidden->GetName() <<
"->UnmapWindow();" << std::endl;
2967 out <<
" " <<
GetName()<<
"->Resize("<<
GetName()<<
"->GetDefaultSize());" << std::endl;
2971 out <<
" " <<
GetName()<<
"->MapWindow();" <<std::endl;
2974 if ((
fWMX != -1) || (
fWMY != -1)) {
2981 out <<
"} " << std::endl;
2984 TList *sl = (
TList *)
gROOT->GetListOfSpecials()->FindObject(
"ListOfSlots");
2999 if (rb - lb > 1 && eq == -1) {
3003 out <<
"void " << s << std::endl;
3004 out <<
"{" << std::endl;
3007 out <<
" std::cout << " << quote <<
"Slot " << s << quote
3008 <<
" <<" << p <<
" << " << quote <<
")" << quote
3009 <<
" << std::endl; " << std::endl;
3013 out <<
"void " << s << std::endl;
3014 out <<
"{" << std::endl;
3015 out <<
" std::cout << " << quote <<
"Slot " << s
3016 << quote <<
" << std::endl; " << std::endl;
3018 out <<
"void " << slobj->
GetString() << std::endl;
3019 out <<
"{" << std::endl;
3020 out <<
" std::cout << " << quote <<
"Slot " << slobj->
GetString()
3021 << quote <<
" << std::endl; " << std::endl;
3024 out <<
"}" << std::endl;
3026 gROOT->GetListOfSpecials()->Remove(sl);
3033 printf(
" C++ macro file %s has been generated\n",
gSystem->BaseName(ff.
Data()));
3036 gROOT->ResetClassSaved();
3051 out <<
"\n // main frame\n";
3052 out <<
" TGMainFrame *" <<
GetName() <<
" = new TGMainFrame(gClient->GetRoot(), 5, 5, "
3054 if (option && strstr(option,
"keep_names"))
3055 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
3063 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
3078 out <<
" " <<
GetName() <<
"->MapSubwindows();\n";
3080 out <<
" " <<
GetName() <<
"->MapWindow();\n";
3091 out <<
"\n // horizontal frame\n";
3092 out <<
" TGHorizontalFrame *" <<
GetName() <<
" = new TGHorizontalFrame(" <<
fParent->GetName() <<
","
3095 if (option && strstr(option,
"keep_names"))
3096 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
3104 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
3120 out <<
"\n // vertical frame\n";
3121 out <<
" TGVerticalFrame *" <<
GetName() <<
" = new TGVerticalFrame(" <<
fParent->GetName() <<
"," <<
GetWidth()
3122 <<
"," <<
GetHeight() << extra_args <<
");\n";
3124 if (option && strstr(option,
"keep_names"))
3125 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
3133 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
3149 out <<
" TGFrame *" <<
GetName() <<
" = new TGFrame("<<
fParent->GetName()
3152 if (option && strstr(option,
"keep_names"))
3153 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
3175 parFont.
Form(
"ufont->GetFontStruct()");
3181 parGC.
Form(
"uGC->GetGC()");
3188 out <<
"\n // \"" <<
GetTitle() <<
"\" group frame\n";
3189 out <<
" TGGroupFrame *" <<
GetName() <<
" = new TGGroupFrame(" <<
fParent->GetName() <<
", \""
3204 out <<
"," <<
GetOptionString() <<
"," << parGC <<
"," << parFont <<
");\n";
3207 out <<
"," <<
GetOptionString() <<
"," << parGC <<
"," << parFont <<
", ucolor);\n";
3209 if (option && strstr(option,
"keep_names"))
3210 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
3213 out <<
" " <<
GetName() <<
"->SetTitlePos(TGGroupFrame::" << (
GetTitlePos() == 0 ?
"kCenter" :
"kRight")
3219 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
3241 gROOT->ResetClassSaved();
3247 while ((
c2 = (
TClass *)nextc2())) {
3248 if (
c1==
c2)
continue;
3250 c3 =
c2->GetBaseClass(
c1);
3261 ilist->
SetName(
"ListOfIncludes");
3262 gROOT->GetListOfSpecials()->Add(ilist);
3267 while ((
c2 = (
TClass *)nextdo())) {
3273 iname =
c2->GetDeclFileName();
3274 if (iname[0] && strstr(iname,
".h")) {
3275 const char *lastsl = strrchr(iname,
'/');
3276 if (lastsl) iname = lastsl + 1;
3277 char *tname =
new char[strlen(iname)+1];
3279 while (*iname !=
'.') {
3299 TString ff = filename && strlen(filename) ? filename :
"Rootdlog.C";
3303 Int_t lenfname = strlen(fname);
3304 char *sname =
new char[lenfname+1];
3307 while ((*fname !=
'.') && (i < lenfname)) {
3315 out.open(ff.
Data(), std::ios::out);
3317 Error(
"SaveSource",
"cannot open file: %s", ff.
Data());
3323 ilist = (
TList *)
gROOT->GetListOfSpecials()->FindObject(
"ListOfIncludes");
3332 out <<
"// Dialog macro generated from application: "<<
gApplication->Argv(0) << std::endl;
3333 out <<
"// By ROOT version "<<
gROOT->GetVersion() <<
" on "<<t.
AsSQLString()<< std::endl;
3336 out << std::endl << std::endl;
3340 out <<
"#include \"" << inc->GetString() <<
".h\"\n";
3341 if (strstr(inc->GetString(),
"TRootEmbeddedCanvas"))
3342 out <<
"#include \"TCanvas.h\"\n";
3344 out <<
"\n#include \"Riostream.h\"\n\n";
3346 gROOT->GetListOfSpecials()->Remove(ilist);
3352 out <<
"void " << sname <<
"()" << std::endl;
3356 out <<
"{"<< std::endl;
3362 lSlots->
SetName(
"ListOfSlots");
3363 gROOT->GetListOfSpecials()->Add(lSlots);
3375 out <<
" " <<
GetName() <<
"->SetMWMHints(";
3384 if ((
fWMX != -1) || (
fWMY != -1)) {
3385 out <<
" "<<
GetName()<<
"->SetWMPosition("<<
fWMX<<
","<<
fWMY<<
");"<<std::endl;
3404 if ((
fWMX != -1) || (
fWMY != -1)) {
3408 out <<
" " <<
GetName()<<
"->MapSubwindows();" << std::endl;
3411 while (
auto fhidden =
static_cast<TGFrame *
>(nexth()))
3412 out <<
" " << fhidden->GetName() <<
"->UnmapWindow();" << std::endl;
3424 out <<
" " <<
GetName()<<
"->Resize("<<
GetName()<<
"->GetDefaultSize());" << std::endl;
3428 out <<
" " <<
GetName()<<
"->MapWindow();" <<std::endl;
3429 if (!usexy) out <<
" " <<
GetName()<<
"->Resize();" << std::endl;
3430 out <<
"} " << std::endl;
3433 TList *sl = (
TList *)
gROOT->GetListOfSpecials()->FindObject(
"ListOfSlots");
3448 if (rb - lb > 1 && eq == -1) {
3452 out <<
"void " << s << std::endl;
3453 out <<
"{" << std::endl;
3456 out <<
" std::cout << " << quote <<
"Slot " << s << quote
3457 <<
" <<" << p <<
" << " << quote <<
")" << quote
3458 <<
" << std::endl; " << std::endl;
3462 out <<
"void " << s << std::endl;
3463 out <<
"{" << std::endl;
3464 out <<
" std::cout << " << quote <<
"Slot " << s
3465 << quote <<
" << std::endl; " << std::endl;
3467 out <<
"void " << slobj->
GetString() << std::endl;
3468 out <<
"{" << std::endl;
3469 out <<
" std::cout << " << quote <<
"Slot " << slobj->
GetString()
3470 << quote <<
" << std::endl; " << std::endl;
3473 out <<
"}" << std::endl;
3475 gROOT->GetListOfSpecials()->Remove(sl);
3483 printf(
" C++ macro file %s has been generated\n",
gSystem->BaseName(ff.
Data()));
3486 gROOT->ResetClassSaved();
3494 out <<
"\n // transient frame\n";
3495 out <<
" TGTransientFrame *" <<
GetName() <<
" = new TGTransientFrame(gClient->GetRoot(),0"
3498 if (option && strstr(option,
"keep_names"))
3499 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
3507 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
const Mask_t kButtonPressMask
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index).
const Mask_t kExposureMask
const Mask_t kWAEventMask
const Mask_t kWABackPixel
const Mask_t kAnyModifier
Handle_t Pixmap_t
Pixmap handle.
ULong_t Time_t
Event time.
EInitialState
Initial window mapping state.
const Mask_t kPointerMotionMask
const Mask_t kKeyControlMask
const Mask_t kKeyMod2Mask
typically mod on numeric keys
const Mask_t kStructureNotifyMask
Handle_t GContext_t
Graphics context handle.
const Mask_t kButtonReleaseMask
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
ULongptr_t Handle_t
Generic resource handle.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
constexpr UInt_t kMaxUInt
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTApplication * gApplication
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externInt_t gErrorIgnoreLevel
errors with level below this value will be ignored. Default is kUnset.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
externTGDNDManager * gDNDManager
TList * gListOfHiddenFrames
static const char * gSaveMacroTypes[]
externTGuiBuilder * gGuiBuilder
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
externTVirtualDragManager * gDragManager
externAtom_t gROOT_MESSAGE
externAtom_t gWM_DELETE_WINDOW
Bool_t TestBitNumber(UInt_t bitnumber) const
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
TClass instances represent classes, structs and namespaces in the ROOT type system.
void SetName(const char *name)
static const char * PixelAsHexString(ULong_t pixel)
static void Pixel2RGB(ULong_t pixel, Int_t &r, Int_t &g, Int_t &b)
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
The base class for composite widgets (menu bars, list boxes, etc.).
Bool_t HandleDragDrop(TGFrame *frame, Int_t x, Int_t y, TGLayoutHints *lo) override
Handle drop event.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
~TGCompositeFrame() override
Delete a composite frame.
virtual TGFrameElement * FindFrameElement(TGFrame *f) const
Find frame-element holding frame f.
TGLayoutManager * fLayoutManager
layout manager
virtual void ChangeSubframesBackground(Pixel_t back)
Change background color for this frame and all subframes.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
UInt_t GetDefaultWidth() const override
TGFrame * GetFrameFromPoint(Int_t x, Int_t y) override
Get frame located at specified point.
Int_t GetState(TGFrame *f) const
Get state of sub frame.
void Print(Option_t *option="") const override
Print all frames in this composite frame.
Bool_t HandleDragMotion(TGFrame *) override
Handle drag motion event.
virtual TGLayoutManager * GetLayoutManager() const
Bool_t HandleSelection(Event_t *) override
Bool_t HandleDragEnter(TGFrame *) override
Handle drag enter event.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Bool_t HandleDragLeave(TGFrame *) override
Handle drag leave event.
Int_t fMustCleanup
cleanup mode (see EFrameCleanup)
virtual void SavePrimitiveSubframes(std::ostream &out, Option_t *option="")
Auxiliary protected method used to save subframes.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual Bool_t TranslateCoordinates(TGFrame *child, Int_t x, Int_t y, Int_t &fx, Int_t &fy)
Translate coordinates to child frame.
void Layout() override
Layout the elements of the composite frame.
Bool_t HandleMotion(Event_t *) override
Bool_t fLayoutBroken
no layout manager is used
Bool_t fMapSubwindows
kTRUE - map subwindows
virtual void ShowFrame(TGFrame *f)
Show sub frame.
TList * fList
container of frame elements
Bool_t IsEditable() const override
Return kTRUE if frame is being edited.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Bool_t IsLayoutBroken() const override
Bool_t HandleButton(Event_t *) override
Bool_t IsArranged(TGFrame *f) const
Get state of sub frame.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
static TGLayoutHints * fgDefaultHints
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a composite frame widget as a C++ statement(s) on output stream out.
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
virtual void RemoveAll()
Remove all frames from composite frame.
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
void SetLayoutBroken(Bool_t on=kTRUE) override
Set broken layout. No Layout method is called.
static Atom_t GetDNDSelection()
static Atom_t GetDNDActionCopy()
This class creates a file selection dialog.
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
char * fIniDir
on input: initial directory, on output: new directory
Bool_t fOverwrite
if true overwrite the file with existing name on save
void SetIniDir(const char *inidir)
Set directory name.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
void SavePrimitive(std::ostream &out, Option_t *="") override
Save the used font as a C++ statement(s) on output stream out.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
virtual Bool_t HandleSelectionClear(Event_t *)
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
static const TGGC * fgWhiteGC
virtual Int_t GetDragType() const
Returns drag source type.
~TGFrame() override
Destructor.
virtual void StartGuiBuilding(Bool_t on=kTRUE)
Go into GUI building mode.
Bool_t IsEditable() const override
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
static const TGGC & GetBlackGC()
Get black graphics context.
static Pixel_t GetBlackPixel()
Get black pixel value.
UInt_t fOptions
frame options
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
virtual Bool_t HandleDoubleClick(Event_t *)
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
UInt_t fMinHeight
minimal frame height
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
virtual Bool_t HandleKey(Event_t *)
TGFrame(const TGFrame &)=delete
static Pixel_t GetWhitePixel()
Get white pixel value.
UInt_t fHeight
frame height
virtual Bool_t HandleColormapChange(Event_t *)
virtual void SetDropType(Int_t type)
SetDropType.
virtual void SetDragType(Int_t type)
SetDragType.
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a frame widget as a C++ statement(s) on output stream out.
virtual void DrawBorder()
Draw frame border.
static const TGGC * fgBckgndGC
virtual Bool_t ProcessMessage(Longptr_t, Longptr_t, Longptr_t)
virtual void Draw3dRectangle(UInt_t type, Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw 3D rectangle on the frame border.
Int_t fBorderWidth
frame border width
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
static const TGGC * fgShadowGC
Bool_t HandleEvent(Event_t *event) override
Handle all frame events.
static Pixel_t fgDefaultSelectedBackground
UInt_t fMinWidth
minimal frame width
void DoRedraw() override
Redraw the frame.
void MapWindow() override
map window
virtual Pixel_t GetForeground() const
Return frame foreground color.
TGFrameElement * GetFrameElement() const
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static UInt_t fgLastButton
TGFrameElement * fFE
pointer to frame element
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual Int_t GetDropType() const
Returns drop target type.
Int_t fDNDState
EDNDFlags.
static Time_t GetLastClick()
Get time of last mouse click.
void Move(Int_t x, Int_t y) override
Move frame.
TClass * IsA() const override
static const TGGC * fgBlackGC
static UInt_t fgUserColor
virtual void DeleteWindow()
Delete window.
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static Time_t fgLastClick
virtual Bool_t HandleFocusChange(Event_t *)
virtual Bool_t IsComposite() const
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
UInt_t fMaxWidth
maximal frame width
void UnmapWindow() override
unmap window
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
virtual void ProcessedConfigure(Event_t *event)
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual Bool_t HandleSelectionRequest(Event_t *)
virtual Bool_t HandleSelection(Event_t *)
void Print(Option_t *option="") const override
Print window id.
virtual Bool_t HandleButton(Event_t *)
virtual Bool_t HandleMotion(Event_t *)
void SetFrameElement(TGFrameElement *fe)
virtual void SetCleanup(Int_t=kLocalCleanup)
void MapSubwindows() override
map sub windows
virtual Bool_t HandleClientMessage(Event_t *event)
Handle a client message.
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
virtual Pixel_t GetBackground() const
UInt_t fEventMask
currently active event mask
UInt_t fMaxHeight
maximal frame height
virtual Bool_t HandleCrossing(Event_t *)
virtual void ProcessedEvent(Event_t *event)
Bool_t Contains(Int_t x, Int_t y) const
static const TGGC & GetWhiteGC()
Get white graphics context.
static Pixel_t fgWhitePixel
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Pixel_t fBackground
frame background color
static Pixel_t fgBlackPixel
static const TGGC & GetBckgndGC()
Get background color graphics context.
static const TGGC * fgHilightGC
static Pixel_t fgDefaultFrameBackground
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
TGGC * FindGC(const TGGC *gc)
Find graphics context. Returns 0 in case gc is not found.
Encapsulate a graphics context used in the low level graphics.
void SetFont(FontH_t v)
Set font.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save graphics context info as a C++ statement(s) on output stream out.
void SetForeground(Pixel_t v)
Set foreground color.
const GCValues_t * GetAttributes() const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a group frame widget as a C++ statement(s) on output stream out.
TGString * fText
title text
Bool_t fHasOwnFont
kTRUE - font defined locally, kFALSE - globally
static const TGGC & GetDefaultGC()
Return default graphics context in use.
static const TGGC * fgDefaultGC
TGGroupFrame(const TGGroupFrame &)=delete
Int_t fTitlePos
OPTION={GetMethod="GetTitlePos";SetMethod="SetTitlePos";Items=(-1="Left",0="Center",...
static const TGFont * fgDefaultFont
void DrawBorder() override
Draw border of around the group frame.
TGDimension GetDefaultSize() const override
Returns default size.
TClass * IsA() const override
void DoRedraw() override
Redraw the group frame.
FontStruct_t fFontStruct
title fontstruct
virtual void SetTextFont(const char *fontName, Bool_t local=kTRUE)
Changes text font specified by name.
GContext_t fNormGC
title graphics context
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
~TGGroupFrame() override
Delete a group frame.
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global).
virtual void SetTextColor(Pixel_t color, Bool_t local=kTRUE)
Changes text color.
Int_t GetTitlePos() const
const char * GetTitle() const override
Returns title of object.
virtual void SetTitle(TGString *title)
Set or change title of the group frame.
const TGFrame * GetFrame() const
TGFrame * fFrame
frame that should be resized
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a horizontal frame widget as a C++ statement(s) on output stream out.
TGHorizontalFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
This class describes layout hints used by the layout classes.
void GetWMSizeHints(UInt_t &wmin, UInt_t &hmin, UInt_t &wmax, UInt_t &hmax, UInt_t &winc, UInt_t &hinc) const
TGMainFrame(const TGMainFrame &)=delete
UInt_t fWMWidthInc
WM width increments.
UInt_t fWMHeightInc
WM height increments.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events.
virtual Bool_t SaveFrameAsCodeOrImage()
Opens dialog window allowing user to save the frame contents as a ROOT macro or as an image.
virtual void SaveSource(const char *filename="Rootappl.C", Option_t *option="")
Save the GUI main frame widget in a C++ macro file.
TString GetMWMfuncString() const
used in SaveSource()
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
UInt_t fWMMinHeight
WM min height.
void GetWMPosition(Int_t &x, Int_t &y) const
UInt_t fWMMinWidth
WM min width.
TString fResourceName
WM resource name.
UInt_t fMWMValue
MWM decoration hints.
void GetWMSize(UInt_t &w, UInt_t &h) const
Atom_t * fDNDTypeList
handles DND types
virtual void SendCloseMessage()
Send close message to self.
void GetMWMHints(UInt_t &value, UInt_t &funcs, UInt_t &input) const
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
virtual void CloseWindow()
Close and delete main frame.
TString fIconPixmap
icon pixmap name
UInt_t fWMMaxWidth
WM max width.
~TGMainFrame() override
TGMainFrame destructor.
Bool_t HandleButton(Event_t *event) override
Handle mouse button events.
Bool_t HandleClientMessage(Event_t *event) override
Handle client messages sent to this frame.
TString fWindowName
window name
UInt_t fWMHeight
WM height.
TList * fBindList
list with key bindings
UInt_t fWMMaxHeight
WM max height.
void SetWMState(EInitialState state)
Set the initial state of the window. Either kNormalState or kIconicState.
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
UInt_t fMWMFuncs
MWM functions.
EInitialState fWMInitState
WM initial state.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
TString GetMWMinpString() const
used in SaveSource()
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
TString fClassName
WM class name.
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
TString fIconName
icon name
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
TString GetMWMvalueString() const
used in SaveSource()
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
const char * GetWindowName() const
Bool_t HandleSelection(Event_t *event) override
Handle primary selection event.
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
const char * GetIconPixmap() const
const char * GetIconName() const override
Returns mime type name of object.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a main frame widget as a C++ statement(s) on output stream out.
virtual void RemoveBind(const TGWindow *w, Int_t keycode, Int_t modifier) const
Remove key binding.
Bool_t HandleSelectionRequest(Event_t *event) override
Handle selection request event.
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
UInt_t fMWMInput
MWM input modes.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Pixmap_t GetPicture() const
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Yield an action as soon as it is clicked.
void SaveSource(const char *filename="Rootdlog.C", Option_t *option="") override
Save the GUI transient frame widget in a C++ macro file.
TGTransientFrame(const TGTransientFrame &)=delete
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a transient frame widget as a C++ statement(s) on output stream out.
const TGFrame * GetFrame() const
TGFrame * fFrame
frame that should be resized
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a vertical frame widget as a C++ statement(s) on output stream out.
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void Move(Int_t x, Int_t y)
Move the window.
static Int_t fgCounter
counter of created windows in SavePrimitive
void Print(Option_t *option="") const override
Print window id.
virtual UInt_t GetEditDisabled() const
virtual void SetEditDisabled(UInt_t on=kEditDisable)
virtual Bool_t HandleExpose(Event_t *event)
virtual void SetName(const char *name)
const TGWindow * fParent
Parent window.
@ kEditDisableLayout
window layout cannot be edited
@ kEditDisable
disable edit of this window
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move and resize the window.
virtual void DestroyWindow()
destroy window
virtual void SetWindowName(const char *name=nullptr)
Set window name.
const TGWindow * GetParent() const
virtual void Resize(UInt_t w, UInt_t h)
Resize the window.
virtual void SetBackgroundColor(Pixel_t color)
set background color
virtual void RaiseWindow()
raise window
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
virtual void MapSubwindows()
map sub windows
UInt_t fEditDisabled
flags used for "guibuilding"
An abstract interface to image processing library.
static TImage * Create()
Create an image.
virtual Bool_t SetImageBuffer(char **, EImageFileTypes=TImage::kPng)
virtual void FromWindow(Drawable_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
virtual void WriteImage(const char *, EImageFileTypes=TImage::kUnknown)
virtual Pixmap_t GetPixmap()
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Collectable string class.
const TString & GetString() const
Monitors objects for deletion and reflects the deletion by reverting the internal pointer to zero.
TObject * GetObject() const
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TQConnection class is an internal class, used in the object communication mechanism.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
UInt_t References() const
TString & Insert(Ssiz_t pos, const char *s)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
int main(int argc, char **argv)
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
Handle_t fHandle
general resource handle (used for atoms or windows)
Int_t fFormat
Next fields only used by kClientMessageEvent.
UInt_t fHeight
width and height of exposed area
Window_t fWindow
window reported event is relative to
UInt_t fState
key or button mask
Int_t fYRoot
coordinates relative to root
Time_t fTime
time event event occurred in ms
UInt_t fCode
key or button code
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Graphics context structure.
Attributes that can be used when creating or changing a window.
Long_t fEventMask
set of events that should be saved
Mask_t fMask
bit mask specifying which fields are valid
ULong_t fBackgroundPixel
background pixel
Window attributes that can be inquired.
Long_t fYourEventMask
my event mask
Int_t fHeight
width and height of window
Int_t fBorderWidth
border width of window
Int_t fY
location of window