Logo ROOT  
Reference Guide
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// //
25// TGView //
26// //
27// A TGView provides the infrastructure for text viewer and editor //
28// widgets. It provides a canvas (TGViewFrame) and (optionally) a //
29// vertical and horizontal scrollbar and methods for marking and //
30// scrolling. //
31// //
32// The TGView (and derivatives) will generate the following //
33// event messages: //
34// kC_TEXTVIEW, kTXT_ISMARKED, widget id, [true|false] //
35// kC_TEXTVIEW, kTXT_DATACHANGE, widget id, 0 //
36// kC_TEXTVIEW, kTXT_CLICK2, widget id, position (y << 16) | x) //
37// kC_TEXTVIEW, kTXT_CLICK3, widget id, position (y << 16) | x) //
38// kC_TEXTVIEW, kTXT_F3, widget id, true //
39// kC_TEXTVIEW, kTXT_OPEN, widget id, 0 //
40// kC_TEXTVIEW, kTXT_CLOSE, widget id, 0 //
41// kC_TEXTVIEW, kTXT_SAVE, widget id, 0 //
42// //
43//////////////////////////////////////////////////////////////////////////
44
45#include "TGView.h"
46#include "TGScrollBar.h"
47#include "TGResourcePool.h"
48#include "TMath.h"
49#include "KeySymbols.h"
50#include "RConfigure.h"
51#include "TVirtualX.h"
52
54
55////////////////////////////////////////////////////////////////////////////////
56/// Create a editor frame.
57
59 ULong_t back) :
60 TGCompositeFrame(v, w, h, options | kOwnBackground, back)
61{
62 fView = v;
63
65
69
72
75 wattr.fBitGravity = 1; // NorthWestGravity
76 wattr.fWinGravity = 1;
77 gVirtualX->ChangeWindowAttributes(fId, &wattr);
78
79 // guibuiding settings
81}
82
83
85
86////////////////////////////////////////////////////////////////////////////////
87/// Create an editor view, containing an TGEditorFrame and (optionally)
88/// a horizontal and vertical scrollbar.
89
91 UInt_t xMargin, UInt_t yMargin, UInt_t options,
92 UInt_t sboptions, ULong_t back)
93 : TGCompositeFrame(p, w, h, options, GetDefaultFrameBackground())
94{
95 fWidgetId = id;
96 fMsgWindow = p;
98
99 fXMargin = xMargin;
100 fYMargin = yMargin;
101 fScrollVal.fX = 1;
102 fScrollVal.fY = 1;
104
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
176void TGView::SetVisibleStart(Int_t newTop, Int_t direction)
177{
178 if (direction == kHorizontal) {
179 if (newTop / fScrollVal.fX == fVisible.fX / fScrollVal.fX) {
180 return;
181 }
182 ScrollCanvas(newTop, kHorizontal);
183 } else {
184 if (newTop / fScrollVal.fY == fVisible.fY / fScrollVal.fY) {
185 return;
186 }
187 ScrollCanvas(newTop, kVertical);
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()) {
213 fExposedRegion.fW = w;
215 } else {
216 TGRectangle r(x, y, w, h);
218 }
219
220 fClient->NeedRedraw(this);
221}
222
223////////////////////////////////////////////////////////////////////////////////
224/// set some gc values
225
227{
230}
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) {
249 amount = fScrollVal.fY;
250 } else if (event->fState & kKeyControlMask) {
251 amount = ch - TMath::Max(ch / 20, 1);
252 }
253
254 if (event->fCode == kButton4) {
255 ScrollDown(amount);
256 return kTRUE;
257 } else if (event->fCode == kButton5) {
258 ScrollUp(amount);
259 return kTRUE;
260 }
261 }
262 return kFALSE;
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// redraw
267
269{
270 DrawBorder();
271
272 if (!fExposedRegion.IsEmpty()) {
276 }
277}
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()) {
291 fExposedRegion = rect;
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))) {
297 DrawRegion(rect.fX, rect.fY, rect.fW, rect.fY);
298 } else {
299 fExposedRegion.Merge(rect);
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{
346 Bool_t need_vsb, need_hsb;
347 Int_t cw, ch;
348
349 need_vsb = need_hsb = kFALSE;
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
462void TGView::ScrollCanvas(Int_t new_top, Int_t direction)
463{
464 Point_t points[4];
465 Int_t xsrc, ysrc, xdest, ydest, cpyheight, cpywidth;
466
467 if (new_top < 0) {
468 return;
469 }
470
471 if (direction == kVertical) {
472 if (new_top == fVisible.fY) {
473 return;
474 }
475
476 points[0].fX = points[3].fX = 0;
477 points[1].fX = points[2].fX = fCanvas->GetWidth();
478 xsrc = xdest = 0;
479 cpywidth = 0;
480 if (new_top < fVisible.fY) {
481 ysrc = 0;
482 ydest = Int_t(fVisible.fY - new_top);
483 cpyheight = ydest;
484 if (ydest > (Int_t)fCanvas->GetHeight()) {
485 ydest = fCanvas->GetHeight();
486 }
487
488 points[1].fY = points[0].fY = 0;
489 points[3].fY = points[2].fY = ydest; // -1;
490 } else {
491 ydest = 0;
492 ysrc = Int_t(new_top - fVisible.fY);
493 cpyheight= ysrc;
494 if (ysrc > (Int_t)fCanvas->GetHeight()) {
495 ysrc = fCanvas->GetHeight();
496 }
497 points[1].fY = points[0].fY = fCanvas->GetHeight()-ysrc; // +1;
498 points[3].fY = points[2].fY = fCanvas->GetHeight();
499 }
500 fVisible.fY = new_top;
501
502 if (fVisible.fY < 0) {
503 fVisible.fY = 0;
504 }
505 } else {
506 if (new_top == fVisible.fX) {
507 return;
508 }
509
510 points[0].fY = points[1].fY = 0;
511 points[2].fY = points[3].fY = fCanvas->GetHeight();
512 ysrc = ydest = 0;
513 cpyheight = 0;
514
515 if (new_top < fVisible.fX) {
516 xsrc = 0;
517 xdest = Int_t(fVisible.fX - new_top);
518 cpywidth = xdest;
519 if (xdest < 0) {
520 xdest = fCanvas->GetWidth();
521 }
522 points[0].fX = points[3].fX = 0;
523 points[1].fX = points[2].fX = xdest ; // -1;
524 } else {
525 xdest = 0;
526 xsrc = Int_t(new_top - fVisible.fX);
527 cpywidth = xsrc;
528 if (xsrc > (Int_t)fCanvas->GetWidth()) {
529 xsrc = fCanvas->GetWidth();
530 }
531 points[0].fX = points[3].fX = fCanvas->GetWidth()-xsrc; // +1;
532 points[1].fX = points[2].fX = fCanvas->GetWidth();
533 }
534 fVisible.fX = new_top;
535 if (fVisible.fX < 0) {
536 fVisible.fX = 0;
537 }
538 }
539
541
542#ifdef R__HAS_COCOA
543 //With QuartzView it's quite tough to copy window's pixels to window.
544 //TODO: non-optimal solution.
545 DrawRegion(0, 0, GetWidth(), GetHeight());
546#else
547 // Copy the scrolled region to its new position
548 gVirtualX->CopyArea(fCanvas->GetId(), fCanvas->GetId(), fWhiteGC(),
549 xsrc, ysrc, fCanvas->GetWidth()-cpywidth,
550 fCanvas->GetHeight()-cpyheight, xdest, ydest);
551
552 UInt_t xdiff = points[2].fX - points[0].fX;
553 UInt_t ydiff = points[2].fY - points[0].fY;
554
555 // under windows we need to redraw larger area (why?)
556#ifdef WIN32
557 xdiff = xdiff << 1;
558 ydiff = ydiff << 1;
559#endif
560
561 DrawRegion(points[0].fX, points[0].fY, xdiff, ydiff);
562#endif
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// Change background color of the canvas frame.
567
569{
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Set background color of the canvas frame.
578
580{
584}
585
586////////////////////////////////////////////////////////////////////////////////
587/// Set backgound pixmap
588
590{
592}
@ kButtonPress
Definition: GuiTypes.h:59
const Mask_t kWABitGravity
Definition: GuiTypes.h:143
const Mask_t kButtonMotionMask
Definition: GuiTypes.h:163
const Mask_t kFocusChangeMask
Definition: GuiTypes.h:168
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
const Mask_t kWAWinGravity
Definition: GuiTypes.h:144
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
Handle_t Pixmap_t
Definition: GuiTypes.h:29
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
@ 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:87
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
ULong_t Pixel_t
Definition: GuiTypes.h:39
@ kButton4
Definition: GuiTypes.h:214
@ kButton5
Definition: GuiTypes.h:214
@ kAnyButton
Definition: GuiTypes.h:213
ROOT::R::TRInterface & r
Definition: Object.C:4
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
#define gClient
Definition: TGClient.h:166
@ kWidgetWantFocus
Definition: TGWidget.h:46
XFontStruct * id
Definition: TGX11.cxx:108
#define gVirtualX
Definition: TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kSB_SLIDERTRACK
@ kSB_SLIDERPOS
@ kC_VSCROLL
@ kC_HSCROLL
Int_t GET_SUBMSG(Long_t val)
point * points
Definition: X3DBuffer.c:22
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
TGLayoutManager * fLayoutManager
Definition: TGFrame.h:328
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual Int_t MustCleanup() const
Definition: TGFrame.h:398
UInt_t fHeight
Definition: TGDimension.h:30
UInt_t fWidth
Definition: TGDimension.h:29
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:323
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:719
UInt_t fOptions
Definition: TGFrame.h:119
Int_t fX
Definition: TGFrame.h:110
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
UInt_t fHeight
Definition: TGFrame.h:113
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:215
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:405
Int_t fBorderWidth
Definition: TGFrame.h:118
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:739
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
Int_t fY
Definition: TGFrame.h:111
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:749
UInt_t fWidth
Definition: TGFrame.h:112
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:613
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:271
virtual void MapWindow()
map window
Definition: TGFrame.h:229
UInt_t GetWidth() const
Definition: TGFrame.h:249
virtual void SetHeight(UInt_t h)
Definition: TGFrame.h:272
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:759
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void SetTileStipYOrigin(Int_t v)
Y offset for tile or stipple operations.
Definition: TGGC.cxx:398
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:276
void SetTileStipXOrigin(Int_t v)
X offset for tile or stipple operations.
Definition: TGGC.cxx:387
void SetBackground(Pixel_t v)
Set background color.
Definition: TGGC.cxx:287
void SetGraphicsExposures(Bool_t v)
True if graphics exposure should be generated.
Definition: TGGC.cxx:431
virtual void SetRange(Int_t range, Int_t page_size)
Set range of horizontal scrollbar.
virtual void SetPosition(Int_t pos)
Set logical slider position of horizontal scrollbar.
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
Bool_t IsEmpty() const
Definition: TGDimension.h:133
void Empty()
Definition: TGDimension.h:132
void Merge(const TGRectangle &r)
Definition: TGDimension.cxx:42
Atom_t GetClipboard() const
virtual Int_t GetPosition() const
Definition: TGScrollBar.h:132
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGScrollBar.h:136
virtual void SetPosition(Int_t pos)
Set logical slider position of vertical scrollbar.
virtual void SetRange(Int_t range, Int_t page_size)
Set range of vertical scrollbar.
TGViewFrame(const TGViewFrame &)
TGView * fView
Definition: TGView.h:131
Definition: TGView.h:43
Atom_t fClipboard
Definition: TGView.h:59
TGHScrollBar * fHsb
Definition: TGView.h:63
virtual ~TGView()
Delete view.
Definition: TGView.cxx:147
virtual Bool_t ItemLayout()
Definition: TGView.h:71
virtual Bool_t HandleButton(Event_t *event)
handle button
Definition: TGView.cxx:235
TGDimension fVirtualSize
Definition: TGView.h:55
TGView(const TGView &)
TGVScrollBar * fVsb
Definition: TGView.h:64
virtual void Layout()
layout view
Definition: TGView.cxx:344
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process scrollbar messages.
Definition: TGView.cxx:314
TGLongPosition fMousePos
Definition: TGView.h:53
void ScrollUp(Int_t pixels)
Definition: TGView.h:98
@ kNoHSB
Definition: TGView.h:48
@ kNoVSB
Definition: TGView.h:48
TGLongPosition fVisible
Definition: TGView.h:52
void ScrollDown(Int_t pixels)
Definition: TGView.h:100
virtual void UpdateBackgroundStart()
set some gc values
Definition: TGView.cxx:226
virtual void DrawBorder()
Draw the border of the text edit widget.
Definition: TGView.cxx:426
UInt_t fXMargin
Definition: TGView.h:60
virtual void SetVisibleStart(Int_t newTop, Int_t direction)
Scroll view in specified direction to make newTop the visible location.
Definition: TGView.cxx:176
Int_t fScrolling
Definition: TGView.h:58
friend class TGViewFrame
Definition: TGView.h:45
virtual void SetBackgroundColor(Pixel_t)
Set background color of the canvas frame.
Definition: TGView.cxx:579
TGLongPosition fScrollVal
Definition: TGView.h:54
TGViewFrame * fCanvas
Definition: TGView.h:62
virtual void ChangeBackground(Pixel_t)
Change background color of the canvas frame.
Definition: TGView.cxx:568
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
virtual void DoRedraw()
redraw
Definition: TGView.cxx:268
TGGC fWhiteGC
Definition: TGView.h:66
virtual Bool_t HandleExpose(Event_t *event)
Handle expose events.
Definition: TGView.cxx:282
virtual void ScrollToPosition(TGLongPosition newPos)
Scroll the canvas to pos.
Definition: TGView.cxx:451
UInt_t fYMargin
Definition: TGView.h:61
virtual void Clear(Option_t *="")
Clear view.
Definition: TGView.cxx:159
TGRectangle fExposedRegion
Definition: TGView.h:56
virtual void SetBackgroundPixmap(Pixmap_t p)
Set backgound pixmap.
Definition: TGView.cxx:589
@ kHorizontal
Definition: TGView.h:49
@ kVertical
Definition: TGView.h:49
Int_t fWidgetId
Definition: TGWidget.h:58
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
Int_t fWidgetFlags
Definition: TGWidget.h:59
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
Definition: TGWindow.cxx:238
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:114
virtual Bool_t HandleExpose(Event_t *event)
Definition: TGWindow.h:102
@ kEditDisableLayout
Definition: TGWindow.h:61
@ kEditDisableBtnEnable
Definition: TGWindow.h:65
@ kEditDisableGrab
Definition: TGWindow.h:60
@ kEditDisableKeyEnable
Definition: TGWindow.h:66
UInt_t fEditDisabled
Definition: TGWindow.h:40
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)
Definition: TMathBase.h:212
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
UInt_t fWidth
Definition: GuiTypes.h:181
UInt_t fHeight
Definition: GuiTypes.h:181
Window_t fWindow
Definition: GuiTypes.h:175
UInt_t fState
Definition: GuiTypes.h:180
Int_t fX
Definition: GuiTypes.h:177
UInt_t fCode
Definition: GuiTypes.h:179