Click here to Skip to main content
15,867,308 members
Articles / Desktop Programming / X11

Programming the Roma Widget Set (C# X11) - a zero dependency GUI application framework - Composite widgets

Rate me:
Please Sign up or sign in to vote.
5.00/5 (10 votes)
9 Mar 2015CPOL63 min read 30.3K   11   4
How to develop Linux/Unix (X11) GUI applications in C# efficiently without dependencies to GUI frameworks like GTK or KDE. Description of composite widgets.

Introduction

This article contains the description of composite widgets of the Roma Widget Set (Xrw) only. It has been created because the whole topic grows beyond 50 pages, and i decided to split it into three parts with Image 1 and into four parts with Image 2.

All features, described later on, can be marked as:

  • Image 7 available from version 0.1,
  • Image 8 disabled with version 0.2,
  • Image 9 available from version 0.2,
  • Image 10 disabled with version 0.3,
  • Image 11 available from version 0.3,
  • Image 12 disabled with version 0.4,
  • Image 13 available from version 0.4,
  • Image 14 disabled with version 0.5,
  • Image 15 available from version 0.5,
  • Image 16 disabled with version 0.6,
  • Image 17 available from version 0.6,
  • Image 18 disabled with version 0.7,
  • Image 19 available from version 0.7,
  • Image 20 disabled with version 0.8 and
  • Image 21 available from version 0.8.

Widget set

The widget names and functionality follow the ideas of the "Athena widget set" with a little influence of the "Motif widget set" and GTK. The widget set is not complete, but continuously growing. Starting with version Image 22 the widget set contains advanced widgets influenced by modern GUI toolkits. The widget hierarchy looks as follows:

Intrinsic widgets

The simple widgest are, starting with Image 23, described within the article Programming the Roma Widget Set (C# X11) - a zero dependency GUI application framework - Intrinsic widgets. They include:

XrwObject:IDisposable ultimate base object[1, ∅] of this widget set
⌊ XrwRectObject fundamental base object[1, ∅] with geometry
  ⌊ XrwVisibleRectObject fundamental base object[1, ∅] with drawing
    ⌊ XrwCore universal base gadget/widget[2/3, ∅]
      ⌊ XrwComposite container[2/3, ∅], managing many children
        ⌊ XrwConstraint container[2/3, ∅], with geometry management
        ⌊ XrwShell fundamental shell widget[3]
          ⌊ XrwOverrideShell base popup shell, not interacting with the WM[4]
          ⌊ XrwWmShell base shell, interacting with the WM[4]
            ⌊ XrwApplicationShell the common code of an X11 application
            ⌊ XrwTransientShell base class for popups, interacting with WM[4]

[1] object = invisible and windowless, uses neither the ***parent*** window nor an ***onw*** window
[2] gadget = uses the ***parent*** window instead of an ***onw*** window, saves resources compared to widget, but can receive events only if forwarded from the widget it is contained in
[3] widget = has an ***onw*** window, can creceive events directly from the WM[4]
[4] WM = Windows Manager
[∅] do not instantiate

Simple widgets

The simple widgest are, starting with Image 24, described within the new article Programming the Roma Widget Set (C# X11) - a zero dependency GUI application framework - Simple widgets. They include:

XrwObject:IDisposable ultimate base object[1, ∅] of this widget set
⌊ XrwRectObject fundamental base object[1, ∅] with geometry
  ⌊ XrwVisibleRectObject fundamental base object[1, ∅] with drawing
    ⌊ XrwCore universal base gadget/widget[2/3, ∅]
      ⌊ XrwSimple universal object[2/3]
        ⌊ XrwColorChooserComb named color choser widget[3], colors arranged as comb
        ⌊ XrwImage image object[2/3]
        ⌊ XrwLabelBase static label base object[2/3, ∅]
        | ⌊ XrwComboBox drop down selection widget[3]
        | ⌊ XrwLabel static label[2/3]
        | | ⌊ XrwCommand command button widget[3]
        | | | ⌊ XrwMenuButton button widget[3], to pop up a simple menu
        | | ⌊ XrwSme simple menu entry gadget[2]
        | ⌊ XrwLabelAndColor label and color rectangle widget[3], select a color
        | ⌊ XrwTextSpinButton spin button widget[3], to spin text constants
        | ⌊ XrwToggle toggle button widget[3]
        |   ⌊ XrwRadio radio button widget[3]
        |     ⌊ XrwNotebookTab notebook tab button widget[3]
        ⌊ XrwList list widget[3]
        ⌊ XrwRange generic base for scroll bar and scale[3]
        | ⌊ XrwScale scale widget[3]
        | ⌊ XrwScrollbar scroll bar widget[3]
        ⌊ XrwRibbonCommandBase base object[2, ∅] of ribbon command gadgets
        | ⌊ XrwRibbonButton command button gadget[2] for ribbon
        | | ⌊ XrwRibbonSplitButton button gadget[2] for ribbon, to pop up a simple menu
        | ⌊ XrwRibbonControlGroup gadget[2] for ribbon, to organize control group nodes
        ⌊ XrwText single line text edit widget[3]
        ⌊ XrwTree toggle button widget[3]
        ⌊ XrwViewportGridViewHeader column header widget for viewport embedded grids[3]

[1] object = invisible and windowless, uses neither the ***parent*** window nor an ***onw*** window
[2] gadget = uses the ***parent*** window instead of an ***onw*** window, saves resources compared to widget, but can receive events only if forwarded from the widget it is contained in
[3] widget = has an ***onw*** window, can creceive events directly from the WM[4]
[4] WM = Windows Manager
[∅] do not instantiate

Composite widgets

The composite widgets are, starting with Image 25, described within this article. They include:

XrwObject:IDisposable ultimate base object[1, ∅]
⌊ XrwRectObject fundamental base object[1, ∅] with geometry
  ⌊ XrwVisibleRectObj fundamental base object[1, ∅] with drawing
    ⌊ XrwCore universal base gadget/widget[2/3, ∅]
      ⌊ XrwComposite container[2/3, ∅], managing many children
        ⌊ XrwConstraint container[2/3, ∅], with geometry management
        | ⌊ XrwBox container[2/3], arranging children horiz./vert.
        | | ⌊ XrwHslColorPanel hue, saturation, lighness color chooser gadget[2]
        | | ⌊ XrwNotebook container[2/3], arranging children on pages
        | | ⌊ XrwRadioBox gadget[2], arranging XrwRadio children horiz./vert.
        | | ⌊ XrwSpinBox gadget[2], spinning invisible children to visible
        | ⌊ XrwFrame container[2/3], arranging just one single child
        | ⌊ XrwGridForm container[2/3], arranging children in a column/row grid
        | | ⌊ XrwColorSelector-
        | |      GridForm
container[2/3], XrwGridForm for XrwLabelAndColor children
        | | ⌊ XrwCustomColorChooser-
        | |      GridForm
container[2], XrwGridForm for children to choose a custom color via HSL or RGB color model
        | | ⌊ XrwRgbColorPanel red, green, blue color chooser gadget[2]
        | ⌊ XrwPaned widget[2], controlling two or more paned children
        | ⌊ XrwPorthole gadget[2], display only ***one*** child at any time
        | ⌊ XrwPropertyGrid widget[3], browse and edit the properties of an object
        | ⌊ XrwRibbon widget[3], that realizes the ribbon GUI
        | ⌊ XrwRibbonPanel gadget[2], organizing command objects for ribbons
        | ⌊ XrwRibbonTab gadget[2], arranging XrwRibbonPanel children horiz.
        | ⌊ XrwViewport container[2/3], enabling ***one*** child to scroll
        ⌊ XrwShell fundamental shell widget[3]
          ⌊ XrwOverrideShell base popup shell, not interacting with the WM[4]
          | ⌊ XrwBaseCellEditorShell popup editor shell[2] base class
          |   ⌊ XrwGenericCell-
          |        EditorShell
popup editor shell[2] for generic purpose
          | ⌊ XrwRibbonAppMenu popup application menu shell[2] of a XrwRibbon
          | ⌊ XrwSimpleMenu popup menu shell[2] for XrwSme gadget
          |   ⌊ XrwDropDownCell-
          |   |    EditorShell
popup editor shell[2] for drop down
          |   ⌊ XrwSpinMenu popup scrollable menu shell of XrwSme gadgets[2]
          ⌊ XrwWmShell base shell, interacting with the WM[4]
            ⌊ XrwApplicationShell the common code of an X11 application
            ⌊ XrwTransientShell base class for popups, interacting with WM[4]
              ⌊ XrwDialogShell base class for dialogs, interacting with WM[4]

[1] object = invisible and windowless, uses neither the ***parent*** window nor an ***onw*** window
[2] gadget = uses the ***parent*** window instead of an ***onw*** window, saves resources compared to widget, but can receive events only if forwarded from the widget it is contained in
[3] widget = has an ***onw*** window, can creceive events directly from the WM[4]
[4] WM = Windows Manager
[∅] do not instantiate

XrwBox

Image 26 The XrwBox class arranges children horizontally or vertically. It is comparable to GTK's Box. It is not comparable to Athena's "Box", that only moves but does not resize its children.

The XrwBox class is a sublass of XrwConstraint. It evaluates its children's constraints ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and resizes the children, if apprpriate.

This class has no public constructor, but four static factory methods. NewHBoxWidget/NewHBoxGadged create a new XrwBox with horizontally oriented cild placement, NewVBoxWidget/NewVBoxGadged create a new XrwBox with vertically oriented child placement.

The image shows two horizontally oriented XrwCommand cildren inside a XrwBox. The child align is 1.0.

Image 27

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox

New event definitions

XrwBox can be instantiated as widget or gadget. The widget can receive events on it's own (has a window on X server side). The gadget can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
ChildAlign float get, set 0.5
Orientation TOrientation get Horizontal
  • <img src="/KB/dialog/746051/V0.1on.png" /> ChildAlign get or set the child alignment. 0.0 aligns left, 0.5 aligns center and 1.0 right. The value can not underflow 0.0 or overflow 1.0. The alignment is operative only if there is space left to align. (That means expand-to-max-siblings-* doesn't use the complete space and expand-to-available-* is not set for any child.)
  • <img src="/KB/dialog/746051/V0.1on.png" /> Orientation get the orientation of child placement.

Overridden public properties (XrwVisibleRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> ExpandToAvailableHeight distinguish whether to expand height equal to the available height (defined by the XrwComposite it is contained).
  • <img src="/KB/dialog/746051/V0.1on.png" /> ExpandToAvailableWidth distinguish whether to expand width equal to the available width (defined by the XrwComposite it is contained).

New public methods

None.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> CalculateChildLayout() distribute the available size to the children (if any) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.1on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSize() calculate the preferred size.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Usage

The sample code shows how to use a XrwBox as action area of a dialog shell.

C#
// Define the action area.
XrwBox hboxActionArea = XrwBox.NewHBoxGadget (vboxMain);
hboxActionArea.BorderWidth = 2;
hboxActionArea.ChildAlign = 1.0F;
hboxActionArea.HorzSpacing = XrwTheme.DlgShellPrimaryChildSpacing;
hboxActionArea.BorderColor = hboxActionArea.BackgroundColorDark;
vboxMain.AddChild (hboxActionArea);

// Add two buttons right aligned (hbox.ChildAlign == 1.0F).
X11Graphic cancelGraphic = XrwTheme.GetGraphic (_display,
    _screenNumber, X11Graphic.StockIcon.Cancel16);
XrwCommand cbCancel = XrwCommand.NewCommandWidget (hboxActionArea,
     "Cancel", cancelGraphic, true, null, false);
cbCancel.ExpandToMaxSiblingWidth = true;
cbCancel.HorzTextAlign = 0.5F;
cbCancel.ButtonRelease += HandleCbCancelButtonRelease;
hboxActionArea.AddChild (cbCancel);

X11Graphic okGraphic = XrwTheme.GetGraphic (_display,
    _screenNumber, X11Graphic.StockIcon.Ok16);
XrwCommand cbOk = XrwCommand.NewCommandWidget (hboxActionArea,
    "OK", okGraphic, true, null, false);
cbOk.ExpandToMaxSiblingWidth = true;
cbOk.HorzTextAlign = 0.5F;
cbOk.ButtonRelease += HandleCbOkButtonRelease;
hboxActionArea.AddChild (cbOk); 

The sample code shows how to use a XrwBox as manager gadget of a dialog shell.

C#
public class XrwBitmapAndVectorFontSelectionDialog : XrwDialogShell
{
    // Define constants and member attributes.
    ...
 
    // Implement the constructor.
    public XrwBitmapAndVectorFontSelectionDialog (XrwApplicationShell parent,
                                                  ref Point assignedPosition,
                                                  ref Size assignedSize, string title)
        : base (parent, ref assignedPosition, ref assignedSize)
    {
        // Initialize member attributes.
        ...
 
        // Create shell's primary layout manager.
        XrwBox vboxMain = XrwBox.NewVBoxGadget (this);
        vboxMain.BorderWidth = XrwTheme.DlgShellPrimaryChildBorderWidth;
        vboxMain.BorderColor = _backgroundColor;
        vboxMain.VertSpacing = XrwTheme.DlgShellPrimaryChildSpacing;
        AddChild (vboxMain);
 
        // Create shell's grandchildren.
        ...
    }
 
    // Implement the destructor, properties and methods.
    ...   
} 

XrwHslColorPanel

Image 28 The XrwHslColorPanel class arranges a bitmap for hue and saturation selection and a scrollbar for lightness selection. Such a class is unknown to Athena and GTK, it's prototype is the System.Windows.Forms "ColorDialog" custom colors tab page.

The XrwHslColorPanel class is a gadget that allows the user to choose a custom color value from hue, saturation and lightness color components.

This class has no public constructor, but one static factory method.  NewHslColorPanelGadget creates a new XrwHslColorPanel.

The image shows a XrwHslColorPanel with color white selected.

Image 29

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox --> XrwHslColorPanel

New event definitions

XrwHrsColorPanel is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

To receive events, a window on server side is required (the object must be a widget, not a gadget). Otherwise events can only be forwarded from widgets to child gadgets. (Athena uses this approach as well, to forward events from "SimpleMenu" to "Sme*".)

  • <img src="/KB/dialog/746051/V0.6on.png" /> ColorSelected occures after any color has been selected and is calling registered event handler delegates.

New public properties

Name Type Access Default/Fallback
SelectedColor int get, set 0xFFFFFF
SelectedColorHTML string get #FFFFFF
SelectedColorHSL int get 0x0000FF
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColor get or set currently selected color as read, green and blue color component values, each in the range of 0 ... 255 (0x00 ... 0xFF).
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColorHTML get the currently selected color as HTML name.
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColorHSL get or set the currently selected color as hue, saturation and lightness color component values, each in the range of 0 ... 255 (0x00 ... 0xFF).

Overridden public properties

None.

Specific static methods

  • <img src="/KB/dialog/746051/V0.6on.png" /> RgbToHsl convert an RGB color value to a HSL color value.
  • <img src="/KB/dialog/746051/V0.6on.png" /> HslToRgb onvert an HSL color value to a RGB color value.

New public methods

None.

Overridden public methods

None.

New event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Usage

The sample code shows how to use a XrwRgbColorPanel.

C#
// Create a HSL color panel.
XrwHslColorPanel hslColorPanel = XrwHslColorPanel.NewHslColorPanelGadget (parent);
parent.AddChild (hslColorPanel);
parent.SetChildConstraints (hslColorPanel, "2", "0", "2", "0", "0");
parent.Rows[2].FixedDimension = 2 * MARGIN + hslColorPanel.PreferredSize().Height;

// Register the delegate to get informed about any color selection.
hslColorPanel.ColorSelected += delegate(XrwRectObj source, int newValue, string newValueHtml)
{
    // Process the color selection.
    ...
};

XrwNotebook

Image 30 The XrwNotebook class arranges children on pages. It is comparable to GTK's Notebook.

The XrwNotebook class is a sublass of XrwConstraint whose children are pages that can be switched between, using tab labels along one edge.

This class has no public constructor, but two static factory method. Image 31 NewTopTabedNotebookGadget creates a new XrwNotebook where tabs are placed on the top.Image 32 NewBottomTabbedNotebookGadget creates a new XrwNotebook where tabs are placed at the bottom.

Image 33 This class introduces four special constants

  • CaptionbarPosition.Top,
  • CaptionbarPosition.Left,
  • CaptionbarPosition.Right and
  • CaptionbarPosition.Bottom,

that define the position of the notebook's caption bar.

Image 34 The next image shows a notebook with four CaptionbarPosition.Top tabs inside the tab-box ("File", "Dialog test", "Toggle test" and "Radio test"). The first tab "File" is selected and shows the first page inside the page-stack (with the four buttons "File", "Close menu", "Message box" and "Close app").

Image 35

Image 36 The next image shows a notebook with five CaptionbarPosition.Bottom tabs inside the tab-box ("Menu", "Toggle", "Radio", "Spin" and "Edit"). The fourth tab "Spin" is selected and shows the fourth page inside the page-stack (with one text spin button "Spin text 1" and a combo box "A", that has a spin menu).

Image 37

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox --> XrwNotebook

New event definitions

XrwNotebook is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

To receive events, a window on server side is required (the object must be a widget, not a gadget). Otherwise events can only be forwarded from widgets to child gadgets. (Athena uses this approach as well, to forward events from "SimpleMenu" to "Sme*".)

  • <img src="/KB/dialog/746051/V0.1on.png" /> TabSelectionChanged occures after the selected tab has changed and is calling registered event handler delegates.

New public properties

Name Type Access Default/Fallback
CountPages int get 0
PageStack XrwPorthole get != null
TabBox XrwRadioBox get != null
TabPosition CaptionbarPosition get CaptionbarPosition.Top
  • <img src="/KB/dialog/746051/V0.1on.png" /> CountPages get the number of pages.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PageStack get the porthole widget, that contains the pages.
  • <img src="/KB/dialog/746051/V0.1on.png" /> TabBox get the box widget, that contains the tabs.
  • Image 38 TabPosition get the position of the notebook's caption bar.

Overridden public properties

None.

New public methods

  • <img src="/KB/dialog/746051/V0.1on.png" /> PageWidget get the page widget of indicated page. Throws IndexOutOfRangeException on index underflow/overflow.
  • <img src="/KB/dialog/746051/V0.1on.png" /> TabWidget get the tab widget of indicated page. Throws IndexOutOfRangeException on index underflow/overflow.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Realize() allocate and map the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object visible.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> RemoveChild() is not implemented.

New event handler

  • <img src="/KB/dialog/746051/V0.1on.png" /> OnTabSelectionChanged() handle the TabSelectionChanged event.

Overridden event handler

None.

New preregistered event delegates

The XrwNotebook registers no event handler on it's own, but it registeres a SwitchedOn event handler to every tab's XrwRadio child.

  • <img src="/KB/dialog/746051/V0.1on.png" /> SwitchedOn += HandleTabSwitchedOnDefault on any tab's XrwRadio child makes the according page visible, switches off all other tab's XrwRadio children and hides their according pages.

Usage

The XrwNotebook is designed to create a notebook with minimum effort.

This sample code creates a top tabbed notebook, adds a ribbon and places a command button as sample content into the added robbon.

C#
// Create a top tabbed notebook.
XrwNotebook notebookTopTabbed = XrwNotebook.NewTopTabbedNotebookGadget (vboxMain);
notebookTopTabbed.FrameType = TFrameType.RaisedBottomOnly;
notebookTopTabbed.FrameWidth = XrwTheme.InteractiveFrameWidth;
vboxMain.AddChild (notebookTopTabbed);

// Create a ribbon tab "Dialog test".
XrwBox hboxToggleNbTab = XrwBox.NewHBoxGadget (notebookTopTabbed);
hboxToggleNbTab.BorderWidth = 0;
hboxToggleNbTab.ChildAlign = 0.0F;
hboxToggleNbTab.VertSpacing = 0;
notebookTopTabbed.AddChild (hboxToggleNbTab);

// Name the notebook tab's caption.
XrwNotebookTab firstTabWidget = notebookTopTabbed.TabWidget (notebookTopTabbed.CountPages - 1);
if (firstTabWidget != null)
    firstTabWidget.Label = " Dialog test ";

// Create a sample content (command button) into the ribbon tab.
X11Graphic fontGraphic = XrwTheme.GetGraphic ( _display,_screenNumber,
                                               X11Graphic.StockIcon.FontBitmapFont16);
XrwCommand fontDialog = XrwCommand.NewCommandWidget (hboxFileRibbon, "Font dialog",
                                                     fontGraphic, true, null, false);
fontDialog.FrameType  = XrwTheme.StaticFrameType;
fontDialog.FrameWidth = XrwTheme.StaticFrameWidth;
fontDialog.ExpandToAvailableHeight = true;
fontDialog.ButtonRelease += HandleFontDialogButtonRelease;
hboxToggleNbTab.AddChild (fontDialog); 

This sample code creates a bottom tabbed notebook, adds a ribbon and places a text spin button as sample content into the added robbon.

C#
// Create a bottom tabbed notebook.
XrwNotebook notebookBottomTabbed = XrwNotebook.NewBottomTabbedNotebookGadget (vboxMain);
notebookBottomTabbed.FrameType = TFrameType.RaisedTopOnly;
notebookBottomTabbed.FrameWidth = XrwTheme.InteractiveFrameWidth;
vboxMain.AddChild (notebookBottomTabbed);

// Create a ribbon tab "Spin".
XrwBox hboxSpinNbTab = XrwBox.NewHBoxGadget (notebookBottomTabbed);
hboxSpinNbTab.BorderWidth = 0;
hboxSpinNbTab.ChildAlign = 0.0F;
hboxSpinNbTab.VertSpacing = 0;
notebookBottomTabbed.AddChild (hboxSpinNbTab);

// Name the ribbon tab's caption.
XrwNotebookTab firstTabWidget = notebookBottomTabbed.TabWidget (notebookBottomTabbed.CountPages - 1);
if (firstTabWidget != null)
    firstTabWidget.Label = " Spin ";

// Create a sample content (text spin button) into the ribbon tab.
XrwTextSpinButton textSpinner = XrwTextSpinButton.NewHXrwTextSpinButton
    (hboxSpinNbTab, "Spin text 1\nText 2\nText 3\nText 4\nSpin text 5");
textSpinner.ExpandToAvailableWidth = false;
textSpinner.HorzTextAlign = 0.5F;
textSpinner.ExpandToMaxSiblingHeight = true;
hboxSpinNbTab.AddChild (textSpinner); 

XrwRadioBox

Image 39 The XrwRadioBox class arranges XrwRadio children horizontally or vertically. It is comparable to GTK's representation of groups of radio buttons, that has no frame.

The XrwRadioBox class is a sublass of XrwConstraint that realizes that only one of its radio button children can be selected at any time.

This class has no public constructor, but two static factory methods. NewHRadioBoxGadget creates a new XrwRadioBox with horizontally oriented cildren, NewVRadioBoxGadget creates a new XrwRadioBox with vertically oriented children.

The image shows a horizontally oriented XrwRadioBox with three radio buttons.

Image 40

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox --> XrwRadioBox

New event definitions

XrwRadioBox is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

None.

New public properties

None.

Overridden public properties

None.

New public methods

  • <img src="/KB/dialog/746051/V0.1on.png" /> GetSelected() get the currently selected radio button.
  • <img src="/KB/dialog/746051/V0.1on.png" /> GetSelectedIndex() get the currently selected radio button's index.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> RemoveChild()is not implemented.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

The XrwRadioBox registers no event handler on it's own, but it registeres a SwitchedOn event handler to every XrwRadio child.

  • <img src="/KB/dialog/746051/V0.1on.png" /> SwitchedOn += HandleChildSwitchedOnDefault on any XrwRadio child switches off all other XrwRadio children of this XrwRadioBox.

Usage

This sample code creates a radio box containing three radio buttons.

C#
// Define the radio box.
XrwRadioBox hboxRadioNbTab = XrwRadioBox.NewHRadioBoxGadget (notebookBar);
hboxRadioNbTab.BorderWidth = 0;
hboxRadioNbTab.ChildAlign = 0.0F;
hboxRadioNbTab.VertSpacing = 0;

// Add three radio buttons left aligned (hbox.ChildAlign == 0.0F).
X11Graphic radioOffGraphic = XrwTheme.GetGraphic (_display,
    _screenNumber, X11Graphic.StockIcon.RadioOff16TrueColor);
X11Graphic radioOnGraphic = XrwTheme.GetGraphic (_display,
    _screenNumber, X11Graphic.StockIcon.RadioOn16TrueColor);
XrwRadio radio1 = XrwRadio.NewRadioWidget (hboxRadioNbTab,
    "Radio test 1", radioOffGraphic, true, radioOnGraphic, true);
radio1.ExpandToAvailableWidth = false;
radio1.FrameType  = XrwTheme.InteractiveFrameType;
radio1.FrameWidth = XrwTheme.InteractiveFrameWidth;
hboxRadioNbTab.AddChild (radio1);

XrwRadio radio2 = XrwRadio.NewRadioWidget (hboxRadioNbTab,
    "Radio test 2", radioOffGraphic, true, radioOnGraphic, true);
radio2.ExpandToAvailableWidth = false;
radio2.FrameType  = XrwTheme.InteractiveFrameType;
radio2.FrameWidth = XrwTheme.InteractiveFrameWidth;
hboxRadioNbTab.AddChild (radio2);

XrwRadio radio3 = XrwRadio.NewRadioWidget (hboxRadioNbTab,
    "Radio test 3", radioOffGraphic, true, radioOnGraphic, true);
radio3.ExpandToAvailableWidth = false;
radio3.FrameType  = XrwTheme.InteractiveFrameType;
radio3.FrameWidth = XrwTheme.InteractiveFrameWidth;
hboxRadioNbTab.AddChild (radio3); 

XrwSpinBox

Image 41 The XrwSpinBox class arranges children horizontally or vertically like the XrwBox class, but it can hide children to meet the requested qeometry. It's prototype is the GTK Nautilus (file manager) path bar.

The XrwSpinBox class is a sublass of XrwConstraint that can organize more children than displayable on its visible area. In that case it can spin invisible children to the visible area and visible children to the invisible area - wherefore it shows two spin navigators (forth and back) dynamically, if required.

This class has no public constructor, but four static factory methods. NewHSpinBoxWidget/NewHSpinBoxGadget creates a new XrwSpinBox with horizontally oriented cild placement, NewVSpinBoxWidget/NewVSpinBoxGadget creates a new XrwSpinBox with vertically oriented child placement.

The image shows a horizontally oriented XrwSpinBox with back and navigators and eight buttons.

Image 42

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox --> XrwSpinBox

New event definitions

XrwSpinBox is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
Back XrwCommand get != null
Forth XrwCommand get != null
ForceNavigators bool get, set false
PreferredSpinOffset int get 0
ShowNavigators bool get false
  • <img src="/KB/dialog/746051/V0.1on.png" /> Back get the back navigator button. The button can be invisible (not realized) or inactive.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Forth get the forth navigator button. The button can be invisible (not realized) or inactive.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ForceNavigators distinguish whether to show the navigator buttons permanently.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSpinOffset get the preferred offset to the first visible child, if spinning is required.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ShowNavigators get the current internal state whether to show navigator buttons or not.

Overridden public properties (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Children get the list of all direct children.

New public methods

None.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> CalculateChildLayout() distribute the available size to the children (if any) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.1on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Realize() allocate and map the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object visible.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> HasChild() test whether the the indicated XrwCore is a child.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> RemoveChild() remove the indicated XrwCore from the list of children.
  • <img src="/KB/dialog/746051/V0.2on.png" /> RemoveChild() remove the indicated XrwCore from the list of children. This method calls the OnChildRemoved() event handler.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.1on.png" /> Clicked += HandleForthButtonClickedDefault on forth spin button recalculate spinned children's layout and redraws.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Clicked += HandleBackButtonClickedDefault on back spin button recalculate spinned children's layout and redraws.

XrwFrame

Image 43 The XrwFrame class arranges just one single child within a decorative frame. It is comparable to GTK's Frame.

The GTK manpage's description for "Frame" says:
A bin with a decorative frame and optional label.

Currently no label is supported.

This class has no public constructor, but two static factory methods. NewFrameWidget/NewFrameGadget create a new XrwFrame.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwFrame

New event definitions

XrwViewport can be instantiated as widget or gadget. The widget can receive events on it's own (has a window on X server side). The gadget can only receive events that are forwarded from a parent widget.

None.

New public properties

None.

Overridden public properties (XrwComposite)

None.

New public methods

None.

Overridden public methods (XrwRectObj)

None.

Overridden public methods (XrwCore)

None.

New event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

XrwGridForm

Image 44 The XrwGridForm class arranges children using a grid of predefined columns and rows. It is comparable to Motif's "Form" widget but doesn't support alignment with reference to the form's edges or to each other.

The LessTif manpage's description for "Form" says (LessTif Manual):
XmForm is a widget which allows you to specify complicated geometries. The widget is capable of aligning children widgets with reference to each other. Widgets can be linked to each other's positions, hooked to a fixed place, or hooked to the form's edges. Positioning can be relative as well as absolute.
The algorithm used to lay out the children is an iterative one. In development versions of LessTif, the amount of iterations that the widget supports before it wants to have reached a steady state is 200. OSF/Motif® uses a much higher number than this; if the low number in LessTif gives you trouble (it generates a warning message mentioning "bailout") then either the number is too low or you've discovered a bug.

Instead of Motif's XmNfractionBase resource it supports columns and rows with fixed dimension, by calling AddColumn("128") or AddRow("256"), and dynamic dimension, by calling AddColumn("1.0*") or AddRow("1.5*"). Fixed dimensions expect an integer value (in pixels) and dynamic dimensions expect a float followed by "*" (to be multiplied with the remaining available dimension). Fixed dimensions and dynamic dimensions can be used through the same form widget in parallel. XrwGridForm does not calculate the position of it's children iterative, but in one siggle pass.

This class has no public constructor, but one static factory method. NewGridFormGadget creates a new XrwGridForm.

The image shows a XrwGridForm with two dynamic columns ("1.0*" and "2.0*") and three rows (static "36" pixels, dynamic "1.0*" and "1.5*"). Four simple button widgets show column span (no. 1), row span (no. 4) and margin (no 1 ... no. 4).

Image 45

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwGridForm

New event definitions

XrwGridForm is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
CountColumns int get 0
CountRows int get 0
Columns ReadOnlyCollection<LaneData> get !=null
Rows ReadOnlyCollection<LaneData> get !=null
  • <img src="/KB/dialog/746051/V0.4on.png" /> CountColumns get the number of columns defined for the grid form.
  • <img src="/KB/dialog/746051/V0.4on.png" /> CountRows get the number of rows defined for the grid form.
  • Image 46 Columns get the read only list of column's lane data.
  • Image 47 Rows get the read only list of row's lane data.

Overridden public properties (XrwComposite)

None.

New public methods

  • <img src="/KB/dialog/746051/V0.4on.png" /> AddColumn() add a new column to the grid's columns at tail position and define it's width.
  • <img src="/KB/dialog/746051/V0.4on.png" /> AddRow() add a new row to the grid's rows at tail position and define it's height.
  • <img src="/KB/dialog/746051/V0.4on.png" /> SetChildConstraints() set an indicated child's constraints (margin, column, row, column span and row span).

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.4on.png" /> CalculateChildLayout() distribute the available size to the children (ribbon tabs with regard to their PreferredSize, ExpandToAvailableWidth and ExpandToMaxSiblingWidth but not ExpandToAvailableHeight and ExpandToMaxSiblingHeight (because the ribbon has a fixed height) and set the AssignedSize and AssignedPosition.
  • Image 48 MinimumSize() calculate the minimum size.
  • Image 49 PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.4on.png" /> Redraw() redraw the widget/gadget

New event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Child constraints

Child constraints can be set by SetChildConstraints() and cover margins (left, right, top and bottom), placement hooks (start column and row) and dimension hooks (column span and row span). Depending on the constraints, children may overlap.

XrwColorSelectorGridForm

Image 50 The XrwColorSelectorGridForm class arranges XrwLabelAndColor children using a grid of predefined columns and rows. It is intended to be created as widget, to hold the children as gadgets (to save memory and X server communication) and to forward the events to it's children. The layout is taken unchanged from it's base class XrwGridForm.

XmColorSelecrorGridForm is a widget that offers a grid of selectable predefined colors

This class has no public constructor, but several static factory methods. NewColorSelectorGridForm16 creates a new XrwColorSelectorGridForm for 16 selectable predefined colors. NewColorSelectorGridForm140 creates a new XrwColorSelectorGridForm for 140 selectable predefined colors (thre are 140 named colors defined for X11).

The image shows a XrwColorSelectorGridForm with 2 columns (static width) and 8 rows (static height) containing 16 XrwLabelAndColor children, each displaying a color rectangle and the color name.

Image 51

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwGridForm --> XrwColorSelectorGridForm

New event definitions

XrwColorSelectorGridForm is always instantiated as widget. It can receive events on it's own (has a window on X server side).

  • Image 52 ColorSelected occures after one of the predefined colors has been selected and is calling registered event handler delegates.

New public properties

Name Type Access Default/Fallback
SelectedChildBorderColor Image 53 Image 54 TPixel
Image 55 TColor
XrwTheme.ShadowFrame-ColorDark XrwTheme.ShadowFrame-ColorDark
SelectedColor int get, set 0xffffff
SelectedColorHtml string get !=null
  • Image 56 SelectedChildBorderColor get or set the border color of a selected color gadget.
  • Image 57 SelectedColor get or set the currently selected color.
  • Image 58 SelectedHolorHrtml get the currently selected color as HTML name.

Overridden public properties

None.

New public methods

None.

Overridden public methods

None.

New event handler

  • Image 59 OnColorSelected() handle the ColorSelected event.

Overridden event handler

None.

New preregistered event delegates

  • Image 60 ButtonPress += HandleButtonPressDefault perform the button press action and forward it to the appropriate child.

Usage

The sample code shows how to use a XrwColorSelectorGridForm.

C#
// Create and register one of the three currently available color selection grid forms.
XrwColorSelectorGridForm colorSelector ;

if (colorArrangement == PredefinedColorArrangement.C07R20Named)
    colorSelector = XrwColorSelectorGridForm.NewColorSelectorGridForm140
                        (parent, colorArrangemen, initialColorValue);
else if (colorArrangement == PredefinedColorArrangement.C08R02)
    colorSelector = XrwColorSelectorGridForm.NewColorSelectorGridForm16
                        (parent, colorArrangemen, initialColorValue);
else if (colorArrangement == PredefinedColorArrangement.C02R08Named)
    colorSelector = XrwColorSelectorGridForm.NewColorSelectorGridForm16
                        (parent, colorArrangemen, initialColorValue);
parent.AddChild (colorSelector); 

XrwCustomColorChooserGridForm

Image 61 The XrwCustomColorChooserGridForm class arranges it's children XrwHslColorPanel and XrwHslColorPanel using a grid of predefined columns and rows.

XmColorSelecrorGridForm is a gadget to choose a custom color via HSL or RGB color model

This class has no public constructor, but one static factory method. NewCustomColorChooserGridForm creates a new XrwCustomColorChooserGridForm.

The image shows a XrwCustomColorChooserGridForm with the  XrwHslColorPanel choose a custom color via HSL color model and the XrwHslColorPanel choose a custom color via RGB color model .

Image 62

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwGridForm --> XrwCustomColorChooserGridForm

New event definitions

XrwCustomColorChooserGridForm is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

To receive events, a window on server side is required (the object must be a widget, not a gadget). Otherwise events can only be forwarded from widgets to child gadgets. (Athena uses this approach as well, to forward events from "SimpleMenu" to "Sme*".)

  • <img src="/KB/dialog/746051/V0.6on.png" /> ColorSelected occures after any color has been choosen and is calling registered event handler delegates.

New public properties

Name Type Access Default/Fallback
SelectedColor int get, set 0xFFFFFF
SelectedColorHTML string get #FFFFFF
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColor get or set currently selected color as read, green and blue color component values, each in the range of 0 ... 255 (0x00 ... 0xFF).
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColorHTML get the currently selected color as HTML name.

Overridden public properties

None.

New public methods

None.

Overridden public methods

None.

New event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Usage

The sample code shows how to use a XrwRgbColorPanel.

C#
// Create a custom color grid form.
XrwCustomColorChooserGridForm gridCustomColors =
    XrwCustomColorChooserGridForm.NewColorChooserGridForm (parent, initialColorValue);
parent.AddChild (gridCustomColors);

// Register the delegate to get informed about any color choose.
gridCustomColors.ColorSelected += delegate(XrwRectObj source, int newValue, string newValueHtml)
{
    // Process the color selection.
    ...
};

XrwRgbColorPanel

Image 63 The XrwRgbColorPanel class arranges a label, a scrollbar and an editor for each of the three color components red, green and blue. Such a class is unknown to Athena and GTK, it's prototype can be one of the many free color pickers on the internet.

The XrwRgbColorPanel class is a gadget that allows the user to choose a custom color value from red, green and blue color components.

This class has no public constructor, but one static factory method.  NewRgbColorPanelGadget creates a new XrwRgbColorPanel.

The image shows a XrwRgbColorPanel with color white selected.

Image 64

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwGridForm --> XrwRgbColorPanel

New event definitions

XrwRgbColorPanel is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

To receive events, a window on server side is required (the object must be a widget, not a gadget). Otherwise events can only be forwarded from widgets to child gadgets. (Athena uses this approach as well, to forward events from "SimpleMenu" to "Sme*".)

  • <img src="/KB/dialog/746051/V0.6on.png" /> ColorSelected occures after any color has been selected and is calling registered event handler delegates.

New public properties

Name Type Access Default/Fallback
SelectedColor int get, set 0xFFFFFF
SelectedColorHTML string get #FFFFFF
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColor get or set currently selected color as read, green and blue color component values, each in the range of 0 ... 255 (0x00 ... 0xFF).
  • <img src="/KB/dialog/746051/V0.6on.png" /> SelectedColorHTML get the currently selected color as HTML name.

Overridden public properties

None.

New public methods

None.

Overridden public methods

None.

New event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Usage

The sample code shows how to use a XrwRgbColorPanel.

C#
// Create a RGB color panel.
XrwRgbColorPanel rgbColorPanel = XrwRgbColorPanel.NewRgbColorPanelGadget (parent);
parent.AddChild (rgbColorPanel);
parent.SetChildConstraints (rgbColorPanel, "2", "0", "2", "0", "0");
parent.Rows[2].FixedDimension = 2 * MARGIN + rgbColorPanel.PreferredSize().Height;

// Register the delegate to get informed about any color selection.
rgbColorPanel.ColorSelected += delegate(XrwRectObj source, int newValue, string newValueHtml)
{
    // Process the color selection.
    ...
};

XrwPaned

Image 65 The XrwPaned class arranges children tiled and allows to change their size. It is comparable to Athena's "Paned" widget already including the appropriate Athena "Grip" widget.

The X Toolkit Intrinsics's description for "Paned" says (X Toolkit Intrinsics Reference Manual):
The Paned widget manages children in a vertically or horizontally tiled fashion. The panes may be dynamically resized by the user by using the grips that appear near the right or bottom edge of the border between two panes.
When the pointer is positioned on a grip and pressed, an arrow is displayed that indicates the pane that is being resized. While keeping the pointer button down, the user can move the pointer up and down (or left and right). This, in turn, changes the border between the panes, causing one pane to shrink and some other pane (or panes) to grow. The size of the Paned widget will not change.The Paned widget may accept any widget class as a pane except Grip. Grip widgets have a special meaning for the Paned widget, and adding a Grip as its own pane will confuse the Paned widget.

This class has no public constructor, but two static factory methods. NewHPanedWidget or NewVPanedWidget create a new horizontally or vertically oriented XrwPaned.

The image shows a horizontally oriented XrwPaned with one XrwTree and one XrwPropertyGrid.

Image 66

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwBox --> XrwPaned

New event definitions

XrwPaned is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
ChildAlign float get, set 0.5
Orientation TOrientation get  
PanerBackgroundColorDark Image 67 Image 68 TPixel
Image 69 TColor
get, set PanerBackgroundColorDark
PanerBackgroundColorLight Image 70 Image 71 TPixel
Image 72 TColor
get, set PanerBackgroundColorLight
PanerBackgroundColorMedium Image 73 Image 74 TPixel
Image 75 TColor
get, set PanerBackgroundColorMedium
  • <img src="/KB/dialog/746051/V0.4on.png" /> ChildAlign get or set the child alignment. 0.0 aligns left, 0.5 aligns center and 1.0 right. The value can not underflow 0.0 or overflow 1.0. The alignment is operative only if there is space left to align. (That means XrwVisibleRectObj.ExpandToMaxSiblings*, set to any number of children, doesn't use the complete space and XrwVisibleRectObj.ExpandToAvailable* is not set for any child.)
  • <img src="/KB/dialog/746051/V0.4on.png" /> Orientation get the orientation of child placement.
  • <img src="/KB/dialog/746051/V0.4on.png" /> PanerBackgroundColorDark get or set the paned's border between the panes background color 3/3.
  • <img src="/KB/dialog/746051/V0.4on.png" /> PanerBackgroundColorLight get or set the paned's border between the panes background color 1/3.
  • <img src="/KB/dialog/746051/V0.4on.png" /> PanerBackgroundColorMedium get or set the paned's border between the panes background color 2/3.

Overridden public properties (XrwComposite)

None.

New public methods

None.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.4on.png" /> CalculateChildLayout() distribute the available size to the children (ribbon tabs with regard to their PreferredSize, ExpandToAvailableWidth and ExpandToMaxSiblingWidth but not ExpandToAvailableHeight and ExpandToMaxSiblingHeight (because the ribbon has a fixed height) and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.4on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.4on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

None.

New event handler

None.

Overridden event handler (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.4on.png" /> OnExpose() handle the ExposeEvent event.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.4on.png" /> Enter += HandleEnterDefault performs noting.
  • <img src="/KB/dialog/746051/V0.4on.png" /> Leave += HandleLeaveDefault unset focused child.
  • <img src="/KB/dialog/746051/V0.4on.png" /> ChildAdded += HandleChildAddedDefault performs some configuration for the paned child, added to the XrwPane widget's Children collection.

XrwPorthole

Image 76 The XrwPorthole class arranges children stacked, but displays only one child at any time. It's prototype is Athena's "Porthole" widget.

The X Toolkit Intrinsics's description for "Porthole" says (X Toolkit Intrinsics Reference Manual):
The Porthole widget provides geometry management of a list of arbitrary widgets, only one of which may be managed at any particular time. The managed child widget is reparented within the porthole and is moved around by the application (typically under the control of a Panner widget).
The Porthole widget allows its managed children to request any size that is as large or larger than the Porthole itself and any location so long as the child still obscures all of the Porthole.

This class has no public constructor, but one static factory methods. NewPortholeGadget creates a new XrwPorthole.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwPorthole

New event definitions

XrwPorthole is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
RealizedChild int get XrwCore
  • <img src="/KB/dialog/746051/V0.1on.png" /> RealizedChild get the currently realized (visible) child.

Overridden public properties

None.

New public methods

  • <img src="/KB/dialog/746051/V0.1on.png" /> RealizeChild() realize indicated child and unrealize (hide) formerly realized child.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> CalculateChildLayout() distribute the available size to the children (if any) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.4on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Realize()allocate and map the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object visible.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> AddChild() add the indicated XrwCore to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter. This method calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.2on.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. This calls the OnChildAdded() event handler.
  • <img src="/KB/dialog/746051/V0.1on.png" /> <img src="/KB/dialog/746051/V0.2off.png" /> RemoveChild() remove the indicated XrwCore from the list of children.
  • <img src="/KB/dialog/746051/V0.2on.png" /> RemoveChild() remove the indicated XrwCore from the list of children. This method calls the OnChildRemoved() event handler.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

XrwPropertyGrid

Image 77 The XrwPropertyGrid class enables browsing and editing the properties of an object. It's prototype is System.Windows.Forms "PropertyGrid" control.

A property grid widget is similar to a normal two-column tree widget, except that it provides only two levels of hierarchy (branch nodes and leaf nodes) and leaf nodes are editable. Leaf node editors can support text values, dropdown lists, filename browsers or pretty much other type imaginable.
The PropertyGrid widget displays the properties of a given object (class instance) grouped into categories allowing to edit these properties. The object's properties that are to display and edit are determined using reflection.

The XrwPropertyGrid is more or less a wrapper around a specific configured XrwTree widget with some additional functionality. This includes:

  • a title area displaying the type and name of the currently assigned object
  • the two-column tree with edit capabilities for the leaf nodes at the second column
  • a description area displaying the name and description of the currently selected property

This class has no public constructor, but one static factory method. NewPropertyGridWidget creates a new XrwPropertyGrid.

The image shows an XrwPropertyGrid with two categories (branch nodes "Default" and "Demonstation"), two text properties (leaf nodes "Name" and "Col2"), one boolean property ( leaf node"Col5"), one three-state property (leaf node "Col6") and one enumeration property (leaf node "Col7"). All leaf node are editable. Currently the enumeration property (leaf node "Col7") is in edit mode.

Image 78

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwPropertyGrid

New event definitions

XrwPropertyGrid is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
BoldTextColor Image 79 Image 80 TPixel
Image 81 TColor
get, set XrwTheme.TextColor
Image 82 BoldFontData X11FontData get != null
TextColor Image 83 Image 84 TPixel
Image 85 TColor
get, set XrwTheme.TextColor
Image 86 Image 87 FontData
Image 88 DefaultFontData
X11FontData get != null
Image 89 FontSpecification string get  
Image 90 FontId IntPtr get IntPtr.Zero
Image 91 BoldFontSpecification string get  
Image 92 BoldFontId IntPtr get IntPtr.Zero
SelectedBackground-
ColorDark
Image 93 Image 94 TPixel
Image 95 TColor
get, set XrwTheme.EditableBackground-
Color
SelectedBackground-
ColorLight
Image 96 Image 97 TPixel
Image 98 TColor
get, set XrwTheme.EditableBackground-
Color
SelectedBackground-
ColorMedium
Image 99 Image 100 TPixel
Image 101 TColor
get, set XrwTheme.EditableBackground-
Color
SelectedObject object get, set null
ShowDescription bool get, set true
  • Image 102 BoldTextColor get or set the bold text color of property grid's label.
  • <img height="14px" src="758151/V0.8on.png" width="35px" /> BoldFontData get the bold font data. To set the bold font data use SetBoldFont() method.
  • Image 103 TextColor get or set the text color of property grid's label.
  • <img src="758151/V0.6on.png" /> <img height="14px" src="758151/V0.8off.png" width="35px" /> FontData <img height="14px" src="758151/V0.8on.png" width="35px" /> DefaultFontData get the default font data. To set the default font data use SetDefaultFont() method.
  • Image 104 Image 105 FontSpecification get the current font specification. An empty string indicates the initially used system default font. To set the font specification use SetFont() method.
  • <img src="/KB/dialog/746051/V0.4on.png" /> Image 106 FontId get the current font id. The IntPtr.Zero indicates the initially used system default font. This font is used to display the name of the currently assigned object in the title area, the leaf nodes in the tree and the description of the currently selected property in the description area.
  • <img src="/KB/dialog/746051/V0.4on.png" /> Image 107 BoldFontSpecification get the current bold font specification. An empty string indicates the initially used system default font. To set the font specification use SetBoldFont() method.
  • <img src="/KB/dialog/746051/V0.4on.png" /> Image 108 BoldFontId get the current bold font id. The IntPtr.Zero indicates the initially used system default font. This font is used to display the type of the currently assigned object in the title area, the branch nodes in the tree and the name of the currently selected property in the description area.
  • <img src="/KB/dialog/746051/V0.4on.png" /> SelectedBackgroundColorDark get or set the selected property node's background color 3/3. The SelectedBackgroundColor* colors are typically not discriminative, because an editable square has no gradient.
  • <img src="/KB/dialog/746051/V0.4on.png" /> SelectedBackgroundColorLight get or set the selected property node's background color 1/3. The SelectedBackgroundColor* colors are typically not discriminative, because an editable square has no gradient.
  • <img src="/KB/dialog/746051/V0.4on.png" /> SelectedBackgroundColorMedium get or set the selected property node's background color 2/3. The SelectedBackgroundColor* colors are typically not discriminative, because an editable square has no gradient.
  • <img src="/KB/dialog/746051/V0.4on.png" /> SelectedObject get or set the currently assigned object.
  • <img src="/KB/dialog/746051/V0.4on.png" /> ShowDescription get or set whether to show the description area.

Note: The SelectedBackgroundColor* (inherited from XrwVisibleRectObj) colors are typically not discriminative, because an editable square has no gradient.

Overridden public properties

None.

New public methods

  • <img src="/KB/dialog/746051/V0.4on.png" /><code> SetBoldFont() set a new bold font.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.4on.png" /> CalculateChildLayout() distribute the available size (title area, tree and description area are integral part of the XrwPropertyGrid and reduce the available size) to the children with regard to their PreferredSize, ExpandToAvailableWidth and ExpandToMaxSiblingWidth but not ExpandToAvailableHeight and ExpandToMaxSiblingHeight (because the ribbon has a fixed height) and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.4on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.4on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.4on.png" /> Image 109 SetFont() Image 110 SetDefaultFont() set a new default font.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.4on.png" /> AddChild() add child is not supported. The tree's viewport is the only child.
  • <img src="/KB/dialog/746051/V0.4on.png" /> InsertChild() insert child is not supported. The tree's viewport is the only child.
  • <img src="/KB/dialog/746051/V0.4on.png" /> RemoveChild() remove child is not supported. The tree's viewport is the only child.

New event handler

None.

Overridden event handler

None.

Preregistered event delegates

  • <img src="/KB/dialog/746051/V0.4on.png" /> EntrySelectionChanged += HandleTreeEntrySelectionChanged handle the EntrySelectionChanged event of the property grid's tree.
  • Image 111 SizePreferenceChanged += XrwViewport.HandleSizePreferenceChangedDefault handle the SizePreferenceChanged event.

XrwRibbon

Image 112 The XrwRibbon is a command bar that organizes the features of an application into a series of tabs at the top of the application window. The ribbon replaces the traditional menu bar and toolbars. The ribbon UI has a better discoverability of features and functions, enables a quicker learning of the application, and makes users feel more in control of their experience with the application.

A ribbon is made up of several components. Every ribbon has an application menu and an arbitrary number of ribbon tabs. Ribbon tabs contain panels and each panel contains command controls. Related command controls can be combined into control groups.

The XrwRibbon has a fixed height and should always expand to the window's full width.

This class has no public constructor, but a static factory method. NewRibbonWidget creates a new XrwRibbon instance, that already contains an XrwRibbonAppMenu and is ready to accept XrwRibbonTab children.

The image shows a XrwRibbon with application menu button (Image 113) and three tabs, "Dialog test", "Radio & toggle test" as well as "Split test". The first tab is selected and contains two ribbon panels. Each panel contains three ribbon buttons - the first panel," Large buttons", shows the dialog launcher right beside the ribbon panel's label and it's buttons with CurrentSizeMode == RibbonPanelSizePolicy.Large, the second panel, "Medium buttons", shows as well the dialog launcher right beside the ribbon panel's label and it's buttons with CurrentSizeMode == RibbonPanelSizePolicy.Medium.

Image 114

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwRibbon

New event definitions

XrwRibbon is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
ApplicationButtonLabel string get, set  
ApplicationButtonBitmap X11Graphic get != null
ApplicationButtonBitmapShared bool get true
ApplicationMenu XrwRibbonAppMenu get != null
Image 115 InactiveStyles StyleList get != null
Image 116 NormalStyles StyleList get != null
Image 117 Image 118 TextColor TPixel get, set XrwTheme.TextColor
Image 119 Image 120 InactiveTextColor TPixel get, set XrwTheme.ShadowFrameColorDark
RibbonTabCaption-
BackgroundColorDark
Image 121 Image 122 TPixel
Image 123 TColor
get, set XrwTheme.RibbonTabCaption-
BackgroundColor
RibbonTabCaption-
BackgroundColorLight
Image 124 Image 125 TPixel
Image 126 TColor
get, set XrwTheme.RibbonTabCaption-
BackgroundColor
RibbonTabCaption-
BackgroundColorMedium
Image 127 Image 128 TPixel
Image 129 TColor
get, set XrwTheme.RibbonTabCaption-
BackgroundColor
RibbonTabCaptionFocused-
BackgroundColorDark
Image 130 Image 131 TPixel
Image 132 TColor
get, set XrwTheme.RibbonTabCaption-
FocusedBackgroundColor
RibbonTabCaptionFocused-
BackgroundColorLight
Image 133 Image 134 TPixel
Image 135 TColor
get, set XrwTheme.RibbonTabCaption-
FocusedBackgroundColor
RibbonTabCaptionFocused-
BackgroundColorMedium
Image 136 Image 137 TPixel
Image 138 TColor
get, set XrwTheme.RibbonTabCaption-
FocusedBackgroundColor
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationButtonLabel get or set the label text of the application button.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationButtonBitmap get the application button's bitmap.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationBitmapShared get the application button's bitmap shared flag. Not shared bitmaps will be disposed by the XrwRibbon's Dispose(), shared bitmaps won't.
  • <img src="/KB/dialog/746051/V0.3on.png" /> AppMenu get the associated application menu to pop up.
  • Image 139 InactiveStyles get the list of styles, used for drawing inactive text of a ribbon button's label.
  • Image 140 NormalStyles get the list of styles, used for drawing normal text of a ribbon button's label.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Image 141 TextColor get or set the text color of a ribbon button's label. Became part of NormalStyles.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Image 142 InactiveTextColor get or set text color of an inactive ribbon button's label. Became part of InactiveStyles.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionBackgroundColorDark get or set the ribbon tab's caption background color 3/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionBackgroundColorLight get or set the ribbon tab's caption background color 1/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionBackgroundColorMedium get or set the ribbon tab's caption background color 2/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionFocusedBackgroundColorDark get or set the ribbon tab's caption focused background color 3/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionFocusedBackgroundColorLight get or set the ribbon tab's caption focused background color 1/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> RibbonTabCaptionFocusedBackgroundColorMedium get or set the ribbon tab's caption focused background color 2/3.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationButtonLabel get or set the label text of the application button.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationButtonBitmap get the application button's bitmap.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ApplicationBitmapShared get the application button's bitmap shared flag. Not shared bitmaps will be disposed by the XrwRibbon's Dispose(), shared bitmaps won't.

Overridden public properties (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> BorderWidth is now read only.

Overridden public properties (XrwVisibleRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> FrameWidth doesn't support set now.
  • <img src="/KB/dialog/746051/V0.4on.png" /> ExpandToAvailableHeight doesn't support set now.

New public methods

  • <img src="/KB/dialog/746051/V0.3on.png" /> SetApplicationButtonBitmap() set application button's bitmap and bitmap shared flag.
  • <img src="/KB/dialog/746051/V0.3on.png" /> GetSelectedTab() get the currently selected tab. Can be null.
  • Image 143 GetTextColor() get the text color of the indicated ribbon tab. Replaces the getter property TextColor. The default value is XrwTheme.TextColor.
  • Image 144 SetSelectedTab() select the indicated tab.
  • Image 145 SetTextColor() set the text color of the indicated ribbon tab. Replaces the setter property TextColor.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> CalculateChildLayout() distribute the available size to the children (ribbon tabs) with regard to their PreferredSize, ExpandToAvailableWidth and ExpandToMaxSiblingWidth but not ExpandToAvailableHeight and ExpandToMaxSiblingHeight (because the ribbon has a fixed height) and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.3on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.3on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.3on.png" /> AllWindowedWidgets() return the collection of all windowed child widgets
  • <img src="/KB/dialog/746051/V0.3on.png" /> Realize() allocate and map the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object visible.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Redraw() redraw the widget/gadget.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Unrealize() unmap and free the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object invisible.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.3on.png" /> AddChild() add the indicated XrwRobbonTab to the list of children at list tail. There is no check to prevent multiple additions of the same child. Ignores null poiter. Selects the last added child.
  • <img src="/KB/dialog/746051/V0.3on.png" /> InsertChild() add the indicated XrwRibbonTab to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. Selects the last added child.

New  event handler

None.

Overridden event handler (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> OnExpose() handle the ExposeEvent event.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.3on.png" /> Application button's Click += HandleApplicationButtonClicked pop up the application menu.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Enter += HandleEnterDefault performs noting.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Leave += HandleLeaveDefault unset focused child.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Motion += HandleMotionDefault focus or unfocus the appropriate child.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ButtonPress+= HandleButtonPressDefault perform the button press action for the appropriate child.
  • <img src="/KB/dialog/746051/V0.3on.png" /> ButtonRelease += HandleButtonReleaseDefault perform the button release action for the appropriate child.

XrwRibbonPanel

Image 146 The XrwRibbonPanel is the second highest level of application command control arrangement and groups command controls into related sets inside a ribbon tab. The descriptive ribbon panel's label explains the common purpose of its command controls.

Because the ribbon is implemented as one integral widget, almost all of its children (including the ribbon panel) are implemented as gadgets. The ribbon panel is a ribbon child, that provides the functionality of a labeled frame to the ribbon.

The XrwRibbonPanel has a fixed height and expands to the requested width according it's children. The XrwRibbonPanel shows a dialog launcher (Image 147), if the ribbon panel has a ButtonRelease event handler registered.

This class has no public constructor, but a static factory method. NewRibbonPanelGadget creates a new empty XrwRibbonPanel instance.

See the image of XrwRibbon for a sample picture of ribbon panels.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwRibbonPanel

New event definitions

XrwRibbonPanel is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
Label string get, set  
TextBackgroundColor Image 148 Image 149 TPixel
Image 150 TColor
get, set XrwTheme.RibbonPanelText-
BackgroundColor
TextColor Image 151 Image 152 TPixel
Image 153 TColor
get, set XrwTheme.TextColor
  • Image 154 Label get or set the label text.
  • <img src="/KB/dialog/746051/V0.3on.png" /> TextBackgroundColor get or set the background color of the panel's label.
  • Image 155 TextColor get or set the text color of a panel's label.

Overridden public properties (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> BorderWidth is now read only.
  • <img src="/KB/dialog/746051/V0.3on.png" /> FrameWidth is now read only.

New public methods

  • <img src="/KB/dialog/746051/V0.3on.png" /> TextBoxArea calculate the panel's label display area.
  • <img src="/KB/dialog/746051/V0.3on.png" /> DialogLauncherArea calculate the panel's dialog launcher button area.
  • <img src="/KB/dialog/746051/V0.3on.png" /> InsideDialogLauncherBoundings check whether the indicated point is inside the panel's dialog launcher button area.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> CalculateChildLayout() distribute the available size to the children (command controls and control groups with regard to their PreferredSize, but not ExpandToAvailableWidth, ExpandToMaxSiblingWidth, ExpandToAvailableHeight and ExpandToMaxSiblingHeight and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.3on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.3on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • Image 156 Redraw() redraw the gadget.

New  event handler

None.

Overridden event handler (XrwRectObj)

None.

New preregistered event delegates

None.

Usage

The XrwRibbonPanel is designed to create a ribbon panel with minimum effort.

C#
XrwRibbonPanel panelLargeButtons = XrwRibbonPanel.NewRibbonPanel (dialogtestTab,
                                                                     "Large buttons");
if (panelLargeButtons != null)
{
    dialogtestTab.AddChild (panelLargeButtons);
    panelLargeButtons.ButtonRelease += delegate(XrwRectObj source, XrwButtonEvent e)
    {
        ApplicationFramework.WriteStatus ("XrwRibbonPanel '" + panelLargeButtons.Label +
                                          "' dialog launcher clicked.");
    };

    // Add command controls and/or control groups.
}

XrwRibbonTab

Image 157 The XrwRibbonTab is the highest level of application command control arrangement and should offer a clear, obvious, and unique mapping between the descriptive ribbon tab's label and the command controls that reside inside them. It organizes the features of an application to aid discoverability.

Because the ribbon is implemented as one integral widget, almost all of its children (including the ribbon tab) are implemented as gadgets. The ribbon tab is a ribbon child, that provides the functionality similar to a notebook tab to the ribbon.

Ribbon tabs are used for commands that affect the content of the window. Examples include commands used to present, format, modify, or use the content of a file or storage, or change the view. (By contrast, the application menu is used to present commands that involve doing something to or with a file or storage, such as commands that traditionally go in the file menu to create, open, and save, to print, and to send or publish data.)

The XrwRibbonTab has a fixed height and expands always to the ribbon's full width.

This class has no public constructor, but a static factory method. NewRibbonTabGadget creates a new empty XrwRibbonTab instance.

See the image of XrwRibbon for a sample picture of ribbon tabs.

Image 158 This version introduces markup. See XrwLabelBase for details.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwRibbonTab

New event definitions

XrwRibbonTab is always instantiated as gadget. It can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
Label string get, set  
Lines StyleText get != null
HeaderFocused bool get, set false
Selected bool get, set false
  • Image 159 Label get or set the label text.
  • Image 160 Lines get the (multiple lines) label of style characters to display (\n has been transformed into lines).
  • <img src="/KB/dialog/746051/V0.3on.png" /> HeaderFocused get or set whether the ribbon tab's header is currently focused.
  • Image 161 Selected get or set whether the ribbon tab is currently selected.

Overridden public properties (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> BorderWidth is now read only.
  • <img src="/KB/dialog/746051/V0.3on.png" /> FrameWidth is now read only.

New public methods

  • <img src="/KB/dialog/746051/V0.3on.png" /><code> TabHeaderPreferredSize get the preferred size of the ribbon tab's header.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> CalculateChildLayout() distribute the available size to the children (ribbon panels with regard to their PreferredSize, but not ExpandToAvailableWidth, ExpandToMaxSiblingWidth, ExpandToAvailableHeight and ExpandToMaxSiblingHeight and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.3on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.3on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • Image 162 Redraw() redraw the gadget.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.3on.png" /> AddChild() add the indicated XrwRobbonPanel to the list of children at tail position. There is no check to prevent multiple additions of the same child. Ignores null poiter. Selects the last added child.
  • <img src="/KB/dialog/746051/V0.3on.png" /> InsertChild() add the indicated XrwRibbonPanel to the list of children at indicated position (or at tail position as fallback). There is no check to prevent multiple additions of the same child. Ignores null poiter. Selects the last added child.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

Usage

The XrwRobbonTab is designed to create a ribbon tab with minimal effort.

C#
XrwRibbonTab dialogtestTab = XrwRibbonTab.NewRibbonTab (ribbon, "Dialog test");
if (dialogtestTab != null)
{
    ribbon.AddChild (dialogtestTab);

    // Add ribbon panels.
} 

XrwViewport

Image 163 The XrwViewport class is a scrollable viewing area widget. It is comparable to Athena's "Viewport" widget.

The Athena's description for "Viewport" says (X Window System Athena Widgets, Quick Reference Guide):
The Viewport widget consists of a frame window, one or two Scrollbars, and an inner window (usually containing a child widget). The size of the frame window is determined by the viewing size of the data that is to be displayed and the dimensions to which the Viewport is created. The inner window is the full size of the data that is to be displayed and is clipped by the frame window. The Viewport widget controls the scrolling of the data directly. No application callbacks are required for scrolling. When the geometry of the frame window is equal in size to the inner window, or when the data does not require scrolling, the Viewport widget automatically removes any scrollbars. The "forceBars" option causes the Viewport widget to display all scrollbars permanently.

A XrwViewport uses four internal widgets - a Clip widget (realized by an XrwSimple), that clips the invisible area of the controlled Child - a VScroll widget (realized by a vertical XrwScroll), that controlles the vertical position of the Child - a HScroll widget (realized by a horizontal XrwScroll), that controlles the horizontal position of the Child - and the controlled Child. The Child is the only user defined widget and must be assigned via AddChild() or InsertChild() and can be any XrwCore or derived class.

This class has no public constructor, but two factory methods. NewViewportWidget/NewViewportGadged create a new XrwViewport.

The image shows the general capabilities of a XrwViewport.

Image 164

Image 165 Starting with this version the XrwViewport has a new integral part, the XrwViewportGridViewHeader widget - it will be created and destroed by the XrwViewport automatically. The XrwViewportGridViewHeader is responsible for the display of the column header names of an XrwViewport's but has no internal header data. It takes the header data from the Child instead. The Child property supports any XrwCore or derived class, but only for a Child implementing the XrwIGridView interface, the XrwViewportGridViewHeader shows column header names, otherwise it remains empty. Irrespective whether the Child is implementing the XrwIGridView interface, the header can be visible, hidden or collpsed, controlled by the HeaderVisibility property, and the header's preferred size can be defined, controlled by the HeaderPreferredHeight property.

Currently the  XrwList and  XrwTree implement the XrwIGridView interface.

The image shows the general capabilities of a XrwViewport including a XrwViewportGridViewHeader.

Image 166

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwConstraint --> XrwViewport

New event definitions

XrwViewport can be instantiated as widget or gadget. The widget can receive events on it's own (has a window on X server side). The gadget can only receive events that are forwarded from a parent widget.

None.

New public properties

Name Type Access Default/Fallback
AllowHoriz bool get, set true
AllowVert bool get, set true
Child XrwCore get null
Clip XrwSimple get != null
ClipFrameType TFrameType get, set TFrameType.None
ClipFrameWidth int get, set 0
ForceBars bool get, set false
HeaderBackground-
ColorDark
Image 167 Image 168 TPixel
Image 169 TColor
get, set XrwTheme.Interactive-
BackgroundColorDark
HeaderBackground-
ColorLight
Image 170 Image 171 TPixel
Image 172 TColor
get, set XrwTheme.Interactive-
BackgroundColorLight
HeaderBackground-
ColorMedium
Image 173 Image 174 TPixel
Image 175 TColor
get, set XrwTheme.Interactive-
BackgroundColorMedium
HeaderPreferredHeight int get, set 16
HeaderVisibility Visibility get, set Visibility.Collapsed
HScroll XrwScroll get != null
VScroll XrwScroll get != null
ScrollFrameType TFrameType get, set TFrameType.None
ScrollFrameWidth int get, set XrwTheme.NonInteracting-
FrameWidth
UseBottom bool get, set true
UseRight bool get, set true
ShowHScroll bool get  
ShowHScroll bool get  
ScrollOffsetX int get  
ScrollOffsetY int get  
  • <img src="/KB/dialog/746051/V0.1on.png" /> AllowHorz distinguish between allowed/prohibited visibility of horizontal scroll bar.
  • <img src="/KB/dialog/746051/V0.1on.png" /> AllowVert distinguish between allowed/prohibited visibility of vertical scroll bar.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Child get the controlled (scrolled) child widget, formerly set with SetChild()/InsertChild() or null.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Clip get the widget, that realizes clipping for the child.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ClipFrameType get or set the frame type of the clip widget.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ForceBars distinguishe between always forced or automatic (if needed) visibility of scroll bars.
  • <img src="/KB/dialog/746051/V0.4on.png" /> HeaderBackgroundColorDark get or set the grid view's column header background color 3/3.
  • <img src="/KB/dialog/746051/V0.4on.png" /> HeaderBackgroundColorLightm get or set the grid view's column header background color  1/3.
  • <img src="/KB/dialog/746051/V0.4on.png" /> HeaderBackgroundColorMedium get or set the grid view's column header background color  2/3.
  • <img src="/KB/dialog/746051/V0.4on.png" /> HeaderPreferredHeight get or set the grid view's column header preferred height.
  • <img src="/KB/dialog/746051/V0.4on.png" /> HeaderVisibility get or set the grid view's column header visibility.
  • <img src="/KB/dialog/746051/V0.1on.png" /> HScroll get the widget, that realizes horizontal scrolling.
  • <img src="/KB/dialog/746051/V0.1on.png" /> VScroll get the widget, that realizes vertical scrolling.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ScrollFrameType get or set the frame type of the scroll widgets.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ScrollFrameWidth get or set the frame width of the scroll widgets.
  • <img src="/KB/dialog/746051/V0.1on.png" /> UseBottom distinguish between top or bottom aligned horizontal scroll bar.
  • <img src="/KB/dialog/746051/V0.1on.png" /> UseRight distinguish between left or right aligned vertical scroll bar.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ShowHScroll get whether horizontal scroll bar is currently visible.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ShowVScroll get whether vertical scroll bar is currently visible.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ScrollOffsetX get the offset of the child's first column x coordinate. It is negative, if the child has been scrolled horizontally.
  • <img src="/KB/dialog/746051/V0.1on.png" /> ScrollOffsetY get the offset of the child's first row y coordinate. It is negative, if the child has been scrolled vertically.

Overridden public properties (XrwComposite)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Children get the list of all direct children.

New public methods

  • Image 176 RealizeChild() realize indicated child and unrealize (hide) formerly realized child.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> CalculateChildLayout() distribute the available size to the children (if any) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.1on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore>)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Realize() allocate and map the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object visible.

Overridden public methods (XrwComposite)

Although XrwViewport is derived from XrwComposite, only ONE child is supported.

  • AddChild() add the indicated XrwCore to the list of children at tail position. There is no check to prevent multiple additions of the same child. Removes the previous child (only one child as acceptable). Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.1on.png" /> InsertChild() add the indicated XrwCore to the list of children at indicated position (or at tail as fallback). There is no check to prevent multiple additions of the same child. Removes the previous child (only one child as acceptable). Ignores null poiter.
  • <img src="/KB/dialog/746051/V0.1on.png" /> RemoveChild() remove the indicated XrwCore from the list children. Ignores null poiter.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

The XrwViewport registers no event handler on it's own, but it registeres a ScrollResponse event handler to each XrwScrollbar child.

  • <img src="/KB/dialog/746051/V0.3on.png" /> ThumbMoved += HandleHScrollResponseDefault and ThumbMoved += HandleVScrollResponseDefault on the XrwScrollbar children update the position of the controlled child.

Usage

See article Unlesh the power of list and tree widget (X11) for sample code and detailed information about application.

XrwBaseCellEditorShell

Image 177 The XrwBaseCellEditorShell is an abstract base class for popup cell editors, that are required for in-place editing of XrwList and XrwTree. It implements XrwICellEditorShell.

The base cell editor shell is used to determine the appropriate cell editor for a list's or tree's column in-place editing. The editor pops up as an overlay to the column's cell to edit and must fit the cell's data type.

This class is abstract and can not be instantiated.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwBaseCellEditorShell.

New event definitions

None.

New public properties

Name Type Access Default/Fallback
Data object get, set != null
DataParent XrwCore get != null
DataBinding XrwBinding get != null
DataType System.Type get != null
InitialDataValue object get != null
  • Image 178 Data (implements XrwICellEditorShell) get or set the data to edit.
  • Image 179 DataParent (implements XrwICellEditorShell) get or (internal only) set the widget/gadget that ist the source of the data to edit.
  • Image 180 DataBinding (implements XrwICellEditorShell) get or (internal only) set the binding to the data's property to edit.
  • Image 181 DataType (implements XrwICellEditorShell) get or (internal only) set the data type to edit.
  • Image 182 InitialValue (implements XrwICellEditorShell) get or (internal only) set the initial data value (before editing).

Overridden public properties

None.

New public methods

  • Image 183 FindCellEditor() determines the appropriate cell editor for a list's or tree's column in-place editing.

Overridden public methods

None.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

None.

XrwGenericCellEditorShell

Image 184 The XrwGenericCellEditorShell provides a popup cell editor for in-place editing of XrwList's and XrwTree's text value cell.

The generic cell editor shell is used as popup text value editor for in-place editing of list or tree cells.

This class has no public constructor, but a static factory method. NewGenericCellEditorShell creates a new empty XrwGenericCellEditorShell instance. Typically it is not necessary to call the factory method from user code, because the XrwBaseCellEditorShell's static FindCellEditor method creates an instance, if required.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwBaseCellEditorShell --> XrwGenericCellEditorShell.

New event definitions

None.

New public properties

None.

Overridden public properties

None.

New public methods

None.

Overridden public methods (XrwRectObj)

  • Image 185 CalculateChildLayout() distribute the available size to the children (text editor). The editor shell pops up as an overlay to the column's cell to edit and must fit the cell's dimension.

New event handler

None.

Overridden event handler

None.

Preregistered event delegates

  • Image 186 FocusOut += HandleFocusOutDefault unrealize this XrwGenericCellEditorShell.

XrwRibbonAppMenu

Image 187 The XrwRibbonAppMenu is the popup application menu of a XrwRibbon, displaying XrwSmes.

The application menu is used to present commands that involve doing something to or with a file or storage, such as commands that traditionally go in the file menu to create, open, and save, to print, and to send or publish data. (By contrast, ribbon tabs are used for commands that affect the content of the window. Examples include commands used to present, format, modify, or use the content of a file or storage, or change change the view.)

This class has no public constructor, but a static factory method. NewRibbonAppMenu creates a new empty XrwRibbonAppMenu instance. Typically it is not necessary to call the factory method from user code, because the XrwRibbon class always creates an application menu by default.

Since the XrwRibbonAppMenu is derived from XrwOverrideShell, it uses XrwOverrideShell's mechanism to registeres itself on Realize() to the XrwApplicationShell's associated shells list (as override shell) to get events forwarded and to deregister itself on Unrealize() from the XrwApplicationShell's associated shells list to stop event forwarding.

The image shows a XrwRibbonAppMenu containing a command panel and a details panel.

Image 188

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwRibbonAppMenu

New event definitions

XrwRibbonAppMenu is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
ChildAlign float get, set 0.5
CommandPanel XrwBox get != null
DetailsPanel XrwBox get != null
HorzSpacing long get, set 10
UnrealizeTimeStamp XrwScroll get != null
  • <img src="/KB/dialog/746051/V0.3on.png" /> ChildAlign get or set the horizontal alignment of CommandPanel's and DetailPanel's children, that do not expand to available width. 0.0 aligns left, 0.5 aligns center and 1.0 right. The value can not underflow 0.0 or overflow 1.0. The alignment is operative only if there is space left to align. (That means expand-to-max-siblings-* doesn't use the complete space and expand-to-available-* is not set for any child.)
  • <img src="/KB/dialog/746051/V0.3on.png" /> CommandPanel get the command pannel (left application menu pannel).
  • <img src="/KB/dialog/746051/V0.3on.png" /> DetailsPanelget the details pannel (right application menu pannel).
  • <img src="/KB/dialog/746051/V0.3on.png" /> HorzSpacing get or set the horizontal spacing between command panel and a details panel. The value can not underflow 0 or overflow 400.
  • <img src="/KB/dialog/746051/V0.3on.png" /> UnrealizeTimeStamp get the timestamp (ms + s * 1000 + m * 60000 + h * 3600000) of the last Unrealize() call. This can be used to distinguish between undesired and desired Realize() calls after a previous Unrealize() call.

Overridden public properties

None.

New public methods

None.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.3on.png" /> CalculateChildLayout() distribute the available size to the children (command panel and a details panel) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.
  • <img src="/KB/dialog/746051/V0.3on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.3on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • Image 189 Redraw() redraw the widget/gadget.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Realize()allocate and map the resources of the associated window (if object is awidget/has own window) on the X server. Makes the object visible.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Unrealize()unmap and free the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object in visible.

Overridden public methods (XrwComposite)

  • <img src="/KB/dialog/746051/V0.3on.png" /> AddChild() not supported. The only permanant child is the horizontal box containing CommandPanel and DetailPanel.
  • <img src="/KB/dialog/746051/V0.3on.png" /> InsertChild() not supported. The only permanant child is the horizontal box containing CommandPanel and DetailPanel
  • <img src="/KB/dialog/746051/V0.4on.png" /> RemoveChild() not supported. The only permanant child is the horizontal box containing CommandPanel and DetailPanel.
  •  

New event handler

None.

Overridden event handler (XrwRectObj)

None.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.3on.png" /> Enter += HandleEnterDefault set focused.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Leave += HandleLeaveDefault unset focused.
  • <img src="/KB/dialog/746051/V0.3on.png" /> FocusIn += HandleFocusInDefault HandleCommandPannelChildAddedDefault.
  • <img src="/KB/dialog/746051/V0.3on.png" /> FocusOut += HandleFocusOutDefault unrealize this XrwSimpleMenu.
  • <img src="/KB/dialog/746051/V0.3on.png" /> Motion += HandleMotionDefault set or unset appropriate XrwSme's focus and call InvokeRedraw().
  • <img src="/KB/dialog/746051/V0.3on.png" /> ButtonRelease += HandleButtonReleaseDefault all appropriate XrwSme's OnButtonRelease().
  • <img src="/KB/dialog/746051/V0.3on.png" /> CommandPanel.ChildAdded += HandleCommandPannelChildAddedDefault register the XrwRibbonAppMenu<code>.HandleCommandButtonReleaseDefault to the new command panel child and adjust the style (colors, margins, ...) if new command panel child is of type XrwSme. The XrwRibbonAppMenu<code>.HandleCommandButtonReleaseDefault event handler calls Unrealize() for the XrwRibbonAppMenu.
  • <img src="/KB/dialog/746051/V0.3on.png" /> DetailsPanel.ChildAdded += HandleDetailsPannelChildAddedDefault register the XrwRibbonAppMenu<code>.HandleDetailsPannelChildAddedDefault to the new details panel child and adjust the style (colors, margins, ...) if new details panel child is of type XrwSme. The XrwRibbonAppMenu<code>.HandleCommandButtonReleaseDefault event handler calls Unrealize() for the XrwRibbonAppMenu.

Usage

The XrwRibbonAppMenu is designed to create a ribbon application menu with minimal effort. This is the complete code to create an application menu as shown in the image above.

C#
XrwBox commandPanel = ribbon.ApplicationMenu.CommandPanel;
if (commandPanel != null)
{
    // Prepare the images - except for WinMidori.
    X11Graphic appmenuGraphicNew     = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonNew));
    X11Graphic appmenuGraphicOpen    = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonOpen));
    X11Graphic appmenuGraphicSave    = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonSave));
    X11Graphic appmenuGraphicSaveAs  = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonSaveAs));
    X11Graphic appmenuGraphicOptions = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonOptions));
    X11Graphic appmenuGraphicClose   = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonClose));
    X11Graphic appmenuGraphicExit    = (XrwTheme.Style == XrwTheme.GeneralStyle.WinMidori ?
        null : XrwTheme.GetGraphic ( _display, _screenNumber, X11Graphic.StockIcon.RibbonExit));

    // Menu entry "New".
    XrwSme appmenuNew     = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "New",
        appmenuGraphicNew,     (appmenuGraphicNew    != null ? true : false), null, false);
    commandPanel.AddChild (appmenuNew);
    
    // Menu entry "Open" and delimiter.
    XrwSme appmenuOpen    = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Open",
       appmenuGraphicOpen,    (appmenuGraphicOpen   != null ? true : false), null, false);
    commandPanel.AddChild (appmenuOpen);
    appmenuOpen.ButtonRelease += HandleFileSelectionDialogButtonRelease;
    appmenuOpen.FrameType  = TFrameType.MenuDelimiter;
    appmenuOpen.FrameWidth = (XrwTheme.Style == XrwTheme.GeneralStyle.WinClassic ? 2 : 1);
    
    // Menu entry "Save".
    XrwSme appmenuSave    = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Save",
        appmenuGraphicSave,    (appmenuGraphicSave   != null ? true : false), null, false);
    commandPanel.AddChild (appmenuSave);
    
    // Menu entry "Save as" and delimiter.
    XrwSme appmenuSaveAs  = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Save as",
        appmenuGraphicSaveAs,  (appmenuGraphicSaveAs != null ? true : false), null, false);
    commandPanel.AddChild (appmenuSaveAs);
    appmenuSaveAs.ButtonRelease += HandleFileSelectionDialogButtonRelease;
    appmenuSaveAs.FrameType  = TFrameType.MenuDelimiter;
    appmenuSaveAs.FrameWidth = (XrwTheme.Style == XrwTheme.GeneralStyle.WinClassic ? 2 : 1);
    
     // Menu entry "Options".
    XrwSme appmenuOptions = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Options",
        appmenuGraphicOptions, (appmenuGraphicOptions != null ? true : false), null, false);
    commandPanel.AddChild (appmenuOptions);
    
    // Menu entry "Close" and delimiter.
    XrwSme appmenuClose   = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Close",
        appmenuGraphicClose,   (appmenuGraphicClose   != null ? true : false), null, false);
    commandPanel.AddChild (appmenuClose);
    appmenuClose.FrameType  = TFrameType.MenuDelimiter;
    appmenuClose.FrameWidth = (XrwTheme.Style == XrwTheme.GeneralStyle.WinClassic ? 2 : 1);
    
     // Menu entry "Exit".
    XrwSme appmenuExit    = XrwSme.NewSmeGadget (ribbon.ApplicationMenu, "Exit",
        appmenuGraphicExit,    (appmenuGraphicExit    != null ? true : false), null, false);
    commandPanel.AddChild (appmenuExit);
    appmenuExit.ButtonRelease += HandleCloseButtonRelease;
}
XrwBox detailsPanel = ribbon.ApplicationMenu.DetailsPanel;
if (detailsPanel != null)
{
    XrwLabel recentDocuments = XrwLabel.NewLabelGadget (detailsPanel, "Recent documents",
        null, false, null, false);
    detailsPanel.AddChild (recentDocuments);
    XrwSme recentDoc1 = XrwSme.NewSmeGadget (detailsPanel, "File 1", null, false, null, false);
    detailsPanel.AddChild (recentDoc1);
    XrwSme recentDoc2 = XrwSme.NewSmeGadget (detailsPanel, "File 2", null, false, null, false);
    detailsPanel.AddChild (recentDoc2);
}

