CMS 3D CMS Logo

FWNumberEntry.cc
Go to the documentation of this file.
2 
3 #include <cstdlib>
4 
5 //------------------------------FWNumberEntryField------------------------------//
6 
7 //______________________________________________________________________________
8 FWNumberEntryField::FWNumberEntryField(const TGWindow * p, Int_t id, Double_t val,
9  GContext_t norm, FontStruct_t font,
10  UInt_t option, ULong_t back)
11  : TGNumberEntryField(p, id, val, norm, font, option, back)
12 {
13  // Constructs a number entry field.
14 }
15 
16 //______________________________________________________________________________
18  Int_t id, Double_t val,
19  EStyle style, EAttribute attr,
20  ELimit limits, Double_t min, Double_t max)
21  : TGNumberEntryField(parent, id, val, style,attr, limits, min, max)
22 {
23  // Constructs a number entry field.
24 }
25 
26 //------------------------------------------------------------------------------
27 
28 //______________________________________________________________________________
30 {
31  // Handle focus change.
32  // Avoid verification by TGNumberEntryField (which is f***ed).
33 
34  return TGTextEntry::HandleFocusChange(event);
35 }
36 
37 //______________________________________________________________________________
39 {
40  // Return was pressed.
41  // Avoid verification by TGNumberEntryField (which is f***ed).
42 
43  TGTextEntry::ReturnPressed();
44 }
45 
46 //------------------------------------------------------------------------------
47 
48 //______________________________________________________________________________
50 {
51  return static_cast<UInt_t>(strtoul(GetText(), nullptr, 10));
52 }
53 
54 //______________________________________________________________________________
56 {
57  SetText(Form("%u", n), kFALSE);
58 }
59 
60 //______________________________________________________________________________
62 {
63  return static_cast<ULong64_t>(strtoull(GetText(), nullptr, 10));
64 }
65 
66 //______________________________________________________________________________
68 {
69  SetText(Form("%llu", n), kFALSE);
70 }
virtual ULong64_t GetULong64Number()
virtual void SetUIntNumber(UInt_t n)
FWNumberEntryField(const TGWindow *p, Int_t id, Double_t val, GContext_t norm, FontStruct_t font=GetDefaultFontStruct(), UInt_t option=kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel())
virtual void SetULong64Number(ULong64_t n)
Definition: style.py:1
virtual UInt_t GetUIntNumber()
T min(T a, T b)
Definition: MathUtil.h:58
Bool_t HandleFocusChange(Event_t *event) override
void ReturnPressed() override
Definition: event.py:1