18namespace GUITutorials {
25 virtual void InitMap();
26 virtual void InitRU();
27 virtual void InitUS();
29 virtual void InitAU();
30 virtual void InitFR();
31 virtual void InitUK();
51 WorldMap(
const char *picName =
"worldmap.jpg");
52 virtual ~WorldMap() {}
54 virtual void Show() { fMain->
MapRaised(); }
55 TGImageMap *GetImageMap()
const {
return fImageMap; }
56 virtual TString GetTitle()
const;
59 void PrintCode(
Int_t code);
63WorldMap::WorldMap(
const char *picName)
79 fImageMap->
Connect(
"RegionClicked(Int_t)",
"ROOT::GUITutorials::WorldMap",
this,
"PrintCode(Int_t)");
83TString WorldMap::GetTitle()
const
87 return "Country Code (left button). City/Area Codes (right button)";
91void WorldMap::InitRU()
95 int x[12] = {403, 406, 427, 444, 438, 470, 508, 568, 599, 632, 645, 493};
96 int y[12] = {68, 90, 120, 125, 109, 94, 109, 101, 122, 107, 74, 46};
104 pm->
AddEntry(
"Protvino = 0967", 967);
105 pm->
AddEntry(
"St.Petersburg = 812", 812);
109void WorldMap::InitUS()
113 int x[5] = {136, 122, 165, 194, 232};
114 int y[5] = {110, 141, 158, 160, 118};
118 int alaskaX[4] = {86, 131, 154, 117};
119 int alaskaY[4] = {90, 82, 64, 63};
120 TGRegion alaska(4, alaskaX, alaskaY);
127 pm->
AddEntry(
"Illinois = 217", 217);
128 pm->
AddEntry(
"New York = 212", 212);
132void WorldMap::InitFR()
136 int x[5] = {349, 353, 368, 368, 358};
137 int y[5] = {112, 123, 119, 108, 107};
144void WorldMap::InitUK()
148 int x[4] = {346, 348, 359, 352};
149 int y[4] = {93, 104, 103, 87};
156void WorldMap::InitAU()
160 int x[6] = {582, 576, 634, 658, 641, 607};
161 int y[6] = {271, 300, 310, 283, 251, 253};
168void WorldMap::InitMap()
181void WorldMap::PrintCode(
Int_t code)
189 new TGMsgBox(
gClient->GetRoot(), fMain,
"Country Code",
Form(
"Country Code=%d", code), icontype, buttons, &retval);
197 namespace GUI = ROOT::GUITutorials;
198 GUI::WorldMap *map =
new GUI::WorldMap;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapRaised() override
map raised
(with TGRegion and TGRegionWithId help classes)
void AddRegion(const TGRegion ®ion, Int_t id)
Add a region to the image map.
TGPopupMenu * CreatePopup(Int_t id)
Create popup menu or returns existing for regions with specified id.
void SetToolTipText(const char *text, Long_t delayms=300) override
Set tooltip text for main region.
Defines top level windows that interact with the system Window Manager.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...