Example #1
0
bool Ball::find(Border &bo) {
	for (vbo::iterator it = lBoR.begin(); it != lBoR.end(); it++) {
		if (bo.getUpperLeft().x == (*it).getUpperLeft().x && bo.getUpperLeft().y == (*it).getUpperLeft().y
		&& bo.getBottomRight().x == (*it).getBottomRight().x && bo.getBottomRight().y == (*it).getBottomRight().y) return true;
	}
	return false;
}
Example #2
0
//called once for single image processing
bool
Decoder::processTag()
{
	if(!config->ARGS_OK ) return false;
	if(tagimage == NULL) tagimage = new Tagimage(config);
	if(!tagimage->isValid()) { 
		delete tagimage; tagimage = NULL;
		return false;
	}
	if(config->VISUAL_DEBUG) config->setDebugPixmap(new Pixmap(config->TAG_IMAGE_FILE));
	Threshold* threshold = new Threshold(config, tagimage);
	threshold->computeEdgemap();
	delete tagimage; tagimage = NULL;
	delete threshold;
	Shape *shapes = new Shape[config->MAX_SHAPES];
	Shape *anchor = new Shape(config);
	Border* border = new Border(config, shapes, anchor);
	int nshapes = border->findShapes();
	delete border;
	if( nshapes >= 12  ){
		Pattern* pattern = new Pattern(config, shapes, nshapes, anchor);
		pattern->findCodeInternal(tag);
		delete pattern;
	}
	delete anchor;
	delete [] shapes;
	return true;
}
ColorPickerRGB::ColorPickerRGB()
{
UI::DockPanel* p = new DockPanel;

	for (int i = 0; i < 3; i++)
	{
		DockPanel* p2 = new DockPanel;
		{
			{
				Border* pBorder = new Border(new Thickness(1));
				m_edit[i] = new TextEdit;
				m_edit[i]->set_Width(32);
				pBorder->set_Child(m_edit[i]);
				DockPanel::SetDock(pBorder, DockPanel::Right);
				p2->AddChild(pBorder);
			}

			{
				m_slider[i] = new ColorSlider;
				m_slider[i]->set_Height(20);
				DockPanel::SetDock(m_slider[i], DockPanel::Fill);
				p2->AddChild(m_slider[i]);
			}
		}
		DockPanel::SetDock(p2, DockPanel::Top);
		p->AddChild(p2);
	}


	set_VisualTree(p);
}
Example #4
0
bool Ball::find(Border &bo) {
	for (vbo::iterator it = lBoR.begin(); it != lBoR.end(); it++) {
		if (bo.return_rectangle().upperleft.x == (*it).return_rectangle().upperleft.x && bo.return_rectangle().upperleft.y == (*it).return_rectangle().upperleft.y
		&& bo.return_rectangle().bottomright.x == (*it).return_rectangle().bottomright.x && bo.return_rectangle().bottomright.y == (*it).return_rectangle().bottomright.y) return true;
	}
	return false;
}
Example #5
0
	void BoxSkin::setFrameThickness( Border frame )
	{
		bool hadFrame = (m_frame.width() + m_frame.height() > 0 );
		bool hasFrame = (frame.width() + frame.height() > 0);
	
		m_frame = frame;
	
		if( hadFrame != hasFrame )
			_updateOpaqueFlag();
	}
Example #6
0
void NPC::onContact (b2Contact* contact, IEntity* entity)
{
	IEntity::onContact(contact, entity);

	if (!isDying())
		return;

	if (!entity->isBorder())
		return;

	Border *b = static_cast<Border*>(entity);
	const float y = getPos().y;
	if (b->isBottom() || y > b->getPos().y) {
		_remove = true;
	}
}
Example #7
0
	BoxSkin::BoxSkin( Color color, Border frame, Color frameColor )
	{
	    m_frame = frame;
	
		for( int i = 0 ; i < StateEnum_Nb ; i++ )
		{
			m_color[i] = color;
			m_frameColor[i] = frameColor;
		}
	
		bool hasFrame = (frame.width() + frame.height() > 0 );
		if( color.a == 255 && (!hasFrame || frameColor.a == 255) )
			m_bOpaque = true;
		else
			m_bOpaque = false;
	}
