Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGView.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 30/6/2000
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11/**************************************************************************
12
13 This source is based on Xclass95, a Win95-looking GUI toolkit.
14 Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16 Xclass95 is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Library General Public
18 License as published by the Free Software Foundation; either
19 version 2 of the License, or (at your option) any later version.
20
21**************************************************************************/
22
23
24/** \class TGView
25 \ingroup guiwidgets
26
27A TGView provides the infrastructure for text viewer and editor
28widgets. It provides a canvas (TGViewFrame) and (optionally) a
29vertical and horizontal scrollbar and methods for marking and
30scrolling.
31
32The TGView (and derivatives) will generate the following
33event messages:
34
35 - kC_TEXTVIEW, kTXT_ISMARKED, widget id, [true|false]
36 - kC_TEXTVIEW, kTXT_DATACHANGE, widget id, 0
37 - kC_TEXTVIEW, kTXT_CLICK2, widget id, position (y << 16) | x)
38 - kC_TEXTVIEW, kTXT_CLICK3, widget id, position (y << 16) | x)
39 - kC_TEXTVIEW, kTXT_F3, widget id, true
40 - kC_TEXTVIEW, kTXT_OPEN, widget id, 0
41 - kC_TEXTVIEW, kTXT_CLOSE, widget id, 0
42 - kC_TEXTVIEW, kTXT_SAVE, widget id, 0
43
44*/
45
46
47#include "TGView.h"
48#include "TGScrollBar.h"
49#include "TGResourcePool.h"
50#include "TMath.h"
51#include "KeySymbols.h"
52#include "RConfigure.h"
53#include "TVirtualX.h"
54
55
56////////////////////////////////////////////////////////////////////////////////
57/// Create a editor frame.
58
60 Pixel_t back) :
61 TGCompositeFrame(v, w, h, options | kOwnBackground, back)
62{
63 fView = v;
64
66
70
73
76 wattr.fBitGravity = 1; // NorthWestGravity
77 wattr.fWinGravity = 1;
78 gVirtualX->ChangeWindowAttributes(fId, &wattr);
79
80 // guibuiding settings
82}
83
84
85
86////////////////////////////////////////////////////////////////////////////////
87/// Create an editor view, containing an TGEditorFrame and (optionally)
88/// a horizontal and vertical scrollbar.
89
93 : TGCompositeFrame(p, w, h, options, GetDefaultFrameBackground())
94{
95 fWidgetId = id;
96 fMsgWindow = p;
98
101 fScrollVal.fX = 1;
102 fScrollVal.fY = 1;
104
105 fClipboard = fClient->GetResourcePool()->GetClipboard();
106
107 fCanvas = new TGViewFrame(this, 10, 10, kChildFrame | kOwnBackground, back);
109
110 if (!(sboptions & kNoHSB)) {
111 fHsb = new TGHScrollBar(this, 10, 10, kChildFrame);
112 AddFrame(fHsb);
113 fHsb->Associate(this);
114 } else {
115 fHsb = 0;
116 }
117
118 if (!(sboptions & kNoVSB)) {
119 fVsb = new TGVScrollBar(this, 10, 10, kChildFrame);
120 AddFrame(fVsb);
121 fVsb->Associate(this);
122 } else {
123 fVsb = 0;
124 }
125
128
129 // sets for guibuilding
130 if (fVsb) {
132 }
133 if (fHsb) {
135 }
136
138
139 // layout manager is not used
140 delete fLayoutManager;
141 fLayoutManager = 0;
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// Delete view.
146
148{
149 if (!MustCleanup()) {
150 delete fCanvas;
151 delete fHsb;
152 delete fVsb;
153 }
154}
155
156////////////////////////////////////////////////////////////////////////////////
157/// Clear view.
158
160{
161 fScrolling = -1;
162
163 fMousePos.fX = fMousePos.fY = -1;
164 fVisible.fX = fVisible.fY = 0;
167
168 gVirtualX->ClearArea(fCanvas->GetId(), 0, 0,
170 Layout();
171}
172
173////////////////////////////////////////////////////////////////////////////////
174/// Scroll view in specified direction to make newTop the visible location.
175
177{
178 if (direction == kHorizontal) {
180 return;
181 }
183 } else {
185 return;
186 }
188 }
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Draw region.
193
195{
196 return;
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// update a part of view
201
203{
204 x = x < 0 ? 0 : x;
205 y = y < 0 ? 0 : y;
206
207 w = x + w > fCanvas->GetWidth() ? fCanvas->GetWidth() - x : w;
208 h = y + h > fCanvas->GetHeight() ? fCanvas->GetHeight() - y : h;
209
210 if (fExposedRegion.IsEmpty()) {
215 } else {
216 TGRectangle r(x, y, w, h);
218 }
219
220 fClient->NeedRedraw(this);
221}
222
223////////////////////////////////////////////////////////////////////////////////
224/// set some gc values
225
231
232////////////////////////////////////////////////////////////////////////////////
233/// handle button
234
236{
237 if (event->fType == kButtonPress) {
238 int amount, ch;
239
240 ch = fCanvas->GetHeight();
241
242 if (fScrollVal.fY == 1) {
243 amount = fScrollVal.fY * TMath::Max(ch/6, 1);
244 } else {
245 amount = fScrollVal.fY * 5;
246 }
247
248 if (event->fState & kKeyShiftMask) {
250 } else if (event->fState & kKeyControlMask) {
251 amount = ch - TMath::Max(ch / 20, 1);
252 }
253
254 if (event->fCode == kButton4) {
256 return kTRUE;
257 } else if (event->fCode == kButton5) {
259 return kTRUE;
260 }
261 }
262 return kFALSE;
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// redraw
267
278
279////////////////////////////////////////////////////////////////////////////////
280/// Handle expose events.
281
283{
284 if (event->fWindow == fCanvas->GetId()) {
285
286 TGPosition pos(event->fX, event->fY);
287 TGDimension dim(event->fWidth, event->fHeight);
288 TGRectangle rect(pos, dim);
289
290 if (fExposedRegion.IsEmpty()) {
292 } else {
293 if (((!rect.fX && !fExposedRegion.fY) ||
294 (!rect.fY && !fExposedRegion.fX)) &&
295 ((rect.fX >= (int)fExposedRegion.fW) ||
296 (rect.fY >= (int)fExposedRegion.fH))) {
298 } else {
300 }
301 }
302
303 fClient->NeedRedraw(this);
304 } else {
305 return TGCompositeFrame::HandleExpose(event);
306 }
307
308 return kTRUE;
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Process scrollbar messages.
313
315{
316 switch(GET_MSG(msg)) {
317 case kC_HSCROLL:
318 switch(GET_SUBMSG(msg)) {
319 case kSB_SLIDERTRACK:
320 case kSB_SLIDERPOS:
322 break;
323 }
324 break;
325
326 case kC_VSCROLL:
327 switch(GET_SUBMSG(msg)) {
328 case kSB_SLIDERTRACK:
329 case kSB_SLIDERPOS:
331 break;
332 }
333 break;
334
335 default:
336 break;
337 }
338 return kTRUE;
339}
340
341////////////////////////////////////////////////////////////////////////////////
342/// layout view
343
345{
347 Int_t cw, ch;
348
350
351 // test whether we need scrollbars
352 cw = fWidth - (fBorderWidth << 1) - fXMargin - 1;
353 ch = fHeight - (fBorderWidth << 1) - fYMargin - 1;
354
355 fCanvas->SetWidth(cw);
356 fCanvas->SetHeight(ch);
357 ItemLayout();
358
359 if ((Int_t)fVirtualSize.fWidth > cw) {
360 if (fHsb) {
361 need_hsb = kTRUE;
362 if (fVsb) ch -= fVsb->GetDefaultWidth();
363 if (ch < 0) ch = 0;
364 fCanvas->SetHeight(ch);
365 ItemLayout();
366 }
367 }
368
369 if ((Int_t)fVirtualSize.fHeight > ch) {
370 if (fVsb) {
371 need_vsb = kTRUE;
372 if (fHsb) cw -= fHsb->GetDefaultHeight();
373 if (cw < 0) cw = 0;
374 fCanvas->SetWidth(cw);
375 ItemLayout();
376 }
377 }
378
379 // re-check again (putting the scrollbar could have changed things)
380
381 if ((Int_t)fVirtualSize.fWidth > cw) {
382 if (!need_hsb) {
383 need_hsb = kTRUE;
384 if (fVsb) ch -= fVsb->GetDefaultWidth();
385 if (ch < 0) ch = 0;
386 fCanvas->SetHeight(ch);
387 ItemLayout();
388 }
389 }
390
391 if (fHsb) {
392 if (need_hsb) {
394 cw, fHsb->GetDefaultHeight());
395 fHsb->MapRaised();
396 } else {
397 fHsb->UnmapWindow();
398 fHsb->SetPosition(0);
399 }
400 }
401
402 if (fVsb) {
403 if (need_vsb) {
405 fVsb->GetDefaultWidth(), ch);
406 fVsb->MapWindow();
407 } else {
408 fVsb->UnmapWindow();
409 fVsb->SetPosition(0);
410 }
411 }
413
414 if (fHsb) {
416 }
417
418 if (fVsb) {
420 }
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Draw the border of the text edit widget.
425
427{
430 if (gClient->GetStyle() < 2) {
431 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
432 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
433 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
434 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);
435
436 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
437 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
438 gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
439 gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, 1, fWidth-2, fHeight-2);
440 break;
441 }
442 default:
444 break;
445 }
446}
447
448////////////////////////////////////////////////////////////////////////////////
449/// Scroll the canvas to pos.
450
452{
453 if (pos.fX < 0) pos.fX = 0;
454 if (pos.fY < 0) pos.fY = 0;
455 if (pos.fX != fHsb->GetPosition()) fHsb->SetPosition(pos.fX / fScrollVal.fX);
456 if (pos.fY != fVsb->GetPosition()) fVsb->SetPosition(pos.fY / fScrollVal.fY);
457}
458
459////////////////////////////////////////////////////////////////////////////////
460/// Scroll the canvas to new_top in the kVertical or kHorizontal direction.
461
463{
464 Point_t points[4];
466#ifndef R__HAS_COCOA
467 Int_t cpyheight = 0, cpywidth = 0;
468#endif
469
470 if (new_top < 0) {
471 return;
472 }
473
474 if (direction == kVertical) {
475 if (new_top == fVisible.fY) {
476 return;
477 }
478
479 points[0].fX = points[3].fX = 0;
480 points[1].fX = points[2].fX = fCanvas->GetWidth();
481 xsrc = xdest = 0;
482 if (new_top < fVisible.fY) {
483 ysrc = 0;
485#ifndef R__HAS_COCOA
487#endif
488 if (ydest > (Int_t)fCanvas->GetHeight()) {
490 }
491
492 points[1].fY = points[0].fY = 0;
493 points[3].fY = points[2].fY = ydest; // -1;
494 } else {
495 ydest = 0;
497#ifndef R__HAS_COCOA
499#endif
500 if (ysrc > (Int_t)fCanvas->GetHeight()) {
502 }
503 points[1].fY = points[0].fY = fCanvas->GetHeight()-ysrc; // +1;
504 points[3].fY = points[2].fY = fCanvas->GetHeight();
505 }
507
508 if (fVisible.fY < 0) {
509 fVisible.fY = 0;
510 }
511 } else {
512 if (new_top == fVisible.fX) {
513 return;
514 }
515
516 points[0].fY = points[1].fY = 0;
517 points[2].fY = points[3].fY = fCanvas->GetHeight();
518 ysrc = ydest = 0;
519
520 if (new_top < fVisible.fX) {
521 xsrc = 0;
523#ifndef R__HAS_COCOA
524 cpywidth = xdest;
525#endif
526 if (xdest < 0) {
528 }
529 points[0].fX = points[3].fX = 0;
530 points[1].fX = points[2].fX = xdest ; // -1;
531 } else {
532 xdest = 0;
534#ifndef R__HAS_COCOA
535 cpywidth = xsrc;
536#endif
537 if (xsrc > (Int_t)fCanvas->GetWidth()) {
538 xsrc = fCanvas->GetWidth();
539 }
540 points[0].fX = points[3].fX = fCanvas->GetWidth()-xsrc; // +1;
541 points[1].fX = points[2].fX = fCanvas->GetWidth();
542 }
544 if (fVisible.fX < 0) {
545 fVisible.fX = 0;
546 }
547 }
548
550
551#ifdef R__HAS_COCOA
552 //With QuartzView it's quite tough to copy window's pixels to window.
553 //TODO: non-optimal solution.
554 DrawRegion(0, 0, GetWidth(), GetHeight());
555#else
556 // Copy the scrolled region to its new position
557 gVirtualX->CopyArea(fCanvas->GetId(), fCanvas->GetId(), fWhiteGC(),
560
561 UInt_t xdiff = points[2].fX - points[0].fX;
562 UInt_t ydiff = points[2].fY - points[0].fY;
563
564 // under windows we need to redraw larger area (why?)
565#ifdef WIN32
566 xdiff = xdiff << 1;
567 ydiff = ydiff << 1;
568#endif
569
571#endif
572}
573
574////////////////////////////////////////////////////////////////////////////////
575/// Change background color of the canvas frame.
576
584
585////////////////////////////////////////////////////////////////////////////////
586/// Set background color of the canvas frame.
587
594
595////////////////////////////////////////////////////////////////////////////////
596/// Set backgound pixmap
597
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kWABitGravity
Definition GuiTypes.h:144
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
const Mask_t kButtonMotionMask
Definition GuiTypes.h:164
const Mask_t kFocusChangeMask
Definition GuiTypes.h:169
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kWAWinGravity
Definition GuiTypes.h:145
const Mask_t kAnyModifier
Definition GuiTypes.h:210
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kKeyShiftMask
Definition GuiTypes.h:195
@ kChildFrame
Definition GuiTypes.h:379
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kOwnBackground
Definition GuiTypes.h:391
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton4
Definition GuiTypes.h:215
@ kButton5
Definition GuiTypes.h:215
@ kAnyButton
Definition GuiTypes.h:214
#define h(i)
Definition RSha256.hxx:106
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gClient
Definition TGClient.h:157
@ kWidgetWantFocus
Definition TGWidget.h:35
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
#define gVirtualX
Definition TVirtualX.h:337
Int_t GET_MSG(Long_t val)
@ kSB_SLIDERTRACK
@ kSB_SLIDERPOS
@ kC_VSCROLL
@ kC_HSCROLL
Int_t GET_SUBMSG(Long_t val)
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:124
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
TGLayoutManager * fLayoutManager
layout manager
Definition TGFrame.h:293
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
Int_t MustCleanup() const override
Definition TGFrame.h:362
UInt_t fHeight
Definition TGDimension.h:21
UInt_t fWidth
Definition TGDimension.h:20
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:331
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:621
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:727
UInt_t fOptions
frame options
Definition TGFrame.h:94
Int_t fX
frame x position
Definition TGFrame.h:85
UInt_t fHeight
frame height
Definition TGFrame.h:88
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:192
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
virtual void DrawBorder()
Draw frame border.
Definition TGFrame.cxx:413
Int_t fBorderWidth
frame border width
Definition TGFrame.h:93
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:304
void MapWindow() override
map window
Definition TGFrame.h:206
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:747
Int_t fY
frame y position
Definition TGFrame.h:86
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:757
UInt_t fWidth
frame width
Definition TGFrame.h:87
UInt_t GetHeight() const
Definition TGFrame.h:227
virtual void SetWidth(UInt_t w)
Definition TGFrame.h:248
UInt_t GetWidth() const
Definition TGFrame.h:226
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:249
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:767
void MapRaised() override
map raised
Definition TGFrame.h:207
void SetTileStipYOrigin(Int_t v)
Y offset for tile or stipple operations.
Definition TGGC.cxx:399
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:277
void SetTileStipXOrigin(Int_t v)
X offset for tile or stipple operations.
Definition TGGC.cxx:388
void SetBackground(Pixel_t v)
Set background color.
Definition TGGC.cxx:288
void SetGraphicsExposures(Bool_t v)
True if graphics exposure should be generated.
Definition TGGC.cxx:432
The TGHScrollBar will generate the following event messages: kC_HSCROLL, kSB_SLIDERPOS,...
void SetRange(Int_t range, Int_t page_size) override
Set range of horizontal scrollbar.
void SetPosition(Int_t pos) override
Set logical slider position of horizontal scrollbar.
Long_t fX
x position
Definition TGDimension.h:56
Long_t fY
y position
Definition TGDimension.h:57
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
Bool_t IsEmpty() const
UInt_t fH
height
Definition TGDimension.h:94
UInt_t fW
width
Definition TGDimension.h:93
Int_t fX
x position
Definition TGDimension.h:91
void Merge(const TGRectangle &r)
Int_t fY
y position
Definition TGDimension.h:92
virtual Int_t GetPosition() const
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
void SetRange(Int_t range, Int_t page_size) override
Set range of vertical scrollbar.
void SetPosition(Int_t pos) override
Set logical slider position of vertical scrollbar.
TGViewFrame(const TGViewFrame &)=delete
TGView * fView
Definition TGView.h:111
A TGView provides the infrastructure for text viewer and editor widgets.
Definition TGView.h:23
Atom_t fClipboard
clipboard property
Definition TGView.h:39
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process scrollbar messages.
Definition TGView.cxx:314
TGHScrollBar * fHsb
horizontal scrollbar
Definition TGView.h:43
virtual Bool_t ItemLayout()
Definition TGView.h:51
void SetBackgroundColor(Pixel_t) override
Set background color of the canvas frame.
Definition TGView.cxx:588
@ kNoHSB
Definition TGView.h:28
@ kNoVSB
Definition TGView.h:28
void DrawBorder() override
Draw the border of the text edit widget.
Definition TGView.cxx:426
TGDimension fVirtualSize
the current virtual window size
Definition TGView.h:35
TGVScrollBar * fVsb
vertical scrollbar
Definition TGView.h:44
TGLongPosition fMousePos
position of mouse
Definition TGView.h:33
void ScrollUp(Int_t pixels)
Definition TGView.h:78
Bool_t HandleButton(Event_t *event) override
handle button
Definition TGView.cxx:235
TGLongPosition fVisible
position of visible region
Definition TGView.h:32
void ScrollDown(Int_t pixels)
Definition TGView.h:80
virtual void UpdateBackgroundStart()
set some gc values
Definition TGView.cxx:226
void Layout() override
layout view
Definition TGView.cxx:344
@ kHorizontal
Definition TGView.h:29
@ kVertical
Definition TGView.h:29
TGView(const TGView &)=delete
void ChangeBackground(Pixel_t) override
Change background color of the canvas frame.
Definition TGView.cxx:577
UInt_t fXMargin
x margin
Definition TGView.h:40
virtual void SetVisibleStart(Int_t newTop, Int_t direction)
Scroll view in specified direction to make newTop the visible location.
Definition TGView.cxx:176
~TGView() override
Delete view.
Definition TGView.cxx:147
Int_t fScrolling
scrolling direction
Definition TGView.h:38
friend class TGViewFrame
Definition TGView.h:25
void DoRedraw() override
redraw
Definition TGView.cxx:268
TGLongPosition fScrollVal
scroll value
Definition TGView.h:34
TGViewFrame * fCanvas
frame containing the text
Definition TGView.h:42
void SetBackgroundPixmap(Pixmap_t p) override
Set backgound pixmap.
Definition TGView.cxx:598
void Clear(Option_t *="") override
Clear view.
Definition TGView.cxx:159
virtual void UpdateRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
update a part of view
Definition TGView.cxx:202
virtual void ScrollCanvas(Int_t newTop, Int_t direction)
Scroll the canvas to new_top in the kVertical or kHorizontal direction.
Definition TGView.cxx:462
virtual void DrawRegion(Int_t x, Int_t y, UInt_t width, UInt_t height)
Draw region.
Definition TGView.cxx:194
TGGC fWhiteGC
graphics context used for scrolling generates GraphicsExposure events
Definition TGView.h:46
virtual void ScrollToPosition(TGLongPosition newPos)
Scroll the canvas to pos.
Definition TGView.cxx:451
UInt_t fYMargin
y margin
Definition TGView.h:41
TGRectangle fExposedRegion
exposed area
Definition TGView.h:36
Bool_t HandleExpose(Event_t *event) override
Handle expose events.
Definition TGView.cxx:282
Int_t fWidgetId
the widget id (used for event processing)
Definition TGWidget.h:46
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
Int_t fWidgetFlags
widget status flags (OR of EWidgetStatus)
Definition TGWidget.h:47
const TGWindow * fMsgWindow
window which handles widget events
Definition TGWidget.h:48
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
Definition TGWindow.cxx:246
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition TGWindow.h:113
virtual Bool_t HandleExpose(Event_t *event)
Definition TGWindow.h:101
@ kEditDisableLayout
window layout cannot be edited
Definition TGWindow.h:60
@ kEditDisableBtnEnable
window can handle mouse button events
Definition TGWindow.h:64
@ kEditDisableGrab
window grab cannot be edited
Definition TGWindow.h:59
@ kEditDisableKeyEnable
window can handle keyboard events
Definition TGWindow.h:65
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:251
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
UInt_t fWidth
Definition GuiTypes.h:182
UInt_t fHeight
width and height of exposed area
Definition GuiTypes.h:182
Window_t fWindow
window reported event is relative to
Definition GuiTypes.h:176
UInt_t fState
key or button mask
Definition GuiTypes.h:181
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:356
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93