49#include "RConfigure.h"
140 if (
gVirtualX->InheritsFrom(
"TGWin32")) {
291 Error(
"TGComboBox",
"arrow_down.xpm not found");
318 "KeyPressed(TGFrame*, UInt_t, UInt_t)");
346 if (
gClient->GetStyle() > 1)
break;
541 if (
h && (
h < 100)) {
606 if (
e->InheritsFrom(TGTextLBEntry::Class())) {
635 Emit(
"Selected(Int_t,Int_t)", args);
668 Emit(
"ReturnPressed()");
705 out << std::endl <<
" // combo box" << std::endl;
706 out <<
" TGComboBox *";
717 out <<
");" << std::endl;
724 if (option && strstr(option,
"keep_names"))
725 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
735 out <<
" " <<
GetName() <<
"->AddEntry(";
736 b->SavePrimitive(out, option);
737 out <<
");" << std::endl;
756 for (
Int_t i = 1; i <= 10; i++)
771 out << std::endl <<
" // line style combo box" << std::endl;
772 out <<
" TGLineStyleComboBox *";
775 <<
"," <<
fWidgetId <<
");" << std::endl;
776 if (option && strstr(option,
"keep_names"))
777 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
800 for (
Int_t i = 0; i < 16; i++)
813 out << std::endl <<
" // line width combo box" << std::endl;
814 out <<
" TGLineWidthComboBox *";
817 <<
"," <<
fWidgetId <<
");" << std::endl;
818 if (option && strstr(option,
"keep_names"))
819 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
827 {
"-*-times-medium-i-*-*-12-*-*-*-*-*-*-*",
"1. times italic" },
828 {
"-*-times-bold-r-*-*-12-*-*-*-*-*-*-*",
"2. times bold" },
829 {
"-*-times-bold-i-*-*-12-*-*-*-*-*-*-*",
"3. times bold italic" },
830 {
"-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*",
"4. helvetica" },
831 {
"-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*",
"5. helvetica italic" },
832 {
"-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*",
"6. helvetica bold" },
833 {
"-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*",
"7. helvetica bold italic" },
834 {
"-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*",
"8. courier" },
835 {
"-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*",
"9. courier italic" },
836 {
"-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*",
"10. courier bold" },
837 {
"-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*",
"11. courier bold italic" },
838 {
"-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*",
"12. symbol" },
839 {
"-*-times-medium-r-*-*-12-*-*-*-*-*-*-*",
"13. times" },
const Mask_t kWABorderPixel
const Mask_t kWAOverrideRedirect
ULong_t Handle_t
Generic resource handle.
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
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.
virtual Int_t GetSelected() const
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 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.
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion in text entry.
TGScrollBarElement * fDDButton
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 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 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the listbox and forward messages to the combobox message handling windo...
virtual void Layout()
layout combobox
virtual Int_t GetNumberOfEntries() const
virtual void Init()
Initiate the internal classes of a combo box.
TGComboBoxPopup * fComboFrame
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.
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.
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]
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.
virtual void MapRaised()
map raised
static Pixel_t GetWhitePixel()
Get white pixel value.
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).
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
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().
static Pixel_t fgBlackPixel
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
unmap window
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
virtual void Update(TGLBEntry *)
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).
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).
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.
Cursor_t GetGrabCursor() const
const char * GetString() const
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.
const TGString * GetText() const
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
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)
virtual void DestroyWindow()
destroy window
const TGWindow * GetParent() const
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
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.
EGEventType fType
of event (see EGEventType)
Long_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
UInt_t fCode
key or button code
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)?