102 }
else if (
fMode == 2) {
105 if ((!strcmp(
fName->GetText(),
"Default"))
106 || (!strcmp(
fName->GetText(),
"Plain" ))
107 || (!strcmp(
fName->GetText(),
"Bold" ))
108 || (!strcmp(
fName->GetText(),
"Video" ))
112 fName->Associate(
this);
113 fName->Resize(200, 22);
127 TString newTitle(
"Imported from canvas ");
129 newTitle +=
fCurPad->GetCanvas()->GetName();
143 gClient->GetColorByName(
"#FF0000", red);
152 fOK->Associate(
this);
174 fOK->SetToolTipText(
"Create this new style");
175 fCancel->SetToolTipText(
"Cancel the creation ");
178 fOK->SetToolTipText(
"Rename the selected style");
179 fCancel->SetToolTipText(
"Cancel the rename ");
182 fOK->SetToolTipText(
"Import this new style from the canvas");
183 fCancel->SetToolTipText(
"Cancel the import");
187 Connect(
"CloseWindow()",
"TStyleDialog",
this,
"DoCloseWindow()");
188 fName->Connect(
"TextChanged(const char *)",
"TStyleDialog",
this,
"DoUpdate()");
189 fOK->Connect(
"Clicked()",
"TStyleDialog",
this,
"DoOK()");
190 fCancel->Connect(
"Clicked()",
"TStyleDialog",
this,
"DoCancel()");
201 fName->Disconnect(
"TextChanged(const char *)");
202 fOK->Disconnect(
"Clicked()");
203 fCancel->Disconnect(
"Clicked()");
272 gROOT->GetListOfStyles()->Add(tmpStyle);
280 fCurPad->GetCanvas()->UseCurrentStyle();
298 if (!strlen(
fName->GetText())) {
304 if (strstr(
fName->GetText(),
" ") != 0) {
305 fWarnLabel->SetText(
"That name contains some spaces");
314 fWarnLabel->SetText(
"That name is already used by another style.");
322 fWarnLabel->SetText(
"That name is already used by another style.");
ULong_t Pixel_t
Pixel value.
int Int_t
Signed integer 4 bytes (int).
externTVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
UInt_t GetDefaultWidth() const override
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
A composite frame that layout their children in horizontal way.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
virtual void SendCloseMessage()
Send close message to self.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
TGTransientFrame(const TGTransientFrame &)=delete
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
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.
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
void DoCancel()
Slot called when the Cancel button is clicked.
TList * fTrashListLayout
to avoid memory leak
void DoOK()
Slot called when the OK button is clicked.
~TStyleDialog() override
Destructor.
TStyleDialog(TStyleManager *sm, TStyle *cur, Int_t mode, TVirtualPad *currentPad=nullptr)
Constructor.
Int_t fMode
1=new, 2=rename, 3=import
TGTextEntry * fTitle
TStyle title text entry.
void DoCloseWindow()
Slot called when the window is closed via the window manager.
TVirtualPad * fCurPad
current pad from which to import
TList * fTrashListFrame
to avoid memory leak
TStyle * fCurStyle
style to copy or to rename
TGTextButton * fOK
save button
TGTextEntry * fName
TStyle name text entry.
TGTextButton * fCancel
cancel button
TStyleManager * fStyleManager
parent style manager
TGLabel * fTitleLabel
title label
TGLabel * fNameLabel
name label
void DoUpdate()
Slot called every time the name is changed.
TGLabel * fWarnLabel
label for warnings
This class provides a Graphical User Interface to manage styles in ROOT.
TStyle objects may be created to define special styles.
TVirtualPad is an abstract base class for the Pad and Canvas classes.