Logo ROOT  
Reference Guide
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:335
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.
Definition: TGTextBuffer.h:17
UInt_t GetBufferLength() const
Definition: TGTextBuffer.h:31
void AddText(Int_t pos, const char *text)
Definition: TGTextBuffer.h:34
void AddText(Int_t pos, const char *text, Int_t length)
Definition: TGTextBuffer.h:35
const char * GetString() const
Definition: TGTextBuffer.h:32
void RemoveText(Int_t pos, Int_t length)
Definition: TGTextBuffer.h:36
TString fBuffer
Definition: TGTextBuffer.h:20
TGTextBuffer(const TGTextBuffer &)=delete
TGTextBuffer & operator=(const TGTextBuffer &)=delete
virtual ~TGTextBuffer()
Definition: TGTextBuffer.h:28
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:30
TGTextBuffer(Int_t length)
Definition: TGTextBuffer.h:27
void Clear()
Definition: TGTextBuffer.h:37
Basic string class.
Definition: TString.h:136
Ssiz_t Length() const
Definition: TString.h:410
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:649
const char * Data() const
Definition: TString.h:369
Ssiz_t Capacity() const
Definition: TString.h:357
TString & Remove(Ssiz_t pos)
Definition: TString.h:673