71 #include "RConfigure.h" 78 const Int_t kAcceleration[
kAutoScrollFudge+1] = {1,1,1,2,3,4,6,7,8,16,32};
88 class TGContainerKeyboardTimer :
public TTimer {
99 Bool_t TGContainerKeyboardTimer::Notify()
101 fContainer->SearchPattern();
109 class TGContainerScrollTimer :
public TTimer {
120 Bool_t TGContainerScrollTimer::Notify()
122 fContainer->OnAutoScroll();
189 if (-xpos < 0)
return;
190 else diff = xpos -
fX0;
196 #if defined(R__HAS_COCOA) 241 if (-ypos < 0)
return;
242 else diff = ypos -
fY0;
248 #if defined(R__HAS_COCOA) 297 if ((event->
fWidth > 32768) || (
event->fHeight > 32768)) {
436 Emit(
"CurrentChanged(Int_t,Int_t)",args);
471 Emit(
"KeyPressed(TGFrame*,UInt_t,UInt_t)", args);
512 Emit(
"Clicked(TGFrame*,Int_t)", args);
527 Emit(
"Clicked(TGFrame*,Int_t,Int_t,Int_t)", args);
540 Emit(
"DoubleClicked(TGFrame*,Int_t)", args);
555 Emit(
"DoubleClicked(TGFrame*,Int_t,Int_t,Int_t)", args);
604 Emit(
"UnSelectAll()");
632 Emit(
"InvertSelection()");
687 *current = (
void *) lnk;
849 gVirtualX->FillRectangle(pixmap, gcBg, 0, 0, w, h);
880 gVirtualX->CopyArea(pixmap,
fId, gcBg, 0, 0, w, h, x, y);
937 newpos = pos.
fY - page;
938 if (newpos < 0) newpos = 0;
955 fXp = pos.
fX +
event->fX;
956 fYp = pos.
fY +
event->fY;
963 total = selected = 0;
977 select_frame =
kTRUE;
981 select_frame =
kTRUE;
1001 if ( selected == 0 ) {
1041 const char *iconname = 0;
1054 if (((name == 0) || (!name[0])) && (cl != 0))
1056 iconname = ((name != 0) && (strlen(name) > 0)) ?
name : obj->
GetName();
1102 Int_t xx = pos.
fX +
event->fX;
1103 Int_t yy = pos.
fY +
event->fY;
1115 select_frame =
kTRUE;
1119 select_frame =
kTRUE;
1140 int xf0, yf0, xff, yff,
total, selected;
1165 total = selected = 0;
1194 if (((xf0 >
fX0 && xf0 <
fXf) ||
1195 (xff >
fX0 && xff <
fXf)) &&
1196 ((yf0 >
fY0 && yf0 <
fYf) ||
1197 (yff >
fY0 && yff <
fYf))) {
1282 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
1314 switch((
EKeySym)keysym & ~0x20) {
1352 if (n && keysym >= 32 && keysym < 127 &&
1432 caseSensitive, subString);
1476 fCanvas, 400, 150, srch, &ret);
1479 "FindFrameByName(char *)");
1496 int xf0, yf0, xff, yff,
total, selected;
1551 total = selected = 0;
1563 if (((xf0 >
fX0 && xf0 <
fXf) ||
1564 (xff >
fX0 && xff <
fXf)) &&
1565 ((yf0 >
fY0 && yf0 <
fYf) ||
1566 (yff >
fY0 && yff <
fYf))) {
1693 if (name.
IsNull())
return 0;
1720 idx = str.
Index(name, 0, cmp);
1809 if (f->
GetY() < pos) {
1830 if (f->
GetX() < pos) {
1870 if (x<=0 && (hb && !hb->
IsMapped())) {
1908 if (x >= hw && (hb && !hb->
IsMapped())) {
2129 TGFrame(p, w, h, options, back)
2170 Error(
"MapSubwindows",
"no canvas container set yet");
2189 Error(
"AddFrame",
"no canvas container set yet");
2195 Error(
"AddFrame",
"canvas container must inherit from TGCompositeFrame");
2209 if (
gClient->GetStyle() > 1)
break;
2228 Bool_t need_vsb, need_hsb;
2231 need_vsb = need_hsb =
kFALSE;
2235 Error(
"Layout",
"no canvas container set yet");
2248 if (!fixedw) container->
SetWidth(cw);
2255 if ((
Int_t) ch < 0) {
2267 if ((
Int_t) cw < 0) {
2271 if (!fixedw) container->
SetWidth(cw);
2282 if ((
Int_t) ch < 0) {
2299 if (fixedw && fixedh) {
2301 }
else if (fixedw) {
2302 container->
Resize(curw, tch);
2303 }
else if (fixedh) {
2306 container->
Resize(tcw, tch);
2447 out << std::endl <<
" // canvas widget" << std::endl;
2449 out <<
" TGCanvas *";
2455 out <<
");" << std::endl;
2462 if (option && strstr(option,
"keep_names"))
2463 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
2466 out << std::endl <<
" // canvas viewport" << std::endl;
2468 <<
"->GetViewPort();" << std::endl;
2474 <<
");" << std::endl;
2476 out <<
" " << cont->
GetName() <<
"->SetLayoutManager(";
2478 out <<
");"<< std::endl;
2480 out <<
" " << cont->
GetName() <<
"->MapSubwindows();" << std::endl;
2483 <<
");" << std::endl;
2485 out <<
" " <<
GetName() <<
"->MapSubwindows();" << std::endl;
2489 <<
");" << std::endl;
2494 <<
");" << std::endl;
2505 out << std::endl <<
" // canvas container" << std::endl;
2508 out <<
GetName() <<
" = new TGContainer(" << GetCanvas()->GetName();
2516 out <<
");" << std::endl;
2523 if (option && strstr(option,
"keep_names"))
2524 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
virtual void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
virtual ~TGCanvas()
Delete canvas.
virtual const char * GetName() const
Returns name of object.
virtual void PageDown(Bool_t select=kFALSE)
Move position one page down.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void LineLeft(Bool_t select=kFALSE)
Move current position one column left.
virtual void MapSubwindows()
virtual UInt_t GetEditDisabled() const
virtual void CurrentChanged(Int_t x, Int_t y)
Emit signal when current position changed.
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
virtual UInt_t GetOptions() const
Utility class for browsing TMapFile objects.
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.
void Reset()
Reset the timer.
const Int_t kAutoScrollFudge
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
virtual void SetPageDimension(const TGDimension &dim)
Set page dimension.
const Mask_t kKeyShiftMask
void Merge(const TGRectangle &r)
R__EXTERN void * gTQSender
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual const char * GetIconName() const
Returns mime type name of object.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas widget as a C++ statement(s) on output stream out.
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual void End(Bool_t select=kFALSE)
Move to the bottom-right corner of container.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
TGCanvas(const TGCanvas &)
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle resize events.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
static const TGGC & GetLineGC()
Get graphics context for line drawing.
const Mask_t kWABitGravity
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void DrawBorder()
Draw frame border.
static Pixel_t fgWhitePixel
const Mask_t kGCLineStyle
Short_t Min(Short_t a, Short_t b)
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
TGFrame * GetContainer() const
static TGSearchDialog *& SearchDialog()
Return global search dialog.
const TGWindow * fMsgWindow
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
Bool_t IsDragging() const
virtual void Layout()
Layout the elements of the composite frame.
EGraphicsFunction fFunction
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
static Atom_t GetDNDActionCopy()
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
R__EXTERN TGDNDManager * gDNDManager
virtual TGPosition GetPagePosition() const
Returns page position.
virtual void Home(Bool_t select=kFALSE)
Move to upper-left corner of container.
virtual TGDimension GetPageDimension() const
Returns page dimension.
const Mask_t kPointerMotionMask
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
TGFrameElement * fLastActiveEl
virtual void SelectAll()
Select all items in the container.
virtual void PageUp(Bool_t select=kFALSE)
Move position one page up.
const TGPicture * GetObjPicture(TGFrame *f)
Retrieve icons associated with class "name".
virtual TGVScrollBar * GetVScrollbar() const
returns pointer to vert. scroll bar
const Mask_t kGCLineWidth
static Pixel_t fgBlackPixel
virtual Bool_t HandleExpose(Event_t *event)
const Mask_t kGCGraphicsExposures
virtual void ClearViewPort()
Clear view port and redraw content.
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 void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual TList * GetList() const
TGVScrollBar * fVScrollbar
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Adding a frame to a canvas is actually adding the frame to the viewport container.
virtual void LineDown(Bool_t select=kFALSE)
Move one line down.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
TGFrame * GetContainer() const
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
TGViewPort * GetViewPort() const
virtual void RemoveItem(TGFrame *item)
Remove item from container.
TGMimeTypes * GetMimeTypeList() const
void Emit(const char *signal)
Acitvate signal without args.
virtual void Layout()
Layout container entries.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas container as a C++ statement(s) on output stream out.
virtual Bool_t Notify()
Notify when timer times out.
virtual void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
virtual Bool_t HandleExpose(Event_t *event)
Handle expose events. Do not use double buffer.
TGRectangle fExposedRegion
const Mask_t kButtonPressMask
Pixmap_t GetPicture() const
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
const Mask_t kKeyPressMask
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 fGraphicsExposures
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
virtual Bool_t HandleKey(Event_t *event)
The key press event handler converts a key press to some line editor action.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
R__EXTERN TSystem * gSystem
virtual TGSearchType * GetType() const
virtual void MapSubwindows()
Map all canvas sub windows.
void SetContainer(TGFrame *f)
Add container frame to the viewport.
virtual void InvertSelection()
Invert the selection, all selected items become unselected and vice versa.
static const TGGC & GetWhiteGC()
Get white graphics context.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetDragPixmap(const TGPicture *pic)
Set drag window pixmaps and hotpoint.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual void SpacePressed(TGFrame *)
Signal emitted when space key pressed.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual void LineRight(Bool_t select=kFALSE)
Move current position one column right.
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.
TGHScrollBar * GetHScrollbar() const
virtual Bool_t IsLayoutBroken() const
virtual UInt_t GetDefaultWidth() const
TGViewPort(const TGViewPort &)
Handles synchronous and a-synchronous timer events.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
virtual TGFrame * FindFrameByName(const char *name)
Find frame by name.
The ROOT global object gROOT contains a list of all defined classes.
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
void SetDragPixmap(Pixmap_t pic, Pixmap_t mask, Int_t hot_x, Int_t hot_y)
Set drag window pixmaps and hotpoint.
void Reset(Detail::TBranchProxy *x)
virtual void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
static const TGGC & GetBlackGC()
Get black graphics context.
friend class TGContainerKeyboardTimer
virtual ~TGContainer()
Delete canvas container.
virtual TObjLink * FirstLink() const
const TGWindow * GetMessageWindow() const
void SetScrolling(Int_t scrolling)
Set scrolling policy.
void SetPos(Int_t xpos, Int_t ypos)
Goto new position.
virtual void ClearViewPort()
Clear view port and redraw full content.
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
static unsigned int total
virtual UInt_t GetDefaultHeight() const
virtual void SetWidth(UInt_t w)
TGContainer(const TGContainer &)
TGHScrollBar * fHScrollbar
virtual void SetPagePosition(const TGPosition &pos)
Set page position.
virtual void DrawCopy(Handle_t, Int_t, Int_t)
const Mask_t kGCFillStyle
virtual void RepeatSearch()
Repeats search.
const Mask_t kStructureNotifyMask
virtual void DrawBorder()
Draw canvas border.
const Mask_t kButtonReleaseMask
const Int_t kKeyboardTime
Int_t GetPadRight() const
Wrapper around a TObject so it can be stored in a TList.
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
friend class TGContainerScrollTimer
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
const Mask_t kWAWinGravity
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
virtual void UnSelectAll()
Unselect all items in the container.
const Mask_t kGCForeground
virtual Bool_t IsActive() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
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.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
const TGWindow * GetParent() const
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
Mother of all ROOT objects.
TObject * GetObject() const
virtual const char * GetTitle() const
Returns title of object.
virtual TGLayoutManager * GetLayoutManager() const
virtual void UnmapWindow()
virtual void SetEditDisabled(UInt_t on=kEditDisable)
virtual void Layout()
Create layout for canvas.
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
virtual void SetHeight(UInt_t h)
const Mask_t kGCSubwindowMode
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
const Mask_t kGCBackground
Short_t Max(Short_t a, Short_t b)
virtual void LineUp(Bool_t select=kFALSE)
Make current position first line in window by scrolling up.
Bool_t IsDNDSource() const
virtual void ActivateItem(TGFrameElement *el)
Activate item.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
virtual void KeyPressed(TGFrame *, UInt_t keysym, UInt_t mask)
Signal emitted when keyboard key pressed.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
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.
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
void SetDashOffset(Int_t v)
Patterned/dashed line offset.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Bool_t StartDrag(TGFrame *src, Int_t x_root, Int_t y_root, Window_t grabWin=kNone)
Start dragging.
const Mask_t kKeyControlMask
virtual Bool_t IsModified() const
virtual void SearchPattern()
Search for entry which name begins with pattern.
virtual const char * GetName() const
Returns name of object.
const Mask_t kAnyModifier
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
const Int_t kAcceleration[kAutoScrollFudge+1]
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
TGVScrollBar * GetVScrollbar() const
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void DestroyWindow()
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
virtual void SetWindowName(const char *name=0)
Set window name.
Int_t GetPadBottom() 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
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".