XrwSimpleMenu

Image 190 The XrwSimpleMenu class is a popup shell, displaying XrwSmes. It is comparable to Athena's "SimpleMenu".

The Athena's description for "SimpleMenu" says (Athena Widget Set — C Language Interface):
The SimpleMenu widget is a container for the menu panes. It is a direct subclass of shell, and is should be created with XtCreatePopupShell(), not XtCreateManagedWidget(). This is the only part of the menu that actually is associated with a window, since each menu pane is a gadget. The SimpleMenu serves as the glue to bind the individual menu entries together into one menu.

This class has no public constructor, but a static factory method. NewSimpleMenu creates a new empty XrwSimpleMenu instance. Typically it is not necessary to call the factory method from user code, because the XrwMenuButton and XrwRibbonSplitButton class always create an simple menu by default.

Since the XrwSimpleMenu is derived from XrwOverrideShell, it uses XrwOverrideShell's mechanism to registeres itself on Realize() to the XrwApplicationShell's associated shells list (as override shell) to get events forwarded and to deregister itself on Unrealize() from the XrwApplicationShell's associated shells list to stop event forwarding.

The image shows a XrwSimpleMenu containing two XrwSmes.

Image 191

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwSimpleMenu

New event definitions

XrwSimpleMenu is always instantiated as widget. It can receive events on it's own (has a window on X server side).

