当前位置: 首页>>代码示例>>C++>>正文


C++ DrawButton函数代码示例

本文整理汇总了C++中DrawButton函数的典型用法代码示例。如果您正苦于以下问题:C++ DrawButton函数的具体用法?C++ DrawButton怎么用?C++ DrawButton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DrawButton函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Config_Render

void Config_Render(bool force)
{
	int x, y;
	
	if (force) configdirty = 2;
	if (!configdirty) return;
	configdirty--;
	
	ClearFramebuffer();
	DrawText(2, 2, RGB(255, 255, 255), "blargSNES config");
	
	y = 2 + 12 + 10;
	
	DrawCheckBox(10, y, RGB(255,255,255), "Hardware renderer", Config.HardwareRenderer);
	
	y += 26;
	
	DrawText(10, y+1, RGB(255,255,255), "Scaling:");
	x = 10 + MeasureText("Scaling:") + 6;
	
	char* scalemodes[] = {"1:1", "Fullscreen", "Cropped", "4:3", "Cropped 4:3"};
	int themode = Config.ScaleMode;
	if (themode < 0 || themode > 4) themode = 0;
	DrawButton(x, y-3, 140, RGB(255,255,255), scalemodes[themode]);
	
	
	DrawButton(10, 212, 0, RGB(255,128,128), "Cancel");
	DrawButton(-10, 212, 0, RGB(128,255,128), "Save changes");
}
开发者ID:Kneecaps,项目名称:blargSnes,代码行数:29,代码来源:ui_config.c

示例2: GetSysColor

