From 31005da9b8ffea2f01dc839bc77b0271e833414f Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 20 Oct 2013 15:50:55 -0400 Subject: [PATCH] Update BWindow shortcut docs --- docs/user/interface/Window.dox | 187 ++++++++++++++++++++++++++++++--- 1 file changed, 173 insertions(+), 14 deletions(-) diff --git a/docs/user/interface/Window.dox b/docs/user/interface/Window.dox index cf0125fc64..a9f9890c28 100644 --- a/docs/user/interface/Window.dox +++ b/docs/user/interface/Window.dox @@ -399,6 +399,111 @@ from the screen without interrupting the message loop by calling Hide(). Other message loop details such as locking and quitting are detailed in the BLooper class. + + BWindow has the following built-in shortcuts: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ShortcutActionHandler
\key{Command}+\key{X}CutFocus view
\key{Command}+\key{C}CopyFocus view
\key{Command}+\key{V}PasteFocus view
\key{Command}+\key{A}Select AllFocus view
\key{Command}+\key{W}CloseWindow (if closable)
\key{Command}+\key{Q}QuitApplication (non-modal windows only)
\key{Command}+\key{Control}+\key{M}MinimizeWindow (if minimizable)
\key{Command}+\key{Control}+\key{Z}ZoomWindow (if zoomable)
\key{Command}+\key{Control}+\key{H}HideWindow
\key{Command}+\key{Control}+\key{F}Send to frontWindow
\key{Command}+\key{Control}+\key{B}Send behindWindow
\key{Command}+\key{Control}+\key{←}Go to left workspaceDesktop window
\key{Command}+\key{Control}+\key{→}Go to right workspaceDesktop window
\key{Command}+\key{Control}+\key{↑}Go to above workspaceDesktop window
\key{Command}+\key{Control}+\key{↓}Go to below workspaceDesktop window
\key{Command}+\key{Control}+\key{Shift}+\key{←}Send window and go to left workspaceDesktop window
\key{Command}+\key{Control}+\key{Shift}+\key{→}Send window and go to right workspaceDesktop window
\key{Command}+\key{Control}+\key{Shift}+\key{↑}Send window and go to above workspaceDesktop window
\key{Command}+\key{Control}+\key{Shift}+\key{↓}Send window and go to below workspaceDesktop window
*/ @@ -973,14 +1078,32 @@ */ +/*! + \name Shortcut methods + + The key parameter is specified in the form of a Unicode code point. This + is generally an ASCII character such as 'A' or a key constant such as + \c B_RIGHT_ARROW. To use a UTF-8 character you must first convert it to a + Unicode code point using BUnicodeChar::FromUTF8(). +*/ + + +//! @{ + + /*! \fn void BWindow::AddShortcut(uint32 key, uint32 modifiers, BMenuItem* item) - \brief Creates a keyboard shortcut that activates \a item. + \brief Creates a keyboard shortcut that activates a menu \a item. \note This method was not available in BeOS R5. - \param key The modifier key to set. - \param modifiers Additional modifiers on top of \a B_COMMAND_KEY. + \param key The character that activates the shortcut, case-insensitive. + \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, + options include: + - \c B_SHIFT_KEY + - \c B_OPTION_KEY + - \c B_CONTROL_KEY + - \c B_MENU_KEY \param item The menu \a item to activate. */ @@ -989,9 +1112,18 @@ \fn void BWindow::AddShortcut(uint32 key, uint32 modifiers, BMessage* message) \brief Creates a keyboard shortcut that sends a \a message to the window. - \param key The modifier key to set. - \param modifiers Additional modifiers on top of \a B_COMMAND_KEY. - \param message The \a message to send when the shortcut is activated. + \warning Don't use this method to a create menu shortcut, add a BMenuItem + instead. + + \param key The character that activates the shortcut, case-insensitive. + \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, + options include: + - \c B_SHIFT_KEY + - \c B_OPTION_KEY + - \c B_CONTROL_KEY + - \c B_MENU_KEY + \param message The \a message to send when the shortcut is activated. The + BWindow takes ownership of the \a message. */ @@ -1001,9 +1133,18 @@ \brief Creates a keyboard shortcut that sends a \a message to the specified \a target. - \param key The modifier key to set. - \param modifiers Additional modifiers on top of \a B_COMMAND_KEY. - \param message The \a message to send when the shortcut is activated. + \warning Don't use this method to a create menu shortcut, add a BMenuItem + instead. + + \param key The character that activates the shortcut, case-insensitive. + \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, + options include one or more of the following: + - \c B_SHIFT_KEY + - \c B_OPTION_KEY + - \c B_CONTROL_KEY + - \c B_MENU_KEY + \param message The \a message to send when the shortcut is activated. The + BWindow takes ownership of the \a message. \param target The handler to send the message to. */ @@ -1012,10 +1153,18 @@ \fn bool BWindow::HasShortcut(uint32 key, uint32 modifiers) \brief Returns whether or not the specified shortcut is set on the window. - \param key The modifier key to check. - \param modifiers Additional modifiers on top of \a B_COMMAND_KEY to check. + \note This method was not available in BeOS R5. - \returns \c true if the window has the specified shortcut, \c false otherwise. + \param key The character to check, case-insensitive. + \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, + options include one or more of the following: + - \c B_SHIFT_KEY + - \c B_OPTION_KEY + - \c B_CONTROL_KEY + - \c B_MENU_KEY + + \returns \c true if the window has the specified shortcut, \c false + otherwise. */ @@ -1023,11 +1172,21 @@ \fn void BWindow::RemoveShortcut(uint32 key, uint32 modifiers) \brief Removes the specified shortcut from the window. - \param key The modifier key. - \param modifiers Additional modifiers on top of \a B_COMMAND_KEY. + The memory used by the shortcut message is freed. + + \param key The character to remove, case-insensitive. + \param modifiers A bit mask of modifiers in addition to \c B_COMMAND_KEY, + options include one or more of the following: + - \c B_SHIFT_KEY + - \c B_OPTION_KEY + - \c B_CONTROL_KEY + - \c B_MENU_KEY */ +//! @} + + /*! \fn BButton* BWindow::DefaultButton() const \brief Returns a pointer to the default button set on the window.