None.

New public properties

Name Type Access Default/Fallback
UnrealizeTimeStamp long get 0
VertSpacing int get, set 0
  • <img src="/KB/dialog/746051/V0.2on.png" /> UnrealizeTimeStamp get the timestamp (ms + s * 1000 + m * 60000 + h * 3600000) of the last Unrealize() call. This can be used to distinguish between undesired and desired Realize() calls after a previous Unrealize() call.
  • <img src="/KB/dialog/746051/V0.1on.png" /> VertSpacing get or set the vertical spacing between two neighbouring children.

Overridden public properties

None.

New public methods

  • <img src="/KB/dialog/746051/V0.1on.png" /> CalculateChildLayout() calculates the layout of all children and composes the menu geometry thereof. This method doesn't override XrwRectObj's CalculateChildLayout because it requires no parameters.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.1on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.1on.png" /> PreferredSize() calculate the preferred size.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.1on.png" /> Realize()allocate and map the resources of the associated window (if object is awidget/has own window) on the X server. Makes the object visible.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Unrealize()unmap and free the resources of the associated window (if object is a widget/has own window) on the X server. Makes the object in visible.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.1on.png" /> FocusIn += HandleFocusInDefault nothing.
  • <img src="/KB/dialog/746051/V0.1on.png" /> FocusOut += HandleFocusOutDefault unrealize this XrwSimpleMenu.
  • <img src="/KB/dialog/746051/V0.1on.png" /> Motion += HandleMotionDefault set or unset appropriate XrwSme's focus and call InvokeRedraw().
  • <img src="/KB/dialog/746051/V0.1on.png" /> ButtonPress += HandleButtonPressDefault process all appropriate XrwSme's OnButtonPress().
  • <img src="/KB/dialog/746051/V0.1on.png" /> ButtonRelease += HandleButtonReleaseDefault process all appropriate XrwSme's OnButtonRelease().
  • <img src="/KB/dialog/746051/V0.2on.png" /> ChildAdded += HandleChildAddedDefault registers the XrwSimpleMenu.HandleChildButtonReleaseDefault to the new child. This event handler calls Unrealize() for the XrwSimpleMenu.

