// Create Tooltip.
CtoolTipCtrl tooltip;
tooltip.Create(m_hWnd,rcDefault,NULL,WS_POPUP|TTS_NOPREFIX|TTS_NOFADE|TTS_NOANIMATE,0 );
tooltip.SetDelayTime(TTDT_INITIAL,0);
tooltip.SetDelayTime(TTDT_RESHOW,0);
// Create rebar.
CReBarCtrl m_bar;
CRect rc( 0,0,100,100 );
m_bar.Create( m_hWnd,rc,"WebRebar",WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|CCS_TOP|RBS_BANDBORDERS|CCS_NODIVIDER,0 );
// Init toolbar.
CImageList img;
CToolBarCtrl m_navigationBar;
m_navigationBar.Create( m_bar.m_hWnd,rc,NULL,CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|WS_CHILD|
TBSTYLE_FLAT|TBSTYLE_TRANSPARENT|TBSTYLE_TOOLTIPS );
img.Create(IDB_HOTTOOLBAR_WEB, 22, 0, RGB(255, 0, 255));
m_navigationBar.SetPadding( 6,6 );
m_navigationBar.SetHotImageList( img );
img.Detach();
img.Create(IDB_COLDTOOLBAR_WEB, 22, 0, RGB(255, 0, 255));
m_navigationBar.SetImageList( img );
img.Detach();
// Init address bar at web rebar.
CRect arc( 0,0,200,120 );
m_addressBar.Create( m_bar.m_hWnd,arc,NULL,CBS_DROPDOWN|WS_CHILD|WS_VISIBLE );
memset( &bi,0,sizeof(bi) );
bi.cbSize = sizeof(REBARBANDINFO);
bi.lpText = "Address";
bi.fStyle = RBBS_GRIPPERALWAYS;
bi.fMask = RBBIM_TEXT|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_STYLE;
bi.cxMinChild = 60;
bi.cyMinChild = 0;
bi.cyMaxChild = 10;
bi.hwndChild = m_addressBar.m_hWnd;
m_bar.InsertBand(m_bar.GetBandCount(),&bi);
// Draw some stuff.
Cbrush brush;
brush.CreateSolidBrush( 0x11223344 );
CPen pen;
pen.CreatePen( PS_SOLID,0, 0x11223344 );
CPen prevPen = dc.SelectPen( pen );
CBrush prevBrush = dc.SelectBrush( brush );
dc.Ellipse( p.x-m_itemSize-2,p.y-m_itemSize-2,p.x+m_itemSize+2,p.y+m_itemSize+2 );
dc.SetTextColor( 0xFFFFFFFF );
dc.SelectFont( (HFONT)GetStockObject(ANSI_VAR_FONT) );
string text = item-getName();
SIZE sz;
dc.GetTextExtent( text,text.size(),&sz );
dc.ExtTextOut( pt.x,pt.y,ETO_CLIPPED,rc,text ); |