50 fItem->GetContainer()->GetViewer()->EditExpression();
66 fItem->GetContainer()->GetViewer()->RemoveItem();
74 fItem->GetContainer()->GetViewer()->SetScanMode();
194 if (
fAlias.Length())
return true;
214 Int_t max_ascent, max_descent;
217 fTHeight = max_ascent + max_descent;
228 if (
fIsCut && type)
return;
229 if (!
fIsCut && !type)
return;
232 SetToolTipText(
"Selection expression. Drag to scissors to activate");
254 SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
266 SetToolTipText(
"User-defined expression/cut. Double-click to edit");
336 if (
f)
return f->ConvertAliases();
382 if (
f)
return f->ConvertAliases();
396 if (
f)
return f->ConvertAliases();
410 if (
f)
return f->ConvertAliases();
424 if (
f)
return f->GetTrueName();
444 total = selected = 0;
453 if (
f->GetTip()) (
f->GetTip())->Hide();
470 if (selected == 1 && event->
fCode == 1) {
497 f->SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
501 if (!strlen(
f->GetTrueName())) {
503 f->SetSmallPic(
fClient->GetPicture(
"pack_t.xpm"));
507 name =
f->GetTrueName();
511 f->SetTrueName(
name.Data());
514 "Name too long. Can not add any more items to scan box.");
523 snprintf(msg,2000,
"Content : %s",
f->GetTrueName());
527 if ((std::abs(event->
fX -
fXp) < 2) && (std::abs(event->
fY -
fYp) < 2)) {
544 Int_t xf0, xff, yf0, yff;
555 if (
f->GetTip()) (
f->GetTip())->Hide();
560 xff =
f->GetX() +
f->GetWidth();
561 yff =
f->GetY() +
f->GetHeight();
562 itemType = (
ULong_t *)
f->GetUserData();
564 if (xpos>xf0 && xpos<xff && ypos>yf0 && ypos<yff) {
571 if ((
fXp - event->
fX) > 10) {
594 f->SetSmallPic(
fClient->GetPicture(
"pack-empty_t.xpm"));
634 if (!strcmp(
f->GetItemName()->GetString(),
name)) {
667 if (!
fViewer)
Error(
"TGSelectBox",
"Must be started from viewer");
677 fTe->SetToolTipText(
"Type an expression using C++ syntax. Click other expression/leaves to paste them here.");
684 fTeAlias->SetToolTipText(
"Define an alias for this expression. Do NOT use leading strings of other aliases.");
694 fDONE->Associate(
this);
756 event.fX =
event.fY = 1;
757 Int_t position =
fTe->GetCursorPosition();
758 fTe->HandleButton(&event);
759 fTe->SetCursorPosition(position);
780 fEntry->SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
782 fEntry->SetToolTipText(
"User-defined expression/cut. Double-click to edit");
784 cutType =
name.Contains(
"<") ||
name.Contains(
">") ||
name.Contains(
"=") ||
785 name.Contains(
"!") ||
name.Contains(
"&") ||
name.Contains(
"|");
824 fTe->InsertText(
text,
fTe->GetCursorPosition());
875 if (!strcmp(
fTeAlias->GetText(),
"-empty-") || !strlen(
fTeAlias->GetText())) {
876 fViewer->Warning(
"ValidateAlias",
"You should define the alias first.");
886 fViewer->Warning(
"ValidAlias",
"Alias can not be the leading string of other alias.");
const Mask_t kLeaveWindowMask
const Mask_t kEnterWindowMask
Handle_t Window_t
Window handle.
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.
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
static unsigned int total
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
Bool_t fMapSubwindows
kTRUE - map subwindows
TList * fList
container of frame elements
virtual void RemoveItem(TGFrame *item)
Remove item from container.
const TGWindow * fMsgWindow
window handling container messages
Int_t fYp
previous pointer position
Int_t fY0
corner of rubber band box
Int_t fSelected
number of selected items
Bool_t fDragging
true if in dragging mode
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
UInt_t fHeight
frame height
void MapWindow() override
map window
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
A composite frame that layout their children in horizontal way.
Empty object used as context menu support for TGLVTreeEntries.
void EditExpression()
Edit expression.
void SetExpression(const char *name="", const char *alias="-empty-", bool cut=false)
Set item expression.
void Draw(Option_t *option="") override
Draw item.
TGItemContext()
Constructor.
void RemoveItem()
Remove item.
TGLVEntry * fLastActive
last active item
TGLVContainer(const TGLVContainer &)=delete
const TGPicture * fCurrent
current icon
UInt_t fTHeight
height of name
void DoRedraw() override
Redraw list view item.
UInt_t fTWidth
width of name
TGDimension GetDefaultSize() const override
Get default size of list item.
Bool_t fActive
true if item is active
FontStruct_t fFontStruct
text font
TGString * fItemName
name of item
void * GetUserData() const
TGLVEntry(const TGLVEntry &)=delete
TGSelectedPicture * fSelPic
selected icon
const TGPicture * fSmallPic
small icon
This class handles GUI labels.
This class describes layout hints used by the layout classes.
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.
This class represent a specialized expression editor for TTVLVEntry 'true name' and 'alias' data memb...
bool ValidateAlias()
Return true if edited alias is not a leading string of other expression aliases.
TGHorizontalFrame * fBf
Buttons frame.
TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w=10, UInt_t h=10)
TGSelectBox constructor.
bool ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Message interpreter.
TGLayoutHints * fBLayout1
Layout for close button.
TGTextEntry * fTeAlias
Alias text entry.
void CloseWindow() override
Close the select box.
void InsertText(const char *text)
Insert text in text entry.
TGLayoutHints * fBLayout
Layout for cancel button.
TGLabel * fLabelAlias
Alias label.
TGLayoutHints * fLayout
Layout hints for widgets inside.
TGTextButton * fCANCEL
Cancel button.
void GrabPointer()
Just focus the cursor inside.
~TGSelectBox() override
TGSelectBox destructor.
void SetLabel(const char *title)
Set label of selection box.
void SetEntry(TTVLVEntry *entry)
Connect one entry.
static TGSelectBox * fgInstance
TTVLVEntry * fEntry
Edited expression entry.
static TGSelectBox * GetInstance()
Return the pointer to the instantiated singleton.
TString fOldAlias
Old alias for edited entry.
TGTextEntry * fTe
Text entry box.
TTreeViewer * fViewer
Pointer to tree viewer.
TGTextButton * fDONE
Close button.
void SaveText()
Save the edited entry true name and alias.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
TGTransientFrame(const TGTransientFrame &)=delete
ROOT GUI Window base class.
const TGWindow * GetParent() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
This class represent the list view container for the TreeView class.
Cursor_t fDefaultCursor
Default cursor.
void SelectItem(const char *name)
Select an item.
TList * fExpressionList
List of user defined expression widgets.
TList * ExpressionList()
Return the list of user-defined expressions.
const char * Cut()
Return the cut entry.
TTreeViewer * GetViewer()
const char * Ez()
Return the expression on Z.
TGListView * fListView
Associated list view.
const char * Ey()
Return the expression on Y.
const char * ScanList()
Return the cut entry.
TTreeViewer * fViewer
Pointer to tree viewer.
Cursor_t fCursor
Current cursor.
~TTVLVContainer() override
TGLVContainer destructor.
TTVLVEntry * ExpressionItem(Int_t index)
Return the expression item at specific position.
bool HandleMotion(Event_t *event) override
Handle mouse motion events.
const char * Ex()
Return the expression on X.
TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame)
TGLVContainer constructor.
bool HandleButton(Event_t *event) override
Handle mouse button event in container.
void EmptyAll()
Clear all names and aliases for expression type items.
void RemoveNonStatic()
Remove all non-static items from the list view, except expressions.
This class represent entries that goes into the TreeViewer listview container.
void SetSmallPic(const TGPicture *spic)
Set small picture.
~TTVLVEntry() override
TTVLVEntry destructor.
bool HasAlias()
Check if alias name is not empty.
TTVLVContainer * GetContainer()
TTVLVContainer * fContainer
Container to whom this item belongs.
TGToolTip * fTip
Tool tip associated with item.
bool fIsCut
Flag for cut type items.
void SetCutType(bool type=false)
Set cut type.
void SetAlias(const char *alias)
void SetExpression(const char *name, const char *alias, bool cutType=false)
Set the true name, alias and type of the expression, then refresh it.
void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this item.
void SetTrueName(const char *name)
TGItemContext * fContext
Associated context menu.
bool HandleCrossing(Event_t *event) override
Handle mouse crossing event.
const char * ConvertAliases()
Convert all aliases into true names.
void CopyItem(TTVLVEntry *dest)
Copy this item's name and alias to an other.
TString fConvName
Name converted into true expressions.
TString fTrueName
Name for this entry.
TString fAlias
Alias for this entry.
void Empty()
Clear all names and alias.
bool FullConverted()
Return true if converted name is alias free.
void SetItemName(const char *name)
Redraw this entry with new name.
const char * GetTrueName()
TTVLVEntry(const TGWindow *p, const TGPicture *bigpic, const TGPicture *smallpic, TGString *name, TGString **subnames, EListViewMode ViewMode)
TTVLVEntry constructor.
void PrependTilde()
Prepend a ~ to item alias.
A graphic user interface designed to handle ROOT trees and to take advantage of TTree class features.
int main(int argc, char **argv)
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
Int_t fYRoot
coordinates relative to root
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.