ROOT logo
#ifndef HPR_VALUESANDTEXT
#define HPR_VALUESANDTEXT
#include <TGWindow.h>
#include <TCanvas.h>
#include <TGTextEntry.h>
#include <TGFrame.h>
#include <TGButton.h>
#include <TGListBox.h>
#include <TGComboBox.h>
#include "TGedMarkerSelect.h"
#include "TGedPatternSelect.h"
#include <TObjString.h>
#include "TOrdCollection.h"
#include "TArrayI.h"
//#include <ostream>
#include <iostream>

//________________________________________________________________________

class TGedAlignPopup : public TGedPopup {

protected:
   Style_t  fCurrentStyle;

public:
   TGedAlignPopup(const TGWindow *p, const TGWindow *m, Style_t alignStyle);
   virtual ~TGedAlignPopup();

   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);

   ClassDef(TGedAlignPopup,0)  //align select popup
};
//_________________________________________________________________________________________

class TGedAlignSelect : public TGedSelect {

protected:
   Style_t          fAlignStyle;
   const TGPicture *fPicture;

   virtual void     DoRedraw();

public:
   TGedAlignSelect(const TGWindow *p, Style_t alignStyle, Int_t id);
   virtual ~TGedAlignSelect() { if(fPicture) gClient->FreePicture(fPicture);}

   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
   void           SetAlignStyle(Style_t pattern);
   Style_t        GetAlignStyle() const { return fAlignStyle; }
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,12,0)
void SavePrimitive(std::ostream &out, Option_t *);
#else
void SavePrimitive(std::ofstream &out, Option_t *);
#endif

   virtual TGDimension GetDefaultSize() const { return TGDimension(38, 21); }

   virtual void AlignSelected(Style_t align = 0)
                { //std::cout << "  Emit(\"AlignSelected(Style_t)\"" << std::endl;
                   Emit("AlignSelected(Style_t)", align ? align : GetAlignStyle()); }  // *SIGNAL*

   ClassDef(TGedAlignSelect,0)  // Align selection button
};

//_________________________________________________________________________________________

class TGMrbValuesAndText : public TGTransientFrame {

private:
   const TGWindow   *fMyWindow;
   TCanvas          *fCallingCanvas;
   TGTextEntry      *fTE;        // text entry widget
   TGTextEntry      *fFileNameEntry;     // for file content
//   TList            *fWidgets;   // keep track of widgets to be deleted in dtor
   TString          *fText;      // address to store return string
   Int_t            *fReturn;    // address to store cancel = -1 / ok =0
   TList            *fLabels;
   void            **fValPointers;
//   void            **fButtonList;
   TArrayI          *fFlags;
   TList            *fFlagButtons;
   TGListBox        *fListBox;
   TGListBox        *fListBoxReq;
   TGTextEntry      **fFileDialogContTextEntry;
   TString          **fClassName;
   TString          fHistory;
   Int_t            fWidgetId;
   TGTextButton     *fCancelButton;
   const char       *fPrompt;
   const char       *fHelpText;
   TList            *fCompList;
   Int_t            fWindowWidth;

   Int_t            fNrows;
   Int_t            fAlign;
   Int_t            fArrowShape;
   TGComboBox       *fArrowComboBox;
   TGComboBox       *fComboBox;
   TString          *fComboSelect;
   Int_t            fFont;
   TGFontTypeComboBox *fFontComboBox;
   Style_t           fLineStyle;
   TGLineStyleComboBox *fLineStyleComboBox;
   TGPictureButton  *fAlignButton;
   TGedMarkerSelect *fMarkerSelect;
   TGedAlignSelect  *fAlignSelect;
   TGedPatternSelect *fPatternSelect;
   Style_t            fMarker;
   Style_t            fPattern;
   TList				  *fEntries;
   Int_t             fButtonId;
   Bool_t            fEmitClose;
   Bool_t            fCallClose;
   Int_t             fLastColorSelect;
	Int_t             *fFileType;
	TString				fStartDir;
	Bool_t            fMustRestoreDir;
   Int_t             fCloseFlag;
public:
   TGMrbValuesAndText(const char *prompt, TString * text,
                             Int_t * ok, Int_t win_width, const TGWindow *win=0,
                             const char * History = 0, TList * complist=0,
                             TList * rowlabs = 0, void **val_pointers = 0,
                             TArrayI * Flags = 0, const char * Flagslabel = 0,
                             const char *helptext=0, TObject * calling_class = 0,
                             const char * cname = 0, const Int_t id = 0);
   virtual ~TGMrbValuesAndText();

