Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGtk4GedEditor.h
Go to the documentation of this file.
1// Author: Sergey Linev, GSI 30/10/2026
2
3/*************************************************************************
4 * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_TGtk4GedEditor
12#define ROOT_TGtk4GedEditor
13
14#include "TVirtualPadEditor.h"
15#include "TQObject.h"
16
17#include <functional>
18
19class TVirtualPad;
20class TAttMarker;
21class TAttText;
22class TAttLine;
23class TAttFill;
24class TClass;
25
27
28namespace Gtk {
29 class DropDown;
30 class SpinButton;
31 class ColorDialogButton;
32}
33
34
35namespace ROOT {
36namespace Experimental {
37
38class TGtk4GedEditor : public TVirtualPadEditor, public TObject, public TQObject {
39
40 protected:
41
42 TCanvas *fCanvas = nullptr;
43 TVirtualPad *fPad = nullptr;
44 TObject *fModel = nullptr;
46
48
49 TAttLine *fAttLine = nullptr;
50 TAttFill *fAttFill = nullptr;
51 TAttText *fAttText = nullptr;
53
54 Gtk::ColorDialogButton* m_line_color = nullptr;
55 Gtk::DropDown *m_line_style = nullptr;
56 Gtk::SpinButton *m_line_width = nullptr;
57
58 Gtk::ColorDialogButton* m_fill_color = nullptr;
59 Gtk::ColorDialogButton* m_text_color = nullptr;
60 Gtk::ColorDialogButton* m_marker_color = nullptr;
61
62 Int_t GetRootColor(Gtk::ColorDialogButton* btn);
63
65
66 void ModifiedPad();
67
68 void FillGed(TClass *cl);
69
71
72 public:
73
74 TGtk4GedEditor(TCanvas *c = nullptr);
75 virtual ~TGtk4GedEditor();
76
77 Bool_t IsGlobal() const override { return fGlobal; }
78 void SetGlobal(Bool_t on) override { fGlobal = on; }
79
80 TCanvas* GetCanvas() const override { return fCanvas; }
81
84 void SetCanvas(TCanvas *c);
85
86 void Show() override;
87 void Hide() override;
88
89 void RecursiveRemove(TObject* obj) override;
90
91 virtual void SetModel(TVirtualPad* pad, TObject* obj, Int_t event);
92
93 // specific editors
94 void AddTAttLine(TAttLine *);
95 void AddTAttFill(TAttFill *);
96 void AddTAttText(TAttText *);
98
99 ClassDefOverride(TGtk4GedEditor, 0) // Implementation for Ged Editor with GTK4
100};
101
102} // namespace Experimental
103} // namespace ROOT
104
105#endif
#define c(i)
Definition RSha256.hxx:101
cudaEvent_t event
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
#define ClassDefOverride(name, id)
Definition Rtypes.h:347
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Specialized dialog to enter arguments for method exection.
Bool_t IsGlobal() const override
Gtk::ColorDialogButton * m_marker_color
Gtk::ColorDialogButton * m_fill_color
void SetGlobal(Bool_t on) override
void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
void ConnectToCanvas(TCanvas *c)
Connect this editor to the Selected signal of canvas 'c'.
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event)
Activate object editors according to the selected object.
void RecursiveRemove(TObject *obj) override
Recursively remove this object from a list.
TCanvas * GetCanvas() const override
Int_t GetRootColor(Gtk::ColorDialogButton *btn)
Gtk::ColorDialogButton * m_text_color
Gtk::ColorDialogButton * m_line_color
Fill Area Attributes class.
Definition TAttFill.h:21
Line Attributes class.
Definition TAttLine.h:21
Marker Attributes class.
Definition TAttMarker.h:22
Text Attributes class.
Definition TAttText.h:21
The Canvas class.
Definition TCanvas.h:23
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
Mother of all ROOT objects.
Definition TObject.h:42
/**
Definition TQObject.h:48
Abstract base class used by ROOT graphics editor.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:53