VOID CDUIIconTextItem::SetHeight(BOOL bExpand, INT nValue) { if(bExpand) { m_nExpandHeight = nValue; } else { m_nNormalHeight = nValue; } SetExpand(m_bExpand); }
Toolbar::Toolbar() : nuiHBox(0), mEventSink(this) { SetObjectClass(_T("Toolbar")); SetExpand(nuiExpandShrinkAndGrow); }
ThreadInspectorTest::ThreadInspectorTest() : nuiVBox(0), mThreadCount(0), mEventSink(this) { SetExpand(nuiExpandShrinkAndGrow); // explanations nuiLabel* pLabel = new nuiLabel(_T("Open the nuiIntrospector(SHIFT+CTRL+D), go to the Thread Inspector, run the Thread Checker, play with the test tool below, and see how the Thread Inspector reacts.\n\nIf you create a dead-lock, the nglThreadChecker will make the application exit, and dump usefull information on the standart output.\n")); pLabel->SetWrapping(true); AddCell(pLabel); SetCellMinPixels(0, 90); //*********************************** // test tool nuiDecoration* pDeco = new nuiGradientDecoration(_T("ThreadInspectorTestDeco"), nuiRect(3, 3, 0, 0), nuiColor(246,246,246), nuiColor(220,220,220), nuiColor(210,210,210), nuiColor(255,255,255), nuiVertical, 1, nuiColor(180,180,180), eStrokeAndFillShape); // buttons pLabel = new nuiLabel(_T("test for Critical Sections locking")); pLabel->SetDecoration(pDeco, eDecorationBorder); AddCell(pLabel); nuiHBox* pBox = new nuiHBox(0); AddCell(pBox); nuiButton* pCreateBtn = new nuiButton(_T("Create CS Thread")); pBox->AddCell(pCreateBtn); mEventSink.Connect(pCreateBtn->Activated, &ThreadInspectorTest::CreateCSThread); nuiButton* pRemoveBtn = new nuiButton(_T("Terminate CS Thread")); pBox->AddCell(pRemoveBtn); mEventSink.Connect(pRemoveBtn->Activated, &ThreadInspectorTest::RemoveCSThread); // threads list mpCSList = new nuiList(); AddCell(mpCSList); AddCell(NULL); SetCellPixels(GetNbCells()-1, 15); pLabel = new nuiLabel(_T("test for Light Locks locking")); pLabel->SetDecoration(pDeco, eDecorationBorder); AddCell(pLabel); pBox = new nuiHBox(0); AddCell(pBox); pCreateBtn = new nuiButton(_T("Create LL Thread")); pBox->AddCell(pCreateBtn); mEventSink.Connect(pCreateBtn->Activated, &ThreadInspectorTest::CreateLLThread); pRemoveBtn = new nuiButton(_T("Terminate LL Thread")); pBox->AddCell(pRemoveBtn); mEventSink.Connect(pRemoveBtn->Activated, &ThreadInspectorTest::RemoveLLThread); // threads list mpLLList = new nuiList(); AddCell(mpLLList); }
VOID CDUIIconTextItem::SetAttribute(const CDUIString& strName, const CDUIString& strValue) { BOOL bHandled(FALSE); if(strName.compare(_T("normal_icon")) == 0) { m_uiData.m_pNormalIcon = GetSkinMgr()->GetImage(strValue); bHandled = TRUE; } else if(strName.compare(_T("expand_icon")) == 0) { m_uiData.m_pExpandIcon = GetSkinMgr()->GetImage(strValue); bHandled = TRUE; } else if(strName.compare(_T("hover_frame")) == 0) { SetHoverFrameBK(GetSkinMgr()->GetFrameBK(strValue)); bHandled = TRUE; } else if(strName.compare(_T("select_frame")) == 0) { SetSelectFrameBK(GetSkinMgr()->GetFrameBK(strValue)); bHandled = TRUE; } else if(strName.compare(_T("normal_height")) == 0) { SetHeight(FALSE, _ttol(strValue.c_str())); bHandled = TRUE; } else if(strName.compare(_T("expand_height")) == 0) { SetHeight(TRUE, _ttol(strValue.c_str())); bHandled = TRUE; } else if(strName.compare(_T("group")) == 0) { if(strValue.compare(DUI_STR_TRUE) == 0) { SetGroup(TRUE); } else { SetGroup(FALSE); } bHandled = TRUE; } else if(strName.compare(_T("expand")) == 0) { if(strValue.compare(DUI_STR_TRUE) == 0) { SetExpand(TRUE); } else { SetExpand(FALSE); } bHandled = TRUE; } if(!bHandled) { theBase::SetAttribute(strName, strValue); } }