51 static
TString gLastSearchString;
81 fF1->Resize(fSearchButton->GetDefaultWidth()+40, GetDefaultHeight());
83 fSearchButton->Associate(
this);
84 fCancelButton->Associate(
this);
91 fF1->AddFrame(fSearchButton, fL1);
92 fF1->AddFrame(fCancelButton, fL1);
99 fSearch = fCombo->GetTextEntry();
100 fBSearch = fSearch->GetBuffer();
101 if (sstruct && sstruct->fBuffer)
102 fBSearch->AddText(0, sstruct->fBuffer);
103 else if (!gLastSearchString.IsNull())
104 fBSearch->AddText(0, gLastSearchString.Data());
107 fSearch->Associate(
this);
108 fCombo->Resize(220, fSearch->GetDefaultHeight());
109 fSearch->SelectAll();
114 fF3->AddFrame(fLSearch, fL5);
115 fF3->AddFrame(fCombo, fL6);
125 fCaseCheck->Associate(
this);
126 fF4->AddFrame(fCaseCheck, fL9);
131 fG2->AddFrame(fDirectionRadio[0], fL4);
132 fG2->AddFrame(fDirectionRadio[1], fL10);
133 fDirectionRadio[0]->Associate(
this);
134 fDirectionRadio[1]->Associate(
this);
141 if (
fType->fDirection)
146 fF4->AddFrame(fG2, fL3);
148 fF2->AddFrame(fF3, fL1);
149 fF2->AddFrame(fF4, fL1);
154 Resize(GetDefaultSize());
155 SetEditDisabled(kEditDisable);
159 SetWindowName(
"Search");
160 SetIconName(
"Search");
168 fSearch->RequestFocus();
169 fClient->WaitFor(
this);
209 Emit(
"TextEntered(const char *)", text);
229 gLastSearchString = string;
279 gLastSearchString = string;
312 char **printProg,
Int_t *ret_code,
358 if ((printProg) && (*printProg))
368 if ((printerName) && (*printerName))
379 if (!printerPicture) {
380 Error(
"TGPrintDialog",
"printer_s.xpm not found");
440 Int_t idx = 1, dflt =1;
445 if (lpstat == 0)
return;
450 while((obj =
iter())) {
456 if (defaultprinter.
Contains(pname)) {
467 defaultprinter.
Remove(0, defaultprinter.
First(
'\n'));
472 while((obj =
iter())) {
475 if (defaultprinter.
Contains(pname)) {
491 const char *string, *txt;
503 const size_t prSize = strlen(
string) + 1;
510 const size_t cmdSize = strlen(
string) + 1;
516 txt =
"Please provide print command or use \"Cancel\"";
583 snprintf(curline, 32,
"%ld", *
fRetCode);
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void CloseWindow()
Close the dialog.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process search dialog widget messages.
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
TString & ReplaceAll(const TString &s1, const TString &s2)
const TGWindow * GetRoot() const
Returns current root (i.e.
TGGotoDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, Long_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a dialog to GoTo a specific line number.
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual ~TGPrintDialog()
Clean up print dialog.
static TGSearchDialog *& SearchDialog()
Return global search dialog.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
TGTextEntry * fPrintCommandEntry
const char * Data() const
virtual void SelectAll()
Selects all text (i.e.
virtual void CloseWindow()
Close the dialog.
virtual UInt_t GetOptions() const
TGRadioButton * fDirectionRadio[2]
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
virtual void TextEntered(const char *text)
emit signal when search text entered
std::map< std::string, std::string >::const_iterator iter
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...
TGCompositeFrame(const TGCompositeFrame &)
const char * GetString() const
virtual const char * Getenv(const char *env)
Get environment variable.
void AddText(Int_t pos, const char *text)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void RequestFocus()
virtual UInt_t GetDefaultWidth() const
void Emit(const char *signal)
Acitvate signal without args.
virtual ~TGSearchDialog()
Clean up search dialog.
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
static TGSearchDialog * fgSearchDialog
R__EXTERN TSystem * gSystem
virtual UInt_t GetDefaultHeight() const
virtual void CloseWindow()
Close the dialog.
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
TGCheckButton * fCaseCheck
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
char * StrDup(const char *str)
Duplicate the string str.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
TString & Remove(Ssiz_t pos)
UInt_t GetTextLength() const
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
virtual const char * GetName() const
Returns name of object.
virtual void AddEntry(TGString *s, Int_t id)
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
TGPrintDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, char **printerName=0, char **printProg=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create the printer dialog box.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
ClassImp(TGSearchDialog) ClassImp(TGPrintDialog) ClassImp(TGGotoDialog) static TString gLastSearchString
Mother of all ROOT objects.
virtual void UnmapWindow()
virtual UInt_t GetDefaultHeight() const
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted...
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TGTextBuffer * GetBuffer() const
TGComboBox * fPrinterEntry
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
TObject * At(Int_t idx) const
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 void Layout()
layout combobox
virtual void DeleteWindow()
Delete window.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
TGTextBuffer * fBPrintCommand
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual ~TGGotoDialog()
Clean up goto dialog.
virtual TGTextEntry * GetTextEntry() const