我的 C++ 学习历程 之三 Button Sytle 译文(3)

按钮样式

【原创译文】By 菜头
Button Styles
  • BS_3STATE 与复选框一样本样式按钮可被单击变暗。变暗状态通常用于指示本样式的按键正处于禁用状态。

  • BS_AUTO3STATE   与三状态的复选框一样当用户选中它本按钮样式状态外观会改变。

  • BS_AUTOCHECKBOX   与复选框一样,除了在用户点控件后会出现一个选中标志,当用户在下一次点选时,该标志会消失。

  • BS_AUTORADIOBUTTON  与单先框一样,不同的是,用户点选它时会高亮显示,同时,会把同一组的其它同样的按钮的高亮状态转移到自己身上。

  • BS_BITMAP  指定按钮以一张位图显示。

  • BS_BOTTOM 把按钮标题放置到按钮矩形区域的底部。

  • BS_CENTER  按钮标题在按钮的矩形区域中央显示。

  • BS_CHECKBOX    在按钮的右边创建一个小方块(此样式必须与BS_LEFTTEXT结合使用。)

  • BS_DEFPUSHBUTTON   创建一个通用的默认按钮该按钮有一个厚重的黑色边框。用户可以通过按回车键来点选本按钮,该按钮可以实现用户通常要使用的功能(即默认执行动作功能)。

  • BS_FLAT  指定按钮为2D按钮,不采用3D控件所使用的阴影。

  • BS_GROUPBOX   创建一个分组框来给控件分组,如果使用了标题,则标题会出现在分组框的左上角位置。 

  • BS_ICON  指定按钮上显示一个图标。 

  • BS_LEFT  在控件的矩形区域内左对齐标题。如果按钮是一个没有BS_RIGHTBUTTON 样式的复选框或单选框 ,那么文本居将在复选框或单选框的右边居左对齐(这话有些多余,意思文本在复选框或单选框的那个可选被小方框或圆圈的右边。)。

  • BS_LEFTTEXT  当按钮是单选或是复选框时,标题文本将出现在单选或复选框的客户区(即复选框的矩形框,单选框的圆形框)的左边。 

  • BS_MULTILINE   如果标题文本太长,将在绘制区域内对文本进行折行处理。

  • BS_NOTIFY  激活按钮,使之可对父窗口发送BN_DBLCLK, BN_KILLFOCUS,  BN_SETFOCUS 消息,注意:不管有没有使用本样式,按钮都有一个 BN_CLICKED 可发送消息。

  • BS_OWNERDRAW   创建一个自绘风格的按钮。当按钮的外观发生改变时,框架会调用DrawItem成员函数。本样式在使用CBitmapButton类时必须设置。

  • BS_PUSHBUTTON   创建一个按钮(即最常见的按钮),该按钮在点击时,将向父窗口发送一个WM_COMMAND 消息。

  • BS_PUSHLIKE  把(多选框,三态多选框,单选框)以按钮的形式显示,该按钮在未选种状态时是浮起的,但在选中状态时是陷入状态的。 

  • BS_RADIOBUTTON  创建单选框,该按钮有一个圆形的客户区,(在本样式不与BS_LEFTTEXT   样式结合使用的情况下)标题文本在其右方。单选框通常用于有相关联的多个可选项里面,但相互之间只有作一个选择的情况下。 

  • BS_RIGHT  在按钮的绘制区域内右对齐文本。但如果按钮是一个没有BS_RIGHTBUTTON样式的单选或复选框,标题文本将在单选或复选框可点选区的右边居右对齐。 

  • BS_RIGHTBUTTON  设定单选框的圆形可选区或复选框的方开形复选区出现在按钮的矩形区域的右边。BS_LEFTTEXT 的效果一样。 

  • BS_TEXT   指定按钮将显示文本标题。

  • BS_TOP  将标题文本显示在按钮的绘制区域的顶边。

  • BS_USERBUTTON  已废弃不用,只作为兼容16位系统版本的Windows,基于32位windows系统的请用BS_OWNERDRAW样式取代。 

  • BS_VCENTER  设定按钮的标题在绘制区域的垂直方向居中。  

 

原文:

 

MFC Library Reference
Button Styles

 

  • BS_3STATE   Same as a check box, except that the box can be dimmed as well as checked. The dimmed state typically is used to show that a check box has been disabled.

  • BS_AUTO3STATE   Same as a three-state check box, except that the box changes its state when the user selects it.

  • BS_AUTOCHECKBOX   Same as a check box, except that a check mark appears in the check box when the user selects the box; the check mark disappears the next time the user selects the box.

  • BS_AUTORADIOBUTTON   Same as a radio button, except that when the user selects it, the button automatically highlights itself and removes the selection from any other radio buttons with the same style in the same group.

  • BS_BITMAP   Specifies that the button displays a bitmap.

  • BS_BOTTOM   Places text at the bottom of the button rectangle.

  • BS_CENTER   Centers text horizontally in the button rectangle.

  • BS_CHECKBOX   Creates a small square that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style).

  • BS_DEFPUSHBUTTON   Creates a button that has a heavy black border. The user can select this button by pressing the ENTER key. This style enables the user to quickly select the most likely option (the default option).

  • BS_FLAT   Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image.

  • BS_GROUPBOX   Creates a rectangle in which other buttons can be grouped. Any text associated with this style is displayed in the rectangle's upper-left corner.

  • BS_ICON   Specifies that the button displays an icon.

  • BS_LEFT   Left aligns the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is left aligned on the right side of the check box or radio button.

  • BS_LEFTTEXT   When combined with a radio-button or check-box style, the text appears on the left side of the radio button or check box.

  • BS_MULTILINE   Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.

  • BS_NOTIFY   Enables a button to send BN_DBLCLK, BN_KILLFOCUS, and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style.

  • BS_OWNERDRAW   Creates an owner-drawn button. The framework calls the DrawItem member function when a visual aspect of the button has changed. This style must be set when using the CBitmapButton class.

  • BS_PUSHBUTTON   Creates a pushbutton that posts a WM_COMMAND message to the owner window when the user selects the button.

  • BS_PUSHLIKE   Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.

  • BS_RADIOBUTTON   Creates a small circle that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style). Radio buttons are usually used in groups of related, but mutually exclusive, choices.

  • BS_RIGHT   Right aligns the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is right aligned on the right side of the check box or radio button.

  • BS_RIGHTBUTTON   Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.

  • BS_TEXT   Specifies that the button displays text.

  • BS_TOP   Places text at the top of the button rectangle.

  • BS_USERBUTTON   Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead.

  • BS_VCENTER   Places text in the middle (vertically) of the button rectangle.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值