95 Int_t max_ascent, max_descent;
100 fTHeight = max_ascent + max_descent;
158 Int_t max_ascent, max_descent;
161 fTHeight = max_ascent + max_descent;
201 const char* n4,
const char* n5,
const char* n6,
202 const char* n7,
const char* n8,
const char* n9,
203 const char* n10,
const char* n11,
const char* n12)
217 if (n12 && strlen(n12)) ncol=12;
218 else if (n11 && strlen(n11)) ncol=11;
219 else if (n10 && strlen(n10)) ncol=10;
220 else if (n9 && strlen(n9)) ncol=9;
221 else if (n8 && strlen(n8)) ncol=8;
222 else if (n7 && strlen(n7)) ncol=7;
223 else if (n6 && strlen(n6)) ncol=6;
224 else if (n5 && strlen(n5)) ncol=5;
225 else if (n4 && strlen(n4)) ncol=4;
226 else if (n3 && strlen(n3)) ncol=3;
227 else if (n2 && strlen(n2)) ncol=2;
228 else if (n1 && strlen(n1)) ncol=1;
248 fCtw =
new int[ncol];
251 for (
int i = 0; i<ncol; i++) {
300 if (!bigpic || !smallpic)
return;
332 Int_t ix, iy, lx, ly;
333 Int_t max_ascent, max_descent;
337 fTHeight = max_ascent + max_descent;
371 if ( ftmpWidth > (
fCpos[0] - lx) ) {
373 tmpString = (*fItemName)(0,j) +
"...";
376 if ( ftmpWidth <= (
fCpos[0] - lx) ) {
438 for (
int j =
fSubnames[i]->Length() - 1 ; j > 0; j--) {
439 tmpString = (*
fSubnames[i])(0,j) +
"...";
451 lx =
fCpos[i+1] - ftmpWidth - 2;
453 lx = (
fCpos[i] +
fCpos[i+1] - ftmpWidth) >> 1;
480 size.fHeight = isize.fHeight + lsize.fHeight + 6;
486 size.fWidth = isize.fWidth + lsize.fWidth + 4;
572 const char* n4,
const char* n5,
const char* n6,
573 const char* n7,
const char* n8,
const char* n9,
574 const char* n10,
const char* n11,
const char* n12)
579 if (n12 && strlen(n12)) ncol=12;
580 else if (n11 && strlen(n11)) ncol=11;
581 else if (n10 && strlen(n10)) ncol=10;
582 else if (n9 && strlen(n9)) ncol=9;
583 else if (n8 && strlen(n8)) ncol=8;
584 else if (n7 && strlen(n7)) ncol=7;
585 else if (n6 && strlen(n6)) ncol=6;
586 else if (n5 && strlen(n5)) ncol=5;
587 else if (n4 && strlen(n4)) ncol=4;
588 else if (n3 && strlen(n3)) ncol=3;
589 else if (n2 && strlen(n2)) ncol=2;
590 else if (n1 && strlen(n1)) ncol=1;
747 if (
f->GetUserData() == userData) {
790 newpos = pos.
fY - page;
791 if (newpos < 0) newpos = 0;
808 fXp = pos.
fX +
event->fX;
809 fYp = pos.
fY +
event->fY;
827 select_frame =
kTRUE;
831 select_frame =
kTRUE;
835 if (select_frame || last==el->
fFrame)
836 inSelection = !inSelection;
837 if (inSelection || select_frame) {
851 total = selected = 0;
862 select_frame =
kTRUE;
866 select_frame =
kTRUE;
891 if ( selected == 0 ) {
1055 if (
x > hw && (hb && !hb->
IsMapped())) {
1191 this,
"ScrollHeader(Int_t)");
1221 Int_t i, xl = - pos;
1242 if (ncolumns <= 0) {
1243 Error(
"SetHeaders",
"number of columns must be > 0");
1274 this,
"LayoutHeader(TGFrame *)");
1276 this,
"SetDefaultColumnWidth(TGVFileSplitter*)");
1303 Error(
"SetHeader",
"header index must be [0 - %d>",
fNColumns-1);
1314 if (txt.
Contains(
"modified")) txt +=
" date";
1315 if (txt.
Contains(
"attributes")) txt =
"type";
1390 Error(
"SetContainer",
"frame must inherit from TGLVContainer");
1410 Error(
"SetDefaultColumnWidth",
"no listview container set yet");
1437 Error(
"ResizeColumns",
"no listview container set yet");
1456 Error(
"Layout",
"no listview container set yet");
1479 for (
int j =
fColNames[i].Length() - 1 ; j > 0; j--) {
1521 container->
Move(0,
h);
1530 container->
Move(0, 0);
1543 static Int_t oldPos = 0;
1544 if (head == 0) oldPos = 0;
1549 Error(
"Layout",
"no listview container set yet");
1572 for (
int j =
fColNames[i].Length() - 1 ; j > 0; j--) {
1615 entry = (
TGLVEntry *) cnt->GetNextSelected(&
p);
1619 if ((cnt->NumSelected() == 1) && (entry != 0)) {
1627 if ((cnt->NumSelected() == 1) && (entry!=0)) {
1653 Emit(
"Clicked(TGLVEntry*,Int_t)", args);
1668 Emit(
"Clicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1681 Emit(
"DoubleClicked(TGLVEntry*,Int_t)", args);
1696 Emit(
"DoubleClicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1728 out << std::endl <<
" // list view" << std::endl;
1729 out <<
" TGListView *";
1735 out <<
");" << std::endl;
1743 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1749 <<
");" << std::endl;
1750 out <<
" " <<
GetName() <<
"->SetViewMode(";
1753 out <<
"kLVLargeIcons";
1756 out <<
"kLVSmallIcons";
1762 out <<
"kLVDetails";
1765 out <<
");" << std::endl;
1771 <<
");" << std::endl;
1776 <<
");" << std::endl;
1787 out << std::endl <<
" // list view container" << std::endl;
1788 out <<
" TGLVContainer *";
1798 out <<
");" << std::endl;
1806 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
Handle_t Window_t
Window handle.
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
ULong_t Pixel_t
Pixel value.
ULongptr_t Handle_t
Generic resource handle.
Handle_t FontStruct_t
Pointer to font structure.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
static unsigned int total
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
virtual void SetContainer(TGFrame *f)
TGFrame * GetContainer() const
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
TGViewPort * fVport
viewport through which we look at contents
TGHScrollBar * fHScrollbar
horizontal scrollbar
TGVScrollBar * fVScrollbar
vertical scrollbar
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle message generated by the canvas scrollbars.
void Layout() override
Create layout for canvas.
const TGResourcePool * GetResourcePool() const
TGMimeTypes * GetMimeTypeList() const
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual TGLayoutManager * GetLayoutManager() const
Int_t MustCleanup() const override
Bool_t fMapSubwindows
kTRUE - map subwindows
TList * fList
container of frame elements
virtual void ActivateItem(TGFrameElement *el)
Activate item.
virtual void RemoveItem(TGFrame *item)
Remove item from container.
TGCanvas * fCanvas
pointer to canvas
TTimer * fScrollTimer
autoscroll timer
Int_t fYf
other corner of rubber band box
virtual void UnSelectAll()
Unselect all items in the container.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in container.
virtual void ClearViewPort()
Clear view port and redraw full content.
const TGWindow * fMsgWindow
window handling container messages
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
Int_t fYp
previous pointer position
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
void Layout() override
Layout container entries.
Int_t fY0
corner of rubber band box
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
TGCanvas * GetCanvas() const
Int_t fSelected
number of selected items
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
Bool_t fScrolling
kTRUE - when scrolling is ON
static const TGGC & GetLineGC()
Get graphics context for line drawing.
Bool_t fDragging
true if in dragging mode
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
TGViewPort * fViewPort
container viewport
void RemoveAll() override
Remove all items from the container.
virtual TGPosition GetPagePosition() const
Returns page position.
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
TGFrameElement * fLastActiveEl
last active item
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
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.
virtual Bool_t IsActive() const
UInt_t fHeight
frame height
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a frame widget as a C++ statement(s) on output stream out.
Int_t fBorderWidth
frame border width
static Pixel_t fgDefaultSelectedBackground
void MapWindow() override
map window
TGFrameElement * GetFrameElement() const
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
void Move(Int_t x, Int_t y) override
Move frame.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
void UnmapWindow() override
unmap window
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
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
Encapsulate a graphics context used in the low level graphics.
void SetFont(FontH_t v)
Set font.
TGHotString is a string with a "hot" character underlined.
void LineRight(Bool_t select=kFALSE) override
Move current position one column right.
TGListView * fListView
listview which contains this container
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in container.
void LineDown(Bool_t select=kFALSE) override
Move one line down.
TList * GetSelectedItems()
Get list of selected items in container.
virtual void SetColumns(Int_t *cpos, Int_t *jmode)
Set column information for list items.
void LineLeft(Bool_t select=kFALSE) override
Move current position one column left.
virtual void SetColHeaders(const char *n1="", const char *n2="", const char *n3="", const char *n4="", const char *n5="", const char *n6="", const char *n7="", const char *n8="", const char *n9="", const char *n10="", const char *n11="", const char *n12="")
set columns headers
virtual void SelectEntry(TGLVEntry *item)
Select the TGLVEntry given as argument and de-select the previous one if the container is not in mult...
Bool_t fMultiSelect
true = multiple file selection
void DeActivateItem(TGFrameElement *el) override
Unselect/deactivate item.
TGLayoutHints * fItemLayout
item layout hints
virtual Int_t GetMaxSubnameWidth(Int_t idx) const
Get width of largest subname in container.
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode for container.
TGLVEntry * fLastActive
last active item
virtual void RemoveItemWithData(void *userData)
Remove item with fUserData == userData from container.
void ActivateItem(TGFrameElement *el) override
Select/activate item.
Int_t * fCpos
position of sub names
TGLVContainer(const TGLVContainer &)=delete
TList * GetSelectedEntries()
Get list of selected items in container.
Int_t * fJmode
alignment of sub names
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list view container as a C++ statement(s) on output stream out.
TGDimension GetPageDimension() const override
Returns page dimension.
~TGLVContainer() override
Delete list view container.
void LineUp(Bool_t select=kFALSE) override
Make current position first line in window by scrolling up.
EListViewMode fViewMode
list view viewing mode
virtual TGDimension GetMaxItemSize() const
Get size of largest item in container.
const TGPicture * fCurrent
current icon
void * fUserData
pointer to user data structure
UInt_t fTHeight
height of name
~TGLVEntry() override
Delete a list view item.
virtual void SetPictures(const TGPicture *bigpic=nullptr, const TGPicture *smallpic=nullptr)
change pictures
TGString ** fSubnames
sub names of item (details)
void DoRedraw() override
Redraw list view item.
Int_t * fCpos
position of sub names
UInt_t fTWidth
width of name
TGDimension GetDefaultSize() const override
Get default size of list item.
void Activate(Bool_t a) override
Make list view item active.
Bool_t fActive
true if item is active
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw list view item in other window.
FontStruct_t fFontStruct
text font
EListViewMode fViewMode
list view viewing mode
GContext_t fNormGC
drawing graphics context
TGString * fItemName
name of item
const TGPicture * fBigPic
big icon
virtual void SetViewMode(EListViewMode viewMode)
Set the view mode for this list item.
Bool_t fChecked
true if item is checked
TGLVEntry(const TGLVEntry &)=delete
Int_t * fCtw
width of sub names
TGSelectedPicture * fSelPic
selected icon
const TGPicture * fSmallPic
small icon
virtual Int_t GetSubnameWidth(Int_t idx) const
Int_t * fJmode
alignment for sub names
virtual void SetSubnames(const char *n1="", const char *n2="", const char *n3="", const char *n4="", const char *n5="", const char *n6="", const char *n7="", const char *n8="", const char *n9="", const char *n10="", const char *n11="", const char *n12="")
Sets new subnames.
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
const TGPicture * fCheckMark
checkmark
static TGGC * fgDefaultGC
static const TGFont * fgDefaultFont
This class describes layout hints used by the layout classes.
virtual void SetDefaultWidth(UInt_t)
This is a layout manager for the TGListView widget.
This is a layout manager for the TGListView widget.
A list view is a widget that can contain a number of items arranged in a grid or list.
Int_t * fJmode
column text alignment
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
virtual void DoubleClicked(TGLVEntry *entry, Int_t btn)
Emit DoubleClicked() signal.
virtual void ResizeColumns()
Resize column headers to show whole item names.
EListViewMode fViewMode
view mode if list view widget
virtual void ScrollHeader(Int_t pos)
Scroll header buttons with horizontal scrollbar.
TGListView(const TGListView &)=delete
Int_t * fColumns
column width
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list view widget as a C++ statement(s) on output stream out.
virtual void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)
Set header button idx [0-fNColumns>, hmode is the x text alignmode (ETextJustification) for the heade...
void Layout() override
Layout list view components (container and contents of container).
FontStruct_t fFontStruct
text font
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
void SetContainer(TGFrame *f) override
Set list view container.
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode.
GContext_t fNormGC
drawing graphics context
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
~TGListView() override
Delete a list view widget.
Int_t fNColumns
number of columns
TGDimension fMaxSize
maximum item size
TGHeaderFrame * fHeader
frame used as container for column headers
virtual void SetHeaders(Int_t ncolumns)
Set number of headers, i.e.
TString * fColNames
column titles for in detailed mode
virtual void SelectionChanged()
UInt_t fMinColumnSize
Minimun column size.
TGTextButton ** fColHeader
column headers for in detailed mode
virtual void SetDefaultHeaders()
Default headers are: Name, Attributes, Size, Owner, Group, Modified.
virtual void Clicked(TGLVEntry *entry, Int_t btn)
Emit Clicked() signal.
virtual void LayoutHeader(TGFrame *head)
Layout list view components (container and contents of container).
Bool_t fJustChanged
Indicate whether the view mode was just changed to Detail.
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
Set default column width of the columns headers.
static const TGFont * fgDefaultFont
TGVFileSplitter ** fSplitHeader
column splitters
virtual const char * GetHeader(Int_t idx) const
Returns name of header idx.
TGDimension GetMaxItemSize() const
static TGGC * fgDefaultGC
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle messages generated by the list view components.
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
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.
void Draw(Option_t *="") override
Default Draw method for all objects.
Pixel_t GetSelectedFgndColor() const
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
Yield an action as soon as it is clicked.
virtual void SetTextJustify(Int_t tmode)
Set text justification.
virtual void SetText(TGHotString *new_label)
Set new button text.
TString GetString() const
This is a layout manager for the TGListView widget.
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
TGFrame * GetContainer() const
ROOT GUI Window base class.
const TGWindow * fParent
Parent window.
virtual void DestroyWindow()
destroy window
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
virtual void RaiseWindow()
raise window
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
void Add(TObject *obj) override
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Collectable string class.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
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.
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
EGEventType fType
of event (see EGEventType)
UInt_t fState
key or button mask
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.