void mxExpressionTray::DrawThumbNail( CExpClass *active, CExpression *current, CChoreoWidgetDrawHelper& helper, int rcx, int rcy, int rcw, int rch, int c, int selected, bool updateselection )
{
	if ( !current )
		return;

	HDC dc = helper.GrabDC();

	helper.DrawFilledRect( GetSysColor( COLOR_BTNFACE ), rcx, rcy, rcw + rcx, rch + rcy );

	if ( current->m_Bitmap[ models->GetActiveModelIndex() ].valid )
	{
		DrawBitmapToDC( dc, rcx, rcy, rcw, rch - m_nDescriptionHeight, current->m_Bitmap[ models->GetActiveModelIndex() ] );
		helper.DrawOutlinedRect( RGB( 127, 127, 127 ), PS_SOLID, 1, rcx, rcy, rcx + rcw, rcy + rch - m_nDescriptionHeight );
	}

	DrawDirtyFlag( helper, current, rcx, rcy, rcw, rch );

	DrawExpressionDescription( helper, rcx, rcy, rcw, rch, current->name, current->description );

	if ( c == selected )
	{
		DrawExpressionFocusRect( helper, rcx, rcy, rcw, rch - m_nDescriptionHeight, RGB( 255, 100, 63 ) );

		if ( updateselection )
		{
			m_nPrevCell = -1;
			m_nCurCell = c;
		}

		if ( current->CanUndo() || current->CanRedo() )
		{
			if ( current->CanUndo() )
			{
				DrawButton( helper, c, FindButton( "undo" ) );
			}

			if ( current->CanRedo() )
			{
				DrawButton( helper, c, FindButton( "redo" ) );
			}

			RECT rc;
			rc.left =  rcx + rcw - 2 * ( m_nButtonSquare + 4 );
			rc.top = rcy + m_nButtonSquare + 6;
			rc.right = rc.left + 2 * ( m_nButtonSquare + 4 );
			rc.bottom = rc.top + 15;

			helper.DrawColoredText( "Arial", 9, FW_NORMAL, RGB( 200, 200, 200 ), rc, 
				"%i/%i", current->UndoCurrent(), current->UndoLevels() );
		}

	}
	else
	{
		if ( current->GetSelected() )
		{
			DrawExpressionFocusRect( helper, rcx, rcy, rcw, rch - m_nDescriptionHeight, RGB( 127, 127, 220 ) );
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:60,代码来源:mxexpressiontray.cpp

示例3: DrawMessageWindow

void DrawMessageWindow(char* message_line1, char* message_line2,
                       char* message_line3, char buttons)
{
  SetFont(SMALL_FONT);
  LcdSetColor(WHITE);
  LcdRect(5, 9, 123, 54);
  LcdSetColor(BLACK);
  
  LcdLine(6,   9,   122, 9);
  LcdLine(6,   55,  122, 55);
  LcdLine(4,   11,  4,   53);
  LcdLine(124, 11,  124, 53);
  
  LcdLine(5,   10,  5,   10);
  LcdLine(5,   54,  5,   54);
  LcdLine(123, 10,  123, 10);
  LcdLine(123, 54,  123, 54);
  
  LcdBmp(6, 26, BMP_EXLAMATION_WIDTH, BMP_EXLAMATION_HEIGHT, bmp_exlamation); 
  //LcdBmp(6, 26, BMP_KEY_INPUT_WIDTH, BMP_KEY_INPUT_HEIGHT, bmp_key_input); 
  
  LcdText(29, 12, 122, 18, message_line1);
  LcdText(29, 21, 122, 27, message_line2);
  LcdText(29, 30, 122, 36, message_line3);
  
  if(buttons & MB_OK)
    DrawButton(29, 40, BTN_OK, mw_focus == 0);
  if(buttons & MB_CANCEL)
    DrawButton(75, 40, BTN_CANCEL, mw_focus == 1);
};
开发者ID:arktur04,项目名称:gas_analyser_v1,代码行数:30,代码来源:message_window.c

示例4: DrawGhosted

static VOID DrawGhosted(struct TB_Element *tool, struct Toolbar_Data *data, Object *obj, BOOL selected)
{
  switch(data->GhostEffect)
  {
    case GHOST_LIGHT:
    case GHOST_HEAVY:
    {
      DrawButton(tool, data, obj, selected, !data->ToolImages);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[2];

        if(data->GhostEffect == GHOST_LIGHT)
        {
          ditherData[0] = 0x8888;
          ditherData[1] = 0x2222;
        }
        else
        {
          ditherData[0] = 0x5555;
          ditherData[1] = 0xAAAA;
        }

        SetAPen(rport, _pens(obj)[MPEN_SHADOW]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX, tool->DstY, tool->DstX+data->ButtonWidth-1, tool->DstY + data->ButtonHeight-1);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_SUPERLIGHT:
    {
      DrawButton(tool, data, obj, selected, THREE_D);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[] = {0x5555, 0xAAAA};
        SetAPen(rport, _pens(obj)[MPEN_HALFSHINE]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX+2, tool->DstY+2, tool->DstX+data->ButtonWidth-3, tool->DstY+1+data->InnerSpace+data->IconHeight);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_BITMAP:
//    case GHOST_DIMMED:
    {
      DrawButton(tool, data, obj, selected, THREE_D);
    }
    break;
  }
}
开发者ID:amiga-mui,项目名称:toolbar,代码行数:55,代码来源:Draw.c

示例5: pen

void ProfileMatchView::PaintButtons(const QVector<int> &demandIndex, const QVector<int> &supplyIndex) 
{
//	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	QPen pen(Qt::red, 3);
	QBrush brush(Qt::yellow);

	//run through all the buttons and highlight those selected.
	for (int i=0;i<dPButtonList.count();++i)
	{
		QRect Rect1 = QRect(dPButtonList[i]->x(), dPButtonList[i]->y(),
			dPButtonList[i]->width(),dPButtonList[i]->height());
		for (int q = 0; q < demandIndex.size(); q++)
		{
			if (i == demandIndex[q])
			{
				m_bDemandSelected = true;
				DrawButton(Rect1,brush);
				int nSupplies=0;
				//lines between demand & supply
				for (int j=0;j<sPButtonList.count();++j)
				{
					QRect Rect2 = QRect(sPButtonList[j]->x(), sPButtonList[j]->y(),
						sPButtonList[j]->width(),sPButtonList[j]->height());
					for (int q = 0; q < supplyIndex.size(); q++)
					{
						if (j == supplyIndex[q])
						{
							++nSupplies;
							DrawLine(Rect1,Rect2,pen);
						}
					}
				}
			}
		}
	}

// run through all the supply button and highlight those selected
	for (int i=0;i<sPButtonList.count();++i)
	{
		QRect Rect2 = QRect(sPButtonList[i]->x(), sPButtonList[i]->y(),
			sPButtonList[i]->width(),sPButtonList[i]->height());
		for (int q = 0; q < supplyIndex.size(); q++)
		{
			if (i == supplyIndex[q])
			{
				m_bSupplySelected = true;
				DrawButton(Rect2,brush);
			}
		}
	}

//	QApplication::restoreOverrideCursor(); 
}
开发者ID:shanipribadi,项目名称:merit,代码行数:53,代码来源:profilematchview.cpp

示例6: ASSERT_VALID

void COXTabViewContainer::DrawScrollButtons(CDC* pDC)
{
	ASSERT_VALID(pDC);

	// scroll to start button
	DrawButton(pDC,m_rectScrollToStartBtn,SCRLSTARTBTN);
	// scroll backward button
	DrawButton(pDC,m_rectScrollBackwardBtn,SCRLBACKWARDBTN);
	// scroll forward button
	DrawButton(pDC,m_rectScrollForwardBtn,SCRLFORWARDBTN);
	// scroll to end button
	DrawButton(pDC,m_rectScrollToEndBtn,SCRLENDBTN);
}
开发者ID:leonwang9999,项目名称:testcode,代码行数:13,代码来源:OXTabView.cpp

示例7: SH_BT_HVVP_Active

 void SH_BT_HVVP_Active()
  {
  SH_BT_HVVP1.Visible = 1;
  SH_BT_HVVP2.Visible = 1;
  SH_BT_HVVN2.Visible = 1;
  SH_BT_HVVN1.Visible = 1;
  SH_BT_HVCP1.Visible = 1;
  SH_BT_HVCP2.Visible = 1;
  SH_BT_HVCN2.Visible = 1;
  SH_BT_HVCN1.Visible = 1;
 DrawButton(&SH_BT_HVVP1);
 DrawButton(&SH_BT_HVVP2);
 DrawButton(&SH_BT_HVVN1);
 DrawButton(&SH_BT_HVVN2);
 DrawButton(&SH_BT_HVCP1);
 DrawButton(&SH_BT_HVCP2);
 DrawButton(&SH_BT_HVCN2);
 DrawButton(&SH_BT_HVCN1);
  SH_BT_HVVP1.Active = 1;
  SH_BT_HVVP2.Active = 1;
  SH_BT_HVVN2.Active = 1;
  SH_BT_HVVN1.Active = 1;
  SH_BT_HVCP1.Active = 1;
  SH_BT_HVCP2.Active = 1;
  SH_BT_HVCN2.Active = 1;
  SH_BT_HVCN1.Active = 1;
 }
开发者ID:whuang86cn,项目名称:uC_Dev,代码行数:27,代码来源:ES613_GUI2_SP_events_code.c

示例8: FakeKeyboardPress

static void FakeKeyboardPress(struct Control* control)
{
  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  DrawButton(control->posx+1, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, FALSE);

  delay(100);

  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, TRUE);
}
开发者ID:CivilPol,项目名称:sdcboot,代码行数:14,代码来源:cmdbtn.c

示例9: DrawButtons

/** Draw the buttons on the dialog window. */
void DrawButtons(void)
{

    ButtonNode button;
    int temp;

    Assert(dialog);

    dialog->buttonWidth = GetStringWidth(FONT_MENU, GetCancelString());
    temp = GetStringWidth(FONT_MENU, GetOKString());
    if(temp > dialog->buttonWidth) {
        dialog->buttonWidth = temp;
    }
    dialog->buttonWidth += 16;
    dialog->buttonHeight = dialog->lineHeight + 4;

    ResetButton(&button, dialog->pmap);
    button.border = 1;
    button.font = FONT_MENU;
    button.width = dialog->buttonWidth;
    button.height = dialog->buttonHeight;
    button.alignment = ALIGN_CENTER;

    dialog->okx = dialog->width / 3 - dialog->buttonWidth / 2;
    dialog->cancelx = 2 * dialog->width / 3 - dialog->buttonWidth / 2;
    dialog->buttony = dialog->height - dialog->lineHeight
                      - dialog->lineHeight / 2;

    if(dialog->buttonState == DBS_OK) {
        button.type = BUTTON_MENU_ACTIVE;
    } else {
        button.type = BUTTON_MENU;
    }
    button.text = GetOKString();
    button.x = dialog->okx;
    button.y = dialog->buttony;
    DrawButton(&button);

    if(dialog->buttonState == DBS_CANCEL) {
        button.type = BUTTON_MENU_ACTIVE;
    } else {
        button.type = BUTTON_MENU;
    }
    button.text = GetCancelString();
    button.x = dialog->cancelx;
    button.y = dialog->buttony;
    DrawButton(&button);

}
开发者ID:kuailexs,项目名称:jwm,代码行数:50,代码来源:confirm.c

示例10: FakeMousePress

static int FakeMousePress(struct Control* control)
{
  int i, wait=TRUE, x, y, status;

  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  ClearMouse();
  DrawButton(control->posx+1, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, FALSE);

  status = DOWN;
  
  while (wait)
        for (i = 0; i < GetNumSupportedButtons(); i++)
            if (MouseReleased(i))
               wait = FALSE;
            else
            {
               WhereMouse(&x, &y);

               if ((x < control->posx) || (x > control->posx+button->len) ||
                   (y < control->posy) || (y > control->posy))
               {
                  if (status == DOWN)
                  {
                     status = UP;
                     DrawButton(control->posx, control->posy, button->len,
                                control->forcolor, button->highcolor, button->caption,
                                TRUE, TRUE);
                  }
               }
               else if (status == UP)
               {
                  status = DOWN;

                  DrawButton(control->posx+1, control->posy, button->len,
                             control->forcolor, button->highcolor, button->caption,
                             TRUE, FALSE);
               }
            }

/*
  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, TRUE);
*/
  return status == DOWN;
}
开发者ID:CivilPol,项目名称:sdcboot,代码行数:49,代码来源:cmdbtn.c

示例11: Bounds

void SpinButton::Draw(BRect updateRect)
{
    BRect rect = Bounds();

    if (IsFocus()) {
        SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR));
        StrokeRect(rect);
    }
    else {
        DrawButton(rect, kSpinButtonNone);
    }

    DrawButton(ButtonFrame(kSpinButtonUp), kSpinButtonUp);
    DrawButton(ButtonFrame(kSpinButtonDown), kSpinButtonDown);
}
开发者ID:diversys,项目名称:sanity,代码行数:15,代码来源:SpinButton.cpp

示例12: DrawMissionScreen

// Mission Screen Draw logic
void DrawMissionScreen(void)
{
    // Draw MISSION screen here!
    DrawTexture(texBackground, 0,0, WHITE);
    DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine));

    if (writeNumber) DrawTextEx(fontMission, FormatText("Filtración #%02i ", currentMission + 1), numberPosition, missionSize + 10, 0, numberColor);
    DrawTextEx(fontMission, TextSubtext(missions[currentMission].brief, 0, missionLenght), missionPosition, missionSize, 0, missionColor);
    if (writeKeyword && blinkKeyWord) DrawTextEx(fontMission, FormatText("Keyword: %s", missions[currentMission].key), keywordPosition, missionSize + 10, 0, keywordColor);

    if (showButton)
    {
        if (!writeEnd) DrawButton("saltar");
        else DrawButton("codificar");
    }
}
开发者ID:raysan5,项目名称:raylib,代码行数:17,代码来源:screen_mission.c

