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

Method setBitmap

Engine/source/gui/controls/guiPopUpCtrl.cpp:576–604  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Added

Source from the content-addressed store, hash-verified

574//------------------------------------------------------------------------------
575// Added
576void GuiPopUpMenuCtrl::setBitmap( const char *name )
577{
578 StringTableEntry bitmapName = StringTable->insert(name);
579
580 if ( bitmapName != StringTable->EmptyString() )
581 {
582 char buffer[1024];
583 char *p;
584 dStrcpy(buffer, bitmapName, 1024);
585 p = buffer + dStrlen(buffer);
586 S32 pLen = 1024 - dStrlen(buffer);
587
588 dStrcpy(p, "_n", pLen);
589
590 _setBitmap((StringTableEntry)buffer, Normal);
591
592 dStrcpy(p, "_d", pLen);
593 _setBitmap((StringTableEntry)buffer, Depressed);
594
595 if ( !mBitmap[Depressed] )
596 mBitmap[Depressed] = mBitmap[Normal];
597 }
598 else
599 {
600 _setBitmap(StringTable->EmptyString(), Normal);
601 _setBitmap(StringTable->EmptyString(), Depressed);
602 }
603 setUpdate();
604}
605
606//------------------------------------------------------------------------------
607void GuiPopUpMenuCtrl::sort()

Callers 4

constructMethod · 0.45
constructEditControlMethod · 0.45
createContentMethod · 0.45
_setBitmapsMethod · 0.45

Calls 5

dStrcpyFunction · 0.85
_setBitmapFunction · 0.85
EmptyStringMethod · 0.80
dStrlenFunction · 0.50
insertMethod · 0.45

Tested by 2

constructMethod · 0.36
constructEditControlMethod · 0.36