70 TGFrame(p, 10, 10, options, back)
93 Int_t max_ascent, max_descent;
128 TGFrame(p, 10, 10, options, back)
157 Int_t max_ascent, max_descent;
160 fTHeight = max_ascent + max_descent;
198 const char* n4,
const char* n5,
const char* n6,
199 const char* n7,
const char* n8,
const char* n9,
200 const char* n10,
const char* n11,
const char* n12)
211 if (n12 && strlen(n12)) ncol=12;
212 else if (n11 && strlen(n11)) ncol=11;
213 else if (n10 && strlen(n10)) ncol=10;
214 else if (n9 && strlen(n9)) ncol=9;
215 else if (n8 && strlen(n8)) ncol=8;
216 else if (n7 && strlen(n7)) ncol=7;
217 else if (n6 && strlen(n6)) ncol=6;
218 else if (n5 && strlen(n5)) ncol=5;
219 else if (n4 && strlen(n4)) ncol=4;
220 else if (n3 && strlen(n3)) ncol=3;
221 else if (n2 && strlen(n2)) ncol=2;
222 else if (n1 && strlen(n1)) ncol=1;
242 fCtw =
new int[ncol];
245 for (
int i = 0; i<ncol; i++) {
294 if (!bigpic || !smallpic)
return;
326 Int_t ix, iy, lx, ly;
327 Int_t max_ascent, max_descent;
331 fTHeight = max_ascent + max_descent;
365 if ( ftmpWidth > (
fCpos[0] - lx) ) {
367 tmpString = (*fItemName)(0,j) +
"...";
370 if ( ftmpWidth <= (
fCpos[0] - lx) ) {
388 tmpTGString.
Draw(
id,
fNormGC, x+lx, y+ly + max_ascent);
432 for (
int j =
fSubnames[i]->Length() - 1 ; j > 0; j--) {
433 tmpString = (*
fSubnames[i])(0,j) +
"...";
445 lx =
fCpos[i+1] - ftmpWidth - 2;
447 lx = (
fCpos[i] +
fCpos[i+1] - ftmpWidth) >> 1;
453 tmpTGString.
Draw(
id,
fNormGC, x + lx, y + ly + max_ascent);
474 size.
fHeight = isize.fHeight + lsize.fHeight + 6;
480 size.
fWidth = isize.fWidth + lsize.fWidth + 4;
566 const char* n4,
const char* n5,
const char* n6,
567 const char* n7,
const char* n8,
const char* n9,
568 const char* n10,
const char* n11,
const char* n12)
573 if (n12 && strlen(n12)) ncol=12;
574 else if (n11 && strlen(n11)) ncol=11;
575 else if (n10 && strlen(n10)) ncol=10;
576 else if (n9 && strlen(n9)) ncol=9;
577 else if (n8 && strlen(n8)) ncol=8;
578 else if (n7 && strlen(n7)) ncol=7;
579 else if (n6 && strlen(n6)) ncol=6;
580 else if (n5 && strlen(n5)) ncol=5;
581 else if (n4 && strlen(n4)) ncol=4;
582 else if (n3 && strlen(n3)) ncol=3;
583 else if (n2 && strlen(n2)) ncol=2;
584 else if (n1 && strlen(n1)) ncol=1;
784 newpos = pos.
fY - page;
785 if (newpos < 0) newpos = 0;
802 fXp = pos.
fX +
event->fX;
803 fYp = pos.
fY +
event->fY;
821 select_frame =
kTRUE;
825 select_frame =
kTRUE;
829 if (select_frame || last==el->
fFrame)
830 inSelection = !inSelection;
831 if (inSelection || select_frame) {
845 total = selected = 0;
857 select_frame =
kTRUE;
861 select_frame =
kTRUE;
886 if ( selected == 0 ) {
1047 if (x > hw && (hb && !hb->
IsMapped())) {
1166 this,
"ScrollHeader(Int_t)");
1196 Int_t i, xl = - pos;
1217 if (ncolumns <= 0) {
1218 Error(
"SetHeaders",
"number of columns must be > 0");
1249 this,
"LayoutHeader(TGFrame *)");
1251 this,
"SetDefaultColumnWidth(TGVFileSplitter*)");
1278 Error(
"SetHeader",
"header index must be [0 - %d>",
fNColumns-1);
1289 if (txt.
Contains(
"modified")) txt +=
" date";
1290 if (txt.
Contains(
"attributes")) txt =
"type";
1365 Error(
"SetContainer",
"frame must inherit from TGLVContainer");
1385 Error(
"SetDefaultColumnWidth",
"no listview container set yet");
1412 Error(
"ResizeColumns",
"no listview container set yet");
1431 Error(
"Layout",
"no listview container set yet");
1454 for (
int j =
fColNames[i].Length() - 1 ; j > 0; j--) {
1496 container->
Move(0, h);
1505 container->
Move(0, 0);
1518 static Int_t oldPos = 0;
1519 if (head == 0) oldPos = 0;
1524 Error(
"Layout",
"no listview container set yet");
1547 for (
int j =
fColNames[i].Length() - 1 ; j > 0; j--) {
1628 Emit(
"Clicked(TGLVEntry*,Int_t)", args);
1643 Emit(
"Clicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1656 Emit(
"DoubleClicked(TGLVEntry*,Int_t)", args);
1671 Emit(
"DoubleClicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1703 out << std::endl <<
" // list view" << std::endl;
1704 out <<
" TGListView *";
1710 out <<
");" << std::endl;
1717 if (option && strstr(option,
"keep_names"))
1718 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1724 <<
");" << std::endl;
1725 out <<
" " <<
GetName() <<
"->SetViewMode(";
1728 out <<
"kLVLargeIcons";
1731 out <<
"kLVSmallIcons";
1737 out <<
"kLVDetails";
1740 out <<
");" << std::endl;
1746 <<
");" << std::endl;
1751 <<
");" << std::endl;
1762 out << std::endl <<
" // list view container" << std::endl;
1763 out <<
" TGLVContainer *";
1766 out <<
GetName() <<
" = new TGLVContainer(" << GetCanvas()->GetName();
1773 out <<
");" << std::endl;
1780 if (option && strstr(option,
"keep_names"))
1781 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual Int_t GetMaxSubnameWidth(Int_t idx) const
Get width of largest subname in container.
virtual Int_t NumSelected() const
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
EListViewMode GetViewMode() const
virtual UInt_t GetOptions() const
virtual void Activate(Bool_t a)
Make list view item active.
virtual void RemoveAll()
Remove all items from the container.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
virtual Int_t GetSubnameWidth(Int_t idx) const
virtual void Clicked(TGLVEntry *entry, Int_t btn)
Emit Clicked() signal.
virtual TGDimension GetMaxItemSize() const
Get size of largest item in container.
Collectable string class.
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
TString GetString() const
const Mask_t kKeyShiftMask
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
virtual void LineLeft(Bool_t select=kFALSE)
Move current position one column left.
virtual void RemoveItemWithData(void *userData)
Remove item with fUserData == userData from container.
virtual void LineDown(Bool_t select=kFALSE)
Move one line down.
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
TGLVContainer(const TGLVContainer &)
virtual void SetContainer(TGFrame *f)
static const TGGC & GetLineGC()
Get graphics context for line drawing.
virtual void SetTextJustify(Int_t tmode)
Set text justification.
const TGResourcePool * GetResourcePool() const
TGVFileSplitter ** fSplitHeader
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list view widget as a C++ statement(s) on output stream out.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
static Pixel_t fgWhitePixel
const TGPicture * fCheckMark
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
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.
virtual void SetColumns(Int_t *cpos, Int_t *jmode)
Set column information for list items.
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
static Pixel_t fgDefaultSelectedBackground
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode.
TGFrame * GetContainer() const
virtual void LayoutHeader(TGFrame *head)
Layout list view components (container and contents of container).
virtual void SelectionChanged()
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
const TGWindow * fMsgWindow
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode for container.
virtual void Layout()
Layout list view components (container and contents of container).
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
virtual ~TGLVContainer()
Delete list view container.
virtual TGPosition GetPagePosition() const
Returns page position.
void Draw(Option_t *="")
Default Draw method for all objects.
virtual void LineRight(Bool_t select=kFALSE)
Move current position one column right.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list view container as a C++ statement(s) on output stream out.
virtual TGDimension GetPageDimension() const
Returns page dimension.
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
TList * GetSelectedEntries()
Get list of selected items in container.
virtual void SetDefaultHeaders()
Default headers are: Name, Attributes, Size, Owner, Group, Modified.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
TGFrameElement * fLastActiveEl
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
virtual void ScrollHeader(Int_t pos)
Scroll header buttons with horizontal scrollbar.
Pixel_t GetSelectedFgndColor() const
static Pixel_t fgBlackPixel
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
Set default column width of the columns headers.
TGVScrollBar * fVScrollbar
virtual void DoubleClicked(TGLVEntry *entry, Int_t btn)
Emit DoubleClicked() signal.
TGFrame * GetContainer() const
TGListView(const TGListView &)
virtual void RemoveItem(TGFrame *item)
Remove item from container.
TGMimeTypes * GetMimeTypeList() const
virtual void Layout()
Layout container entries.
TGTextButton ** fColHeader
virtual const char * GetHeader(Int_t idx) const
Returns name of header idx.
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 SetFont(FontH_t v)
Set font.
const TGPicture * fSmallPic
static TGGC * fgDefaultGC
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a frame widget as a C++ statement(s) on output stream out.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
TGLVEntry(const TGLVEntry &)
R__EXTERN TSystem * gSystem
void * GetUserData() const
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw list view item in other window.
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
virtual void DeActivateItem(TGFrameElement *el)
Unselect/deactivate item.
virtual void ActivateItem(TGFrameElement *el)
Select/activate item.
virtual UInt_t GetDefaultWidth() const
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
virtual ~TGListView()
Delete a list view widget.
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
virtual TGDimension GetDefaultSize() const
Get default size of list item.
static constexpr double ms
TList * GetSelectedItems()
Get list of selected items in container.
virtual void ClearViewPort()
Clear view port and redraw full content.
virtual void Move(Int_t x, Int_t y)
Move frame.
const char * GetString() const
virtual void LineUp(Bool_t select=kFALSE)
Make current position first line in window by scrolling up.
virtual void SetText(TGHotString *new_label)
Set new button text.
static unsigned int total
virtual UInt_t GetDefaultHeight() const
TGLayoutHints * fItemLayout
TGHScrollBar * fHScrollbar
TGDimension GetMaxItemSize() const
static const TGFont * fgDefaultFont
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
virtual void SetPictures(const TGPicture *bigpic=0, const TGPicture *smallpic=0)
change pictures
static const TGFont * fgDefaultFont
virtual void RaiseWindow()
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle messages generated by the list view components.
FontStruct_t GetFontStruct() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
virtual void UnSelectAll()
Unselect all items in the container.
virtual Bool_t IsActive() const
virtual void SetViewMode(EListViewMode viewMode)
Set the view mode for this list item.
const TGWindow * GetParent() const
const TGPicture * fCurrent
TGSelectedPicture * fSelPic
virtual void SetHeaders(Int_t ncolumns)
Set number of headers, i.e.
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
virtual TGLayoutManager * GetLayoutManager() const
static TGGC * fgDefaultGC
virtual void UnmapWindow()
virtual void Layout()
Create layout for canvas.
virtual void Add(TObject *obj)
Short_t Max(Short_t a, Short_t b)
virtual void ActivateItem(TGFrameElement *el)
Activate item.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual void DoRedraw()
Redraw list view item.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
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...
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
const Mask_t kKeyControlMask
virtual void ResizeColumns()
Resize column headers to show whole item names.
virtual ~TGLVEntry()
Delete a list view item.
const TGPicture * fBigPic
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
virtual void SetContainer(TGFrame *f)
Set list view container.
virtual void SetDefaultWidth(UInt_t)
virtual void DestroyWindow()
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
virtual Int_t MustCleanup() const
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
const char * Data() const
FontH_t GetFontHandle() const