Usage

A XrwSimpleMenu is typically used in conjunction with a XrwMenuButton. See XrwMenuButton for details about the use of XrwSimpleMenu.

XrwDropDownCellEditorShell

Image 192 The XrwDropDownCellEditorShell provides a popup cell editor for in-place editing of XrwList's and XrwTree's enumerable value cell. It implements XrwICellEditorShell.

The drop down cell editor shell is used as popup enumerable value editor for in-place editing of list or tree cells.

This class has no public constructor, but a static factory method. NewDropDownCellEditorShell creates a new empty XrwDropDownCellEditorShell instance. Typically it is not necessary to call the factory method from user code, because the XrwBaseCellEditorShell's static FindCellEditor method creates an instance, if required.

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwSimpleMenu --> XrwDropDownCellEditorShell.

New event definitions

None.

New public properties

Name Type Access Default/Fallback
Data object get, set != null
DataParent XrwCore get != null
DataBinding XrwBinding get != null
DataType System.Type get != null
InitialDataValue object get != null
  • Image 193 Data (implements XrwICellEditorShell) get or set the data to edit.
  • Image 194 DataParent (implements XrwICellEditorShell) get or (internal only) set the widget/gadget that ist the source of the data to edit.
  • Image 195 DataBinding (implements XrwICellEditorShell) get or (internal only) set the binding to the data's property to edit.
  • Image 196 DataType (implements XrwICellEditorShell) get or (internal only) set the data type to edit.
  • Image 197 InitialValue (implements XrwICellEditorShell) get or (internal only) set the initial data value (before editing).