   virtual Bool_t  ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
   void UpdateRequestBox(const char *fname, Bool_t store = kTRUE, Int_t id = 0);
   void StoreValues();
   void ReloadValues();
   void ReloadValue(TObject *obj, TObjString *objs, Int_t ipos);
   void CloseDown(Int_t wid);
   void CRButtonPressed(Int_t, Int_t, TObject*);
   void CloseWindowExt();
   void CloseWindow();
   void SaveList();
   Int_t GetColorPixelByInd(Int_t index);
   void EnableButton(Int_t id) ;
   void DisableButton(Int_t id);
   void EnableCancelButton()    { fCancelButton->SetEnabled(kTRUE); };
   void DisableCancelButton()   { fCancelButton->SetEnabled(kFALSE); };
	void DoNeedRedraw()          { gClient->NeedRedraw(this); };
	void SetCheckButton(Int_t id, Int_t state);
	void SetComboSelect(Int_t id, Int_t sel);
	TList * GetButtonList()       { return fEntries; };
	
ClassDef(TGMrbValuesAndText,0)		// [GraphUtils] A dialog box
};
//_________________________________________________________________________________________

Bool_t  GetStringExt(const char *prompt, TString * text,
                             Int_t win_width, TGWindow *win = 0,
                             const char * History = 0, TList * complist=0,
                             TList * rowlabs =0 , void ** val_pointers=0,
                             TArrayI * Flags = 0, const char * Flagslabel = 0,
                             const char *helptext = 0, TObject * calling_class = 0,
                             const char * cname = 0);
#endif
 TGMrbValuesAndText.h:1
 TGMrbValuesAndText.h:2
 TGMrbValuesAndText.h:3
 TGMrbValuesAndText.h:4
 TGMrbValuesAndText.h:5
 TGMrbValuesAndText.h:6
 TGMrbValuesAndText.h:7
 TGMrbValuesAndText.h:8
 TGMrbValuesAndText.h:9
 TGMrbValuesAndText.h:10
 TGMrbValuesAndText.h:11
 TGMrbValuesAndText.h:12
 TGMrbValuesAndText.h:13
 TGMrbValuesAndText.h:14
 TGMrbValuesAndText.h:15
 TGMrbValuesAndText.h:16
 TGMrbValuesAndText.h:17
 TGMrbValuesAndText.h:18
 TGMrbValuesAndText.h:19
 TGMrbValuesAndText.h:20
 TGMrbValuesAndText.h:21
 TGMrbValuesAndText.h:22
 TGMrbValuesAndText.h:23
 TGMrbValuesAndText.h:24
 TGMrbValuesAndText.h:25
 TGMrbValuesAndText.h:26
 TGMrbValuesAndText.h:27
 TGMrbValuesAndText.h:28
 TGMrbValuesAndText.h:29
 TGMrbValuesAndText.h:30
 TGMrbValuesAndText.h:31
 TGMrbValuesAndText.h:32
 TGMrbValuesAndText.h:33
 TGMrbValuesAndText.h:34
 TGMrbValuesAndText.h:35
 TGMrbValuesAndText.h:36
 TGMrbValuesAndText.h:37
 TGMrbValuesAndText.h:38
 TGMrbValuesAndText.h:39
 TGMrbValuesAndText.h:40
 TGMrbValuesAndText.h:41
 TGMrbValuesAndText.h:42
 TGMrbValuesAndText.h:43
 TGMrbValuesAndText.h:44
 TGMrbValuesAndText.h:45
 TGMrbValuesAndText.h:46
 TGMrbValuesAndText.h:47
 TGMrbValuesAndText.h:48
 TGMrbValuesAndText.h:49
 TGMrbValuesAndText.h:50
 TGMrbValuesAndText.h:51
 TGMrbValuesAndText.h:52
 TGMrbValuesAndText.h:53
 TGMrbValuesAndText.h:54
 TGMrbValuesAndText.h:55
 TGMrbValuesAndText.h:56
 TGMrbValuesAndText.h:57
 TGMrbValuesAndText.h:58
 TGMrbValuesAndText.h:59
 TGMrbValuesAndText.h:60
 TGMrbValuesAndText.h:61
 TGMrbValuesAndText.h:62
 TGMrbValuesAndText.h:63
 TGMrbValuesAndText.h:64
 TGMrbValuesAndText.h:65
 TGMrbValuesAndText.h:66
 TGMrbValuesAndText.h:67
 TGMrbValuesAndText.h:68
 TGMrbValuesAndText.h:69
 TGMrbValuesAndText.h:70
 TGMrbValuesAndText.h:71
 TGMrbValuesAndText.h:72
 TGMrbValuesAndText.h:73
 TGMrbValuesAndText.h:74
 TGMrbValuesAndText.h:75
 TGMrbValuesAndText.h:76
 TGMrbValuesAndText.h:77
 TGMrbValuesAndText.h:78
 TGMrbValuesAndText.h:79
 TGMrbValuesAndText.h:80
 TGMrbValuesAndText.h:81
 TGMrbValuesAndText.h:82
 TGMrbValuesAndText.h:83
 TGMrbValuesAndText.h:84
 TGMrbValuesAndText.h:85
 TGMrbValuesAndText.h:86
 TGMrbValuesAndText.h:87
 TGMrbValuesAndText.h:88
 TGMrbValuesAndText.h:89
 TGMrbValuesAndText.h:90
 TGMrbValuesAndText.h:91
 TGMrbValuesAndText.h:92
 TGMrbValuesAndText.h:93
 TGMrbValuesAndText.h:94
 TGMrbValuesAndText.h:95
 TGMrbValuesAndText.h:96
 TGMrbValuesAndText.h:97
 TGMrbValuesAndText.h:98
 TGMrbValuesAndText.h:99
 TGMrbValuesAndText.h:100
 TGMrbValuesAndText.h:101
 TGMrbValuesAndText.h:102
 TGMrbValuesAndText.h:103
 TGMrbValuesAndText.h:104
 TGMrbValuesAndText.h:105
 TGMrbValuesAndText.h:106
 TGMrbValuesAndText.h:107
 TGMrbValuesAndText.h:108
 TGMrbValuesAndText.h:109
 TGMrbValuesAndText.h:110
 TGMrbValuesAndText.h:111
 TGMrbValuesAndText.h:112
 TGMrbValuesAndText.h:113
 TGMrbValuesAndText.h:114
 TGMrbValuesAndText.h:115
 TGMrbValuesAndText.h:116
 TGMrbValuesAndText.h:117
 TGMrbValuesAndText.h:118
 TGMrbValuesAndText.h:119
 TGMrbValuesAndText.h:120
 TGMrbValuesAndText.h:121
 TGMrbValuesAndText.h:122
 TGMrbValuesAndText.h:123
 TGMrbValuesAndText.h:124
 TGMrbValuesAndText.h:125
 TGMrbValuesAndText.h:126
 TGMrbValuesAndText.h:127
 TGMrbValuesAndText.h:128
 TGMrbValuesAndText.h:129
 TGMrbValuesAndText.h:130
 TGMrbValuesAndText.h:131
 TGMrbValuesAndText.h:132
 TGMrbValuesAndText.h:133
 TGMrbValuesAndText.h:134
 TGMrbValuesAndText.h:135
 TGMrbValuesAndText.h:136
 TGMrbValuesAndText.h:137
 TGMrbValuesAndText.h:138
 TGMrbValuesAndText.h:139
 TGMrbValuesAndText.h:140
 TGMrbValuesAndText.h:141
 TGMrbValuesAndText.h:142
 TGMrbValuesAndText.h:143
 TGMrbValuesAndText.h:144
 TGMrbValuesAndText.h:145
 TGMrbValuesAndText.h:146
 TGMrbValuesAndText.h:147
 TGMrbValuesAndText.h:148
 TGMrbValuesAndText.h:149
 TGMrbValuesAndText.h:150
 TGMrbValuesAndText.h:151
 TGMrbValuesAndText.h:152
 TGMrbValuesAndText.h:153
 TGMrbValuesAndText.h:154
 TGMrbValuesAndText.h:155
 TGMrbValuesAndText.h:156
 TGMrbValuesAndText.h:157
 TGMrbValuesAndText.h:158
 TGMrbValuesAndText.h:159
 TGMrbValuesAndText.h:160