Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGuiBldGeometryFrame.cxx
Go to the documentation of this file.
1// @(#)root/guibuilder:$Id$
2// Author: Valeriy Onuchin, Lucie Flekova 12/09/04
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, 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#include "TGuiBldEditor.h"
13#include "TGuiBldHintsEditor.h"
14#include "TGuiBldNameFrame.h"
15#include "TGResourcePool.h"
16#include "TGLabel.h"
17#include "TGButtonGroup.h"
18#include "TGNumberEntry.h"
19#include "TG3DLine.h"
21#include "TRootGuiBuilder.h"
22#include "TGuiBldDragManager.h"
23#include "TGFrame.h"
24
25/** \class TGuiBldGeometryFrame
26 \ingroup guibuilder
27*/
28
29
30////////////////////////////////////////////////////////////////////////////////
31/// Constructor.
32
34 : TGVerticalFrame(p, 1, 1)
35{
36 fEditor = ed;
40 fEditDisabled = 1;
42
43 TGGroupFrame *fGroupFrame = new TGGroupFrame(this, "Size");
44
46
47 hf->AddFrame(new TGLabel(hf, " Width "), new TGLayoutHints(kLHintsLeft |
48 kLHintsCenterY, 2, 2, 2, 2));
49 fNEWidth = new TGNumberEntry(hf, 0.0, 4, -1, (TGNumberFormat::EStyle)5);
51 2, 2, 2, 2));
52
53 hf->AddFrame(new TGLabel(hf, " Height "), new TGLayoutHints(kLHintsLeft |
54 kLHintsCenterY, 2, 2, 2, 2));
55 fNEHeight = new TGNumberEntry(hf, 0.0, 4, -1, (TGNumberFormat::EStyle)5);
57 2, 2, 2, 2));
58
60 0, 0, 5, 0));
61
63
64 fNEWidth->GetNumberEntry()->Connect("ReturnPressed()", "TGuiBldGeometryFrame",
65 this, "ResizeSelected()");
66 fNEWidth->Connect("ValueSet(Long_t)", "TGuiBldGeometryFrame", this,
67 "ResizeSelected()");
68 fNEHeight->GetNumberEntry()->Connect("ReturnPressed()", "TGuiBldGeometryFrame",
69 this, "ResizeSelected()");
70 fNEHeight->Connect("ValueSet(Long_t)", "TGuiBldGeometryFrame", this,
71 "ResizeSelected()");
72
73 if (!fSelected) {
76 }
77 else {
80 }
81}
82
83////////////////////////////////////////////////////////////////////////////////
84/// Resize and redraw selected frame.
85
87{
88 if (!fEditor)
89 return;
90
92
93 if (!fSelected)
94 return;
95
98
99 if ((w > 0) && (h > 0)) {
102 TGWindow *root = (TGWindow*)fClient->GetRoot();
103 fClient->NeedRedraw(root, kTRUE);
105 if (fBuilder) {
107 }
108 } else {
111 }
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Update number entries when new frame selected.
116
118{
119 if (!frame) {
122 } else {
123 fNEWidth->SetNumber(frame->GetWidth());
124 fNEHeight->SetNumber(frame->GetHeight());
125 }
126}
127
128
#define h(i)
Definition RSha256.hxx:106
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
R__EXTERN TVirtualDragManager * gDragManager
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
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
Int_t GetX() const
Definition TGFrame.h:233
UInt_t GetHeight() const
Definition TGFrame.h:227
Int_t GetY() const
Definition TGFrame.h:234
UInt_t GetWidth() const
Definition TGFrame.h:226
A composite frame with a border and a title.
Definition TGFrame.h:524
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual Long_t GetIntNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
A composite frame that layout their children in vertical way.
Definition TGFrame.h:376
ROOT GUI Window base class.
Definition TGWindow.h:23
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
Drag and drop manager used by the ROOT GUI Builder.
void DrawGrabRectangles(TGWindow *win=nullptr)
Draw small grab rectangles around grabbed/selected/frame.
The property editor.
TGFrame * GetSelected() const
TRootGuiBuilder * fBuilder
void ResizeSelected()
Resize and redraw selected frame.
void ChangeSelected(TGFrame *frame)
Update number entries when new frame selected.
TGuiBldGeometryFrame(const TGWindow *p, TGuiBldEditor *editor)
Constructor.
TGuiBldDragManager * fDragManager
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
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.
Definition TQObject.cxx:865