69#include "RConfigure.h"
79const Int_t kAcceleration[
kAutoScrollFudge+1] = {1,1,1,2,3,4,6,7,8,16,32};
89class TGContainerKeyboardTimer :
public TTimer {
100Bool_t TGContainerKeyboardTimer::Notify()
102 fContainer->SearchPattern();
110class TGContainerScrollTimer :
public TTimer {
121Bool_t TGContainerScrollTimer::Notify()
123 fContainer->OnAutoScroll();
190 if (-xpos < 0)
return;
191 else diff = xpos -
fX0;
197#if defined(R__HAS_COCOA)
242 if (-ypos < 0)
return;
243 else diff = ypos -
fY0;
249#if defined(R__HAS_COCOA)
298 if ((event->
fWidth > 32768) || (
event->fHeight > 32768)) {
358 TGCompositeFrame(p->GetViewPort(), p->GetWidth(), p->GetHeight(), options, back)
437 Emit(
"CurrentChanged(Int_t,Int_t)",args);
472 Emit(
"KeyPressed(TGFrame*,UInt_t,UInt_t)", args);
513 Emit(
"Clicked(TGFrame*,Int_t)", args);
528 Emit(
"Clicked(TGFrame*,Int_t,Int_t,Int_t)", args);
541 Emit(
"DoubleClicked(TGFrame*,Int_t)", args);
556 Emit(
"DoubleClicked(TGFrame*,Int_t,Int_t,Int_t)", args);
603 Emit(
"UnSelectAll()");
631 Emit(
"InvertSelection()");
686 *current = (
void *) lnk;
848 gVirtualX->FillRectangle(pixmap, gcBg, 0, 0, w,
h);
936 newpos = pos.
fY - page;
937 if (newpos < 0) newpos = 0;
954 fXp = pos.
fX +
event->fX;
955 fYp = pos.
fY +
event->fY;
962 total = selected = 0;
976 select_frame =
kTRUE;
980 select_frame =
kTRUE;
1000 if ( selected == 0 ) {
1040 const char *iconname = 0;
1042 if (
f->InheritsFrom(
"TGLVEntry")) {
1045 if (obj->IsA() == TKey::Class()) {
1047 }
else if (obj->IsA() == TKeyMapFile::Class()) {
1053 if (((
name == 0) || (!
name[0])) && (cl != 0))
1101 Int_t xx = pos.
fX +
event->fX;
1102 Int_t yy = pos.
fY +
event->fY;
1114 select_frame =
kTRUE;
1118 select_frame =
kTRUE;
1139 int xf0, yf0, xff, yff,
total, selected;
1164 total = selected = 0;
1188 xf0 =
f->GetX() + (
f->GetWidth() >> 3);
1189 yf0 =
f->GetY() + (
f->GetHeight() >> 3);
1190 xff = xf0 +
f->GetWidth() - (
f->GetWidth() >> 2);
1191 yff = yf0 +
f->GetHeight() - (
f->GetHeight() >> 2);
1193 if (((xf0 >
fX0 && xf0 <
fXf) ||
1194 (xff >
fX0 && xff <
fXf)) &&
1195 ((yf0 >
fY0 && yf0 <
fYf) ||
1196 (yff >
fY0 && yff <
fYf))) {
1281 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
1313 switch((
EKeySym)keysym & ~0x20) {
1351 if (
n && keysym >= 32 && keysym < 127 &&
1431 caseSensitive, subString);
1475 fCanvas, 400, 150, srch, &ret);
1478 "FindFrameByName(char *)");
1495 int xf0, yf0, xff, yff,
total, selected;
1550 total = selected = 0;
1557 xf0 =
f->GetX() + (
f->GetWidth() >> 3);
1558 yf0 =
f->GetY() + (
f->GetHeight() >> 3);
1559 xff = xf0 +
f->GetWidth() - (
f->GetWidth() >> 2);
1560 yff = yf0 +
f->GetHeight() - (
f->GetHeight() >> 2);
1562 if (((xf0 >
fX0 && xf0 <
fXf) ||
1563 (xff >
fX0 && xff <
fXf)) &&
1564 ((yf0 >
fY0 && yf0 <
fYf) ||
1565 (yff >
fY0 && yff <
fYf))) {
1692 if (
name.IsNull())
return 0;
1725 if (str.
Length() ==
name.Length())
return el;
1808 if (
f->GetY() < pos) {
1813 }
else if (
f->GetY() + (
Int_t)
f->GetHeight() > vh) {
1829 if (
f->GetX() < pos) {
1834 }
else if (
f->GetX() + (
Int_t)
f->GetWidth() > hw) {
1907 if (
x >= hw && (hb && !hb->
IsMapped())) {
2169 Error(
"MapSubwindows",
"no canvas container set yet");
2188 Error(
"AddFrame",
"no canvas container set yet");
2191 if (container->
InheritsFrom(TGCompositeFrame::Class()))
2194 Error(
"AddFrame",
"canvas container must inherit from TGCompositeFrame");
2208 if (
gClient->GetStyle() > 1)
break;
2227 Bool_t need_vsb, need_hsb;
2230 need_vsb = need_hsb =
kFALSE;
2234 Error(
"Layout",
"no canvas container set yet");
2247 if (!fixedw) container->
SetWidth(cw);
2254 if ((
Int_t) ch < 0) {
2266 if ((
Int_t) cw < 0) {
2270 if (!fixedw) container->
SetWidth(cw);
2281 if ((
Int_t) ch < 0) {
2298 if (fixedw && fixedh) {
2300 }
else if (fixedw) {
2301 container->
Resize(curw, tch);
2302 }
else if (fixedh) {
2305 container->
Resize(tcw, tch);
2446 out << std::endl <<
" // canvas widget" << std::endl;
2448 out <<
" TGCanvas *";
2454 out <<
");" << std::endl;
2461 if (option && strstr(option,
"keep_names"))
2462 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
2465 out << std::endl <<
" // canvas viewport" << std::endl;
2467 <<
"->GetViewPort();" << std::endl;
2473 <<
");" << std::endl;
2475 out <<
" " << cont->
GetName() <<
"->SetLayoutManager(";
2477 out <<
");"<< std::endl;
2479 out <<
" " << cont->
GetName() <<
"->MapSubwindows();" << std::endl;
2482 <<
");" << std::endl;
2484 out <<
" " <<
GetName() <<
"->MapSubwindows();" << std::endl;
2488 <<
");" << std::endl;
2493 <<
");" << std::endl;
2504 out << std::endl <<
" // canvas container" << std::endl;
2515 out <<
");" << std::endl;
2522 if (option && strstr(option,
"keep_names"))
2523 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
const Mask_t kWABitGravity
const Mask_t kGCBackground
const Mask_t kGCForeground
const Mask_t kGCLineStyle
const Mask_t kGCSubwindowMode
const Mask_t kGCLineWidth
const Mask_t kButtonPressMask
const Mask_t kGCFillStyle
const Mask_t kWAWinGravity
const Mask_t kAnyModifier
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kKeyPressMask
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kStructureNotifyMask
Handle_t GContext_t
Graphics context handle.
const Mask_t kButtonReleaseMask
const Mask_t kGCGraphicsExposures
Handle_t Window_t
Window handle.
const Int_t kKeyboardTime
const Int_t kAutoScrollFudge
const Int_t kAcceleration[kAutoScrollFudge+1]
R__EXTERN TGDNDManager * gDNDManager
static unsigned int total
R__EXTERN void * gTQSender
R__EXTERN TSystem * gSystem
TClass instances represent classes, structs and namespaces in the ROOT type system.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
TGFrame * GetContainer() const
virtual void MapSubwindows()
Map all canvas sub windows.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas widget as a C++ statement(s) on output stream out.
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
virtual void DrawBorder()
Draw canvas border.
TGHScrollBar * fHScrollbar
TGVScrollBar * GetVScrollbar() const
TGVScrollBar * fVScrollbar
TGViewPort * GetViewPort() const
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
virtual void ClearViewPort()
Clear view port and redraw content.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Adding a frame to a canvas is actually adding the frame to the viewport container.
@ kCanvasScrollHorizontal
virtual void Layout()
Create layout for canvas.
void SetScrolling(Int_t scrolling)
Set scrolling policy.
TGCanvas(const TGCanvas &)=delete
virtual ~TGCanvas()
Delete canvas.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
TGHScrollBar * GetHScrollbar() const
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
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 TList * GetList() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual TGLayoutManager * GetLayoutManager() const
virtual void Layout()
Layout the elements of the composite frame.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
virtual Bool_t HandleExpose(Event_t *event)
Handle expose events. Do not use double buffer.
TGRectangle fExposedRegion
virtual void ActivateItem(TGFrameElement *el)
Activate item.
virtual void RemoveItem(TGFrame *item)
Remove item from container.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
virtual void RepeatSearch()
Repeats search.
virtual void UnSelectAll()
Unselect all items in the container.
virtual Bool_t HandleKey(Event_t *event)
The key press event handler converts a key press to some line editor action.
virtual void PageDown(Bool_t select=kFALSE)
Move position one page down.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
virtual void LineLeft(Bool_t select=kFALSE)
Move current position one column left.
virtual void ClearViewPort()
Clear view port and redraw full content.
const TGWindow * fMsgWindow
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
virtual void InvertSelection()
Invert the selection, all selected items become unselected and vice versa.
virtual void PageUp(Bool_t select=kFALSE)
Move position one page up.
virtual void LineDown(Bool_t select=kFALSE)
Move one line down.
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
virtual void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
virtual ~TGContainer()
Delete canvas container.
virtual void LineUp(Bool_t select=kFALSE)
Make current position first line in window by scrolling up.
virtual void Home(Bool_t select=kFALSE)
Move to upper-left corner of container.
virtual void KeyPressed(TGFrame *, UInt_t keysym, UInt_t mask)
Signal emitted when keyboard key pressed.
virtual void SetDragPixmap(const TGPicture *pic)
Set drag window pixmaps and hotpoint.
const TGPicture * GetObjPicture(TGFrame *f)
Retrieve icons associated with class "name".
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
TGCanvas * GetCanvas() const
virtual void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
virtual void SearchPattern()
Search for entry which name begins with pattern.
virtual void SetPageDimension(const TGDimension &dim)
Set page dimension.
virtual void LineRight(Bool_t select=kFALSE)
Move current position one column right.
TGContainer(const TGContainer &)=delete
virtual void SpacePressed(TGFrame *)
Signal emitted when space key pressed.
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
virtual void DoRedraw()
Redraw content of container in the viewport region.
virtual TGDimension GetPageDimension() const
Returns page dimension.
virtual void Layout()
Layout container entries.
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
static const TGGC & GetLineGC()
Get graphics context for line drawing.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas container as a C++ statement(s) on output stream out.
virtual void CurrentChanged(Int_t x, Int_t y)
Emit signal when current position changed.
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
virtual void RemoveAll()
Remove all items from the container.
friend class TGContainerScrollTimer
virtual TGVScrollBar * GetVScrollbar() const
returns pointer to vert. scroll bar
virtual TGFrame * FindFrameByName(const char *name)
Find frame by name.
friend class TGContainerKeyboardTimer
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
const TGWindow * GetMessageWindow() const
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
virtual TGPosition GetPagePosition() const
Returns page position.
virtual void End(Bool_t select=kFALSE)
Move to the bottom-right corner of container.
virtual void SetPagePosition(const TGPosition &pos)
Set page position.
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
TGFrameElement * fLastActiveEl
virtual void SelectAll()
Select all items in the container.
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
Bool_t IsDragging() const
Bool_t StartDrag(TGFrame *src, Int_t x_root, Int_t y_root, Window_t grabWin=kNone)
Start dragging.
void SetDragPixmap(Pixmap_t pic, Pixmap_t mask, Int_t hot_x, Int_t hot_y)
Set drag window pixmaps and hotpoint.
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
static Atom_t GetDNDActionCopy()
virtual void DrawCopy(Handle_t, Int_t, Int_t)
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual Bool_t IsLayoutBroken() const
static const TGGC & GetBlackGC()
Get black graphics context.
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
virtual Bool_t IsActive() const
virtual void MapRaised()
map raised
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void DrawBorder()
Draw frame border.
virtual void Activate(Bool_t)
static const TGGC & GetHilightGC()
Get highlight color graphics context.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static const TGGC & GetShadowGC()
Get shadow color graphics context.
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.
Bool_t IsDNDSource() const
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 SetWidth(UInt_t w)
virtual void MapWindow()
map window
static const TGGC & GetWhiteGC()
Get white graphics context.
static Pixel_t fgWhitePixel
virtual void MapSubwindows()
map sub windows
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void SetHeight(UInt_t h)
static Pixel_t fgBlackPixel
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
unmap window
void SetDashOffset(Int_t v)
Patterned/dashed line offset.
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
Int_t GetPadRight() const
Int_t GetPadBottom() const
virtual Bool_t IsModified() const
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
Pixmap_t GetPicture() const
void Merge(const TGRectangle &r)
virtual TGSearchType * GetType() const
static TGSearchDialog *& SearchDialog()
Return global search dialog.
TGFrame * GetContainer() const
TGViewPort(const TGViewPort &)=delete
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle resize events.
void SetContainer(TGFrame *f)
Add container frame to the viewport.
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
void SetPos(Int_t xpos, Int_t ypos)
Goto new position.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual UInt_t GetEditDisabled() const
virtual void SetEditDisabled(UInt_t on=kEditDisable)
virtual Bool_t HandleExpose(Event_t *event)
virtual void DestroyWindow()
destroy window
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Utility class for browsing TMapFile objects.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObjLink * FirstLink() const
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual const char * GetName() const
Returns name of object.
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Mother of all ROOT objects.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
virtual const char * GetName() const
Returns name of object.
virtual const char * GetIconName() const
Returns mime type name of object.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
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.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
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
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Handles synchronous and a-synchronous timer events.
void Reset()
Reset the timer.
virtual Bool_t Notify()
Notify when timer times out.
Short_t Max(Short_t a, Short_t b)
Short_t Min(Short_t a, Short_t b)
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fHeight
width and height of exposed area
Window_t fWindow
window reported event is relative to
UInt_t fState
key or button mask
Int_t fYRoot
coordinates relative to root
Long_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Time_t fTime
time event event occurred in ms
UInt_t fCode
key or button code
Graphics context structure.
ULong_t fBackground
background pixel
Int_t fLineWidth
line width
Mask_t fMask
bit mask specifying which fields are valid
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Bool_t fGraphicsExposures
boolean, should exposures be generated
ULong_t fForeground
foreground pixel
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
EGraphicsFunction fFunction
logical operation
Int_t fSubwindowMode
kClipByChildren, kIncludeInferiors
Attributes that can be used when creating or changing a window.
Mask_t fMask
bit mask specifying which fields are valid
Int_t fWinGravity
one of the window gravity values
Int_t fBitGravity
one of bit gravity values