TitledToggleButton::TitledToggleButton(string title) { _titleView = new TextRenderView(CGRect(22,-10,100,50), CGColor(0.0,0.0,0.0,1.0), title); _toggleButton = new ToggleButton(); _toggleButton->setBounds(CGRect(0,0,20,20)); this->addSubView(_titleView); this->addSubView(_toggleButton); }
SearchViewController::SearchViewController() : ViewController() { _indexerDirName = new TitledTextInputView("Indexer Directory:"); _indexerDirName->setBounds(CGRect(10,10,160,75)); getMasterView()->addSubView(_indexerDirName); _runIndexerButton = new Button("Run Indexer", CGRect(10,95,200,30)); _runIndexerButton->setOnClickCallback(&w_runIndexerButtonPressed, this); getMasterView()->addSubView(_runIndexerButton); _queryDirName = new TitledTextInputView("Query Directory:"); _queryDirName->setBounds(CGRect(10,135,160,75)); getMasterView()->addSubView(_queryDirName); _query = new TitledTextInputView("Query:"); _query->setBounds(CGRect(10,220,160,75)); getMasterView()->addSubView(_query); _runQueryButton = new Button("Run Query", CGRect(10,305,200,30)); _runQueryButton->setOnClickCallback(&w_runQueryButtonPressed, this); getMasterView()->addSubView(_runQueryButton); _fileViewer = new TextScrollView(CGRect(320,10,700,600)); getMasterView()->addSubView(_fileViewer); _results = new ResultList(CGRect(10,345,280,280), _fileViewer); getMasterView()->addSubView(_results); }
Portrait::Portrait() { CCSprite::init(); CCTexture2D *portaits = Manager_Resource::getInstance()->getResourceWithString("portrait"); CCAnimation *pPA = new CCAnimation; pPA->initWithName("PORTRAIT"); pPA->addFrameWithTexture(portaits, CGRect(0, 0, 1, 1)); for (int n = 0; n < MAX_CHARACTER_NUMBER+1; n++) { pPA->addFrameWithTexture(portaits, CGRect(226*(n%8),(n/8) * 482 , 224, 480)); } this->addAnimation(pPA); }
void ProgressBar::draw() { CGRect gB = this->getGlobalBounds(); drawRectWithColor(gB, this->getColor()); // draw the progress bar rectangle drawRectWithColor(CGRect(gB.getX(),gB.getY(),gB.getWidth()*_percentComplete, gB.getHeight()), *_foregroundColor); // draw a border drawBorderWithColor(gB, CGColor(0.0,0.0,0.0,1.0)); // no subviews to call draw on }
FloatRect AffineTransform::mapRect(const FloatRect &rect) const { return FloatRect(CGRectApplyAffineTransform(CGRect(rect), m_transform)); }
IntRect AffineTransform::mapRect(const IntRect &rect) const { return enclosingIntRect(CGRectApplyAffineTransform(CGRect(rect), m_transform)); }
CGRect CCXEGLView::getFrame() { TRectangle rc; GetClientBounds(&rc); return (CGRect((float)rc.X(), (float)rc.Y(), (float)rc.Width(), (float)rc.Height())); }
CGRect CCXEGLView::getFrame() { RECT rc; GetClientRect(m_hWnd, &rc); return (CGRect((float)rc.left, (float)rc.top, (float)(rc.right - rc.left), (float)(rc.bottom - rc.top))); }
void SVGPaintServerGradient::handleBoundingBoxModeAndGradientTransformation(GraphicsContext* context, const FloatRect& targetRect) const { CGContextRef contextRef = context->platformContext(); if (boundingBoxMode()) { // Choose default gradient bounding box CGRect gradientBBox = CGRectMake(0.0, 0.0, 1.0, 1.0); // Generate a transform to map between both bounding boxes CGAffineTransform gradientIntoObjectBBox = CGAffineTransformMakeMapBetweenRects(gradientBBox, CGRect(targetRect)); CGContextConcatCTM(contextRef, gradientIntoObjectBBox); } // Apply the gradient's own transform CGAffineTransform transform = gradientTransform(); CGContextConcatCTM(contextRef, transform); }