Standard Windows Identifiers In wxWidgets

本文介绍了wxWidgets中预定义的标准窗口标识符及其用途。这些标识符有助于实现跨平台一致性和默认行为,如文件操作、编辑操作等。此外,文章还提到了一些特定于操作系统的标识符。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

wxWidgets supplies the standard identifiers listed in Table 3-1. Use the standard identifiers wherever possible: some systems can use the information to provide standard graphics (such as the OK and Cancel buttons on GTK+) or default behavior (such as responding to the Escape key by emulating a wxID_CANCEL event). On Mac OS X, wxID_ABOUT, wxID_PREFERENCES and wxID_EXIT menu items are interpreted specially and transferred to the application menu. Some wxWidgets components, such as wxTextCtrl, know how to handle menu items or buttons with identifiers such as wxID_COPY, wxID_PASTE, wxID_UNDO.

Table 3-1. Standard Window Identifiers

Identifier Name

Description

wxID_ANY

This may be passed to a window constructor as an identifier, and wxWidgets will generate an appropriate identifier

wxID_LOWEST

The lowest standard identifier value (4999)

wxID_HIGHEST

The highest standard identifier value (5999)

wxID_OPEN

File open

wxID_CLOSE

Window close

wxID_NEW

New window, file or document

wxID_SAVE

File save

wxID_SAVEAS

File save as (prompts for a save dialog)

wxID_REVERT

Revert (revert to file on disk)

wxID_EXIT

Exit application

wxID_UNDO

Undo the last operation

wxID_REDO

Redo the last undo

wxID_HELP

General help (for example, for dialog Help buttons)

wxID_PRINT

Print

wxID_PRINT_SETUP

Print setup dialog

wxID_PREVIEW

Print preview

wxID_ABOUT

Show a dialog describing the application

wxID_HELP_CONTENTS

Show the help contents

wxID_HELP_COMMANDS

Show the application commands

wxID_HELP_PROCEDURES

Show the application procedures

wxID_HELP_CONTEXT

Unused

wxID_CUT

Cut

wxID_COPY

Copy

wxID_PASTE

Paste

wxID_CLEAR

Clear

wxID_FIND

Find

wxID_DUPLICATE

Duplicate

wxID_SELECTALL

Select all

wxID_DELETE

Delete (cut without copying)

wxID_REPLACE

Replace

wxID_REPLACE_ALL

Replace all

wxID_PROPERTIES

Show properties for the selection

wxID_VIEW_DETAILS

View details in a list control

wxID_VIEW_LARGEICONS

View as large icons in a list control

wxID_VIEW_SMALLICONS

View as small icons in a list control

wxID_VIEW_LIST

View as a list in a list control

wxID_VIEW_SORTDATE

Sort by date

wxID_VIEW_SORTNAME

Sort by name

wxID_VIEW_SORTSIZE

Sort by size

wxID_VIEW_SORTTYPE

Sort by type

wxID_FILE1 to wxID_FILE9

View recent file

wxID_OK

Confirms dialog selections

wxID_CANCEL

Vetoes dialog selections

wxID_APPLY

Applies selections to data

wxID_YES

Identifier for a Yes button

wxID_NO

Identifier for a No button

wxID_STATIC

Identifier for static text or bitmap control

wxID_FORWARD

Navigate forward

wxID_BACKWARD

Navigate backward

wxID_DEFAULT

Restore default settings

wxID_MORE

View more settings

wxID_SETUP

View a setup dialog

wxID_RESET

Reset settings

wxID_CONTEXT_HELP

Show context-sensitive help

wxID_YESTOALL

Reply yes to all prompts

wxID_NOTOALL

Reply no to all prompts

wxID_ABORT

Abort the current operation

wxID_RETRY

Retry the operation

wxID_IGNORE

Ignore an error condition

wxID_UP

Navigate up

wxID_DOWN

Navigate down

wxID_HOME

Navigate home

wxID_REFRESH

Refresh

wxID_STOP

Stop the current operation

wxID_INDEX

Show an index

wxID_BOLD

Highlight in bold

wxID_ITALIC

Highlight in italic

wxID_JUSTIFY_CENTER

Center

wxID_JUSTIFY_FILL

Format

wxID_JUSTIFY_RIGHT

Right align

wxID_JUSTIFY_LEFT

Left align

wxID_UNDERLINE

Underline

wxID_INDENT

Indent

wxID_UNINDENT

Unindent

wxID_ZOOM_100

Zoom to 100%

wxID_ZOOM_FIT

Fit to page

wxID_ZOOM_IN

Zoom in

wxID_ZOOM_OUT

Zoom out

wxID_UNDELETE

Undelete

wxID_REVERT_TO_SAVED

Revert to saved state

 

You can use wxID_HIGHEST to determine the number above which it is safe to define your own identifiers, or you can use identifiers below wxID_LOWEST.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值