CbmRoot
Loading...
Searching...
No Matches
CbmTsEveTransparencyControl.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau[committer] */
4
6
7#include "CbmTimesliceManager.h" // for CbmTimesliceManager
8
9#include <TGButton.h> // for TGCheckButton
10#include <TGNumberEntry.h> // for TGNumberEntry, TGNumberFormat, TGNumbe...
11
12CbmTsEveTransparencyControl::CbmTsEveTransparencyControl(TGFrame const* parent, char const* label)
13 : TGHorizontalFrame(parent)
14 , fCheck(new TGCheckButton(this, label))
15 , fNumber(new TGNumberEntry(this,
16 80., // initial number
17 6, // digitwidth
18 -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
19 TGNumberFormat::kNELLimitMinMax,
20 0, // min
21 100)) // max
22{
23 SetCleanup(kDeepCleanup);
24
25 // display
26 AddFrame(fCheck); // takes ownership
27 AddFrame(fNumber); // takes ownership
28
29 // wire up observers
30 fCheck->Connect("Toggled(Bool_t)", this->ClassName(), this, "Toggled()");
31 fNumber->Connect("ValueSet(Long_t)", this->ClassName(), this, "ValueSet()");
32}
33
35{
36 if (fCheck->IsOn()) { //
37 CbmTimesliceManager::Instance()->SetTransparency(kFALSE, fNumber->GetIntNumber());
38 }
39 else {
40 CbmTimesliceManager::Instance()->SetTransparency(kTRUE, fNumber->GetIntNumber());
41 }
42}
43
45{
46 if (fCheck->IsOn()) { //
47 CbmTimesliceManager::Instance()->SetTransparency(kFALSE, fNumber->GetIntNumber());
48 }
49 else {
50 CbmTimesliceManager::Instance()->SetTransparency(kTRUE, fNumber->GetIntNumber());
51 }
52}
virtual void SetTransparency(Bool_t use_xml, Int_t trans)
static CbmTimesliceManager * Instance()
void ValueSet()
Called when transparency value changed. RESERVED FOR GUI CALLS!
void Toggled()
Called when button clicked. RESERVED FOR GUI CALLS!
CbmTsEveTransparencyControl(TGFrame const *parent, char const *label="Transparency")