mirror of
https://github.com/tribes2/engine.git
synced 2026-03-06 14:00:28 +00:00
t2 engine svn checkout
This commit is contained in:
commit
ff569bd2ae
988 changed files with 394180 additions and 0 deletions
73
gui/guiBubbleTextCtrl.cc
Normal file
73
gui/guiBubbleTextCtrl.cc
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// V12 Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "GUI/guiBubbleTextCtrl.h"
|
||||
#include "GUI/guiCanvas.h"
|
||||
|
||||
IMPLEMENT_CONOBJECT(GuiBubbleTextCtrl);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void GuiBubbleTextCtrl::popBubble()
|
||||
{
|
||||
// Release the mouse:
|
||||
mInAction = false;
|
||||
mouseUnlock();
|
||||
|
||||
// Pop the dialog
|
||||
getRoot()->popDialogControl(mDlg);
|
||||
|
||||
// Kill the popup
|
||||
mDlg->removeObject(mPopup);
|
||||
mPopup->removeObject(mMLText);
|
||||
mMLText->deleteObject();
|
||||
mPopup->deleteObject();
|
||||
mDlg->deleteObject();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void GuiBubbleTextCtrl::onMouseDown(const GuiEvent &event)
|
||||
{
|
||||
if (mInAction)
|
||||
{
|
||||
popBubble();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mDlg = new GuiControl();
|
||||
AssertFatal(mDlg, "Failed to create the GuiControl for the BubbleTextCtrl");
|
||||
mDlg->setField("profile","GuiModelessDialogProfile");
|
||||
mDlg->setField("horizSizing", "width");
|
||||
mDlg->setField("vertSizing", "height");
|
||||
mDlg->setField("extent", "640 480");
|
||||
|
||||
mPopup = new GuiControl();
|
||||
AssertFatal(mPopup, "Failed to create the GuiControl for the BubbleTextCtrl");
|
||||
mPopup->setField("profile","GuiBubblePopupProfile");
|
||||
|
||||
mMLText = new GuiMLTextCtrl();
|
||||
AssertFatal(mMLText, "Failed to create the GuiMLTextCtrl for the BubbleTextCtrl");
|
||||
mMLText->setField("profile","GuiBubbleTextProfile");
|
||||
mMLText->setField("position", "2 2");
|
||||
mMLText->setField("extent", "296 51");
|
||||
|
||||
mMLText->setText(mText,dStrlen(mText));
|
||||
|
||||
mMLText->registerObject();
|
||||
mPopup->registerObject();
|
||||
mDlg->registerObject();
|
||||
|
||||
mPopup->addObject(mMLText);
|
||||
mDlg->addObject(mPopup);
|
||||
|
||||
mPopup->resize(event.mousePoint,Point2I(300,55));
|
||||
|
||||
getRoot()->pushDialogControl(mDlg,0);
|
||||
mouseLock();
|
||||
|
||||
mInAction = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue