Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGTextBuffer.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 05/05/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGTextBuffer
13#define ROOT_TGTextBuffer
14
15#include "TString.h"
16
18
19private:
21
22 TGTextBuffer(const TGTextBuffer&) = delete;
24
25public:
28 virtual ~TGTextBuffer() {}
29
30 UInt_t GetTextLength() const { return fBuffer.Length(); }
31 UInt_t GetBufferLength() const { return fBuffer.Capacity(); }
32 const char *GetString() const { return fBuffer.Data(); }
33
34 void AddText(Int_t pos, const char *text) { fBuffer.Insert(pos, text); }
35 void AddText(Int_t pos, const char *text, Int_t length) { fBuffer.Insert(pos, text, length); }
37 void Clear() { fBuffer.Remove(0, fBuffer.Length()); }
38
39 ClassDef(TGTextBuffer,0) // Text buffer used by widgets like TGTextEntry, etc.
40};
41
42#endif
#define ClassDef(name, id)
Definition Rtypes.h:337
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 length
Option_t Option_t TPoint TPoint const char text
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
UInt_t GetBufferLength() const
void AddText(Int_t pos, const char *text)
void AddText(Int_t pos, const char *text, Int_t length)
const char * GetString() const
void RemoveText(Int_t pos, Int_t length)
TString fBuffer
TGTextBuffer(const TGTextBuffer &)=delete
TGTextBuffer & operator=(const TGTextBuffer &)=delete
virtual ~TGTextBuffer()
UInt_t GetTextLength() const
TGTextBuffer(Int_t length)
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
TString & Insert(Ssiz_t pos, const char *s)
Definition TString.h:661
const char * Data() const
Definition TString.h:380
Ssiz_t Capacity() const
Definition TString.h:368
TString & Remove(Ssiz_t pos)
Definition TString.h:685