Ctrl_Help

 

The "Ctrl_Help()" function is called whenever the help key is activated while the cursor is over your interface window.

 

Syntax

 

extern "C" __declspec(dllexportint  Ctrl_Help(

          HWND wnd,

          int key,

          short x, short y

)

 

 

Parameters

 

wnd

A handle to the interface's window

 

key

is the key code of the activated key

 

x, y

Horizontal (x) and vertical (y) position of the cursor within the current window. (0,0 at bottom left)

 

 

Return value

 

The function returns "1" if the event has been used.

 

 

Remarks

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

Sample "Ctrl_Help" function  from the "Edit mode" module.

 

...

 

// ----------------------------------------------------------------------------

//

//          Function:          Ctrl_Help

//

//          Parameters:          wnd (HWND)          Pointer to Window's generating the signal

//                              key (int)          code of the activated key

//                              x, y (int)          current cursor position

//          Returns:          (int)                    1 if key is used

//

//          This is called each time the cursor is inside your menu and the "Help"

//          key has been pressed.

//

//          Note:          This fct use the "Fct_Help()" to call the help web page at the

//                    appropriate position.

//                    The first parameter is the name of the Web page for this module,

//                    this page must be present in the "HelpPages" directory.

//                    The second parameter is a bookmark inside this page (created

//                    with <a name=xxxx> ... </a> (where "xxxx" is the bookmark)

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) int          Ctrl_Help( HWND wnd, int key, short x, short y )

{

#define          HELP_PAGE          "mode_tag_edit"

 

          // ------------------------------------------------

          // ---              Brush Selection Tool                    ---

          // ------------------------------------------------

          if ( box_brush.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "brush" ) ;

              return( 1 ) ;

          }

          // ------------------------------------------------

 

          // ------------------------------------------------

          // ---              TAG Selection Tool                              ---

          // ------------------------------------------------

          if ( box_tag.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "tag" ) ;

              return( 1 ) ;

          }

          // ------------------------------------------------

 

 

          // --- morpho commands ---

          if ( but_erose.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

          if ( but_dilat.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

          if ( but_open1.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

          if ( but_open2.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

          if ( but_close1.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

          if ( but_close2.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "morpho" ) ;

              return( 1 ) ;

          }

 

          // -- save the tag_work image to the erase buffer ---

          if ( but_load.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "load" ) ;

              return( 1 ) ;

          }

 

          // --- last undo ---

          if ( but_undo.Select( KEY_QUERY ) ) {

              Fct_Help( HELP_PAGE, "undo" ) ;

              return( 1 ) ;

          }

 

          Fct_Help( HELP_PAGE, NULL ) ;

          return( 1 ) ;

}

 

...

 

See also