CGUIButton::CGUIButton(CGUIDialog * parent, float x, float y, float w, float h, CImage2D * img) :CGUIControl(parent, x, y, w, h) { m_img = img; if (m_img) { float cliph = m_img->TextureHeight / 3.0f; m_rtNormal = MakeBounds(0, 0, m_img->TextureWidth, (int)(cliph + 0.5f)); m_rtFocus = MakeBounds(0, (int)(cliph + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f)); m_rtPush = MakeBounds(0, (int)(cliph * 2 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f)); } m_fadeSpeed = 5; m_counter = 0; m_bPushed = false; m_bClicked = false; }
static void BuildStack() { // Get log data vector<CLog> vL; int nL = ReadLogs( vL, gArgs.zmin, gArgs.zmax ); if( gArgs.table ) Tabulate( vL, nL ); if( !nL ) return; // Make layer TForms vector<TAffine> vT( nL ); MakeTAffines( vT, vL ); // Calculate bounds DBox B; MakeBounds( B, vL, vT ); // Write WriteTrakEM2( "LowRes.xml", B, vL, vT ); }
CGUICheckBox::CGUICheckBox(CGUIDialog * parent, float x, float y, float w, float h, CImage2D * img) :CGUIControl(parent, x, y, w, h) { m_img = img; if (m_img) { float cliph = m_img->TextureHeight / 4.0f; m_rtUncheck = MakeBounds(0, 0, m_img->TextureWidth, (int)(cliph + 0.5f)); m_rtCheck = MakeBounds(0, (int)(cliph + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f)); m_rtFocusUncheck = MakeBounds(0, (int)(cliph * 2 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f)); m_rtFocusCheck = MakeBounds(0, (int)(cliph * 3 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f)); } m_fadeSpeed = 15; m_counter = 0; m_bChecked = false; m_bChanged = false; }
void CGUIList::Draw(CGame2D* g2d) { if (m_imgBk) { SetEffect(fxBlend); g2d->DrawImageScale(m_imgBk, X + Parent->GetX(), Y + Parent->GetY(), Width, Height); } for (int i = m_topline; i < (int)Items.size() && i < m_topline + m_lines; i++) { RECT rt = MakeBounds((int)(X + Parent->GetX() + m_offsetX + 10), (int)(Y + Parent->GetY() + m_offsetY + m_itemHeight * (i - m_topline)), (int)(Width + 0.5f - m_offsetX * 2), (int)(m_itemHeight + 0.5f)); if (m_index != i) { g2d->DrawString(m_font, Items[i].c_str(), &rt, m_textColor, DT_VCENTER); }else { g2d->DrawImageScale(m_imgSel, (float)rt.left - 10, (float)rt.top, Width - m_offsetX * 2, m_itemHeight); g2d->DrawString(m_font, Items[i].c_str(), &rt, m_selColor, DT_VCENTER); } } }
void CGUIControl::Draw(CGame2D* g2d) { RECT rt = MakeBounds((int)(X + Parent->GetX()), (int)(Y + Parent->GetY()), (int) Width, (int) Height); g2d->DrawRect(&rt, 0xFFFFFFFF); }