Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/base/src/TString.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ TString& TString::ReplaceAll(const char *s1, Ssiz_t ls1, const char *s2,

TString &TString::ReplaceSpecialCppChars()
{
return ReplaceAll("\\","\\\\").ReplaceAll("\"","\\\"");
return ReplaceAll("\\","\\\\").ReplaceAll("\"","\\\"").ReplaceAll("\n","\\n").ReplaceAll("\t","\\t");
}


Expand Down
2 changes: 2 additions & 0 deletions gui/gui/inc/TGFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class TGFrame : public TGWindow, public TQObject {
// some protected methods use in gui builder
virtual void StartGuiBuilding(Bool_t on = kTRUE);

TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options = kChildFrame, Bool_t check_white_pixel = kFALSE);

private:
TGFrame(const TGFrame&) = delete;
TGFrame& operator=(const TGFrame&) = delete;
Expand Down
12 changes: 7 additions & 5 deletions gui/gui/inc/TGListTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class TGListTreeItem
UInt_t fHeight; // item height
///@}

virtual TString SaveTreeItem(std::ostream &, const char *, const char *) { return ""; }

public:
TGListTreeItem(TGClient *client = gClient);
virtual ~TGListTreeItem() {}
Expand Down Expand Up @@ -117,8 +119,6 @@ class TGListTreeItem
virtual void HandleDrag() {}
virtual void HandleDrop() {}

virtual void SavePrimitive(std::ostream&, Option_t*, Int_t) {}

ClassDef(TGListTreeItem,0) // Abstract base-class for items that go into a TGListTree container.
};

Expand All @@ -144,6 +144,10 @@ class TGListTreeItemStd : public TGListTreeItem
TGListTreeItemStd(const TGListTreeItemStd&) = delete;
TGListTreeItemStd& operator=(const TGListTreeItemStd&) = delete;

protected:

TString SaveTreeItem(std::ostream &out, const char *treevarname, const char *parent_var_name) override;

public:
TGListTreeItemStd(TGClient *fClient = gClient, const char *name = nullptr,
const TGPicture *opened = nullptr, const TGPicture *closed = nullptr,
Expand Down Expand Up @@ -186,8 +190,6 @@ class TGListTreeItemStd : public TGListTreeItem
void SetColor(Color_t color) override { fHasColor = true;fColor = color; }
void ClearColor() override { fHasColor = false; }

void SavePrimitive(std::ostream &out, Option_t *option, Int_t n) override;

ClassDefOverride(TGListTreeItemStd,0) //Item that goes into a TGListTree container
};

Expand Down Expand Up @@ -272,7 +274,7 @@ class TGListTree : public TGContainer {
void DrawNode(Handle_t id, TGListTreeItem *item, Int_t x, Int_t y);
virtual void UpdateChecked(TGListTreeItem *item, Bool_t redraw = kFALSE);

void SaveChildren(std::ostream &out, TGListTreeItem *item, Int_t &n);
void SaveChildren(std::ostream &out, const char *parent_var_name, TGListTreeItem *item);
void RemoveReference(TGListTreeItem *item);
void PDeleteItem(TGListTreeItem *item);
void PDeleteChildren(TGListTreeItem *item);
Expand Down
44 changes: 12 additions & 32 deletions gui/gui/src/TG3DLine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,13 @@ void TGHorizontal3DLine::DrawBorder()

void TGHorizontal3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);

out << " TGHorizontal3DLine *";
out << GetName() << " = new TGHorizontal3DLine(" << fParent->GetName()
<< "," << GetWidth() << "," << GetHeight();

if (fBackground == GetDefaultFrameBackground()) {
if (!GetOptions()) {
out << ");" << std::endl;
} else {
out << "," << GetOptionString() << ");" << std::endl;
}
} else {
out << "," << GetOptionString() << ",ucolor);" << std::endl;
}
auto extra_args = SaveCtorArgs(out);

out << " TGHorizontal3DLine *" << GetName() << " = new TGHorizontal3DLine(" << fParent->GetName()
<< "," << GetWidth() << "," << GetHeight() << extra_args << ");\n";

if (option && strstr(option, "keep_names"))
out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -106,21 +96,11 @@ void TGVertical3DLine::DrawBorder()

void TGVertical3DLine::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);

out << " TGVertical3DLine *";
out << GetName() << " = new TGVertical3DLine(" << fParent->GetName()
<< "," << GetWidth() << "," << GetHeight();

if (fBackground == GetDefaultFrameBackground()) {
if (!GetOptions()) {
out << ");" << std::endl;
} else {
out << "," << GetOptionString() <<");" << std::endl;
}
} else {
out << "," << GetOptionString() << ",ucolor);" << std::endl;
}
auto extra_args = SaveCtorArgs(out);

out << " TGVertical3DLine *" << GetName() << " = new TGVertical3DLine(" << fParent->GetName() << "," << GetWidth()
<< "," << GetHeight() << extra_args << ");\n";

if (option && strstr(option, "keep_names"))
out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
}
Loading
Loading