CMS 3D CMS Logo

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