Tabs::Read

 

This method return the index of the tab at the current position of the cursor.

 

 

Syntax

 

int  Read(

          void 

) ;

 

 

Parameters

 

This method does not have a parameter.

 

 

Return value

 

return the index of the tab at the current position of the cursor.

 

 

Remarks

 

The value of "Cur_Value" variable is not updated automatically, you need to call "Read" and assign the returned value to the "Cur_Value" variable and then call "Adjust" for the graphic to reflect the new value.

 

 

Requirements

 

Header:

          TomoVision_Util.hpp

          TomoVision_Tools.hpp

 

Library:

          TomoVision_Util.lib

          TomoVision_Tools.lib

 

 

Example

 

static          Tabs          tab ;

 

static          short          Page_Pos_X ;

static          short          Page_Pos_Y ;

static          short          Page_Dim_X ;

static          short          Page_Dim_Y ;

 

extern "C" __declspec(dllexport) int          Ctrl_Click( HWND wnd, int up_down, short x, short y )

{

 

          // --- We only want the key press, not the key release ---

          if ( ! up_down ) {

              return( 0 ) ;

          }

 

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

          // We received a mouse click, now we try to find in

          // which tool the click was.  For this we use the

          // "select" method.

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

          if ( tab.Select( up_down ) ) {

 

              // --- did we click on a new tab ? ---

              int i = tab.Read() ;

              if ( i >= 0 ) {

 

                    // --- change the current tab ---

                    tab.Cur_Value = i ;

                    tab.Adjust() ;

 

                    // --- clear the page with the current color ---

                    tab.Page() ;

 

                    // --- resize the content of this tab page ---

                    (*(Func_Resize[tab.Cur_Value]))( wnd,

                                                       Page_Pos_X, Page_Pos_Y, Page_Dim_X, Page_Dim_Y,

                                                       tab.Item[tab.Cur_Value]->color ) ;

                    (*(Func_Init[tab.Cur_Value]))() ;

              }

              return( 1 ) ;

          }

          return( 0 ) ;

}

 

See also