📄 cpw_menus.h
字号:
/***************************************************************************/
/* */
/* cpw_menus.h */
/* */
/* Window menus. */
/* */
/* Copyright 2001-2002 by */
/* Jim Mathies, */
/* */
/* This file is part of the Cpw project, and may only be used, */
/* modified, and distributed under the terms of the Cpw project */
/* license. By continuing to use, modify, or distribute this file */
/* you indicate that you have read the license and understand and */
/* accept it fully. */
/* */
/* File Platform: cross */
/* */
/***************************************************************************/
#ifndef __cpw_menus_h__
#define __cpw_menus_h__
#include "cpw_config.h"
#include "cpw_state.h"
#include "cpw_window.h"
CPW_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Prototypes> */
/* CpwMenuCallback */
/* */
/* <Description> */
/* Callback function prototype for menu selections. */
/* */
typedef void (*CpwMenuCallback) ( pCpw cpw, uint_32 winid, uint_32 menuid, uint_32 entryid );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwCreateMenu */
/* */
/* <Description> */
/* Creates a new top level menu and returns an identifier to it. */
/* The menu may be used as a popup or titlebar menu, or both and */
/* can be assigned to multiple windows. */
/* */
CPW_API uint_32
cpwCreateMenu( pCpw cpw,
CpwMenuCallback callback );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwCreateSubMenu */
/* */
/* <Description> */
/* Creates a new sub menu and returns an identifier for it. */
/* Sub menus are identical to menus except they do not have */
/* a callback associated with them. They are expected to be */
/* embedded within top level menus. The identifier is only */
/* for editing the menu or inserting it into a top level menu. */
/* */
CPW_API uint_32
cpwCreateSubMenu( pCpw cpw );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwDestroyMenu */
/* */
/* <Description> */
/* Destroys the resources associated with a menu or sub menu. */
/* (All menu resources are automatically destroyed when Cpw exits.) */
/* */
CPW_API bool
cpwDestroyMenu( pCpw cpw,
uint_32 menuid );
/* */
/*************************************************************************/
/* menu entry manipulation */
/*************************************************************************/
/* */
/* <Function> */
/* cpwAddMenuEntry */
/* */
/* <Description> */
/* Inserts a new entry into a menu. 'entryid' is the value */
/* handed back to the callback when a user selects the entry. */
/* Entries are added to a menu in a top down fashion. */
/* */
CPW_API bool
cpwAddMenuEntry( pCpw cpw,
uint_32 menuid,
pChar title,
uint_32 entryid,
bool checked );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwAddMenuSeperator */
/* */
/* <Description> */
/* Inserts a new seperator into a menu. 'entryid' is the value */
/* used when editing the menu. Seperators can not be 'selected' */
/* and therefore do not generate callbacks. */
/* */
CPW_API bool
cpwAddMenuSeperator( pCpw cpw,
uint_32 menuid,
uint_32 entryid );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwAddSubMenu */
/* */
/* <Description> */
/* Inserts a new sub menu entry into a menu. 'entryid' is the */
/* value used when editing the menu. Sub menu titles can not be */
/* 'selected' and therefore do not generate callbacks. */
/* */
CPW_API bool
cpwAddSubMenu( pCpw cpw,
uint_32 menuid,
pChar title,
uint_32 submenuid,
uint_32 entryid );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwEditMenuItem */
/* */
/* <Description> */
/* Changes the attributes of an existing menu entry. The call */
/* will override all previous settings. Editing menus is time */
/* consuming, and should not be carried out based on user */
/* actions. To create different menu's based on the current */
/* state of your application, create multiple menus and assigned */
/* them to a window at the appropriate time. */
/* */
CPW_API bool
cpwEditMenuItem( pCpw cpw,
uint_32 menu,
uint_32 entryid,
uint_32 newid,
pChar newtitle,
uint_32 newmenu );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwRemoveMenuItem */
/* */
/* <Description> */
/* Removes a menu entry from a menu. You can not insert a new */
/* entry to replace an entry you have removed. Editing menus */
/* are time consuming, and should not be carried out based on */
/* user actions. To create different menu's based on the current */
/* state of your application, create multiple menus and assigned */
/* them to a window at the appropriate time. */
/* */
CPW_API bool
cpwRemoveMenuItem( pCpw cpw,
uint_32 menu,
uint_32 entryid );
/* */
/*************************************************************************/
/* assigning menus to windows */
/*************************************************************************/
/* */
/* <Function> */
/* cpwAssignMenuToWindow */
/* */
/* <Description> */
/* Assigns a top level menu to a window's titlebar and displays */
/* it. Once a menu is assigned, menu selections will generate */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -