MCPcopy Create free account
hub / github.com/Geant4/geant4 / GetHelpTreeToolTips

Method GetHelpTreeToolTips

source/interfaces/implementation/src/G4UIWin32.cc:1006–1031  ·  view source on GitHub ↗

/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/

Source from the content-addressed store, hash-verified

1004/****************************************************************************************************/
1005/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
1006G4String G4UIWin32::GetHelpTreeToolTips(HTREEITEM item)
1007{
1008 // Tooltips for the help tree
1009 G4UImanager* UI = G4UImanager::GetUIpointer();
1010 if (UI == nullptr) return "";
1011 G4UIcommandTree* treeTop = UI->GetTree();
1012
1013 G4String itemText = GetItemPath(item);
1014
1015 // Check if it is a command path
1016 if (TreeView_GetChild(fHWndHelpTree, item) != nullptr) itemText += "/";
1017
1018 G4UIcommand* command = treeTop->FindPath(itemText.c_str());
1019
1020 if (command) {
1021 // This is a command, return the first line of help
1022 return command->GetGuidanceLine(0).data();
1023 }
1024 else {
1025 // This is not a command, but a sub directory, return the title
1026 G4UIcommandTree* path = treeTop->FindCommandTree(itemText.c_str());
1027 if (path) return path->GetTitle().data();
1028 }
1029
1030 return "";
1031}
1032/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
1033/****************************************************************************************************/
1034

Callers 1

MainWindowProcMethod · 0.80

Calls 6

FindPathMethod · 0.80
c_strMethod · 0.80
FindCommandTreeMethod · 0.80
GetTreeMethod · 0.45
dataMethod · 0.45
GetTitleMethod · 0.45

Tested by

no test coverage detected