MCPcopy Create free account
hub / github.com/bumptop/BumpTop / init

Method init

trunk/win/Source/BT_LibraryOverlay.cpp:39–73  ·  view source on GitHub ↗

This method creates the control for the first time. It should only be called on creation

Source from the content-addressed store, hash-verified

37// This method creates the control for the first time. It should only be called
38// on creation
39void LibraryMenuControl::init(QSharedPointer<Library>& library)
40{
41 destroy();
42
43 if (!winOS->GetLibraryManager())
44 return;
45
46 getStyle().setFloating(true);
47
48 _dropDownMenu = new DropDownMenu();
49
50 LibraryMenuItem* toSelect = NULL;
51 const QList< QSharedPointer<Library> >& libraries = winOS->GetLibraryManager()->getLibraries();
52 QListIterator< QSharedPointer<Library> > iter(libraries);
53 while (iter.hasNext())
54 {
55 QSharedPointer<Library> lib = iter.next();
56 LibraryMenuItem* item = new LibraryMenuItem(lib);
57 if (lib->getHashKey().startsWith(QT_NT("usr_")) && library != lib)
58 item->setDeleteable(true);
59 _dropDownMenu->addItem(item);
60 if (lib->getHashKey() == library->getHashKey())
61 toSelect = item;
62 }
63
64 BrowseFolderMenuItem* browseFolder = new BrowseFolderMenuItem(QString("More places..."));
65 _dropDownMenu->addItem(browseFolder);
66
67 if (toSelect)
68 _dropDownMenu->select(toSelect);
69
70 this->addItem(_dropDownMenu);
71 scnManager->registerOverlay(this);
72 fadeOut(_unHoveredAlpha);
73}
74
75// This method is called just before a render
76void LibraryMenuControl::update()

Callers

nothing calls this directly

Calls 15

ColorValClass · 0.85
GetLibraryManagerMethod · 0.80
getLibrariesMethod · 0.80
hasNextMethod · 0.80
getHashKeyMethod · 0.80
setDeleteableMethod · 0.80
registerOverlayMethod · 0.80
getValueAsIntMethod · 0.80
getIconTextureKeyMethod · 0.80
setScaledDimensionsMethod · 0.80
FontDescriptionClass · 0.70

Tested by

no test coverage detected