Overridden public properties

None.

New public methods

None.

Overridden public methods

None.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

  • Image 198 FocusOut += HandleFocusOutDefault unrealize this XrwDropDownCellEditorShell.
  • Image 199 ButtonRelease += HandleMenuButtonReleasetDefault assumes the selected XrwSme's value.

XrwSpinMenu

Image 200 The XrwSpinMenu class is is a popup shell, displaying XrwSmes. If there is not enough space to display the all XrwSmes, the content can be scrolled.

The XrwSpinMenu class is a subclass of XrwSimpleMenu. It is the only part of the menu that actually is associated with a window, since each menu pane is a gadget. The XrwSpinMenu serves as the glue to bind the individual menu panes together into one menu. Different to XrwSimpleMenu it can organize more menu panes than displayable on its visible area. In that case it can spin invisible menu panes to the visible area and visible menu panes to the invisible area - wherefore it shows two spin navigators (forth and back) dynamically, if required.

This class has no public constructor, but a static factory method. NewSpinMenu creates a new empty XrwSpinMenu instance. Typically it is not necessary to call the factory method from user code, because the XrwComboBox class always creates an spin menu by default.

Since the XrwSpinMenu is derived from XrwOverrideShell (via XrwSimpleMenu), it uses XrwOverrideShell's mechanism to registeres itself on Realize() to the XrwApplicationShell's associated shells list (as override shell) to get events forwarded and to deregister itself on Unrealize() from the XrwApplicationShell's associated shells list to stop event forwarding.

