51 "8",
"9",
"10",
"11",
"12",
"13",
"14",
"16",
52 "18",
"20",
"22",
"24",
"26",
"28",
"30",
"32",
53 "34",
"36",
"48",
"72", 0
57 "Normal",
"Bold",
"Italic",
"Bold Italic", 0
64 "top left",
"top center",
"top right",
65 "middle left",
"middle center",
"middle right",
66 "bottom left",
"bottom center",
"bottom right",
100 char **fontList,
Bool_t wait) :
109 UInt_t width = 0, height = 0;
121 Error(
"TGFontDialog",
"fontProp argument may not be 0");
130 if (fontProp->
fName ==
"") {
131 fName = fontList ? fontList[0] :
"Arial";
160 fFontNames->Connect(
"Selected(char*)",
"TGFontDialog",
this,
"UpdateStyleSize(char*)");
242 fontList =
gVirtualX->ListFonts(
"-*-*-*-*", 10000, cnt);
246 Build(fontList, cnt);
313 if (own)
gVirtualX->FreeFontNames(fontList);
494 for (i = 0; i < cnt; i++) {
496 n1 = font.
Index(
"-", 1);
497 n2 = font.
Index(
"-", n1+1);
498 family = font(n1+1, n2-n1-1);
548 if (!cnt || !fontList) {
562 if (
gVirtualX->InheritsFrom(
"TGCocoa")) {
571 for (i = 0; i < cnt; i++) {
573 n1 =
name.Index(family);
579 n2 =
name.Index(
"-", n1);
584 style1 =
name(n1, n2 - n1);
587 n2 =
name.Index(
"-", n1);
591 style2 =
name(n1, n2 - n1);
593 if ((style1 ==
"normal") || (style1 ==
"medium")) {
597 }
else if (style2 ==
"i") {
600 }
else if (style2 ==
"o") {
604 }
else if (style1 ==
"bold") {
608 }
else if (style2 ==
"i") {
611 }
else if (style2 ==
"o") {
615 }
else if (style1 ==
"(null)") {
627 n2 =
name.Index(
"-", n1);
629 n2 =
name.Index(
"-", n1);
633 n2 =
name.Index(
"-", n1);
634 sz =
name(n1, n2 - n1);
639 all_sizes = (sz ==
"0") && !x11;
655 if (all_styles || styles[i]) {
661 if (nostyles && x11) {
726 name =
e ?
e->GetText()->GetString() :
"";
730 size =
e ?
e->GetText()->GetString() :
"0";
734 if (sel < 0) sel = 0;
759 const char *rgstry =
"*";
761 if ((
fName ==
"Symbol") || (
fName ==
"Webdings") || (
fName ==
"Wingdings")) {
762 rgstry =
"microsoft";
836 n1 =
name.Index(
"-", 1);
837 n2 =
name.Index(
"-", n1 + 1);
839 family =
name(n1, n2 - n1);
848 n2 =
name.Index(
"-", n1);
850 style1 =
name(n1, n2 - n1);
853 n2 =
name.Index(
"-", n1);
857 style2 =
name(n1, n2 - n1);
859 if ((style1 ==
"normal") || (style1 ==
"medium")) {
862 }
else if (style2 ==
"i") {
864 }
else if (style2 ==
"o") {
867 }
else if (style1 ==
"bold") {
870 }
else if (style2 ==
"i") {
872 }
else if (style2 ==
"o") {
877 n2 =
name.Index(
"-", n1);
879 n2 =
name.Index(
"-", n1);
881 n2 =
name.Index(
"-", n1);
884 n2 =
name.Index(
"-", n1);
885 sz =
name(n1, n2 - n1);
const Mask_t kGCForeground
ULong_t Pixel_t
Pixel value.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externInt_t gErrorIgnoreLevel
errors with level below this value will be ignored. Default is kUnset.
static const char * gFontStyles[]
static const char * gAlignTypes[]
static const Int_t gAlignValues[]
static const char * gFDLG_DEFAULTSAMPLE
static const char * gFontSizes[]
static TString gFontStylesReal[4]
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
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
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
TGGC * fSampleTextGC
GC used for sample text.
Pixel_t fTextColor
text color
virtual void AlignSelected(Int_t a)
void CloseWindow() override
Called when window is closed via window manager.
Bool_t Build(char **fontList, Int_t cnt)
Build font dialog.
virtual void SetAlign(Int_t align)
Set align.
TGListBox * fFontSizes
list of font sizes
Int_t fTextAlign
text alignment
TString fSampleText
string used for sample
Bool_t fHitOK
flag = kTRUE if user press the Ok button
TGLabel * fSample
sample of selected font
TGFont * fLabelFont
TGFont used for sample text.
TGListBox * fFontStyles
list of font styles
Bool_t fWaitFor
if kTRUE WaitForUnmap is called in constructor.
Pixel_t fInitColor
initial value of text color
FontProp_t * fFontProp
font info structure
virtual void FontSelected(char *font)
virtual void UpdateStyleSize(const char *family)
Build font style and size list boxes.
virtual void SetFont(TGFont *font)
Set font.
Bool_t fItalic
italic flag
~TGFontDialog() override
Delete all widgets.
virtual void EnableAlign(Bool_t on=kTRUE)
Enable/disable align combobox.
void GetFontName()
Sets fLName and other data members.
TGFont * fInitFont
initial font
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle dialog events.
TGColorSelect * fColorSelect
color selection dialog
Int_t fInitAlign
initial value of text align
TGFontDialog(const TGWindow *parent=nullptr, const TGWindow *t=nullptr, FontProp_t *fontProp=nullptr, const TString &sample="", char **fontList=nullptr, Bool_t wait=kTRUE)
Create font dialog.
virtual void SetColor(Pixel_t color)
Set color.
Int_t fNumberOfFonts
total number of fonts
TGListBox * fFontNames
list of font names
TGComboBox * fTextAligns
font alignment selection
virtual void ColorSelected(Pixel_t c)
TString fLName
logical font name
Encapsulate fonts used in the GUI system.
static Pixel_t GetBlackPixel()
Get black pixel value.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
void MapWindow() override
map window
virtual void DeleteWindow()
Delete window.
void UnmapWindow() override
unmap window
A composite frame with a border and a title.
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
A listbox is a box, possibly with scrollbar, containing entries.
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.
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.
TGClient * fClient
Connection to display server.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Yield an action as soon as it is clicked.
Text string listbox entries.
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.
@ kEditDisable
disable edit of this window
const char * GetName() const override
Returns name of object.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Graphics context structure.
Mask_t fMask
bit mask specifying which fields are valid
ULong_t fForeground
foreground pixel
FontH_t fFont
default text font for text operations
Bool_t fItalic
italic flag
UInt_t fAlign
text alignment