216 Int_t max_ascent, max_descent;
219 fTHeight = max_ascent + max_descent;
234 SetToolTipText(
"Selection expression. Drag to scissors to activate");
256 SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
268 SetToolTipText(
"User-defined expression/cut. Double-click to edit");
339 if (
f)
return f->ConvertAliases();
385 if (
f)
return f->ConvertAliases();
399 if (
f)
return f->ConvertAliases();
413 if (
f)
return f->ConvertAliases();
427 if (
f)
return f->GetTrueName();
447 total = selected = 0;
456 if (
f->GetTip()) (
f->GetTip())->Hide();
473 if (selected == 1 &&
event->fCode == 1) {
500 f->SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
504 if (!strlen(
f->GetTrueName())) {
510 name =
f->GetTrueName();
514 f->SetTrueName(
name.Data());
517 "Name too long. Can not add any more items to scan box.");
526 snprintf(msg,2000,
"Content : %s",
f->GetTrueName());
547 Int_t xf0, xff, yf0, yff;
558 if (
f->GetTip()) (
f->GetTip())->Hide();
563 xff =
f->GetX() +
f->GetWidth();
564 yff =
f->GetY() +
f->GetHeight();
565 itemType = (
ULong_t *)
f->GetUserData();
567 if (xpos>xf0 && xpos<xff && ypos>yf0 && ypos<yff) {
637 if (!strcmp(
f->GetItemName()->GetString(),
name)) {
671 if (!
fViewer)
Error(
"TGSelectBox",
"Must be started from viewer");
681 fTe->
SetToolTipText(
"Type an expression using C++ syntax. Click other expression/leaves to paste them here.");
688 fTeAlias->
SetToolTipText(
"Define an alias for this expression. Do NOT use leading strings of other aliases.");
760 event.fX =
event.fY = 1;
784 fEntry->
SetToolTipText(
"Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
788 cutType =
name.Contains(
"<") ||
name.Contains(
">") ||
name.Contains(
"=") ||
789 name.Contains(
"!") ||
name.Contains(
"&") ||
name.Contains(
"|");
880 fViewer->
Warning(
"ValidateAlias",
"You should define the alias first.");
890 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.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
static unsigned int total
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
const TGWindow * GetRoot() const
Returns current root (i.e.
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void FreePicture(const TGPicture *pic)
Free picture resource.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Bool_t fMapSubwindows
kTRUE - map subwindows
TList * fList
container of frame elements
virtual UInt_t GetDefaultHeight() const
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.
UInt_t fHeight
frame height
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
virtual void MapWindow()
map window
A composite frame that layout their children in horizontal way.
Empty object used as context menu support for TGLVTreeEntries.
void EditExpression()
Edit expression.
TGItemContext()
Constructor.
void Draw(Option_t *option="")
Draw item.
void RemoveItem()
Remove item.
void SetExpression(const char *name="", const char *alias="-empty-", Bool_t cut=kFALSE)
Set item expression.
void Associate(TTVLVEntry *item)
TGLVEntry * fLastActive
last active item
const TGPicture * fCurrent
current icon
UInt_t fTHeight
height of name
UInt_t fTWidth
width of name
virtual void DoRedraw()
Redraw list view item.
Bool_t fActive
true if item is active
FontStruct_t fFontStruct
text font
TGString * fItemName
name of item
void * GetUserData() const
virtual TGDimension GetDefaultSize() const
Get default size of list item.
virtual void Activate(Bool_t a)
Make list view item active.
TGSelectedPicture * fSelPic
selected icon
const TGPicture * fSmallPic
small icon
This class handles GUI labels.
virtual void SetText(TGString *newText)
Set new text in label.
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...
TGHorizontalFrame * fBf
Buttons frame.
TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w=10, UInt_t h=10)
TGSelectBox constructor.
TGLayoutHints * fBLayout1
Layout for close button.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Message interpreter.
TGTextEntry * fTeAlias
Alias text entry.
virtual void CloseWindow()
Close the select box.
virtual ~TGSelectBox()
TGSelectBox destructor.
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.
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.
Bool_t ValidateAlias()
Return true if edited alias is not a leading string of other expression aliases.
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...
const char * GetString() const
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.
Int_t GetCursorPosition() const
const char * GetText() const
virtual void SetCursorPosition(Int_t pos)
Set the cursor position to newPos.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual void InsertText(const char *text, Int_t pos)
Inserts text at position pos, clears the selection and moves the cursor to the end of the line.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in text entry widget.
Defines transient windows that typically are used for dialogs windows.
ROOT GUI Window base class.
const TGWindow * GetParent() const
virtual void Add(TObject *obj)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
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.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
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.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
TTVLVEntry * ExpressionItem(Int_t index)
Return the expression item at specific position.
virtual ~TTVLVContainer()
TGLVContainer destructor.
const char * Ex()
Return the expression on X.
TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame)
TGLVContainer constructor.
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.
void SetCutType(Bool_t type=kFALSE)
Set cut type.
Bool_t fIsCut
Flag for cut type items.
Bool_t 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.
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
void SetAlias(const char *alias)
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.
const char * ConvertAliases()
Convert all aliases into true names.
void SetExpression(const char *name, const char *alias, Bool_t cutType=kFALSE)
Set the true name, alias and type of the expression, then refresh it.
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.
void SetItemName(const char *name)
Redraw this entry with new name.
virtual ~TTVLVEntry()
TTVLVEntry destructor.
const char * GetTrueName()
Bool_t FullConverted()
Return true if converted name is alias free.
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.
void SetScanMode(Bool_t mode=kTRUE)
void Message(const char *msg)
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
#define dest(otri, vertexptr)