54#include "RConfigure.h"
140 if (
gVirtualX->InheritsFrom(
"TGWin32")) {
178 fListBox->GetContainer()->RequestFocus();
182 fClient->GetResourcePool()->GetGrabCursor());
253 fTextEntry->Connect(
"ReturnPressed()",
"TGComboBox",
this,
"ReturnPressed()");
291 Error(
"TGComboBox",
"arrow_down.xpm not found");
316 fListBox->GetContainer()->Connect(
"KeyPressed(TGFrame*, UInt_t, UInt_t)",
318 "KeyPressed(TGFrame*, UInt_t, UInt_t)");
346 if (
gClient->GetStyle() > 1)
break;
385 fTextEntry->Connect(
"ReturnPressed()",
"TGComboBox",
this,
"ReturnPressed()");
541 if (
h && (
h < 100)) {
635 Emit(
"Selected(Int_t,Int_t)", args);
668 Emit(
"ReturnPressed()");
706 out <<
"\n // combo box\n";
708 out <<
" TGComboBox *" <<
GetName() <<
" = new TGComboBox(" <<
fParent->GetName();
711 out <<
", " <<
fWidgetId << extra_args <<
");\n";
713 if (option && strstr(option,
"keep_names"))
714 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
722 out <<
" " <<
GetName() <<
"->AddEntry(";
723 b->SavePrimitive(out, option);
724 out <<
");" << std::endl;
742 for (
Int_t i = 1; i <= 10; i++)
757 out <<
"\n // line style combo box\n";
758 out <<
" TGLineStyleComboBox *" <<
GetName() <<
" = new TGLineStyleComboBox(" <<
fParent->GetName() <<
","
760 if (option && strstr(option,
"keep_names"))
761 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
783 for (
Int_t i = 0; i < 16; i++)
796 out <<
"\n // line width combo box\n";
797 out <<
" TGLineWidthComboBox *" <<
GetName() <<
" = new TGLineWidthComboBox(" <<
fParent->GetName() <<
","
799 if (option && strstr(option,
"keep_names"))
800 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
807 {
"-*-times-medium-i-*-*-12-*-*-*-*-*-*-*",
"1. times italic" },
808 {
"-*-times-bold-r-*-*-12-*-*-*-*-*-*-*",
"2. times bold" },
809 {
"-*-times-bold-i-*-*-12-*-*-*-*-*-*-*",
"3. times bold italic" },
810 {
"-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*",
"4. helvetica" },
811 {
"-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*",
"5. helvetica italic" },
812 {
"-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*",
"6. helvetica bold" },
813 {
"-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*",
"7. helvetica bold italic" },
814 {
"-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*",
"8. courier" },
815 {
"-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*",
"9. courier italic" },
816 {
"-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*",
"10. courier bold" },
817 {
"-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*",
"11. courier bold italic" },
818 {
"-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*",
"12. symbol" },
819 {
"-*-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.
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).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
static const char * gFonts[][2]
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
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.
TGCompositeFrame(const TGCompositeFrame &)=delete
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.
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]
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.
TGFrame(const TGFrame &)=delete
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.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
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.
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
virtual Pixel_t GetBackground() const
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.
This class describes layout hints used by the layout classes.
Line style and width listbox entries.
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).
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 TGFrame * GetContainer() const
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
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.
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.
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 SetWindowName(const char *name=nullptr)
Set window name.
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"
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
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.
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)?