MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onMouseDown

Method onMouseDown

Engine/source/gui/utility/guiBubbleTextCtrl.cpp:68–109  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

66
67//------------------------------------------------------------------------------
68void GuiBubbleTextCtrl::onMouseDown(const GuiEvent &event)
69{
70 if (mInAction)
71 {
72 popBubble();
73
74 return;
75 }
76
77 mDlg = new GuiControl();
78 AssertFatal(mDlg, "Failed to create the GuiControl for the BubbleTextCtrl");
79 mDlg->setDataField( StringTable->insert("profile"), NULL, "GuiModelessDialogProfile");
80 mDlg->setField("horizSizing", "width");
81 mDlg->setField("vertSizing", "height");
82 mDlg->setField("extent", "640 480");
83
84 mPopup = new GuiControl();
85 AssertFatal(mPopup, "Failed to create the GuiControl for the BubbleTextCtrl");
86 mPopup->setDataField( StringTable->insert("profile"), NULL, "GuiBubblePopupProfile");
87
88 mMLText = new GuiMLTextCtrl();
89 AssertFatal(mMLText, "Failed to create the GuiMLTextCtrl for the BubbleTextCtrl");
90 mMLText->setDataField( StringTable->insert("profile"), NULL, "GuiBubbleTextProfile");
91 mMLText->setField("position", "2 2");
92 mMLText->setField("extent", "296 51");
93
94 mMLText->setText((char*)mText,dStrlen(mText));
95
96 mMLText->registerObject();
97 mPopup->registerObject();
98 mDlg->registerObject();
99
100 mPopup->addObject(mMLText);
101 mDlg->addObject(mPopup);
102
103 mPopup->resize(event.mousePoint,Point2I(300,55));
104
105 getRoot()->pushDialogControl(mDlg,0);
106 mouseLock();
107
108 mInAction = true;
109}

Callers

nothing calls this directly

Calls 10

setFieldMethod · 0.80
pushDialogControlMethod · 0.80
dStrlenFunction · 0.50
Point2IClass · 0.50
setDataFieldMethod · 0.45
insertMethod · 0.45
setTextMethod · 0.45
registerObjectMethod · 0.45
addObjectMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected