48 const char *title,
const char *msg,
const TGPicture *icon,
54 PMsgBox(title, msg, icon, buttons, ret_code, text_align);
75 const char *title,
const char *msg,
EMsgBoxIcon icon,
84 icon_pic =
fClient->GetPicture(
"mb_stop_s.xpm");
85 if (!icon_pic)
Error(
"TGMsgBox",
"mb_stop_s.xpm not found");
89 icon_pic =
fClient->GetPicture(
"mb_question_s.xpm");
90 if (!icon_pic)
Error(
"TGMsgBox",
"mb_question_s.xpm not found");
94 icon_pic =
fClient->GetPicture(
"mb_exclamation_s.xpm");
95 if (!icon_pic)
Error(
"TGMsgBox",
"mb_exclamation_s.xpm not found");
99 icon_pic =
fClient->GetPicture(
"mb_asterisk_s.xpm");
100 if (!icon_pic)
Error(
"TGMsgBox",
"mb_asterisk_s.xpm not found");
109 PMsgBox(title, msg, icon_pic, buttons, ret_code, text_align);
142 fYes->Associate(
this);
144 width = std::max(width,
fYes->GetDefaultWidth()); ++nb;
147 if (buttons &
kMBNo) {
149 fNo->Associate(
this);
151 width = std::max(width,
fNo->GetDefaultWidth()); ++nb;
154 if (buttons &
kMBOk) {
156 fOK->Associate(
this);
158 width = std::max(width,
fOK->GetDefaultWidth()); ++nb;
165 width = std::max(width,
fApply->GetDefaultWidth()); ++nb;
172 width = std::max(width,
fRetry->GetDefaultWidth()); ++nb;
179 width = std::max(width,
fIgnore->GetDefaultWidth()); ++nb;
186 width = std::max(width,
fCancel->GetDefaultWidth()); ++nb;
193 width = std::max(width,
fClose->GetDefaultWidth()); ++nb;
200 width = std::max(width,
fYesAll->GetDefaultWidth()); ++nb;
207 width = std::max(width,
fNoAll->GetDefaultWidth()); ++nb;
214 width = std::max(width,
fNewer->GetDefaultWidth()); ++nb;
221 width = std::max(width,
fAppend->GetDefaultWidth()); ++nb;
228 width = std::max(width,
fDismiss->GetDefaultWidth()); ++nb;
259 char *tmpMsg, *nextLine;
261 int len = strlen(msg) + 1;
262 tmpMsg =
new char[len];
266 strlcpy(nextLine, msg, len);
267 while ((nextLine = strchr(
line,
'\n'))) {
388 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
const Mask_t kKeyPressMask
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
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 AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
virtual void DeleteWindow()
Delete window.
void MapRaised() override
map raised
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI icons.
This class handles GUI labels.
void SetTextJustify(Int_t tmode)
Set text justification.
This class describes layout hints used by the layout classes.
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
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.
TGButton * fNoAll
buttons in dialog box
TGLayoutHints * fL5
layout hints
TList * fMsgList
text (list of TGLabels)
TGHorizontalFrame * fIconFrame
frame containing icon and text
void PMsgBox(const char *title, const char *msg, const TGPicture *icon, Int_t buttons, Int_t *ret_code, Int_t text_align)
Protected, common message dialog box initialization.
TGVerticalFrame * fLabelFrame
frame containing text
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process message dialog box event.
TGMsgBox(const TGMsgBox &)=delete
Bool_t HandleKey(Event_t *event) override
Handle enter and escape keys (used as Ok and Cancel for now).
TGHorizontalFrame * fButtonFrame
frame containing buttons
TGButton * fDismiss
buttons in dialog box
~TGMsgBox() override
Destroy message dialog box.
TGButton * fCancel
buttons in dialog box
Int_t * fRetCode
address to store return code
void CloseWindow() override
Close dialog box.
TGButton * fApply
buttons in dialog box
TGClient * fClient
Connection to display server.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Yield an action as soon as it is clicked.
TGTransientFrame(const TGTransientFrame &)=delete
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
int main(int argc, char **argv)
EGEventType fType
of event (see EGEventType)