O Manual de Programação do KDevelop: O Guia do Utilizador para Desenvolvimento de Aplicações C++ para o Ambiente de Trabalho K (KDE) com o ambiente de trabalho KDevelop, Versão 2.1
Prev | Capítulo 8. Help Functions | Next

# 8.3. Extending the Statusbar Help

As the frame applications provided by KDevelop contain a statusbar as well, it also offers a set of statusbar messages already for all menu and toolbar items. A statusbar help message is a short message that extends the meaning of a tool-tip or can be seen as a replacement for a tool-tip over menubar items and is (as the name suggests) displayed in the statusbar when the user enters a menu and highlights the menu entry; therefore all menu items connect their signal `highlighted(int)` to the method `statusCallback(int)` which selects the according message in a switch statement. Whenever you add a menuitem to already existing menus or a toolbar item, add an according entry in this method with a short description of the action the user will cause when activating the button or menuentry.

Example:

         case ID_FILE_NEW:
      	  	slotStatusHelpMsg(i18n("Creates a new document"));
      	  	break;

This will display a statusbar message by calling the method `slotStatusHelpMsg()` with the according translated help string whenever the user highlights a menu or toolbar item with the id ID&_;FILE&_;NEW that is connected to the `statusCallback()` method. Toolbars connect to this method by their signal `pressed(int)`, which allows the user to press the toolbar button and move away the mouse when he doesn't want to invoke the command. `KToolBar` also offers the signal `highlighted(int, bool)` which can be used to display the message whenever the user highlights the button instead of the preset signal used.

Prev | Home | Next
Adding Quick-help | Up | The "What's This...?" Button