CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/Fireworks/Core/src/FWNumberEntry.cc

Go to the documentation of this file.
00001 #include "Fireworks/Core/src/FWNumberEntry.h"
00002 
00003 #include <cstdlib>
00004 
00005 //------------------------------FWNumberEntryField------------------------------//
00006 
00007 //______________________________________________________________________________
00008 FWNumberEntryField::FWNumberEntryField(const TGWindow * p, Int_t id, Double_t val,
00009                                        GContext_t norm, FontStruct_t font,
00010                                        UInt_t option, ULong_t back)
00011    : TGNumberEntryField(p, id, val, norm, font, option, back)
00012 {
00013    // Constructs a number entry field.
00014 }
00015 
00016 //______________________________________________________________________________
00017 FWNumberEntryField::FWNumberEntryField(const TGWindow * parent,
00018                                        Int_t id, Double_t val,
00019                                        EStyle style, EAttribute attr,
00020                                        ELimit limits, Double_t min, Double_t max)
00021    : TGNumberEntryField(parent, id, val, style,attr, limits, min, max)
00022 {
00023    // Constructs a number entry field.
00024 }
00025 
00026 //------------------------------------------------------------------------------
00027 
00028 //______________________________________________________________________________
00029 Bool_t FWNumberEntryField::HandleFocusChange(Event_t* event)
00030 {
00031    // Handle focus change.
00032    // Avoid verification by TGNumberEntryField (which is f***ed).
00033 
00034    return TGTextEntry::HandleFocusChange(event);
00035 }
00036 
00037 //______________________________________________________________________________
00038 void FWNumberEntryField::ReturnPressed()
00039 {
00040    // Return was pressed.
00041    // Avoid verification by TGNumberEntryField (which is f***ed).
00042 
00043    TGTextEntry::ReturnPressed();
00044 }
00045 
00046 //------------------------------------------------------------------------------
00047 
00048 //______________________________________________________________________________
00049 UInt_t FWNumberEntryField::GetUIntNumber()
00050 {
00051    return static_cast<UInt_t>(strtoul(GetText(), 0, 10));
00052 }
00053 
00054 //______________________________________________________________________________
00055 void FWNumberEntryField::SetUIntNumber(UInt_t n)
00056 {
00057    SetText(Form("%u", n), kFALSE);
00058 }