Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TG3DLine.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 6/09/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/**
14\class TGHorizontal3DLine
15\ingroup guiwidgets
16
17A horizontal 3D line is a line that typically separates a toolbar
18from the menubar.
19
20\class TGVertical3DLine
21\ingroup guiwidgets
22
23A vertical 3D line is a line that can be used to separate groups of
24widgets.
25
26*/
27
28#include "TG3DLine.h"
29#include "TVirtualX.h"
30
31#include <iostream>
32
33
34
35////////////////////////////////////////////////////////////////////////////////
36/// constructor
37
45
46////////////////////////////////////////////////////////////////////////////////
47/// draw border
48
50{
51 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
52 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, 1, fWidth-1, 1);
53 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, 0, fWidth-1, 1);
54}
55
56
57////////////////////////////////////////////////////////////////////////////////
58/// Save an vertical 3D line as a C++ statement(s) on output stream out.
59
60void TGHorizontal3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
61{
62 auto extra_args = SaveCtorArgs(out);
63
64 out << " TGHorizontal3DLine *" << GetName() << " = new TGHorizontal3DLine(" << fParent->GetName()
65 << "," << GetWidth() << "," << GetHeight() << extra_args << ");\n";
66
67 if (option && strstr(option, "keep_names"))
68 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
69}
70
71////////////////////////////////////////////////////////////////////////////////
72/// constructor
73
75 UInt_t options, Pixel_t back) :
76 TGFrame(p, w, h, options, back)
77{
80}
81
82////////////////////////////////////////////////////////////////////////////////
83/// draw border
84
86{
87 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
88 gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 0, 1, fHeight-1);
89 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, 1, fHeight-1);
90}
91
92////////////////////////////////////////////////////////////////////////////////
93/// Save an vertical 3D line as a C++ statement(s) on output stream out.
94
95void TGVertical3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
96{
97 auto extra_args = SaveCtorArgs(out);
98
99 out << " TGVertical3DLine *" << GetName() << " = new TGVertical3DLine(" << fParent->GetName() << "," << GetWidth()
100 << "," << GetHeight() << extra_args << ");\n";
101
102 if (option && strstr(option, "keep_names"))
103 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
104}
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
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.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
#define gVirtualX
Definition TVirtualX.h:337
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
UInt_t fHeight
frame height
Definition TGFrame.h:88
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:747
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
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
Definition TGFrame.cxx:2493
UInt_t GetWidth() const
Definition TGFrame.h:226
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an vertical 3D line as a C++ statement(s) on output stream out.
Definition TG3DLine.cxx:60
void DrawBorder() override
draw border
Definition TG3DLine.cxx:49
TGHorizontal3DLine(const TGWindow *p=nullptr, UInt_t w=4, UInt_t h=2, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
constructor
Definition TG3DLine.cxx:38
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an vertical 3D line as a C++ statement(s) on output stream out.
Definition TG3DLine.cxx:95
void DrawBorder() override
draw border
Definition TG3DLine.cxx:85
TGVertical3DLine(const TGWindow *p=nullptr, UInt_t w=2, UInt_t h=4, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
constructor
Definition TG3DLine.cxx:74
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
@ kEditDisableHeight
window height cannot be edited
Definition TGWindow.h:62
@ kEditDisableWidth
window width cannot be edited
Definition TGWindow.h:63
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition TGWindow.cxx:127
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:334
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32