The image shows a XrwSpinMenu containing 10 menu pane XrwSmes and the back and forth navigators.

Image 201

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwOverrideShell --> XrwSimpleMenu --> XrwSpinMenu

New event definitions

XrwSpinMenu is always instantiated as widget. It can receive events on it's own (has a window on X server side).
None.

New public properties

Name Type Access Default/Fallback
ChildCountWithoutNavigators int get  
Back XrwSme get  
Forth XrwSme get  
ShowNavigators bool get false
VisibilityStartOffset int get, set 0
VisibilityEndOffset int get, set  
  • <img src="/KB/dialog/746051/V0.2on.png" /> ChildCountWithoutNavigators get the number of menu panes, excluding the navigators. This is much faster than a call to Children.Count (because the navigators must be excluded fom the list of children).
  • <img src="/KB/dialog/746051/V0.2on.png" /> Back get the back navigator XrwSme.
  • <img src="/KB/dialog/746051/V0.2on.png" /> Forth get the forth navigator XrwSme.
  • <img src="/KB/dialog/746051/V0.2on.png" /> ShowNavigators get the current internal state whether to show navigators or not.
  • <img src="/KB/dialog/746051/V0.2on.png" /> VisibilityStartOffset get or set the index of the first non-navigator menu pane to show. This index is not calculated by the XrwSimpleMenu itself, it must be calculated and set by the caller.
  • <img src="/KB/dialog/746051/V0.2on.png" />VisibilityEndOffset get or set the index of the last non-navigator menu pane to show. This index is not calculated by the XrwSimpleMenu itself, it must be calculated and set by the caller.

