10 #include "KVListView.h"
12 #include "TVirtualX.h"
27 : TGListView(p, w, h, options, back), nselected(0), fObjClass(obj_class)
34 SetContainer(
new KVLVContainer(
this, kHorizontalFrame, fgWhitePixel));
35 SetViewMode(kLVDetails);
38 fContextMenu =
new TContextMenu(
"fCurrentContext");
50 switch (GET_SUBMSG(msg)) {
62 return TGCanvas::ProcessMessage(msg, parm1, parm2);
78 TGTextButton** buttons = GetHeaderButtons();
80 for (
int i = 0; i < (int)GetNumColumns(); i++) {
81 buttons[i]->Connect(
"Clicked()",
"KVLVContainer",
82 GetContainer(), Form(
"Sort(=%d)", i));
93 TGListView::SetHeaders(ncolumns);
114 SetHeader(name, kTextCenterX, mode, index);
129 for (Int_t idx = 0; idx < fNColumns - 1; idx++) {
130 if (fColHeader[idx]) {
131 if (fColNames[idx] == colname)
return idx;
151 TGLVContainer* container = (TGLVContainer*) fVport->GetContainer();
154 Error(
"SetDefaultColumnWidth",
"no listview container set yet");
157 container->ClearViewPort();
158 UInt_t minWidth = container->GetPageDimension().fWidth / (fNColumns - 1);
160 for (
int i = 0; i < fNColumns; ++i) {
161 if (fSplitHeader[i] == splitter) {
162 TString dt = fColHeader[i]->GetString();
163 UInt_t bsize = gVirtualX->TextWidth(fColHeader[i]->GetFontStruct(),
164 dt.Data(), dt.Length());
165 UInt_t w = TMath::Max(fColHeader[i]->GetDefaultWidth(), bsize + 20);
168 w = TMath::Max(w, minWidth);
171 w = TMath::Max(container->GetMaxSubnameWidth(i) + 40, (Int_t)w);
174 w = TMath::Max(w, minWidth);
176 fColHeader[i]->Resize(w, fColHeader[i]->GetHeight());
Extension of TGLVContainer for KVListView widget.
Enhanced version of ROOT TGListView widget.
virtual void ActivateSortButtons()
virtual void SetDataColumns(Int_t ncolumns)
void SetDoubleClickAction(const char *receiver_class, void *receiver, const char *slot)
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle messages generated by the list view container.
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
void AddContextMenuClassException(TClass *)
virtual Int_t GetColumnNumber(const Char_t *colname)
int nselected
number of selected items
TClass * fObjClass
class of objects in list
virtual void SetDataColumn(Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
void SetUseObjLabelAsRealClass(Bool_t yes=kTRUE)