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",
101 char **fontList,
Bool_t wait) :
102 TGTransientFrame(p, t, 100, 100), fFontNames(0), fFontSizes(0), fFontStyles(0),
103 fTextAligns(0), fColorSelect(0), fFontProp(0), fItalic(0), fBold(0),
fSize(0),
104 fTextAlign(0), fTextColor(0), fNumberOfFonts(0)
122 Error(
"TGFontDialog",
"fontProp argument may not be 0");
131 if (fontProp->
fName ==
"") {
132 fName = fontList ? fontList[0] :
"Arial";
161 fFontNames->
Connect(
"Selected(char*)",
"TGFontDialog",
this,
"UpdateStyleSize(char*)");
243 fontList =
gVirtualX->ListFonts(
"-*-*-*-*", 10000, cnt);
247 Build(fontList, cnt);
314 if (own)
gVirtualX->FreeFontNames(fontList);
495 for (i = 0; i < cnt; i++) {
497 n1 = font.
Index(
"-", 1);
498 n2 = font.
Index(
"-", n1+1);
499 family = font(n1+1, n2-n1-1);
549 if (!cnt || !fontList) {
563 if (
gVirtualX->InheritsFrom(
"TGCocoa")) {
572 for (i = 0; i < cnt; i++) {
574 n1 =
name.Index(family);
580 n2 =
name.Index(
"-", n1);
585 style1 =
name(n1, n2 - n1);
588 n2 =
name.Index(
"-", n1);
592 style2 =
name(n1, n2 - n1);
594 if ((style1 ==
"normal") || (style1 ==
"medium")) {
598 }
else if (style2 ==
"i") {
601 }
else if (style2 ==
"o") {
605 }
else if (style1 ==
"bold") {
609 }
else if (style2 ==
"i") {
612 }
else if (style2 ==
"o") {
616 }
else if (style1 ==
"(null)") {
628 n2 =
name.Index(
"-", n1);
630 n2 =
name.Index(
"-", n1);
634 n2 =
name.Index(
"-", n1);
635 sz =
name(n1, n2 - n1);
640 all_sizes = (sz ==
"0") && !x11;
656 if (all_styles || styles[i]) {
662 if (nostyles && x11) {
727 name =
e ?
e->GetText()->GetString() :
"";
731 size =
e ?
e->GetText()->GetString() :
"0";
735 if (sel < 0) sel = 0;
760 const char *rgstry =
"*";
762 if ((
fName ==
"Symbol") || (
fName ==
"Webdings") || (
fName ==
"Wingdings")) {
763 rgstry =
"microsoft";
837 n1 =
name.Index(
"-", 1);
838 n2 =
name.Index(
"-", n1 + 1);
840 family =
name(n1, n2 - n1);
849 n2 =
name.Index(
"-", n1);
851 style1 =
name(n1, n2 - n1);
854 n2 =
name.Index(
"-", n1);
858 style2 =
name(n1, n2 - n1);
860 if ((style1 ==
"normal") || (style1 ==
"medium")) {
863 }
else if (style2 ==
"i") {
865 }
else if (style2 ==
"o") {
868 }
else if (style1 ==
"bold") {
871 }
else if (style2 ==
"i") {
873 }
else if (style2 ==
"o") {
878 n2 =
name.Index(
"-", n1);
880 n2 =
name.Index(
"-", n1);
882 n2 =
name.Index(
"-", n1);
885 n2 =
name.Index(
"-", n1);
886 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
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN Int_t gErrorIgnoreLevel
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]
void WaitForUnmap(TGWindow *w)
Wait for window to be unmapped.
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
void FreeGC(const TGGC *gc)
Free a graphics context.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
virtual Int_t GetSelected() const
virtual void AddEntry(TGString *s, Int_t id)
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
virtual void SetEnabled(Bool_t on=kTRUE)
Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
The base class for composite widgets (menu bars, list boxes, etc.).
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual UInt_t GetDefaultWidth() const
virtual void Layout()
Layout the elements of the composite frame.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual UInt_t GetDefaultHeight() const
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Font selection dialog, allowing to select one in the list of available fonts in the system.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Handle dialog events.
TGGC * fSampleTextGC
GC used for sample text.
Pixel_t fTextColor
text color
virtual void AlignSelected(Int_t a)
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
TGFontDialog(const TGWindow *parent=0, const TGWindow *t=0, FontProp_t *fontProp=0, const TString &sample="", char **fontList=0, Bool_t wait=kTRUE)
Create font dialog.
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.
virtual ~TGFontDialog()
Delete all widgets.
virtual void CloseWindow()
Called when window is closed via window manager.
Bool_t fItalic
italic flag
virtual void EnableAlign(Bool_t on=kTRUE)
Enable/disable align combobox.
void GetFontName()
Sets fLName and other data members.
TGFont * fInitFont
initial font
TGColorSelect * fColorSelect
color selection dialog
Int_t fInitAlign
initial value of text align
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.
FontH_t GetFontHandle() const
static Pixel_t GetBlackPixel()
Get black pixel value.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void DeleteWindow()
Delete window.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MapWindow()
map window
virtual void UnmapWindow()
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.
void SetTextJustify(Int_t tmode)
Set text justification.
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
virtual void SetTextFont(TGFont *font, Bool_t global=kFALSE)
Changes text font specified by pointer to TGFont object.
This class describes layout hints used by the layout classes.
A listbox is a box, possibly with scrollbar, containing entries.
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
virtual TGLBEntry * GetSelectedEntry() const
virtual Int_t GetSelected() const
Return id of selected listbox item.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
virtual TGScrollBar * GetScrollBar() const
virtual void Layout()
Layout the listbox components.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
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 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.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
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.
Defines transient windows that typically are used for dialogs windows.
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
virtual const char * GetName() const
Returns name of object.
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.
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