Example #8
0
//called more than once in video frame processing
bool
Decoder::processFrame(unsigned char *data, int width, int height)
{
	assert(data != NULL) ;
	assert( (data+(width*height)) != NULL) ;

	//1. Skip frame 
	if(fuzzy->selectFrame(config->V_SKIP_FRAMES) == false) {
		if(fuzzy->tagIsActive()) markCode(data, width, height, 0);
		return false;
	}

	//2.Check Motion 
	if(fuzzy->motionDetect(data, width, height) == false) { 
		if(fuzzy->tagIsActive()) markCode(data, width, height, 0);
		return false;
	}

	//3. Process Tag
	config->V_GRID_WIDTH = width;
	config->V_GRID_HEIGHT = height;
	//config->setDebugPixmap(new Pixmap("debug.jpg"));
	for(int i=0; i<12; i++) tag[i] = -1;
	Threshold* threshold = new Threshold(config, data, width, height);
	threshold->computeEdgemap();
	delete threshold;
	resetVMap(width*height);
	Shape *shapes = new Shape[config->MAX_SHAPES];
	Shape *anchor = new Shape(config);
	Border* border = new Border(config, shapes, anchor);
	int nshapes = border->findShapes();
	delete border;
	if( nshapes >= 12  ){
		Pattern* pattern = new Pattern(config, shapes, nshapes, anchor);
		pattern->findCodeExternal(tag);
		delete pattern;
	}
		
	delete anchor;
	delete [] shapes;
	bool tagvalidity = fuzzy->validateTag(tag);
	if(tagvalidity) markCode(data, width, height, 1);
	return tagvalidity;
}
Example #9
0
//-----------------------------------------------------------------------------
// Purpose: create the Border objects from the scheme data
//-----------------------------------------------------------------------------
void CScheme::LoadBorders()
{
	m_pkvBorders = m_pData->FindKey("Borders", true);
	{for ( KeyValues *kv = m_pkvBorders->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
	{
		if (kv->GetDataType() == KeyValues::TYPE_STRING)
		{
			// it's referencing another border, ignore for now
		}
		else
		{
			int i = m_BorderList.AddToTail();

			Border *border = new Border();
			border->SetName(kv->GetName());
			border->ApplySchemeSettings(this, kv);

			m_BorderList[i].border = border;
			m_BorderList[i].bSharedBorder = false;
			m_BorderList[i].borderSymbol = kv->GetNameSymbol();
		}
	}}

	// iterate again to get the border references
	for ( KeyValues *kv = m_pkvBorders->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
	{
		if (kv->GetDataType() == KeyValues::TYPE_STRING)
		{
			// it's referencing another border, find it
			Border *border = (Border *)GetBorder(kv->GetString());
//			const char *str = kv->GetName();
			Assert(border);

			// add an entry that just references the existing border
			int i = m_BorderList.AddToTail();
			m_BorderList[i].border = border;
			m_BorderList[i].bSharedBorder = true;
			m_BorderList[i].borderSymbol = kv->GetNameSymbol();
		}
	}
	
	m_pBaseBorder = GetBorder("BaseBorder");
}
void Component::draw(Graphics* const TheGraphics, Real32 Opacity) const
{
    //If not visible then don't draw
    if (!getVisible())
        return;

    //Grab the initial transformation
    GLdouble InitMat[16];
    glGetDoublev(GL_MODELVIEW_MATRIX, InitMat);

    //Translate to my position
    glTranslatef(getPosition().x(), getPosition().y(), 0);

    if(setupClipping(TheGraphics))
    {

        //Activate My Border Drawing constraints
        Border* DrawnBorder = getDrawnBorder();
        if(DrawnBorder != NULL)
        {
            DrawnBorder->activateInternalDrawConstraints(TheGraphics,0,0,getSize().x(),getSize().y());
        }


        //Draw My Background
        drawBackground(TheGraphics, getDrawnBackground(), Opacity);

        //Draw Internal
        drawInternal(TheGraphics, Opacity);

        //Make sure the clipping is reset
        setupClipping(TheGraphics);

        //Draw My Foreground
        drawForeground(TheGraphics, getDrawnForeground(), Opacity);

        //Draw all parts that should not be clipped against
        drawUnclipped(TheGraphics, Opacity);
    }

    //Reset the transformation
    glLoadMatrixd(InitMat);
}
Example #11
0
void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = this->border();
  Rect rc = ev.getBounds();
  bool docControls = (rc.w > 300*ui::guiscale());
  if (docControls) {
    int prefWidth = m_docControls->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_docControls->setVisible(m_doc != nullptr);
    m_docControls->setBounds(rc);
  }
  else
    m_docControls->setVisible(false);
}
Example #12
0
File: Frame.cpp Project: nusus/osg
bool Frame::resizeFrame(point_type w, point_type h) {
    Border* left   = getBorder(BORDER_LEFT);
    Border* right  = getBorder(BORDER_RIGHT);
    Border* top    = getBorder(BORDER_TOP);
    Border* bottom = getBorder(BORDER_BOTTOM);

    if(!left || !right || !top || !bottom) return false;

    return resize(
               left->getWidth() + right->getWidth() + w,
               top->getHeight() + bottom->getHeight() + h
           );
}
Example #13
0
	void BinaryBoard::Fill(BgraFrame *src)
	{
		AssertCompatibleTo(src);

		Clear();

		if (src->IsBlank())
		{
			return;
		}

		Border b = { INT_MAX, INT_MAX, INT_MIN, INT_MIN };

		char const Mask0 = (char)0x01, Mask8 = (char)0x80;
		for (int y = 0; y < boardSize.h; ++y)
		{
			char* line = buffer + stride * y;
			char mask = Mask0;
			for (int x = 0; x < boardSize.w; ++x, mask = (mask == Mask8) ? Mask0 : (mask << 1))
			{
				Rect blockCrop { x * blockSize, y * blockSize, blockSize, blockSize };
				bool isCropBlank = IsCropBlank(src, blockCrop);
				line[x >> BitPerByteIndex] |= (isCropBlank ? 0 : mask);
				if (!isCropBlank)
				{
					b.left = (b.left > x) ? x : b.left;
					b.right = (b.right < x) ? x : b.right;
					b.top = (b.top > y) ? y : b.top;
					b.bottom = (b.bottom < y) ? y : b.bottom;
				}
			}
		}

		if (b.right >= 0)
		{
			cropCache = Rect::FromOuterBorder(b.ToOuterBorder()) * blockSize;
		}

		return;
	}
Example #14
0
void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = getBorder();
  Rect rc = ev.getBounds();
  bool frameControls = (rc.w > 300*ui::guiscale());

  if (frameControls) {
    m_slider->setVisible(rc.w > 400*ui::guiscale());
    int prefWidth = m_commandsBox->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_commandsBox->setVisible(true && m_hasDoc);
    m_commandsBox->setBounds(rc);
  }
  else
    m_commandsBox->setVisible(false);
}
Example #15
0
void CMyExcel::SetBorderLine(short Xposition,MyBorder XBorder)
{
	long Row,Col;
	Row=GetRowS();
	Col=GetColS();
	if(Row==1)
		if(Xposition==xlInsideHorizontal) return;
	if(Col==1)
		if(Xposition==xlInsideVertical) return;
	LPDISPATCH  lpDisp=NULL;
	lpDisp=MyRange.GetBorders();   
	Borders   bds;   
	bds.AttachDispatch(lpDisp);   
	Border   bd;   
	lpDisp=bds.GetItem((long)Xposition);   
	bd.AttachDispatch(lpDisp);   
	bd.SetLineStyle((_variant_t)(short)XBorder.LineStyle);
	bd.SetColor((_variant_t)(long)XBorder.Color);
	bd.SetWeight((_variant_t)(short)XBorder.Weight);
	bd.ReleaseDispatch();
	bds.ReleaseDispatch();
}
Example #16
0
P2PFrame::P2PFrame()
{
//	std::string filename = DownloadFile("http://www.lerstad.com/");

	put_Width(new Length(400, Length::UnitAbsolute));
	put_Height(new Length(300, Length::UnitAbsolute));

	DockPanel* p = new DockPanel;
	{

		{
			CUIDockBar* pDockbar = new CUIDockBar;
			{
				pDockbar->put_BackgroundBrush(new SolidColorBrush(new Color(236, 233, 216)));
				{
					//Gripper* pGripper = new Gripper;
				//	pGripper->put_BackgroundBrush(new CLSolidColorBrush(new CLColor(255, 0, 0)));
					{
						Toolbar* pToolbar = new Toolbar;
					//	pToolbar->put_BackgroundBrush(new CLSolidColorBrush(new CLColor(0, 255, 0)));

						{

							CLXUIMenuElement* pMenu = new CLXUIMenuElement(new TextString(OLESTR("File")));
							{
								pMenu->AddItem(new TextString(OLESTR("Open")), ID_FILE_OPEN);
								pMenu->AddItem(new TextString(OLESTR("Save")));
								pMenu->AddItem(new TextString(OLESTR("Open Program")), ID_FILE_OPENPROGRAM);
								{
									CLXUIMenuElement* pMenu2 = new CLXUIMenuElement(new TextString(OLESTR("Debug")));
									pMenu2->AddItem(new TextString(OLESTR("Go")), ID_DEBUG_GO);
									pMenu2->AddItem(new TextString(OLESTR("Step Into")), ID_DEBUG_STEPINTO);
									pMenu->AddMenuItem(pMenu2);
								}
								{
									CLXUIMenuElement* pMenu2 = new CLXUIMenuElement(new TextString(OLESTR("Edit")));
									pMenu2->AddItem(new TextString(OLESTR("Cut")), ID_EDIT_CUT);
									pMenu2->AddItem(new TextString(OLESTR("Copy")), ID_EDIT_COPY);
									pMenu2->AddItem(new TextString(OLESTR("Paste")), ID_EDIT_PASTE);
									pMenu->AddMenuItem(pMenu2);
								}
								/*
								{
									CLXUIMenuElement* pMenu2 = new CLXUIMenuElement(new TextString(OLESTR("Prefs2")));
									pMenu2->AddItem(new TextString(OLESTR("Local")));
									pMenu2->AddItem(new TextString(OLESTR("Global")));
									pMenu2->AddItem(new TextString(OLESTR("Something")));
									{
										CLXUIMenuElement* pMenu3 = new CLXUIMenuElement(new TextString(OLESTR("Prefs3")));
										pMenu3->AddItem(new TextString(OLESTR("Local")));
										pMenu3->AddItem(new TextString(OLESTR("Global")));
										pMenu3->AddItem(new TextString(OLESTR("Something")));
										pMenu2->AddMenuItem(pMenu3);
									}

									pMenu->AddMenuItem(pMenu2);
								}
								*/
								pMenu->AddSeparator();
								pMenu->AddItem(new TextString(OLESTR("Exit")), ID_APP_EXIT);
							}
							pToolbar->AddRChild(pMenu);

						}

						{
							Button* pButton = new Button;
							pButton->set_Content(new TextString(OLESTR("Save")));
							pToolbar->AddRChild(pButton);
						}

						{
							Button* pButton = new Button;
							pButton->set_Content(new TextString(OLESTR("Exit")));
							pToolbar->AddRChild(pButton);
						}

						/*
						{
							TextString* pText = new TextString(OLESTR("Button0"), font);
							pToolbar->AddRChild(pText);
						}

						{
							TextString* pText = new TextString(OLESTR("Button1"), font);
							pToolbar->AddRChild(pText);
						}

						{
							TextString* pText = new TextString(OLESTR("Button2"), font);
							pToolbar->AddRChild(pText);
						}
						*/

						//pGripper->put_Content(pToolbar);
						pDockbar->DockControlBar(pToolbar);
					}
					//pDockbar->DockControlBar(pGripper);
				}

				{
				//	Gripper* pGripper = new Gripper;
				//	pGripper->put_BackgroundBrush(new CLSolidColorBrush(new CLColor(255, 0, 0)));
					{
						Toolbar* pToolbar = new Toolbar;
					//	pToolbar->put_BackgroundBrush(new CLSolidColorBrush(new CLColor(0, 255, 0)));

						{
							Button* pButton = new Button;
							pButton->set_Content(new TextString(OLESTR("Cut")));
							pToolbar->AddRChild(pButton);
						}

						{
							Button* pButton = new Button;
							pButton->set_Content(new TextString(OLESTR("Copy")));
							pToolbar->AddRChild(pButton);
						}

						{
							Button* pButton = new Button;
							pButton->set_Content(new TextString(OLESTR("Paste")));
							pToolbar->AddRChild(pButton);
						}


				//		pGripper->put_Content(pToolbar);
						pDockbar->DockControlBar(pToolbar);
					}
				//	pDockbar->DockControlBar(pGripper);
				}

			}
			p->set_Dock(pDockbar, DockPanel::Top);
			p->AddRChild(pDockbar);
		}

		{
			CUIDockBar* pDockbar = new CUIDockBar;
			{
				pDockbar->set_BackgroundBrush(new SolidColorBrush(new Color(236, 233, 216)));
			}
			p->set_Dock(pDockbar, DockPanel::Bottom);
			p->AddRChild(pDockbar);
		}


		pCanvas = new ChildWindowContainer;
		{
			Border* outerBorder = new Border(new Thickness(new Length(4, Length::UnitAbsolute), new Length(4, Length::UnitAbsolute), new Length(4, Length::UnitAbsolute), new Length(4, Length::UnitAbsolute)));
			outerBorder->put_BackgroundBrush(new SolidColorBrush(new Color(255, 255, 255)));
			{
				DockPanel* panel2 = new DockPanel;
				{
					DockPanel* panel = new DockPanel;
					{
						Button* pSearchButton = new Button(new TextString(OLESTR("Search")));
						DockPanel::set_Dock(pSearchButton, DockPanel::Right);
						panel->AddRChild(pSearchButton);
					}

					{
						Border* pBorder = new Border(new Thickness(new Length(1, Length::UnitAbsolute), new Length(1, Length::UnitAbsolute), new Length(1, Length::UnitAbsolute), new Length(1, Length::UnitAbsolute)));
						pBorder->m_LeftBrush = new SolidColorBrush(new Color(0, 0, 0));
						pBorder->m_TopBrush = new SolidColorBrush(new Color(0, 0, 0));
						pBorder->m_RightBrush = new SolidColorBrush(new Color(160, 160, 160));
						pBorder->m_BottomBrush = new SolidColorBrush(new Color(160, 160, 160));
						{
							m_searchEdit = new TextEdit;
						//	m_searchEdit->m_tdp = new TextDocument;
						//	m_searchEdit->SetText(OLESTR(""));
							pBorder->set_Content(m_searchEdit);
						}
						DockPanel::set_Dock(pBorder, DockPanel::Fill);
						panel->AddRChild(pBorder);
					}
					DockPanel::put_Dock(panel, DockPanel::Top);
					panel2->AddRChild(panel);
				}
				{
					Border* pSpacer = new Border;
					DockPanel::set_Dock(pSpacer, DockPanel::Fill);
					panel2->AddRChild(pSpacer);
				}
				outerBorder->put_Content(panel2);
			}
			Border* ctl = outerBorder;


			{
				ChildWindow* pWindow = new ChildWindow;
				pWindow->m_computedLeft = 80;//put_Left(pWindow, new Length(100, UnitAbsolute));
				pWindow->m_computedTop = 80;//put_Top(new Length(100, UnitAbsolute));
				pWindow->set_Width(new Length(240, Length::UnitAbsolute));
				pWindow->set_Height(new Length(210, Length::UnitAbsolute));

				if (true)
				{
					pWindow->set_Content(ctl);
				}
				else
				{
					ScrollViewer* pScroller = new ScrollViewer;
					{
						pScroller->put_Content(ctl/*m_watchWnd*/);
					}
					pWindow->set_Content(pScroller);
				}

				pWindow->set_TitleText(OLESTR("Search"));

			//	pWindow->SetOwnerWindow(pCanvas->get_OwnerWindow());	// TODO, not here
				pCanvas->AddChild(pWindow);
			}
			if (true)
			{
				ConnectionsCtl = new TreeControlContainer;
			//	ConnectionsCtl->m_treeHeader->AddColumn(new TextString(OLESTR("IP-Address")));
			//	ConnectionsCtl->m_treeHeader->AddColumn(new TextString(OLESTR("Status")));

				ConnectionsCtl->AddField(L"Address");

				ChildWindow* pWindow = new ChildWindow;
				pWindow->m_computedLeft = 80;//put_Left(pWindow, new Length(100, UnitAbsolute));
				pWindow->m_computedTop = 80;//put_Top(new Length(100, UnitAbsolute));
				pWindow->set_Width(new Length(240, Length::UnitAbsolute));
				pWindow->set_Height(new Length(210, Length::UnitAbsolute));

				pWindow->set_Content(dynamic_cast<Control*>(ConnectionsCtl));

				pWindow->set_TitleText(OLESTR("Connections"));

				pCanvas->AddChild(pWindow);
			}

			if (true)
			{
				m_Downloads = new Downloads;
				ChildWindow* pWindow = new ChildWindow;
				pWindow->m_computedLeft = 80;//put_Left(pWindow, new Length(100, UnitAbsolute));
				pWindow->m_computedTop = 80;//put_Top(new Length(100, UnitAbsolute));
				pWindow->set_Width(new Length(240, Length::UnitAbsolute));
				pWindow->set_Height(new Length(210, Length::UnitAbsolute));

				pWindow->set_Content(dynamic_cast<Control*>(m_Downloads->m_itemContainer));

				pWindow->set_TitleText(OLESTR("Downloads"));

				pCanvas->AddChild(pWindow);
			}

			if (true)
			{
				m_Networks = new Networks;

				if (false)
				{
					Network* pNetwork = new Network;

					{
						pNetwork->pP2P = new GnutellaNetwork(pNetwork);
						pNetwork->pP2P->Connect();
					}

					m_Networks->m_itemContainer->AddItem(pNetwork);
				}

				if (false)
				{
					Network* pNetwork = new Network;

					{
						pNetwork->pP2P = new Gnutella2Network(pNetwork);
						pNetwork->pP2P->Connect();
					}

					m_Networks->m_itemContainer->AddItem(pNetwork);
				}

				{
					Network* pNetwork = new Network;

					{
						pNetwork->pP2P = new EDonkeyNetwork(pNetwork);
						pNetwork->pP2P->Connect();
					}

					m_Networks->m_itemContainer->AddItem(pNetwork);
				}

				ChildWindow* pWindow = new ChildWindow;
				pWindow->m_computedLeft = 80;//put_Left(pWindow, new Length(100, UnitAbsolute));
				pWindow->m_computedTop = 80;//put_Top(new Length(100, UnitAbsolute));
				pWindow->set_Width(new Length(240, Length::UnitAbsolute));
				pWindow->set_Height(new Length(210, Length::UnitAbsolute));

				pWindow->set_Content(dynamic_cast<Control*>(m_Networks->m_itemContainer));

				pWindow->set_TitleText(OLESTR("Networks"));

				pCanvas->AddChild(pWindow);
			}
		}
		p->set_Dock(pCanvas, DockPanel::Fill);
		p->AddRChild(pCanvas);
	}
	set_Content(p);
	set_TitleText(WSTR("LP2P"));
}
Example #17
0
TreeItem::TreeItem(TreeControl* ownerTree)
{
	ASSERT(0);
#if 0
	m_itemData = NULL;
//	m_iIndex = -1;
	m_cChildren = -1;

	m_userdata = NULL;
	//m_expanded = false;

	m_Span = new Border;

//	m_Content = NULL;

//	DockPanel* pPanel = new DockPanel;

	m_ownerCtl = ownerTree;

	if (ownerTree)
		m_pos = ownerTree->m_treeItems.insert(ownerTree->m_treeItems.end(), this);

	m_Children = NULL;
#if 0
	m_Children = new TreeItemChildren(ownerTree);
	m_Children->put_Visibility(Collapsed);
#endif
	//m_Button = new Canvas;
	{
		m_ExpandButton = new Border(new Thickness(new Length(1)));
	//	m_ExpandButton->put_Width(Length(22));
	//	m_ExpandButton->put_Height(Length(22));

		/*
			m_ExpandButton->m_LeftBrush = new SolidColorBrush(Color(0,0,0));
			m_ExpandButton->m_TopBrush = new SolidColorBrush(Color(0,0,0));
			m_ExpandButton->m_RightBrush = new SolidColorBrush(Color(0,0,0));
			m_ExpandButton->m_BottomBrush = new SolidColorBrush(Color(0,0,0));
			*/

		//Border* pRect = new Border(Thickness(Length(1), Length(1), Length(1), Length(1)));
	//	m_ExpandButton->put_Visibility(Hidden);
		{
			Border* pRect = new Border(new Thickness(new Length(1)));
			pRect->set_Width(new Length(14));
			pRect->set_Height(new Length(14));
			pRect->set_BorderBrush(new SolidColorBrush(new Color(90,90,90)));

			/*
			pRect->put_Fill(new SolidColorBrush(new Color(0, 0, 0)));
			pRect->put_RectangleWidth(new Length(14, Length::UnitAbsolute));
			pRect->put_RectangleHeight(new Length(14, Length::UnitAbsolute));
			*/
			{
				pRect->set_Content(new TextString(WSTR("-")));
			}
			m_ExpandButton->set_Content(pRect);
		}

		m_ExpandButton->set_Visibility(Hidden);

		//DockPanel::put_Dock(m_ExpandButton, DockPanel::Left);
		/*m_Button->*/AddRChild(m_ExpandButton);
	}

	AddRChild(m_Span);
	/*
	{
		m_ContentBorder = new CLXUICanvas;
	//	m_ContentBorder->put_Content(m_Content);
		DockPanel::put_Dock(m_ContentBorder, DockPanel::Fill);
		m_Button->AddRChild(m_ContentBorder);
	}
	*/
	//AddRChild(m_Button);
#if 0
	AddRChild(m_Children);
#endif
/*
	pPanel->AddRChild(m_Button);
	pPanel->AddRChild(m_Children);

	put_VisualTree(pPanel);
*/

//	m_pFont = m_ownerCtl->m_pFont;

//	m_ownerCtl->m_items.push_back(this);
#endif
}
Example #18
0
bool cmp_col(const Border & a, const Border & b) {
    return a.col() < b.col();
}
Example #19
0
	void Menubar::_render( GfxDevice * pDevice, const Rect& _canvas, const Rect& _window, const Rect& _clip )
	{
		Widget::_render(pDevice,_canvas,_window,_clip);
	
		// Take backgrounds content borders into account
	
		Rect	window;
		Rect	clip;
	
		if( m_pSkin )
		{
			window = m_pSkin->contentRect( _canvas, m_state );
			clip.intersection( window, _clip );
		}
		else
		{
			window = _canvas;
			clip = _clip;
		}
	
		// Go throught the MenuBarItems and print their text and render their rectangles.
	
		MenuBarItem * pI = m_items.first();
		uint32_t posX = window.x;
	
		Pen pen;
	
	
		TextAttr	attr;
		TextTool::addPropAttributes( attr, Base::getDefaultTextprop(), StateEnum::Normal);
		TextTool::addPropAttributes( attr, m_pTextProp, StateEnum::Normal);
	
		pen.setAttributes( attr );
		pen.setClipRect( clip );
		pen.setDevice( pDevice );
	
		uint32_t printPosY = window.y + ( window.h - pen.getLineHeight() )/2 + pen.getBaseline();
	
		uint32_t itemNb = 1;
		while( pI )
		{
			if( pI->isVisible() )
			{
				State	state = StateEnum::Disabled;
				if( m_state.isEnabled() && pI->m_bEnabled )
				{
					state = StateEnum::Normal;
	
					if( itemNb == m_selectedItem )
						state = StateEnum::Pressed;
					else if( itemNb == m_markedItem )
						state = StateEnum::Hovered;
				}
	
				Border b = _getEntryBorder();
	
	//			ColorsetPtr pTextColors;
				
	//			if( m_pSkin )
	//				pTextColors = m_pSkin->TextColors();
	
				if( m_pEntrySkin )
				{
					Rect	dest( posX, window.y, pI->m_width + b.width(), window.h );
					m_pEntrySkin->render( pDevice, dest, state, clip );
	
	//				pTextColors = m_pEntrySkin->TextColors();
				}
	
				pen.setPos( Coord(posX + b.left, printPosY) );
	
				TextAttr	attr;
				TextTool::addPropAttributes( attr, Base::getDefaultTextprop(), state );
	//			TextTool::setAttrColor( attr, pTextColors, mode );
				TextTool::addPropAttributes( attr, m_pTextProp, state );
				pen.setAttributes( attr );
	
				pDevice->printLine( pen, attr, pI->m_pText );
	
				posX += pI->m_width + b.width();
			}
			itemNb++;
			pI = pI->next();
		}
	}
Example #20
0
bool cmp_row(const Border & a, const Border & b) {
    return a.row() < b.row();
}