70 fEditDisabled = kEditDisable | kEditDisableGrab;
117 int max_ascent, max_descent;
121 fTHeight = max_ascent + max_descent;
140 int max_ascent, max_descent;
176 int max_ascent, max_descent;
179 fTHeight = max_ascent + max_descent;
229 memcpy(gcv.
fDashes,
"\x5\x5", 3);
234 int max_ascent, max_descent;
239 max_ascent, max_descent);
240 fTHeight = max_ascent + max_descent;
273 static const char* dashed =
"\x3\x3";
274 static const char* dotted=
"\x1\x2";
275 static const char* dasheddotted =
"\x3\x4\x1\x4";
276 static const char* ls05 =
"\x5\x3\x1\x3";
277 static const char* ls06 =
"\x5\x3\x1\x3\x1\x3\x1\x3";
278 static const char* ls07 =
"\x5\x5";
279 static const char* ls08 =
"\x5\x3\x1\x3\x1\x3";
280 static const char* ls09 =
"\x20\x5";
281 static const char* ls10 =
"\x20\x10\x1\x10";
284 if (linestyle <= 1) {
373 int max_ascent, max_descent;
383 max_ascent, max_descent);
384 fTHeight = max_ascent + max_descent;
437 if (pic) ((
TGPicture *)pic)->AddReference();
446 virtual ~TGLBFrameElement() {}
461 if ((d1 = atof(t1)) && (d2 = atof(t2))) {
464 return strcmp(t1, t2);
530 TGLBFrameElement *nw =
new TGLBFrameElement(lbe, lhints ? lhints :
fgDefaultHints);
551 if (e->
EntryId() == afterID)
break;
554 if (!el && afterID != -1) {
558 nw =
new TGLBFrameElement(lbe, lhints);
594 nw =
new TGLBFrameElement(lbe, lhints);
815 int xf0, yf0, xff, yff;
836 if (newpos < 0) newpos = 0;
862 (x > xf0) && (x < xff) && (y > yf0) && (y < yff);
892 (x > xf0) && (x < xff) && (y > yf0) && (y < yff) && !f->
IsActive();
946 int xf0, yf0, xff, yff;
951 if ((now-was) < 50)
return kFALSE;
981 (x > xf0) && (x < xff) && (y > yf0) && (y < yff);
1004 (x > xf0) && (x < xff) && (y > yf0) && (y < yff) && !f->
IsActive();
1042 if (vb && y > 0 && y < 10) {
1045 if (newpos < 0) newpos = 0;
1062 if ((y + pos.
fY > yf0) && (y + pos.
fY < yff)) {
1193 if (
gClient->GetStyle() > 1)
break;
1387 if (lbe->
EntryId() == id)
return lbe;
1481 if ((
Int_t) cw < 0) {
1482 Warning(
"Layout",
"width would become too small, setting to 10");
1493 container->
Resize(cw, tch);
1624 Emit(
"Selected(Int_t,Int_t)", args);
1637 Emit(
"DoubleClicked(Int_t,Int_t)", args);
1662 out << std::endl <<
" // list box" << std::endl;
1664 out<<
" TGListBox *";
1670 out <<
");" << std::endl;
1672 out <<
"," <<
fWidgetId <<
");" << std::endl;
1680 if (option && strstr(option,
"keep_names"))
1681 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1689 out <<
" " <<
GetName() <<
"->AddEntry(";
1691 out <<
");"<< std::endl;
1694 <<
");" << std::endl;
1702 TString content = GetText()->GetString();
1706 out << quote << content << quote <<
"," << EntryId();
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw text listbox entry on window/pixmap.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a list box entry widget as a C++ statement(s) on output stream out.
TGLayoutManager * fLayoutManager
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
virtual TGViewPort * GetViewPort() const
virtual UInt_t GetOptions() const
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
static TGGC * fgDefaultGC
virtual void Update(TGLBEntry *e)
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
void Reset()
Reset the timer.
virtual void SelectionChanged()
virtual ~TGLineLBEntry()
Delete line style listbox entry.
virtual void DoubleClicked(Int_t widgetId, Int_t id)
Emit DoubleClicked signal with list box id and entry id.
virtual TGFrame * GetContainer() const
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual TGDimension GetDefaultSize() const
Return default size of listbox widget.
const Mask_t kButtonMotionMask
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
TString & ReplaceAll(const TString &s1, const TString &s2)
const TGPicture * fPicture
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
TGLineLBEntry(const TGLineLBEntry &)
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
virtual void Associate(const TGWindow *w)
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
const TGResourcePool * GetResourcePool() const
virtual void SetPicture(const TGPicture *pic=0)
Change the icon of listbox entry containing icon & text.
virtual void RemoveEntry(Int_t id)
Remove the entry with specified id from the listbox container.
virtual const char * GetTitle() const
Returns title of object.
virtual void DrawBorder()
Draw frame border.
TGTextLBEntry(const TGTextLBEntry &)
static Pixel_t fgWhitePixel
const Mask_t kGCLineStyle
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
static Pixel_t fgDefaultSelectedBackground
virtual void Layout()
Layout container.
virtual void DoRedraw()
Redraw the frame.
virtual void Activate(Bool_t a)
Toggle active state of listbox entry.
virtual void DoRedraw()
redraw
virtual TGLBEntry * Select(Int_t id, Bool_t sel)
Select / deselect the entry with the specified id.
virtual void Toggle()
Toggle active state of listbox entry.
const TGWindow * fMsgWindow
virtual void DrawCopy(Handle_t id, Int_t x, Int_t y)
Draw copy on window/pixmap.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
virtual TGVScrollBar * GetVScrollbar() const
virtual TGPosition GetPagePosition() const
Returns page position.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
void Draw(Option_t *="")
Default Draw method for all objects.
virtual TGDimension GetPageDimension() const
Returns page dimension.
const Mask_t kPointerMotionMask
virtual void DoRedraw()
Redraw the frame.
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Insert entry with specified string and id behind the entry with afterID.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move and resize the listbox widget.
virtual ~TGTextLBEntry()
Delete text listbox entry.
TGListBox(const TGListBox &)
virtual ~TGListBox()
Delete a listbox widget.
TGFrameElement * fLastActiveEl
virtual Bool_t GetMultipleSelections() const
virtual ~TGIconLBEntry()
Delete icon & text listbox entry.
void FreePicture(const TGPicture *pic)
Free picture resource.
Pixel_t GetSelectedFgndColor() const
Pixel_t GetBlackColor() const
virtual Pixel_t GetForeground() const
Return frame foreground color.
const Mask_t kGCLineWidth
virtual void Selected(Int_t widgetId, Int_t id)
Emit Selected signal with list box id and entry id.
virtual void InitListBox()
Initiate the internal classes of a list box.
void SetContainer(TGFrame *f)
TGLBContainer(const TGLBContainer &)
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual void Activate(Bool_t)
virtual TList * GetList() const
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
void FreeGC(const TGGC *gc)
Free a graphics context.
TGFrame * GetContainer() const
virtual Int_t GetSelected() const
Returns id of selected entry.
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
virtual void ActivateItem(TGFrameElement *el)
Activate item.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in listbox container.
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
virtual void Layout()
Layout container entries.
virtual void SetVsbPosition(Int_t newPos)
Set new vertical scroll bar position.
virtual Int_t GetPos(Int_t id)
Returns the position in the list box of the entry id.
virtual TGLBEntry * GetSelectedEntry() const
virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints)
Add listbox entry with hints to container.
const Mask_t kButtonPressMask
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
virtual void RemoveAll()
Remove all entries.
virtual void SetListBox(TGListBox *lb)
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
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.
virtual void SetLineWidth(Int_t width)
Set or change line witdh in an entry.
TGIconLBEntry(const TGIconLBEntry &)
virtual Bool_t IsSortable() const
R__EXTERN TSystem * gSystem
Bool_t IsEditable() const
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event in the listbox container.
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void DoRedraw()
Redraw line style listbox entry.
virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints)
Insert listbox entry before the list box entry with a higher id.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
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.
static TGLayoutHints * fgDefaultHints
virtual UInt_t GetDefaultWidth() const
virtual void Update(TGLBEntry *e)
Update line style listbox entry.
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
virtual ~TGLBContainer()
Delete the listbox container.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the listbox container and forward messages to the listbox message handl...
static const TGGC & GetBlackGC()
Get black graphics context.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
void SetText(TGString *new_text)
Set or change text in text entry.
virtual Int_t GetNumberOfEntries() const
virtual void ClearViewPort()
Clear view port and redraw full content.
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
const char * GetString() const
virtual void DrawBorder()
Draw borders of the list box widget.
virtual UInt_t GetDefaultHeight() const
virtual void SetWidth(UInt_t w)
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
const Mask_t kGCFillStyle
const TGString * GetText() const
void SetLineStyle(Int_t v)
Set line style (kLineSolid, kLineOnOffDash, kLineDoubleDash).
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
const Mask_t kButtonReleaseMask
FontStruct_t GetFontStruct() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
virtual TGVScrollBar * GetVScrollbar() const
Return a pointer to vertical scroll bar.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual void DoRedraw()
Redraw icon & text listbox entry.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void NewEntry(const char *s="Entry")
method used to add entry via context menu
const TGWindow * GetParent() const
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
static const TGFont * fgDefaultFont
TGVScrollBar * fVScrollbar
Mother of all ROOT objects.
virtual void Layout()
Layout the listbox components.
virtual const char * GetTitle() const
Returns title of object.
virtual void UnmapWindow()
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
virtual void SetEditDisabled(UInt_t on=kEditDisable)
virtual void Update(TGLBEntry *e)
Update icon & text listbox entry.
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
virtual void SetHeight(UInt_t h)
virtual Int_t GetSelected() const
Return id of selected listbox item.
virtual void Add(TObject *obj)
double f2(const double *x)
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
Short_t Max(Short_t a, Short_t b)
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in the listbox container.
virtual void ActivateItem(TGFrameElement *el)
Activate item.
void SetLineWidth(Int_t v)
Set line width.
virtual Bool_t GetMultipleSelections() const
Double_t Ceil(Double_t x)
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void DoRedraw()
Redraw content of container in the viewport region.
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
virtual void ChangeBackground(Pixel_t back)
Change background to all entries.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a list box widget as a C++ statement(s) on output stream out.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
double norm(double *x, double *p)
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual void DoRedraw()
Redraw text listbox entry.
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void RemoveAll()
Remove all entries in this container.
virtual void DestroyWindow()
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
virtual void SetWindowName(const char *name=0)
Set window name.
void SetCapStyle(Int_t v)
Set cap style (kCapNotLast, kCapButt, kCapRound, kCapProjecting).
virtual Int_t MustCleanup() const
const char * Data() const