本文整理汇总了C++中setFocusable函数的典型用法代码示例。如果您正苦于以下问题:C++ setFocusable函数的具体用法?C++ setFocusable怎么用?C++ setFocusable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFocusable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Widget
GuiTable::GuiTable(const Widget2 *const widget,
TableModel *const initial_model,
const bool opacity) :
Widget(widget),
MouseListener(),
KeyListener(),
mModel(nullptr),
mTopWidget(nullptr),
mActionListeners2(),
mHighlightColor(getThemeColor(ThemeColorId::HIGHLIGHT)),
mSelectedRow(-1),
mSelectedColumn(-1),
mLinewiseMode(false),
mWrappingEnabled(false),
mOpaque(opacity),
mSelectable(true)
{
mAllowLogic = false;
mBackgroundColor = getThemeColor(ThemeColorId::BACKGROUND);
setModel(initial_model);
setFocusable(true);
addMouseListener(this);
addKeyListener(this);
}
示例2: setFocusable
void Tab::init()
{
setFocusable(false);
setFrameSize(0);
mFlash = false;
if (mInstances == 0)
{
// Load the skin
Image *tab[TAB_COUNT];
int a, x, y, mode;
for (mode = 0; mode < TAB_COUNT; mode++)
{
tab[mode] = Theme::getImageFromTheme(data[mode].file);
a = 0;
for (y = 0; y < 3; y++)
{
for (x = 0; x < 3; x++)
{
tabImg[mode].grid[a] = tab[mode]->getSubImage(
data[x].gridX, data[y].gridY,
data[x + 1].gridX - data[x].gridX + 1,
data[y + 1].gridY - data[y].gridY + 1);
tabImg[mode].grid[a]->setAlpha(mAlpha);
a++;
}
}
tab[mode]->decRef();
}
}
mInstances++;
}
示例3: sprite_
TSpriteIcon::TSpriteIcon() :
sprite_(NULL)
{
setFrameSize(1);
setFocusable(0);
setVisible(1);
}
示例4: setFocusable
void Slider::init()
{
mAllowLogic = false;
setFocusable(true);
setFrameSize(1);
addMouseListener(this);
addKeyListener(this);
setFrameSize(0);
// Load resources
if (mInstances == 0)
{
if (theme)
{
for (int mode = 0; mode < 2; mode ++)
theme->loadRect(buttons[mode], data[mode], "slider.xml", 0, 8);
}
updateAlpha();
}
mInstances++;
if (buttons[0].grid[HGRIP])
setMarkerLength(buttons[0].grid[HGRIP]->getWidth());
}
示例5: mInventory
ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
mInventory(inventory),
mGridColumns(1),
mGridRows(1),
mSelectedIndex(-1),
mHighlightedIndex(-1),
mLastUsedSlot(-1),
mSelectionStatus(SEL_NONE),
mForceQuantity(forceQuantity),
mSwapItems(false),
mDescItems(false)
{
mItemPopup = new ItemPopup;
setFocusable(true);
ResourceManager *resman = ResourceManager::getInstance();
mSelImg = resman->getImage("graphics/gui/selection.png");
if (!mSelImg)
logger->error("Unable to load selection.png");
addKeyListener(this);
addMouseListener(this);
addWidgetListener(this);
}
示例6: highestTab
TabbedPane::TabbedPane( Widget * tabContainer /*= NULL*/,
Widget *widgetContainer /*= NULL*/ )
: highestTab(0), tabPadding(0), resizeTabContent(false),
selectedTab(reinterpret_cast<Tab*>(NULL),reinterpret_cast<Widget*>(NULL))
{
if(tabContainer)
{
isMaintainingTabContainer = false;
this->tabContainer = tabContainer;
}
else
{
isMaintainingTabContainer = true;
this->tabContainer = new EmptyWidget();
}
if(widgetContainer)
{
isMaintainingWidgetContainer = false;
this->widgetContainer = widgetContainer;
}
else
{
isMaintainingWidgetContainer = true;
this->widgetContainer = new EmptyWidget();
}
addPrivateChild(this->tabContainer);
addPrivateChild(this->widgetContainer);
setTabable(true);
setFocusable(true);
setReverseTabable(false);
adjustTabs();
}
示例7: mMap
Viewport::Viewport():
mMap(0),
mMouseX(0),
mMouseY(0),
mPixelViewX(0.0f),
mPixelViewY(0.0f),
mDebugFlags(0),
mPlayerFollowMouse(false),
mLocalWalkTime(-1),
mHoverBeing(0),
mHoverItem(0)
{
setOpaque(false);
addMouseListener(this);
mScrollLaziness = config.getIntValue("ScrollLaziness");
mScrollRadius = config.getIntValue("ScrollRadius");
mScrollCenterOffsetX = config.getIntValue("ScrollCenterOffsetX");
mScrollCenterOffsetY = config.getIntValue("ScrollCenterOffsetY");
mPopupMenu = new PopupMenu;
mBeingPopup = new BeingPopup;
setFocusable(true);
listen(Event::ConfigChannel);
listen(Event::ActorSpriteChannel);
}
示例8: mInventory
ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
mInventory(inventory),
mGridColumns(1),
mGridRows(1),
mSelectedIndex(-1),
mHighlightedIndex(-1),
mLastUsedSlot(-1),
mSelectionStatus(SEL_NONE),
mForceQuantity(forceQuantity),
mSwapItems(false),
mDescItems(false),
mTag(0),
mSortType(0),
mItemPopup(new ItemPopup),
mShowMatrix(nullptr),
mClicks(1),
mEquipedColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)),
mUnEquipedColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
setFocusable(true);
mSelImg = Theme::getImageFromTheme("selection.png");
if (!mSelImg)
logger->log1("Error: Unable to load selection.png");
addKeyListener(this);
addMouseListener(this);
addWidgetListener(this);
}
示例9: addMouseListener
void Tab::init()
{
addMouseListener(this);
setFocusable(false);
setFrameSize(0);
mFlash = 0;
addWidgetListener(this);
if (mInstances == 0)
{
// Load the skin
Theme *const theme = Theme::instance();
if (theme)
{
for (int mode = 0; mode < TAB_COUNT; mode ++)
tabImg[mode] = theme->load(data[mode], "tab.xml");
}
updateAlpha();
}
mInstances++;
add(mLabel);
const Skin *const skin = tabImg[TAB_STANDARD];
if (!skin)
return;
const int padding = skin->getPadding();
mLabel->setPosition(padding, padding);
}
示例10: Container
TabbedArea::TabbedArea(bool hide) :
Container(),
mHideWhenOneTab(hide),
mSelectedTab(NULL)
{
setFocusable(false);
addKeyListener(this);
addMouseListener(this);
mTabContainer = new Container();
mTabContainer->setOpaque(false);
mWidgetContainer = new Container();
mWidgetContainer->setOpaque(false);
add(mTabContainer);
add(mWidgetContainer);
mProtFocusListener = new ProtectedFocusListener();
addFocusListener(mProtFocusListener);
mProtFocusListener->blockKey(SDLK_LEFT);
mProtFocusListener->blockKey(SDLK_RIGHT);
mProtFocusListener->blockKey(SDLK_UP);
mProtFocusListener->blockKey(SDLK_DOWN);
}
示例11: setScrollPolicy
FFScrollArea::FFScrollArea()
{
setScrollPolicy(ShowNever,
ShowNever);
addKeyListener(this);
setFocusable(false);
setFrameSize(0);
}
示例12: setMarked
CheckBox::CheckBox()
{
setMarked(false);
setFocusable(true);
addMouseListener(this);
addKeyListener(this);
}
示例13: Widget
Menu::Menu(Layer& layer):
Widget(layer),
m_selection(NO_ITEM)
{
setDraggable(true);
setFocusable(true);
hide();
}
示例14: setSelected
RadioButton::RadioButton()
{
setSelected(false);
setFocusable(true);
addMouseListener(this);
addKeyListener(this);
}
示例15: mCurrentSelection
MultiSelector::MultiSelector()
: mCurrentSelection(0),
mFrameCounter(0)
{
setFocusable(true);
mSelectorImage = gcn::Image::load(ResourceHandler::getInstance()->getRealFilename("menu-selector.bmp"));
addKeyListener(this);
}