25 TGNumberEntry *fEntry;
28 TextMargin(
const TGWindow *p,
const char *
name) : TGHorizontalFrame(p)
32 TGLabel *label =
new TGLabel(
this,
name);
44 TGTextButton *fButton;
48 void DoHPosition(
Int_t);
49 void DoVPosition(
Int_t);
50 void DoLeftMargin(
char *);
51 void DoRightMargin(
char *);
52 void DoTopMargin(
char *);
53 void DoBottomMargin(
char *);
78 fButton =
new TGTextButton(contents,
"&This button has a multi-line label\nand shows features\n"
79 "available in the button classes");
80 fButton->Resize(300, 200);
81 fButton->ChangeOptions(fButton->GetOptions() |
kFixedSize);
82 fButton->SetToolTipText(
"The assigned tooltip\ncan be multi-line also", 200);
89 disable->
Connect(
"Toggled(Bool_t)",
"TGButton", fButton,
"SetEnabled(Bool_t)");
100 horizontal->
Connect(
"Pressed(Int_t)",
"ButtonWindow",
this,
"DoHPosition(Int_t)");
110 vertical->
Connect(
"Pressed(Int_t)",
"ButtonWindow",
this,
"DoVPosition(Int_t)");
117 TextMargin *left =
new TextMargin(margins,
"Left");
119 left->GetEntry()->Connect(
"TextChanged(char*)",
"ButtonWindow",
this,
"DoLeftMargin(char*)");
121 TextMargin *right =
new TextMargin(margins,
"Right");
123 right->GetEntry()->Connect(
"TextChanged(char*)",
"ButtonWindow",
this,
"DoRightMargin(char*)");
125 TextMargin *top =
new TextMargin(margins,
"Top");
127 top->GetEntry()->Connect(
"TextChanged(char*)",
"ButtonWindow",
this,
"DoTopMargin(char*)");
129 TextMargin *bottom =
new TextMargin(margins,
"Bottom");
131 bottom->GetEntry()->Connect(
"TextChanged(char*)",
"ButtonWindow",
this,
"DoBottomMargin(char*)");
139 Connect(
"CloseWindow()",
"TApplication",
gApplication,
"Terminate()");
145 SetWMSizeHints(GetDefaultWidth(), GetDefaultHeight(), 1000, 1000, 0, 0);
146 SetWindowName(
"Button Test");
151void ButtonWindow::DoHPosition(
Int_t id)
155 Int_t tj = fButton->GetTextJustify();
160 fButton->SetTextJustify(tj);
164void ButtonWindow::DoVPosition(
Int_t id)
168 Int_t tj = fButton->GetTextJustify();
174 fButton->SetTextJustify(tj);
178void ButtonWindow::DoLeftMargin(
char *val)
182 fButton->SetLeftMargin(atoi(val));
187void ButtonWindow::DoRightMargin(
char *val)
191 fButton->SetRightMargin(atoi(val));
196void ButtonWindow::DoTopMargin(
char *val)
200 fButton->SetTopMargin(atoi(val));
205void ButtonWindow::DoBottomMargin(
char *val)
209 fButton->SetBottomMargin(atoi(val));
int Int_t
Signed integer 4 bytes (int).
#define ClassDef(name, id)
externTApplication * gApplication
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
A composite frame with a border and a title.
virtual void SetTitlePos(ETitlePos pos=kLeft)
A composite frame that layout their children in horizontal way.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
Yield an action as soon as it is clicked.
A vertical 3D line is a line that can be used to separate groups of widgets.
A composite frame that layout their children in vertical way.
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.