54#include "RConfigure.h"
145 if (
gVirtualX->InheritsFrom(
"TGWin32")) {
296 Error(
"TGComboBox",
"arrow_down.xpm not found");
323 "KeyPressed(TGFrame*, UInt_t, UInt_t)");
351 if (
gClient->GetStyle() > 1)
break;
546 if (
h && (
h < 100)) {
611 if (
e->InheritsFrom(TGTextLBEntry::Class())) {
640 Emit(
"Selected(Int_t,Int_t)", args);
673 Emit(
"ReturnPressed()");
710 out << std::endl <<
" // combo box" << std::endl;
711 out <<
" TGComboBox *";
722 out <<
");" << std::endl;
729 if (option && strstr(option,
"keep_names"))
730 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
740 out <<
" " <<
GetName() <<
"->AddEntry(";
741 b->SavePrimitive(out, option);
742 out <<
");" << std::endl;
761 for (
Int_t i = 1; i <= 10; i++)
776 out << std::endl <<
" // line style combo box" << std::endl;
777 out <<
" TGLineStyleComboBox *";
780 <<
"," <<
fWidgetId <<
");" << std::endl;
781 if (option && strstr(option,
"keep_names"))
782 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
805 for (
Int_t i = 0; i < 16; i++)
818 out << std::endl <<
" // line width combo box" << std::endl;
819 out <<
" TGLineWidthComboBox *";
822 <<
"," <<
fWidgetId <<
");" << std::endl;
823 if (option && strstr(option,
"keep_names"))
824 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
832 {
"-*-times-medium-i-*-*-12-*-*-*-*-*-*-*",
"1. times italic" },
833 {
"-*-times-bold-r-*-*-12-*-*-*-*-*-*-*",
"2. times bold" },
834 {
"-*-times-bold-i-*-*-12-*-*-*-*-*-*-*",
"3. times bold italic" },
835 {
"-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*",
"4. helvetica" },
836 {
"-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*",
"5. helvetica italic" },
837 {
"-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*",
"6. helvetica bold" },
838 {
"-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*",
"7. helvetica bold italic" },
839 {
"-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*",
"8. courier" },
840 {
"-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*",
"9. courier italic" },
841 {
"-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*",
"10. courier bold" },
842 {
"-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*",
"11. courier bold italic" },
843 {
"-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*",
"12. symbol" },
844 {
"-*-times-medium-r-*-*-12-*-*-*-*-*-*-*",
"13. times" },
const Mask_t kWABorderPixel
const Mask_t kWAOverrideRedirect
const Mask_t kButtonPressMask
const Mask_t kWASaveUnder
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
const Mask_t kWABorderWidth
ULongptr_t Handle_t
Generic resource handle.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
static const char * gFonts[][2]
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Bool_t IsEditable() const
void RegisterPopup(TGWindow *w)
Add a popup menu to the list of popups.
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.
const TGResourcePool * GetResourcePool() const
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void FreePicture(const TGPicture *pic)
Free picture resource.
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
TGLBEntry * fSelEntry
selected item frame
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle selection request in text entry.
TGComboBox(const TGComboBox &)=delete
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in the combo box.
virtual void AddEntry(TGString *s, Int_t id)
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages generated by the listbox and forward messages to the combobox message handling windo...
TGListBox * fListBox
the listbox with text items
virtual void RemoveAll()
Remove all entries from combo box.
virtual void SetTopEntry(TGLBEntry *e, TGLayoutHints *lh)
Set a new combo box value (normally update of text string in fSelEntry is done via fSelEntry::Update(...
virtual Bool_t HandleSelection(Event_t *event)
Handle selection in text entry.
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
virtual TGListBox * GetListBox() const
virtual ~TGComboBox()
Delete a combo box widget.
TGTextEntry * fTextEntry
text entry
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion in text entry.
TGScrollBarElement * fDDButton
button controlling drop down of popup
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...
TGLayoutHints * fLhs
layout hints for selected item frame
TGLayoutHints * fLhdd
layout hints for fListBox
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click in text entry.
virtual void DrawBorder()
Draw border of combo box widget.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a combo box widget as a C++ statement(s) on output stream out.
virtual void SetEnabled(Bool_t on=kTRUE)
Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
virtual void Selected(Int_t widgetId, Int_t id)
Emit signal, done only when selected entry changed.
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
virtual void EnableTextInput(Bool_t on)
Switch text input or readonly mode of combobox (not perfect yet).
virtual void Layout()
layout combobox
virtual Int_t GetNumberOfEntries() const
virtual void Init()
Initiate the internal classes of a combo box.
TGComboBoxPopup * fComboFrame
popup containing a listbox
const TGPicture * fBpic
down arrow picture used in fDDButton
TGLayoutHints * fLhb
layout hints for fDDButton
The base class for composite widgets (menu bars, list boxes, etc.).
virtual TList * GetList() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual TGLayoutManager * GetLayoutManager() const
virtual void Layout()
Layout the elements of the composite frame.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual Int_t MustCleanup() const
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
TList * fList
container of frame elements
virtual UInt_t GetDefaultHeight() const
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
The TGFontTypeComboBox is user callable and it creates a combobox for selecting the font.
virtual ~TGFontTypeComboBox()
Text font combo box dtor.
TGFontTypeComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t bask=GetWhitePixel())
Create a text font combo box.
FontStruct_t fFonts[kMaxFonts]
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
static const TGGC & GetBlackGC()
Get black graphics context.
UInt_t fOptions
frame options
virtual void MapRaised()
map raised
static Pixel_t GetWhitePixel()
Get white pixel value.
UInt_t fHeight
frame height
virtual void DrawBorder()
Draw frame border.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual Pixel_t GetBackground() const
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Pixel_t fBackground
frame background color
static Pixel_t fgBlackPixel
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
unmap window
A Composite frame that contains a list of TGLBEnties.
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
virtual void Update(TGLBEntry *)
This class describes layout hints used by the layout classes.
Line style and width listbox entries.
The TGLineStyleComboBox user callable and it creates a combobox for selecting the line style.
TGLineStyleComboBox(const TGWindow *p=nullptr, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel())
Create a line style combo box.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a line style combo box widget as a C++ statement(s).
The TGLineWidthComboBox user callable and it creates a combobox for selecting the line width.
TGLineWidthComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel(), Bool_t none=kFALSE)
Create a line width combo box.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a line width combo box widget as a C++ statement(s).
A listbox is a box, possibly with scrollbar, containing entries.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
virtual Int_t GetNumberOfEntries() const
virtual TGLBEntry * GetSelectedEntry() const
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
virtual void RemoveAll()
Remove all entries.
virtual TGScrollBar * GetScrollBar() const
UInt_t GetItemVsize() const
virtual TGFrame * GetContainer() const
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
Cursor_t GetGrabCursor() const
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
A TGTextEntry is a one line text input widget.
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle request to send current clipboard contents to requestor window.
const char * GetText() const
virtual void SetTitle(const char *label)
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in the text entry widget.
virtual void SetFrameDrawn(Bool_t flag=kTRUE)
Sets the text entry to draw itself inside a two-pixel frame if enable is kTRUE, and to draw itself wi...
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual Bool_t HandleSelection(Event_t *event)
Handle text selection event.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click event in the text entry widget.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in text entry widget.
Text string listbox entries.
const TGString * GetText() const
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
ROOT GUI Window base class.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void RequestFocus()
request focus
virtual void SetEditDisabled(UInt_t on=kEditDisable)
const TGWindow * fParent
Parent window.
@ kEditDisableHeight
window height cannot be edited
@ kEditDisableLayout
window layout cannot be edited
@ kEditDisableBtnEnable
window can handle mouse button events
@ kEditDisableGrab
window grab cannot be edited
@ kEditDisable
disable edit of this window
@ kEditDisableEvents
window events cannot be edited
virtual void DestroyWindow()
destroy window
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
UInt_t fEditDisabled
flags used for "guibuilding"
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
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.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Graphics context structure.
Mask_t fMask
bit mask specifying which fields are valid
FontH_t fFont
default text font for text operations
Attributes that can be used when creating or changing a window.
UInt_t fBorderWidth
border width in pixels
Bool_t fOverrideRedirect
boolean value for override-redirect
Mask_t fMask
bit mask specifying which fields are valid
ULong_t fBorderPixel
border pixel value
Bool_t fSaveUnder
should bits under be saved (popups)?