packages icon



 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




 NAME
      XmAxyNotebook - The Notebook widget class

 SYNOPSIS
      #include <XmAxy/Notebook.h>

 DESCRIPTION
      Notebook is a manager widget that organizes its children into pages so
      and makes only one  of  them  visible  at  a time.  For  navigation
      between pages it shows the tabs at the top. Application designer can
      also control currently visible page  programatically.  Gadget children
      are fully supported.

      The widget completely ingnores unmanaged children, i.e. even tab with
      a label will not appear for the child that is not managed. For the
      effect of empty page, use some kind of a container as a direct child
      of the Notebook and add your widget as a child to that container. In
      this setup you can manage and unmanage your widget with corresponfing
      tab always present.  You can even use Notebook itself as such
      container. In fact, it can be used as a general-purpose CardLayout
      container widget - the one that shows only one card (child) at a time.
      For full effect, set XmNshowTabs to FALSE, XmNmarginWidth,
      XmNmarginHeight, XmNinnerMarginHeight, XmNinnerMarginWidth, and
      XmNshadowThickness to zero.

      Notebook resizes all of its managed children to the same size.  Child
      can request a size change which Notebook will try to accomodate.  To
      prevent this behavior, set child's constraint resource XmNresizable to
      FALSE.

      Notebook creates one additional child - XmDrawingArea which is used to
      draw tabs and for keyboard operations. The name of the child is "Tabs"
      and one can get the Widget ID ot it by using XtNameToWidget() call.
      Notebook overrides some translations of the DrawingArea Widget.


    Page Numbers
      Notebook internally assigns page numbers to its children starting from
      1.  This process cannot be controlled by the application. Unmanaged
      children are not asigned a number. One can use
      XmAxyNotebookGetNumberOfPages() to get the total number of pages and
      XmAxyNotebookGetCurrentPage() for the number of currently visible
      page.


    Classes
      Notebook inherits behavior and resources from Core, Composite,
      Constraint, and XmManager classes.

      The class pointer is xmAxyNotebookWidgetClass.




                                    - 1 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      The class name is XmAxyNotebook.

    New Resources
      The following table defines a set of widget resources used by the
      programmer to specify data. The programmer can also set the resource
      values for the inherited classes to set attributes for this widget.
      The codes in the access column indicate if the given resource can be
      set at creation time (C), set by using XtSetValues (S), retrieved by
      using XtGetValues (G), or is not applicable (N/A).

      tab() box; c s s s s l| l| l| l| l.  XmAxyNotebook Resource Set
      NameClassTypeDefaultAccess _____
      XmNfontListXmCFontListXmFontListdynamicCSG _____
      XmNhighlightThicknessXmCHighlightThicknessDimension1CSG _____
      XmNinnerMarginHeightXmCInnerMarginHeightDimension4CSG _____
      XmNinnerMarginWidthXmCInnerMarginWidthDimension4CSG _____
      XmNlabelMarginHeightXmCLabelMarginHeightDimension2CSG _____
      XmNlabelMarginWidthXmCLabelMarginWidthDimension2CSG _____
      XmNmarginHeightXmCMarginHeightDimension6CSG _____
      XmNmarginWidthXmCMarginWidthDimension6CSG _____
      XmNpageChangedCallbackXmCPageChangedCallbackXtCallbackListNULLCSG
      _____ XmNselectColorXmCSelectColorPixeldynamicCSG _____
      XmNshowTabsXmCShowTabsBooleanTRUECSG _____
      XmNtabMarginHeightXmCTabMarginHeightDimension2CSG _____
      XmNtabMarginWidthXmCTabMarginWidthDimension2CSG _____
      XmNtabRaiseXmCTabRaiseDimension2CSG _____
      XmNtabSpacingXmCTabSpacingDimension0CSG

      XmNfontList
                Specifies the font list for tab labels.

      XmNhighlightThickness
                Specifies thickness of highlight drawn around the tab label.

      XmNinnerMarginHeight
                Specifies the hight of the margin between a child widget and
                top/bottom shadow.

      XmNinnerMarginWidth
                Specifies the width of the margin between a child widget and
                left/right shadow.

      XmNlabelMarginHeight
                Specifies the margin height between the text of the tab
                label and highlight.

      XmNlabelMarginWidth
                Specifies the margin width between the text of the tab label
                and highlight.





                                    - 2 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      XmNmarginHeight
                Specifies the height of the margin between the edges of the
                Notebook and shadows.

      XmNmarginWidth
                Specifies the width of the margin between the edges of the
                Notebook and shadows.

      XmNpageChangedCallback
                Specifies the list of callbacks to call whenever the
                Noteabook changes the currently displayed page.  The
                callback structure is XmAxyNotebookCallbackStruct.  The
                reason is XmAxyNotebookPageChangedReason.

      XmNselectColor
                Specifies the background color for the not current tabs.
                Affected by XmChangeColor() routine.

      XmNshowTabs
                Specifies whether tabs should be displayed.

      XmNtabMarginHeight
                Specifies the height of the margin between the edges of the
                tab and the highlight.

      XmNtabMarginWidth
                Specifies the width of the margin between the edges of the
                tab and the highlight.

      XmNtabRaise
                Specifies the distance tab would raize when selected.

      XmNtabSpacing
                Specifies the spacing between tabs.


      tab() box; c s s s s l| l| l| l| l.  XmAxyNotebook Constraint Resource
      Set NameClassTypeDefaultAccess _____
      XmNtabLabelXmCTabLabelXmStringdynamicCSG _____
      XmNresizableXmCResizableBooleanTrueCSG

      XmNtabLabel
                Specifies tab label for this child's page.  Defaults to the
                child widget name.

      XmNresizable
                Specifies whether this child can request a resize.

    Inherited Resources
      Notebook inherits behavior and resources from the superclasses
      described in the following tables.  For a complete description of each



                                    - 3 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      resource, refer to the reference page for that superclass.  tab() box;
      c s s s s l| l| l| l| l.  XmManager Resource Set
      NameClassTypeDefaultAccess _____
      XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____
      XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
      _____ XmNforegroundXmCForegroundPixeldynamicCSG _____
      XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____
      XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____
      XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____
      XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____
      XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____
      XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____
      XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____
      XmNshadowThicknessXmCShadowThicknessDimension0CSG _____
      XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____
      XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____
      XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____
      XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____
      XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____
      XmNuserDataXmCUserDataXtPointerNULLCSG _____

      tab() box; c s s s s l| l| l| l| l.  Composite Resource Set
      NameClassTypeDefaultAccess _____ XmNchildrenXmCReadOnlyWidgetListNULLG
      _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____
      XmNnumChildrenXmCReadOnlyCardinal0G _____

      tab() box; c s s s s l| l| l| l| l.  Core Resource Set
      NameClassTypeDefaultAccess _____
      XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____
      XmNancestorSensitiveXmCSensitiveBooleandynamicG _____
      XmNbackgroundXmCBackgroundPixeldynamicCSG _____
      XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____
      XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____
      XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____
      XmNborderWidthXmCBorderWidthDimension0CSG _____
      XmNcolormapXmCColormapColormapdynamicCG _____
      XmNdepthXmCDepthintdynamicCG _____
      XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____
      XmNheightXmCHeightDimensiondynamicCSG _____
      XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC
      _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____
      XmNscreenXmCScreenScreen *dynamicCG _____
      XmNsensitiveXmCSensitiveBooleanTrueCSG _____
      XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____
      XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG
      _____ XmNyXmCPositionPosition0CSG _____

    Callback
      A pointer to the following structure is passed to callbacks for
      XmNpageChangedCallback.




                                    - 4 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      typedef struct {
              int reason;
              XEvent *event;
              int     page_number;
              Widget  page_widget;
              XmString tab_label;
              int     prev_page_number;
              Widget  prev_page_widget;
              XmString prev_tab_label;
      } XmAxyNotebookCallbackStruct;

      reason    Specifies the reason for the callback. Always set to
                XmAxyNotebookPageChangedReason.

      event     Points to the XEvent that triggered the callback. It can be
                NULL.

      page_number
                Indicates the page number to be displayed.

      page_widget
                Indicates the page widget that has the new page number.

      tab_label Indicates tab label for the new page.

      prev_page_number
                Indicates the page number of the currently displayed page.

      prev_page_widget
                Indicates the currently displayed page widget.

      prev_tab_label
                Indicates tab label for the currently displayed page.

    Translations
      Notebook inherits translations from Manager.  It also overrides the
      following translations for the XmDrawingArea child:

      <FocusIn>:
                XmAxyNotebookDAFocusIn()

      <FocusOut>:
                XmAxyNotebookDAFocusOut()

      <Btn1Down>:
                XmAxyNotebookDAMouseDown()

      <Btn1Down>(2+):
                XmAxyNotebookDAMouseDown()





                                    - 5 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      :<Key>osfRight:
                XmAxyNotebookDAMoveRight()

      :<Key>osfLeft:
                XmAxyNotebookDAMoveLeft()

      :<Key>osfDown:
                XmAxyNotebookDAMoveRight()

      :<Key>osfUp:
                XmAxyNotebookDAMoveLeft()

      <Key>Return:
                XmAxyNotebookDASelect()

      <Key>space:
                XmAxyNotebookDASelect()


    Action Routines
      Action routines defined by Notebook are described below.  Please note
      that they are invoked on the "Tabs" DrawingArea child and XEvents are
      assumed to be relative to this child's window!


      XmAxyNotebookDAFocusIn()
                Highlights the current tab label.

      XmAxyNotebookDAFocusOut()
                Unighlights any currently highlighted tab label.

      XmAxyNotebookDAMouseDown()
                If coordinates of the MouseEvent are within one of the shown
                but not current tabs, makes this tab current and highlights
                it.

      XmAxyNotebookDAMoveLeft()
                Moves highlight to the next tab to the left of the currently
                highligted.  If the very first one was highlighted, moves
                highlight to the last tab.

      XmAxyNotebookDAMoveRight()
                Moves highlight to the next tab to the right of the
                currently highligted.  If the very last one was highlighted,
                moves highlight to the first tab.

      XmAxyNotebookDASelect()
                Makes currently highlighted tab current.






                                    - 6 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




    Additional Behavior
      The Notebook widget has the additional behavior described below: When
      Notebook accepts a focus, it draws a highlight around the label in the
      tab corresponding to the visible child. One can then use <Tab> to move
      focus to the child itself or use <osfLeft>,<osfRight>,<osfUp>, and
      <osfDown> to move the highlight to other (not current) tabs. To make
      highlighted tab current, use <Return> or <space>.  If Notebook is
      resized so that there is not enough space for all the tabs, only those
      tabs that can be drawn fully inside an allocated space are shown.  You
      can still traverse to the "invisible" pages by using keyboard
      navigation described above. Highlight is not visible for the tabs that
      are not shown, but the page can still be activated with <Return> or
      <space>.


 METHODS
      Notebook defines the following methods:

      Widget XmAxyCreateNotebook(
      Widget parent,
      String name,
      ArgList arglist,
      Cardinal argcount)

      Creates an instance of a Notebook and returns the associated Widget
      ID.

      parent    Specifies the parent widget ID

      name      Specifies the name of the created widget

      arglist   Specifies the argument list

      argcount  Specifies the number of attribute/value pairs in the
                argument list (arglist)


      int XmAxyGetCurrentPage(
      Widget notebook)

      Returns the current page number.

      notebook  Specifies the Notebook widget ID


      Widget XmAxyGetCurrentWidget(
      Widget notebook)

      Returns the widget ID of the currently visible (current) child.





                                    - 7 -         Formatted:  March 28, 2024






 XmAxyNotebook(3X)                                         XmAxyNotebook(3X)




      notebook  Specifies the Notebook widget ID


      int XmAxyGetNumberOfPages(
      Widget notebook)

      Returns the total number of pages in the Notebook.

      notebook  Specifies the Notebook widget ID


      void XmAxySetCurrentPage(
      Widget notebook,
      int page)

      Sets the current page in accordance to the argument specified. If out
      of range (less then 1 or greater then the total number of pages), the
      methos does nothing.

      notebook  Specifies the Notebook widget ID

      page      Specifies the page to make current.


      void XmAxySetCurrentWidget(
      Widget notebook,
      int child)

      Sets the current page in accordance to the argument specified. If
      child specified is not a managed child of the Notebook in question or
      the DrawingArea "Tabs" child created by Notebook itself, methos just
      returns.

      notebook  Specifies the Notebook widget ID

      child     Specifies the child to make current.


 RELATED
      Composite(3), Constraint(3), Core(3), and XmManager(3).


 AUTHOR
      Alexander Yukhimets (alexy@edgarmail.com)










                                    - 8 -         Formatted:  March 28, 2024