示例13: dc

void CTranAnalysisToolBar::OnPaint()
{
    CPaintDC dc(this); // device context for painting

    DrawButton();
    UpdateView();
}
开发者ID:rgmabs19357,项目名称:esdk_ivs_sdk_windows,代码行数:7,代码来源:TranAnalysisToolBar.cpp

示例14: GetMenuStatus

ENDDISPATCH

/*	XGToolbarView::DoPeriodic
 *
 *		Handle periodic events
 */

long XGToolbarView::DoPeriodic(long,void *)
{
	long i,len;
	autoptr<XGDraw> draw;
	char c;
	
	/*
	 *	Scan all the commands and figure out their status
	 */
	
	len = fStatus.GetSize();
	for (i = 0; i < len; i++) {
		c = GetMenuStatus(GetItemCommand(i));
		if (c != fStatus.GetChar(i)) {
			if (NULL == draw.Ptr()) draw = new XGDraw(this);
			fStatus.SetChar(i,c);
			DrawButton(*draw,
					   CalcButton(i),
					   i,
					   c);
		}
	}
	return 0;
}
开发者ID:ElusiveMind,项目名称:ballistic,代码行数:31,代码来源:XGToolbarView.cpp

示例15: CalcButton

bool XGToolbarView::DoMouseDown(Point where, short)
{
	long i,len;
	XRect r;
	unsigned char c;
	
	XGToolTip::CloseTip();
	len = fStatus.GetSize();
	for (i = 0; i < len; i++) {
		r = CalcButton(i);
		if (PtInRect(where,&r)) {
			c = fStatus.GetChar(i);
			if (c & kSkip) return false;			
			if (0 == (c & kEnable)) return false;		// not enabled.
			fHitStatus = true;
			fHitWhat = i;
			fHitWhere = r;
			fHitMode = c;
			
			XGDraw draw(this);
			DrawButton(draw,r,fHitWhat,c | kDown);
			return true;
		}
	}
	return false;
}
开发者ID:ElusiveMind,项目名称:ballistic,代码行数:26,代码来源:XGToolbarView.cpp


注:本文中的DrawButton函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。