TGNumberEntry.cxx File Reference

#include "TGNumberEntry.h"
#include "KeySymbols.h"
#include "TTimer.h"
#include "TSystem.h"
#include "TGToolTip.h"
#include "TMath.h"
#include "Riostream.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  RealInfo_t
class  TRepeatTimer
class  TGRepeatFireButton

Enumerations

enum  ERealStyle

Functions

 ClassImp (TGNumberFormat)
 ClassImp (TGNumberEntryField)
 ClassImp (TGNumberEntryLayout)
 ClassImp (TGNumberEntry)
static Long_t Round (Double_t x)
static Long_t Truncate (Double_t x)
static Bool_t IsLeapYear (Int_t year)
static Bool_t IsGoodChar (char c, TGNumberFormat::EStyle style, TGNumberFormat::EAttribute attr)
static char * EliminateGarbage (char *text, TGNumberFormat::EStyle style, TGNumberFormat::EAttribute attr)
static Long_t IntStr (const char *text)
static char * StrInt (char *text, Long_t i, Int_t digits)
static TString StringInt (Long_t i, Int_t digits)
static char * RealToStr (char *text, const RealInfo_t &ri)
static Double_t StrToReal (const char *text, RealInfo_t &ri)
static ULong_t HexStrToInt (const char *s)
static char * IntToHexStr (char *text, ULong_t l)
static char * MIntToStr (char *text, Long_t l, Int_t digits)
static char * DIntToStr (char *text, Long_t l, Bool_t Sec, char Del)
static void GetNumbers (const char *s, Int_t &Sign, Long_t &n1, Int_t maxd1, Long_t &n2, Int_t maxd2, Long_t &n3, Int_t maxd3, const char *Delimiters)
static Long_t GetSignificant (Long_t l, Int_t Max)
static void AppendFracZero (char *text, Int_t digits)
static Long_t MakeDateNumber (const char *, Long_t Day, Long_t Month, Long_t Year)
static Long_t TranslateToNum (const char *text, TGNumberFormat::EStyle style, RealInfo_t &ri)
static char * TranslateToStr (char *text, Long_t l, TGNumberFormat::EStyle style, const RealInfo_t &ri)
static Double_t RealToDouble (const RealInfo_t ri)
static void CheckMinMax (Long_t &l, TGNumberFormat::EStyle style, TGNumberFormat::ELimit limits, Double_t min, Double_t max)
static void IncreaseReal (RealInfo_t &ri, Double_t mag, Bool_t logstep, TGNumberFormat::ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
static void IncreaseDate (Long_t &l, TGNumberFormat::EStepSize step, Int_t sign)

Variables

const Double_t kEpsilon = 1E-12
const Int_t kDays [13]


Enumeration Type Documentation

enum ERealStyle

Definition at line 104 of file TGNumberEntry.cxx.


Function Documentation

static void AppendFracZero ( char *  text,
Int_t  digits 
) [static]

Definition at line 532 of file TGNumberEntry.cxx.

References i, p, and strcpy().

Referenced by TranslateToNum().

static void CheckMinMax ( Long_t l,
TGNumberFormat::EStyle  style,
TGNumberFormat::ELimit  limits,
Double_t  min,
Double_t  max 
) [static]

Definition at line 730 of file TGNumberEntry.cxx.

References TGNumberFormat::kNELLimitMax, TGNumberFormat::kNELLimitMin, TGNumberFormat::kNELLimitMinMax, TGNumberFormat::kNELNoLimits, TGNumberFormat::kNESHex, TGNumberFormat::kNESReal, TGNumberFormat::kNESRealFour, TGNumberFormat::kNESRealOne, TGNumberFormat::kNESRealThree, TGNumberFormat::kNESRealTwo, and Round().

Referenced by TGNumberEntryField::IncreaseNumber().

ClassImp ( TGNumberEntry   ) 

ClassImp ( TGNumberEntryLayout   ) 

ClassImp ( TGNumberEntryField   ) 

ClassImp ( TGNumberFormat   ) 

static char* DIntToStr ( char *  text,
Long_t  l,
Bool_t  Sec,
char  Del 
) [static]

Definition at line 469 of file TGNumberEntry.cxx.

References TMath::Abs(), s, StringInt(), and strlcpy().

Referenced by TranslateToStr().

static char* EliminateGarbage ( char *  text,
TGNumberFormat::EStyle  style,
TGNumberFormat::EAttribute  attr 
) [static]

Definition at line 222 of file TGNumberEntry.cxx.

References i, IsGoodChar(), and memmove.

Referenced by TGNumberEntryField::SetText().

static void GetNumbers ( const char *  s,
Int_t Sign,
Long_t n1,
Int_t  maxd1,
Long_t n2,
Int_t  maxd2,
Long_t n3,
Int_t  maxd3,
const char *  Delimiters 
) [static]

Definition at line 488 of file TGNumberEntry.cxx.

References d, dummy, kMaxLong, and n.

Referenced by TranslateToNum().

static Long_t GetSignificant ( Long_t  l,
Int_t  Max 
) [static]

Definition at line 523 of file TGNumberEntry.cxx.

References TMath::Abs().

Referenced by MakeDateNumber(), and TranslateToNum().

static ULong_t HexStrToInt ( const char *  s  )  [static]

Definition at line 404 of file TGNumberEntry.cxx.

References i, and w.

Referenced by TranslateToNum().

static void IncreaseDate ( Long_t l,
TGNumberFormat::EStepSize  step,
Int_t  sign 
) [static]

Definition at line 980 of file TGNumberEntry.cxx.

References TMath::Abs(), IsLeapYear(), kDays, TGNumberFormat::kNSSHuge, TGNumberFormat::kNSSLarge, TGNumberFormat::kNSSMedium, and TGNumberFormat::kNSSSmall.

Referenced by TGNumberEntryField::IncreaseNumber().

static void IncreaseReal ( RealInfo_t ri,
Double_t  mag,
Bool_t  logstep,
TGNumberFormat::ELimit  limits = TGNumberFormat::kNELNoLimits,
Double_t  min = 0,
Double_t  max = 1 
) [static]

Definition at line 811 of file TGNumberEntry.cxx.

References TMath::Abs(), RealInfo_t::fExpoNum, RealInfo_t::fFracBase, RealInfo_t::fFracDigits, RealInfo_t::fStyle, j, k, kEpsilon, TGNumberFormat::kNELLimitMax, TGNumberFormat::kNELLimitMin, TGNumberFormat::kNELLimitMinMax, kRSExpo, kRSFrac, kRSFracExpo, kRSInt, max, min, TMath::Power(), RealToDouble(), Round(), and x.

Referenced by TGNumberEntryField::IncreaseNumber().

static Long_t IntStr ( const char *  text  )  [static]

Definition at line 238 of file TGNumberEntry.cxx.

References i, kMaxLong, l, and RootCsg::sign().

Referenced by StrToReal().

static char* IntToHexStr ( char *  text,
ULong_t  l 
) [static]

Definition at line 418 of file TGNumberEntry.cxx.

References buf, p, and strcpy().

Referenced by TGNumberEntry::SavePrimitive(), TGNumberEntryField::SavePrimitive(), and TranslateToStr().

static Bool_t IsGoodChar ( char  c,
TGNumberFormat::EStyle  style,
TGNumberFormat::EAttribute  attr 
) [static]

Definition at line 160 of file TGNumberEntry.cxx.

References kFALSE, TGNumberFormat::kNEAAnyNumber, TGNumberFormat::kNESDayMYear, TGNumberFormat::kNESDegree, TGNumberFormat::kNESHex, TGNumberFormat::kNESHourMin, TGNumberFormat::kNESHourMinSec, TGNumberFormat::kNESInteger, TGNumberFormat::kNESMDayYear, TGNumberFormat::kNESMinSec, TGNumberFormat::kNESReal, TGNumberFormat::kNESRealFour, TGNumberFormat::kNESRealOne, TGNumberFormat::kNESRealThree, TGNumberFormat::kNESRealTwo, and kTRUE.

Referenced by EliminateGarbage(), and TGNumberEntryField::HandleKey().

static Bool_t IsLeapYear ( Int_t  year  )  [static]

Definition at line 154 of file TGNumberEntry.cxx.

Referenced by G__G__Base3_124_0_27(), IncreaseDate(), and MakeDateNumber().

static Long_t MakeDateNumber ( const char *  ,
Long_t  Day,
Long_t  Month,
Long_t  Year 
) [static]

Definition at line 556 of file TGNumberEntry.cxx.

References TMath::Abs(), GetSignificant(), IsLeapYear(), and kDays.

Referenced by TranslateToNum().

static char* MIntToStr ( char *  text,
Long_t  l,
Int_t  digits 
) [static]

Definition at line 437 of file TGNumberEntry.cxx.

References TMath::Abs(), s, StringInt(), and strlcpy().

Referenced by TranslateToStr().

static Double_t RealToDouble ( const RealInfo_t  ri  )  [static]

Definition at line 703 of file TGNumberEntry.cxx.

References TMath::Abs(), RealInfo_t::fExpoNum, RealInfo_t::fFracBase, RealInfo_t::fFracNum, RealInfo_t::fIntNum, RealInfo_t::fSign, RealInfo_t::fStyle, kRSExpo, kRSFrac, kRSFracExpo, kRSInt, and TMath::Power().

Referenced by IncreaseReal().

static char* RealToStr ( char *  text,
const RealInfo_t ri 
) [static]

Definition at line 276 of file TGNumberEntry.cxx.

References TMath::Abs(), RealInfo_t::fExpoNum, RealInfo_t::fFracDigits, RealInfo_t::fFracNum, RealInfo_t::fIntNum, RealInfo_t::fSign, RealInfo_t::fStyle, kRSExpo, kRSFrac, kRSFracExpo, p, StrInt(), and strlcpy().

Referenced by TGNumberEntryField::IncreaseNumber(), and TranslateToStr().

static Long_t Round ( Double_t  x  )  [static]

Definition at line 130 of file TGNumberEntry.cxx.

Referenced by CheckMinMax(), TGNumberEntryField::IncreaseNumber(), IncreaseReal(), and TGNumberEntryField::SetNumber().

static TString StringInt ( Long_t  i,
Int_t  digits 
) [static]

Definition at line 268 of file TGNumberEntry.cxx.

References StrInt(), and text().

Referenced by DIntToStr(), MIntToStr(), and TranslateToStr().

static char* StrInt ( char *  text,
Long_t  i,
Int_t  digits 
) [static]

Definition at line 253 of file TGNumberEntry.cxx.

References TMath::Abs(), s, snprintf, and strlcpy().

Referenced by RealToStr(), StringInt(), and TranslateToStr().

static Double_t StrToReal ( const char *  text,
RealInfo_t ri 
) [static]

Definition at line 305 of file TGNumberEntry.cxx.

References TMath::Abs(), buf, RealInfo_t::fExpoNum, RealInfo_t::fFracBase, RealInfo_t::fFracDigits, RealInfo_t::fFracNum, RealInfo_t::fIntNum, RealInfo_t::fSign, RealInfo_t::fStyle, i, IntStr(), kMaxInt, kRSExpo, kRSFrac, kRSFracExpo, kRSInt, TMath::Power(), s, and strlcpy().

Referenced by TGNumberEntryField::GetNumber(), TGNumberEntryField::IncreaseNumber(), and TranslateToNum().

static Long_t TranslateToNum ( const char *  text,
TGNumberFormat::EStyle  style,
RealInfo_t ri 
) [static]

Definition at line 583 of file TGNumberEntry.cxx.

References AppendFracZero(), buf, GetNumbers(), GetSignificant(), HexStrToInt(), TGNumberFormat::kNESDayMYear, TGNumberFormat::kNESDegree, TGNumberFormat::kNESHex, TGNumberFormat::kNESHourMin, TGNumberFormat::kNESHourMinSec, TGNumberFormat::kNESInteger, TGNumberFormat::kNESMDayYear, TGNumberFormat::kNESMinSec, TGNumberFormat::kNESReal, TGNumberFormat::kNESRealFour, TGNumberFormat::kNESRealOne, TGNumberFormat::kNESRealThree, TGNumberFormat::kNESRealTwo, MakeDateNumber(), RootCsg::sign(), strlcpy(), and StrToReal().

Referenced by TGNumberEntryField::GetIntNumber().

static char* TranslateToStr ( char *  text,
Long_t  l,
TGNumberFormat::EStyle  style,
const RealInfo_t ri 
) [static]

Definition at line 652 of file TGNumberEntry.cxx.

References TMath::Abs(), DIntToStr(), IntToHexStr(), kFALSE, TGNumberFormat::kNESDayMYear, TGNumberFormat::kNESDegree, TGNumberFormat::kNESHex, TGNumberFormat::kNESHourMin, TGNumberFormat::kNESHourMinSec, TGNumberFormat::kNESInteger, TGNumberFormat::kNESMDayYear, TGNumberFormat::kNESMinSec, TGNumberFormat::kNESReal, TGNumberFormat::kNESRealFour, TGNumberFormat::kNESRealOne, TGNumberFormat::kNESRealThree, TGNumberFormat::kNESRealTwo, kTRUE, MIntToStr(), RealToStr(), StringInt(), StrInt(), and strlcpy().

Referenced by TGNumberEntryField::SetIntNumber().

static Long_t Truncate ( Double_t  x  )  [static]

Definition at line 142 of file TGNumberEntry.cxx.

References kEpsilon.


Variable Documentation

const Int_t kDays[13]

Initial value:

    { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }

Definition at line 126 of file TGNumberEntry.cxx.

Referenced by IncreaseDate(), and MakeDateNumber().

const Double_t kEpsilon = 1E-12

Definition at line 123 of file TGNumberEntry.cxx.

Referenced by TFumiliUnbinLikelihoodFCN::Calculate_element(), TFumiliBinLikelihoodFCN::Calculate_element(), IncreaseReal(), and Truncate().


Generated on Tue Jul 5 16:00:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1