Overridden public properties (XrwComposite)

  • <img src="/KB/dialog/746051/V0.2on.png" /> Children get the list of all direct children, excluding the navigators.

New public methods

  • <img src="/KB/dialog/746051/V0.2on.png" /> IndexOfWithoutNavigarors() searches for the specified child and returns the zero-based index of the first occurrence within the entire child list. Since the forth and back navigators are the first two children, the Value chould be equal to IndexOf() - 2.

Overridden public methods (XrwRectObj)

  • <img src="/KB/dialog/746051/V0.2on.png" /> MinimumSize() calculate the minimum size.
  • <img src="/KB/dialog/746051/V0.2on.png" /> PreferredSize() calculate the preferred size.
  • <img src="/KB/dialog/746051/V0.2on.png" /> CalculateChildLayout() distribute the available size to the children (if any) with regard to their PreferredSize, ExpandToAvailableHeight, ExpandToMaxSiblingHeight, ExpandToAvailableWidth, and ExpandToMaxSiblingWidth and set the AssignedSize and AssignedPosition.

Overridden public methods (XrwCore)

  • <img src="/KB/dialog/746051/V0.2on.png" /> Realize()allocate and map the resources of the associated window (if object is awidget/has own window) on the X server. Makes the object visible.

New  event handler

None.

Overridden event handler

None.

New preregistered event delegates

  • <img src="/KB/dialog/746051/V0.2on.png" /> Back.ButtonRelease += HandleBackButtonRelease() scroll the visible menu panes back.
  • <img src="/KB/dialog/746051/V0.2on.png" /> Forth.ButtonRelease += HandleForthButtonRelease() scroll the visible menu panes forth.

Usage

A XrwSpinMenu is typically used in conjunction with a XrwComboBox. See XrwComboBox source code for details about the use of XrwSpinMenu within user defined controls.

XrwDialogShell

Image 202 The XrwDialogShell class is the base class for dialog box popups.

Xrw typically treats a dialog as a window split vertically. The top section is called "content area" and the bottom section is called "action area". A XrwDialogShell can be implemented modal (application blocking) or non-modal.

This class is abstract and must be inherited by an application's dialog window.

The image shows the standard XrwMessageBox, that is a predefined inheritance of the XrwDialogShell. It's "content area" contains a XrwLabel and it's "action area" contains two XrwCommands.

Image 203

Inheritance (↑)

IDisposable --> XrwObject --> XrwRectObject --> XrwVisibleRectObj --> XrwCore --> XrwComposite --> XrwShell --> XrwWmShell --> XrwTransientShell --> XrwDialogShell

New event definitions

XrwDialogShell is always instantiated as widget. It can receive events on it's own (has a window on X server side).
None.

New event definitions

The XrwDialogShell always receives events on it's own.

  • <img src="/KB/dialog/746051/V0.1on.png" /> DialogShellEnd occures after the windows manager requests the to XrwDialogShell close or any dialog internal command forces the XrwDialogShell to close.

New public properties

None.

Overridden public properties

None.

New public methods

None.

Overridden public methods

None.

New event handler

  • <img src="/KB/dialog/746051/V0.1on.png" /> OnEnd() handle the close ClientMessage event.

Overridden event handler

None.

New preregistered event delegates

None.

Points of Interest

It was surprising how little effort is required to create a simple widget set with an attractive design.
This work should also animate other programmers to deal with Mono on Linux or Linux-like platforms.

History

This article has been split-off from the article Programming the Roma Widget Set (C# X11) - a zero dependency GUI application framework - Part 1, Basics with the third public version of the Roma widget set, version Image 204 from 07. March 2014.
The fourth public version of the Roma widget set is version Image 205 from 13. May 2014.
The fifth public version of the Roma widget set is version Image 206 from 15. August 2014.
The sixth public version of the Roma widget set is version Image 207 from 03. October 2014.
The seventh public version of the Roma widget set is version Image 208 from 14. December 2014.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader Celonis SA
Germany Germany
I am currently the CEO of Symbioworld GmbH and as such responsible for personnel management, information security, data protection and certifications. Furthermore, as a senior programmer, I am responsible for the automatic layout engine, the simulation (Activity Based Costing), the automatic creation of Word/RTF reports and the data transformation in complex migration projects.

The main focus of my work as a programmer is the development of Microsoft Azure Services using C# and Visual Studio.

Privately, I am interested in C++ and Linux in addition to C#. I like the approach of open source software and like to support OSS with own contributions.

Comments and Discussions

 
QuestionIs this supported for COSMOS? Pin
adriancs31-Mar-14 20:55
mvaadriancs31-Mar-14 20:55 
AnswerRe: Is this supported for COSMOS? Pin
Steffen Ploetz31-Mar-14 21:32
mvaSteffen Ploetz31-Mar-14 21:32 
AnswerMy vote of 5 Pin
Christian Amado31-Mar-14 11:31
professionalChristian Amado31-Mar-14 11:31 
GeneralRe: My vote of 5 Pin
Steffen Ploetz31-Mar-14 19:47
mvaSteffen Ploetz31-Mar-14 19:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.