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)) {
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;
730 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
740 out <<
" " <<
GetName() <<
"->AddEntry(";
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;
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;
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
Handle_t Window_t
Window handle.
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.
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]
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t gval
Option_t Option_t TPoint TPoint const char text
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
void Layout() override
layout combobox
Bool_t HandleSelection(Event_t *event) override
Handle selection in text entry.
TGLBEntry * fSelEntry
selected item frame
TGComboBox(const TGComboBox &)=delete
void RemoveAll() override
Remove all entries from combo box.
virtual void AddEntry(TGString *s, Int_t id)
void DrawBorder() override
Draw border of combo box widget.
TGListBox * fListBox
the listbox with text items
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a combo box widget as a C++ statement(s) on output stream out.
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click in text entry.
~TGComboBox() override
Delete a combo box widget.
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 void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
virtual TGListBox * GetListBox() const
TGTextEntry * fTextEntry
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
Bool_t HandleSelectionRequest(Event_t *event) override
Handle selection request in text entry.
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by the listbox and forward messages to the combobox message handling windo...
Bool_t HandleButton(Event_t *event) override
Handle mouse button events in the combo box.
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.
Bool_t HandleMotion(Event_t *event) override
Handle pointer motion in text entry.
virtual void EnableTextInput(Bool_t on)
Switch text input or readonly mode of combobox (not perfect yet).
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.).
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.
virtual TList * GetList() const
virtual TGLayoutManager * GetLayoutManager() const
Int_t MustCleanup() const override
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
void Layout() override
Layout the elements of the composite frame.
TList * fList
container of frame elements
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
The TGFontTypeComboBox is user callable and it creates a combobox for selecting the font.
TGFontTypeComboBox(const TGWindow *p=nullptr, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t bask=GetWhitePixel())
Create a text font combo box.
~TGFontTypeComboBox() override
Text font combo box dtor.
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.
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
static const TGGC & GetBlackGC()
Get black graphics context.
UInt_t fOptions
frame options
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
UInt_t fHeight
frame height
virtual void DrawBorder()
Draw frame border.
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
void UnmapWindow() override
unmap window
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 Pixel_t GetBackground() const
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.
void MapRaised() override
map raised
A Composite frame that contains a list of TGLBEnties.
virtual void Update(TGLBEntry *)
void SetBackgroundColor(Pixel_t col) override
Set background color (override from TGWindow base class).
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.
void SavePrimitive(std::ostream &out, Option_t *option="") override
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.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a line width combo box widget as a C++ statement(s).
TGLineWidthComboBox(const TGWindow *p=nullptr, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel(), Bool_t none=kFALSE)
Create a line width combo box.
A listbox is a box, possibly with scrollbar, containing entries.
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.
void Resize(UInt_t w, UInt_t h) override
Resize the listbox widget.
virtual TGScrollBar * GetScrollBar() const
UInt_t GetItemVsize() const
virtual TGFrame * GetContainer() const
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
void RemoveAll() override
Remove all entries.
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.
Bool_t HandleSelectionRequest(Event_t *event) override
Handle request to send current clipboard contents to requestor window.
const char * GetText() const
Bool_t HandleSelection(Event_t *event) override
Handle text selection event.
Bool_t HandleDoubleClick(Event_t *event) override
Handle mouse double click event in the text entry widget.
virtual void SetTitle(const char *label)
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.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in the text entry widget.
Bool_t HandleButton(Event_t *event) override
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 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
virtual void SetWindowName(const char *name=nullptr)
Set window name.
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
UInt_t fEditDisabled
flags used for "guibuilding"
TObject * First() const override
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.
EGEventType fType
of event (see EGEventType)
UInt_t fCode
key or button code
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Graphics context structure.
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)?