EasyMotif




Author: Dipl. Ing. Jürgen Keidel (WizAnt Software)

Dipl. Inf. Manfred Reimann


[ EADS Manching (Germany)]


Mail: wizant.keidel@freenet.de

manfred.reimann@freenet.de



home: http://www.freenet.de/wizantkeidel

download: https://sourceforge.net/projects/easymotif





User manual



Table of Contents

EasyMotif 1

EasyMotif create graphical user interfaces for Motif under Motif 1

Copyright 1

Shortcuts 1

Supported Widgets 1

Forms: 1

Motif Widgets: 1

Public domain Widgets: 1

Usage 1

Main dialog 1

Loading 1

Project options 1

saving, loading, create code 1

Creating a new dialog 1

Control dialog 1

Widget List 1

Clipboard 1

Options Pulldown 1

Tools (Toolbox) 1

create widgets 1

pop up 1

Alignment 1

create menus 1

WED widget editor 1

WED widget editor Widget specific area 1

Widget specific PUSH BUTTON 1

Widget specific ARROW BUTTON 1

Widget specific CASCADE BUTTON 1

Widget specific TOGGLE BUTTON 1

Widget specific Single Line TEXTFIELD 1

Widget specific Multi Line TEXTFIELD 1

Widget specific SCROLLED LIST 1

Widget specific OPTION MENU 1

Widget specific LABEL 1

Widget specific Scaler (Slider) 1

Widget specific FORM 1

Widget specific RADIO BOX 1

Widget specific ROW / COLUMN CONTAINER 1

Widget specific Scrolled Window 1

Widget specific Frame 1

Widget specific SEPARATOR 1

Widget specific GL drawing area 1

Widget specific PD Scrolling widget 1

Widget specific PD Histbar widget 1

Widget specific PD Ezdraw widget 1

Widget specific PD ComboBox widget 1

Widget specific PD listTree widget 1

Widget specific PD Rotlabel widget 1

Widget specific PD Counter widget 1

Widget specific PD Index widget 1

Widget specific PD ThumbWheel widget 1

Widget specific PD Whistspectr widget 1


1

WED widget editor Attachments 1

WED widget editor callbacks and events 1

WED callbacks 1

WED events 1

RED resource editor 1

RED resource editor font selection 1

RED resource editor color selection 1

GRED graphics editor 1

Attachment editor 1

Workbench 1

Texteditor (syntax sensitive) 1

Searching 1

Hierarchy browser 1

libeasymotif.a (Brainlib) 2

Textfield associated functions: 2

Scaler associated functions: 2

XmList associated functions: 2

Xm..RadioBox associated functions: 2

XmOptionButton associated functions: 2

String functions: 2

Getting color (with allocating): 2

Dealing with pixmaps: 2

Miscellaneous functions: 2

PD functions (libPD.a) 2

Resourcefile and useful resources: 2



EasyMotif create graphical user interfaces for Motif under Motif

Creating a graphical interface with EasyMotif requests only a minimal knowledge of Motif and allows rapid prototyping without writing any real code. The result will be a source-code file in standard ansi C, which can be compiled and linked to get a demonstration program. The widgets will be positioned and modified using graphical tools only, there is no need to write the complicated Motif function calls. Finally, the functionality of the program needs C-code, here an editor with several embedded functions allows to link the functionality to the widgets. The needed prototypes and calling structures are created automatically, so the user might concentrate on his functionality. An additional library, where the functions may be selected using menus, is included.
In addition, it is possible to create drawings in a form and add effects to them as blinking or flowing.

      Copyright

    This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General PublicLicense ; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

      Shortcuts

    Normally EasyMotif is used in a graphical environment, selecting the project to be edited via fileselector. It is possible to start EasyMotif with a preloaded project. Using the commandline option
    "-PRJ project-file-path" will start it with the given project loaded. In additon a second option "-c" on the commandline will write the C-code for the loaded project and exit immediately without displaying anything. This may be used p.e. in a Makefile to get the C-code for compiling.
    Example:
    EasyMotif -PRJ EasyMotif.prj -c

    will create the file EasyMotif.c from the project.

    Supported Widgets

    Forms:





    Motif Widgets:





    Public domain Widgets:



    WthumbWheel


    Whistspectr




    Usage

    Main dialog

The basic dialog, which appears when started (after loading a project), is shown in this picture. The pale green field at the bottom gives a short help for the actual button touched by the mouse (this field is existing in all dialogs).As long as no actual project is in use, the button icons are marked as insensitive (either empty or grayed). They reflect functions from the menus in the menubar, except the right ones, which will start the "Workbench".or the "Hierarchy browser" or start a make followed by running the target, displaying the output (normal and error) via xless.

The toolbox item in the menubar switches the toolbox to be used or not.

The second pictures shows the situation after loading a complex project, consisting of several projects. This is a feature to assemble some independent projects into one bigger project. (P.e. EasyMotif itself)























Loading

To get a project one must select NEW or Load from the Project menu..

Selecting New will raise a file selector to choose a projectfile. (the extension ".PRJ" will be added.) Selecting Simple-Load will raise a file selector showing all files with the extension ".PRJ" to be selected as a project. If you have already a project loaded and want to add another project, so creating a complex project, use the Add-Project item from the project pulldown. This will change to complex project, adding the selected project. The Project-Options dialog is opened to display the default settings for complex. Please change the entries for your convenience. The display changes to show the actual projects. The active Project button is the actual project and its dialogs are displayed as buttons in the lower field. Project buttons in yellow are projects with a main-dialog or a main function. Dialog button in yellow are main-dialogs. Switching between projects is done just by clicking the requested one.
CAUTION: The save and create C-code buttons will work only with the actual project. To save all, or to create the complete C-code use the corresponding items from the pulldown menus.





Project options


Following the file selection, a dialog is raised (the same dialog as the Options menu point Project options ) to set or change project specific options. The four left buttons will raise different menus to enter project options or comments. If EasyMotif generates defaults, they will be displayed. The fields for Program-name and Resource-name must be set, therefore EasyMotif generates initial defaults. In case of Complex project, there are two fields, Global include and Complex project file. These fields are defaulted, but may be changed. As the name defines, Complex project file will be used to save the Complex project information at save all. The Global include path will be referenced in each project C-code file. It will be autogenerated, including the part written by the options pulldown edit global header.The Options part actually only contains a toggle button selecting a main program or not in the target C-code and a toggle to write out fallbacks in the C-code. The Includes let the user select several include files and the Docu-button starts the editor with a documentation template to enter a basic documentation, which will be included in the target C-code. Pressing OK will close this dialog and activate all buttons. If an existing project is loaded, its dialogs are displayed as pushbuttons in the middle area, pressing a button will raise the dialog as it will appear later, raise a control dialog and the toolbox. If a new project shall be created, the next step should be "create a dialog".




saving, loading, create code






If the project is created, dialogs are created and filled with some widgets, the code etc. is typed in, the project needs to be stored. From the file-pulldown use the item save (or use the save button). This will generate a file with the name of the project and the extension ".PRJ", in addition, the old file is renamed with the additional extension ".BCK". This file may be loaded in using Load Project from the menu. The save actual creates a plain ascii file with several keywords (under LINUX possibly gzip compressed) . Before trying to edit it!!, you really should understand the structure. In case of a "complex Project", the SAVE ALL will create a complex-project file plus a file for each sub-project.
The Dialog pulldown has five entries, the first , create new Dialog, will be explained in the next chapter, the other two, Edit dialog, Delete dialog and Export dialog, will raise a list of existing dialogs and let the user select one to edit, delete or export. In case of delete, the user will be asked for confirmation, export will add the selected dialog to the clipboard and save the clipboard.



Import dialog will raise the Clipboard showing all items in the Clipboard, loading a Clipboard file, that contains the needed dialog, selecting the dialog and pressing Copy will insert the dialog into the actual project. After Copy, the Clipboard is closed. The import is done including callbacks, but without header information and without event-handlers. These must be copied manually.


There is another pulldown menu Generate. This gives a selection for generating C-code, a resourcefile and UIL-C-code. For both C-code items there are corresponding buttons as shortcut. Generate Soucecode differentiates between actual project and total Project. The latter will generate all C-code file for all frojects of a complex project and, in addition, an include file containing all global prototypes widgets etc.. This is the only case, where the contents of global header will be written. In case of complex project a reference to the global header is written to all source files. (EasyMotif itself has this reference manually include, therefore it is existing twice in the source-code. The generated code can be compiled and linked, but it needs all the motif-libraries and the easymotif-library. Selecting “Sourcecode-UIL“ will generate a file for the UIL compiler and the „UIL-Makefile generates the corresponding Makefile „. The resourcefile is actually written only locally,, so copy it into the home-directory . Generating Makefile will raise the editor with either a template for a new Makefile or with the existing Makefile. This allows to edit it. Saving will write the Makefile into the current directory. The same holds true for generating Imake, this followed (after editing) by a xmkmf followed by a make depend. Both cases of generating Makefiles will update the Makefile/Imakefile to honor all the projects for a Complex Project. Generating Docu-file will extract all internal documentation comments from the actual project (as to be added via the documentation buttons) and write them into a separate file.



In the Options pulldown there are two additional buttons, edit fallbacks, edit resourcefile and edit global header (in case of complex project). These will start the editor with a template (or the stored contents) to add own fallbacks, resource or header code entries. These will be added to the internal created items.



Creating a new dialog

Select the point Create new dialog from the Dialog menu. The other two points of this pulldown will raise a list of existing dialogs, identified by their title. These points will either start the Dialog-editor or delete the selected dialog (with an additional question!). Create new dialog will raise a dialog to choose several options for the new dialog. This dialog may be activated lateron by pressing a dialog button with the middle mouse, or choosing options in the dialog control window.

All fields, that are necessary are set with defaults. The upper area on the right (Dialog Type) is used to choose between normal and row/column dialogs, The lower right area selects several options for the dialog, these may be changed at any time later. Main Dialog, if set, will use this dialog as the one which appears when starting the target program. All other dialogs cannot have this flag set. Global dialog decides if the creation function and the Widget will be created static or not. The position of the created dialog may be forced to a fixed position, (use Default Position off) If this button is off, the fields for left and top position appear. Positioning for the Maindialog is always absolute in screen coordinates. For all other dialogs, positioning is relative to the Xtparent of parent, i.e. some pixels right of the parent (if negative, some pixels left), or above of the parent, respectively. The Toplevel button forces the dialog to be created independently from its parent, the dialog may be iconized. If either Toplevel or Main Dialog is selected, the selection area for Icon Pixmaps will appear. The Parameter field may contain parameters to be transferred to the dialog when created. These should be any C-code declarations as used in a function prototype (p.e. int nth, struct xyz *pos ). No Dialog Shell creates a dialog, that may be embedded into other dialog (p.e. Into a form , but selecting one dialog out of several possibilities. Of course this difference will show up only at the compiled target. In addition, this option is exclusive to Toplevel, Maindialog and Modal. The area HELP, containing three fields to select how the Quickhelp should appear: Two toggle buttons choose the appearance of Quickhelp, one selects a textfield (user created and marked as help ), the other chooses balloon help. In case of textfield, the help widget may be given as parameter or being global, in this case replace the word automatic by the Widget-Id of the requested help-textfield. The other options are self-explaining.
The button Add/Edit GrabDelete will start the Callback-Editor to create a callback hooked on the dialog in case the user uses the window-manager button "close Window". This callback may be p.e. The one used for cancel (press the external button in the CE) or any piece of code to clean up the functionality.
The lower two buttons, OK and Cancel are doing what the label says, create the dialog or forgets all about it. The other four buttons give control about several parts of the target C-code. Documentation will raise the editor with a template (initially, else with the stored documentation), this documentation is inserted in the target C-code. Project Header raises the editor with a template (initially else with the stored header) for all project global declarations. Init Function starts the editor to generate a piece of C-code, inserted immediately after the declarations of the creation function. One may add additional declaration, or write some statements to initialize something. This is prior to all widget generation. Finit Function again starts the editor to insert C-code to be inserted just prior to return from the dial creation function. Here all widgets are created and managed, so additional changes to widgets may be added, as well as starting other dialogs etc.. Both, the Init and the Finit function, take the actual stored as name, so if you change Id and title, edit these functions at a second visit to this dialog, otherwise these functions will be created with the automatic name.


After pressing OK, this window will be replaced by the dialog control window, the toolbox and the layout of the actual dialog, if a new dialog, an empty area of the selected size, else the area with all constructed widgets as they will appear in the target program.



Control dialog

This is the main design area. The control dialog has several pulldown menus, where the Navigate menu duplicates the left two buttons, and has an item to start the dialog options menu. The Menu gives two selections, one to create a pulldown menu for the actual dialog, the other to create a popup menu. both are defined to have only one per dialog (Motif allows them per form).

The green help field is used to display size, position and Id of the widget, where the cursor is focused, or which is moved or stretched.



The third menu (Options) has a set of options, as start the Widget-editor at creation, display a grid or let all widgets snap to the grid at creation. The leftmost button terminates this dialog and returns to the main dialog. The second does a "simple-save" and the third starts the "Workbench". The fourth starts a little dialog showing all widgets of the actual dialog. The last one starts the display of the Clipboard contents,
The button "items" gives a pulldown menu for selecting a widget to create. Using this replaces the Toolbox functionality.
The green button at the right side is used to protect the actual dialog from accidental changes. It shows green(move), if moving or resizing is allowed and red (Lock) if no moving or resizing is possible. All other features, as editing, aligning etc. are still possible.
The button GRED starts the graphic editor without any selection.

Widget List


The button Show Widget in the Widget List starts a short blinking sequence on the selected widget making it easier to identify a certain widget. The other two buttons, Edit and Delete are doing what the name says,raising the WED or deleting the selected widget.












Clipboard




The Clipboard shows all item id's of stored items. It may contain any item . Selecting one will display the id in the textfield below. Pressing Copy will prepare the selected item for being inserted, in case of a dialog, the dialog will be added to the project. So the cursor in the design will change to a down arrow and pressing the left mouse will create a dashed rectangle, which may be positioned. Releasing the button will create a copy of the selected widget. Copying will resolve all duplicate ids and callbacks by preceding the name with an "C_", if multiple copies are done, this will be repeated. The Clipboard will stay across dialogs and even if a new project is loaded. Saving it via the File pulldown and loading in again at later times will allow to copy items across projects at any time. Items in the clipboard will be deleted only by pressing the delete button with an item selected.










Options Pulldown

The Options pulldown:

AutoEdit starts the WED after creating (i.e. At release the left button.
Grid plots a grid into every form of a dialog (distance is selectable via WED)
Snap-on-Grid forces every created or stretched widget to align to the grid lines.
But Caution: if grid is active, redisplaying gets a lot slower.




Tools (Toolbox)

In addition, The Tools dialog appears beneath the controldialog. It acts as a selector for widgets to be created. Select using a click to the icon, The short description of the icons appears in the pale green field at the bottom (Quickhelp field).
The button with the question mark stands for a user widget. This is the only widget, where it is not possible to display it as it will appear lateron. It will be displayed as area with its class name.
In the lower part of Tools (reachable by scrolling it) are buttons for public domain widgets, if PD was defined at compile. To get the information about the integrated PD-widgets, use the documentation in $(EasyMotif)/Doc. or download documentation and sourcecode from the corresponding url. The sourcecode of actual integrated PD-widgets is stored in $(EasyMotif)lib/PD and $(EasyMotif)include/PD. The library containing them is located in $(EasyMotif)/lib/libPD.a .
It should be possible to disable all PD-widgets at the time of installing EasyMotif by using “ -UPD” in the Makefile (and deleting the -lPD). But as the ComboBox, Counter, Rotlabel, ThumbIndex and the ListTree is used internally, this may lead at least to some shortcomings.
The right part of Tools contains buttons to select graphic primitives. These may be selected and drawn as any widget. The cursor will be reversed in color to indicate graphic drawing. There are some changes in handling: if polygo or lines is selected, pressing the left mouse button wil set a point, moving the mouse will draw a line, oressing the middle button in addition sets the next point, darwing continues from there and so on. Releasing the left button set the last point and completes drawing. Drawing a circle sets the middle and changes the radius from now.









create widgets


The design area uses all three mouse buttons. The left button acts for different actions, dependent on the action type selected by the popup menu from the third button and the item where the cursor points to. The middle button always raises the Widget Editor. The right button raises a popup menu to select the action of the left button. The shape of the mouse cursor changes dependent on the position. If a widget type is selected from the toolbox and the cursor points into a form, it shows up as a crosshair, if it points into an created widget (if action is default) it is a pointing hand, allowing now to move the item, if it hits the rim of the widget, it shows the corresponding border (or edge) pointers, allowing to resize the widget. Pressing the left button and moving with pressed button, results in replacing the widget by a blue rectangle which will move or stretch. releasing the button will recreate the widget in the new shape. With the crosshair cursor (an item selected for creation, leftbutton press will display a red rectangle to be stretched into final size, releasing now will create the widget (or first raise the WED if autoedit is selected).

The picture shows the design area in the phase of creation. There are created: A form with a pushbutton, two textfields, one as Quickhelp. The red rectangle shows a new widget being created.
Additional graphics may be created for a form or a dialog. The points of the graphic items may be attached to any widget and effects may be set to the graphic as Blinking or flowing. (see description of Tools). The points may be edited or moved. If normal action is selected, the cursor will change into a dot-box to indicate a point. Pressing left mouse will pick the point and move it around. Pressing the middle mouse will start GRED, the graphics editor with this point selected. Setting the action to edit or delete, so changing the cursor, it will reverse color if a graphics point is hit, pressing left mouse button will give the expected result. Graphics cannot be moved, except point by point nor copied to clipboard. Graphics will be plotted in order of creation, so a latter drawn area will hide earlier ones. They are grouped to objects, the initial is one object. Additional object may be created using GRED. New graphics are always added to the last object, so objects must be reordered via GRED to add graphics to a special group.



pop up

Action: this is the default behavior, the cursor changes its shape when entering a widget or when selecting a new widget via the toolbox.
Move: The cursor accepts only the movement of widgets, showing this by changing into a pointing hand.
Edit: The cursor changes into a question mark, so indicating the edit mode, pressing the left mouse button now starts the WED.
Delete: The cursor changes into a skull, indicating, that the left mouse button will cause a delete of the widget.
Align: The cursor changes into a diamond-cross, pressing left mouse and dragging will draw a green rectangle. Each item touched by this rectangle (within one form) will be selected for alignment. Releasing the button will raise an Alignment dialog, allowing all selected items to be aligned together.
Hide: The cursor changes into a spider, it will unmanage the selected widget at button press to gain more control over the underlying form.
To Clipboard: changes the cursor int an up arrow. Pressing left mouse will copy the actual item into the clipboard

Alignment

After selecting Align, selecting some widgets and releasing the mouse button, an Alignment dialog will be raised. The left part of it is for Vertical Alignment, the right part for Horizontal Alignment. The buttons are toggle buttons, a selected feature will show up in green. In both parts, the two left buttons align to a side, if they are both selected, the size of all widgets is adjusted to the bounds of the extrema. The next sets all widgets to the same size and the rightmost button will use the bounds of the outermost widgets as limits and will adjust all widgets to the same distance between each other. All selections will be done, when pressing OK, the display is recreated and will reflect the changes immediately.




create menus

The button Menu will select either pulldown or popup menu, starting a dialog to enter the labels and to create cascaded menus. Depending on the level and actual type-selection, several fields will be insensitive. The left list field will contain the stored menu items, the right one will display the type of item. The single textfield displays the actual selected item, or acts as input for a new item. Pressing return adds this to the list, taking the type from the radiobox at the right side. If an item is selected and the label is changed, the label changes. Using the buttons in the lower area, the position of the item may be moved (UP / DOWN), The item may be deleted (DELETE), the WED for the selected item may be started (EDIT) or a new submenu created (SUBMENU), this is only possible if the type is button. In case of submenu a new Menu dialog is started to create the submenu items. This might be repeated to get a real cascade of menus. Each open Menu must be closed by pressing OK, before the upper level can be continued.




The WED can be reached as well (for pulldown menu only), if pressing the requested item in the menubar (following the cascade down to it), whereas popup menus can be edited only via the Menu editor.


WED widget editor

After creating a widget, it needs some functionality or some more details. To add these, use the WED. The widget editor may be started via using the middle mouse button on a widget, (in case of pulldown menu, just select the item), or via the left button if the action is switched to edit (the cursor shows a question mark). It might be started as well from the hierarchy-browser by clicking on an item. The WED consists of two parts, a general part, equal for all widgets, and a widget specific part.

The picture shows the general part only, the big rectangle will contain the special part for the actual widget. The button "Quickhelp" will raise a short dialog to input one line of help text, displayed in the quickhelp field of the dialog (if created). The Fglobal button selects if the widget should be global (for the actual project) or dialog-local. The Pglobal button selects if the widget shall be real global, i.e. Exported and added to the global header (in case of complex project)The Activ button, if not set, will create the widget insensitive. The next four field are displaying the actual position and size. These fields may be used to set position/size to exact values. The two textfields at the right are filled automatically by EasyMotif, but may be changed. The ID field is the C-name of the widget and therefore checked against duplication if changed. The Resource is used to access the widget via resource file or fallbacks. Any change to the widget will become active only after pressing the OK button, Cancel will disregard all changes. The area Attachments shows four arrow buttons and a default button. Pressing any arrow will raise the AED (attachment editor), the default button will reset all attachments to self attaching. The field above the attachments shows the actual callbacks, selecting one of the will start the callback editor as well as pressing Create. The same field may contain a list of eventhandlers if the Events button is pressed. In this case, the label on the Create button changes to Link. The selected button will be highlighted in green. This allows the user to add callbacks or to link event masks to a previously written event-handler function. The last button, Resources, will start the RED (resource editor), which will display the possible resources for the actual widget and gives more control about the behavior or shape of it. The field Condition allows to enter a string, which will be written to the created source file with #ifdef(or #ifndef) string / #endif surrounding the widget creation. So creating platform dependent or specialized sourcecode.
The toggle button in the right lower corner activates a navigation highlight for the target program. The feature needs a resource "Highlight" set to a color. (Default is cyan) and will change the widgets background to this color, if it gets the cursor position.

WED widget editor Widget specific area

Widget specific PUSH BUTTON




A pushbutton should have at least a label, in addition it may have several pixmaps overlaying the label. These pixmap (as xpm-files with the variable equal to the filename without extension) may be entered into three textfields. The buttons beneath the textfields will start a file selection to select the pixmap file. depending on the state of the togglebutton pixmap relative, the pathname will be stored as absolute path or relative to the working directory. The option button Pixmaps will choose the type of loading the pixmaps, either at compile time (where they are included) or loaded at run time. The radio box below the Pixmaps button will select the positioning of the label. The two toggle buttons Default button and Auto Size change the behavior and the sizing of the button.





Widget specific ARROW BUTTON


The arrow button is a modified pushbutton, displaying an arrow instead of the label. The lower radiobox Arrow direction chooses the pointing direction of the arrow.













Widget specific CASCADE BUTTON



The cascade button is used in pulldown and popup menus as well as in option menus. It may hold a label and / or a pixmap. (see pushbutton). The positioning of the label is chosen by the lower radio box. The toggle button Help button is valid only in case of pulldown menu, where it forces the button to the extreme right side of a menu bar.










Widget specific TOGGLE BUTTON




Toggle buttons again can hold a label and some pixmaps. (see pushbutton) Label positioning and Auto Size see pushbutton. If it should display the indicator, set the Indicator toggle button (default). If the button should be initially set, set the Set button.











Widget specific Single Line TEXTFIELD



Textfields act as input for some data. The maximum Length may be defined, if zero, no limit is given. A initial Value may be preset. If the textfield shall act only to display some data, deselect the Editable button. Selecting The button Help Widget it will be attached to the bottom of the form and will receive all Quickhelp messages. In parallel, the Editable button will be deselected. The resource then is set to "help" to allow a global resource setting for all helps.





The input can be checked automatically (by inserting some library functions), the picture shows the menu.





Widget specific Multi Line TEXTFIELD




Multiline textfields are scrollable , the type of scrolling can be set by selecting the toggle buttons. As the single line textfield, it may be writable (Editable) or not. If it should contain only one line initially, type in the Text field, else use the edit button next to the field to start the editor. The editor now will take (or modify stored) text and set this into the textfield at creation.











Widget specific SCROLLED LIST



A scrolled list widget normally has a complete list of items at creation. Of course in many cases, this list will be set during execution. To preset such a list, enter an item into the Element textfield by pressing enter after typing. It will then appear in the list above. Selecting an item out of that list will copy the item into the textfield, now allowing to edit, move or delete it. Moving can be done using the two buttons UP and DOWN, pressing DELETE will remove the item from both the textfield and the list. The list widget is normally scrollable, the mode may be chosen to either static, scrollbars are always active, or As needed, where the scrollbars will appear only if the displayable space is to small. The selection modus may be chosen from the left radio box. For details see the Motif manuals.







Widget specific OPTION MENU



The option menu button is used the select something out of a list of possibities. It may have a Label, its size is normally dependent on the size of the subitems in the selection list, but it is possible to force it to fixed size. Deselect the autosize button and select the size by moving the slider (Size of selection). The selection list is entered like the list widget and may be moved or deleted using the buttons left of the list. If an item is selected, if may be chosen being the displayed item at creation. use top selection. The edit button will raise the WED again with Cascadebutton editing. Here callbacks etc. may be added.








Widget specific LABEL




Labels only need their text and its positioning. The toggle Auto Size will adapt the size of the widget to the label text if set.














Widget specific Scaler (Slider)


Sliders may act as value displaying widget only or to select a value. The have a Label and may have different shape (this is possible under Linux only). The shape can be switched by the view as option menu and the show Arrows toggle button. If EasyMotif is compiled under other systems, these selections will be not visible. The limits of the slider may be chosen by entering Maximum and Minimum value, the initial Value may be set. The two sliders at the lower left select how the value is displayed if show value is selected. The default orientation is automatic, i.e. the orientation is chosen from the graphical layout. Selecting any other button will fix the orientation regardless of the graphical created shape.







Widget specific FORM

Forms are used as container to group several widgets together. They may have special Characteristics, that means, that the may be embedded in a Frame or in a scrolled Window. These can be chosen by Characteristics menu and edited by pressing Options. Depending on the selection Typ , widgets in a form may be attachable or not. Typ also may change the Form to a drawing area. A form may have a pixmap as background, to select it see Pixmap. It may have a frame plotted around (default), so Characteristics is set to frame as default. The Option button selects details about the frame, including a title and its shape, or about the scrolled window. When pressed, the Widget specific part will be replaced by the frame editing part or the scrolled window editing part. The selectable grid (see create widgets design area) can be changed using the two sliders. These define the number of grid lines per form.
The characteristics option-button selects between No, Frame, scrolled, Shadow behaviour. Frame and Scroll will raise an optional submenu to select special features. Shadow will just add a (hardcoded) resource with shadow thickness of 2.



Widget specific RADIO BOX



A radio box can only contain toggle buttons where the state of toggle buttons is exclusively set. The Characteristics see FORM. The orientation can be chosen Horizontal or Vertical.
The characteristics option-button selects between No, Frame, scrolled, Shadow behaviour. Frame and Scroll will raise an optional submenu to select special features. Shadow will just add a (hardcoded) resource with shadow thickness of 2.











Widget specific ROW / COLUMN CONTAINER



Row column container are a special kind of form. Beside the Characteristics selections and the pixmap the orientation can be selected as well as the pack type. For details see the Motif manuals. The number of columns (or rows) can be selected using the slider left at the bottom. The toggle button Adjust last see in the Motif manuals.
The characteristics option-button selects between No, Frame, scrolled, Shadow behaviour. Frame and Scroll will raise an optional submenu to select special features. Shadow will just add a (hardcoded) resource with shadow thickness of 2.








Widget specific Scrolled Window



If the Options button in any Form editing window is pressed, while characteristics Scroll is selected, the window will appear. The two scaler are defining the size-factor of the actual form within the scrolled window. As normally a scrolled window is used to put a bigger area than visible in, the form will be created in each axis with the corresponding size factor. As soon as the factor is greater than one, a corresponding scrollbar will be created to move the form. The Option menu Scroll position select the positions of the scrollbars.










Widget specific Frame



If in any Forms editing session the Options button with Frame selected is pressed, the Forms part will disappear and this Frame part will be raised. The most used field is the Label, it adds a title string to the Frame with its horizontal position selected by the toggle buttons in the lower left radio box. The vertical position in respect to the frame can be selected using the toggle buttons for Vertical. The default shape of the frame (and its embedded form) is set to SHADOW_ETCHED_OUT. It may be changed using the toggle buttons in the Shadow type radio box. A return to the Forms WED can be done by pressing the Close button.








Widget specific SEPARATOR



Separators are horizontal or vertical lines with their shape selectable. (Separator type). The Margin may be set, but is not active in all shapes. (see Motif)















Widget specific GL drawing area

As the normal drawing area is handled as a sub type of Form, the Open-GL library needs a special drawing area, call GL-drawing area. This area cannot be handled as a form, it really is a separate item. The primary control for its resources is done in the normal WED using the special part seen in the picture. There is no additional support for GL beside the GL-drawing area, this must be done manually by writing code.












Widget specific PD Scrolling widget


As the scrolling widget is used to display dynamic data, it needs scalings and setting of grid and annotation. In addition, the scrolling direction should be set, as well as the position of annotation(scaling information). The optional Label may be set here. More resources, as colours, might be set using the RED.

The url to get access to scrolling widget:
https://sourceforge.net/projects/movingmotif









Widget specific PD Histbar widget

The histbar widget is used to display dynamic data, it needs scaling and setting of grids. The number of bars shall be set at runtime. The width of a bar can be set as well as the distance between two bars. The 3D-effect of the history display might be changed by modifying the angle into the Z-axis. The user may choose, if the actual value will be numerical displayed, an additional text annotation should be allowed or any annotation be done.More resources, as colours may be set using the RED.The histbar widget is available at:
https://sourceforge.net/projects/movingmotif









Widget specific PD Ezdraw widget

Ezdraw is a widget to plot X/Y diagrams to the screen. In addition, it can store the history, so the user may get all the stored date back to use them for paper-plotting. Like the scrolling widget, it tries to act without flickering and it allows to plot into an area bigger than the visible area.. The middle button of mouse will move the visible window. Scaling, gridding and annotation is similar to the scrolling widget. Actually this widget supports linear scaling only, may be this will change due to requests. The complete sourcecode and documentation is available at:
https://sourceforge.net/projects/movingmotif
please get more information from there.








Widget specific PD ComboBox widget

    The ComboBox is a good replacement for an option menu. It displays a label(optional), a textfield and an arrow. Clicking the arrow a complete srcolled list will appear, displaying the possible options. As the textfield may be created editable an it really is a textfield, one may get the actual value of it via an activate or value-changed callback. There are several convenience functions delivered with the ComboBox to make life easier. As there are different Versions of ComboBox available (p.e. within OpenMotif now), The used version of ComboBox is renamed, together with all associated references to CombiBox, so avoiding conflicts. This will be reflected in the created code.


    The possible settings via WED are:
    The Label to be displayed
    The contents of the List
    and the order of it
    The initial value to be displayed (must be one contained in the List)
    If the List should be sorted before displayed
    Textfield being editable
    The number of visible lines in the list (columns)




Widget specific PD listTree widget


As the listTree widget needs four pixmaps, two for branches and two for leaves, these may be selected in known manner. The line width and the vertical distance between items may be choosen. All other resources can be set via RED.










Widget specific PD Rotlabel widget


As this widget acts as a label, the textfield on top is used to set the label. The radio-box at the right bottom selects the rotation center, either the center-point of the labels text, the lower left corner or the lower right corner. The counter box bottom left sets the angle of rotation. To get a feeling, how it will be displayed, the demonstration rotlabel (POINT->) will be rotated.












Widget specific PD Counter widget


The Counterwidget acts similar to a scaler widget. It needs the range as minimum/maximum, the increment, the initial value. The length field is set to one as default. The radio box in the lower right corner selects the format for displaying (and value setting!!). p.e. If the format is set to Hex, all inputs should be given in Hex. Switching the format will switch the display of values. The bell button enables/disabes audible warning.












Widget specific PD Index widget

The index widget act similar to the option button. It needs several labels to be input via the "Element" textfield. The order of elements my be changed using the UP/DOWN buttons. Initially selected is always the element on top. Changing the display of the Index widget can be done using the two scalers. The upper influences the distance between to labels, the lower sets the number of Pixels for the bottom greater than the top. (per side). Using the widgets defaults set the scalers to -1.












Widget specific PD ThumbWheel widget

The ThumbWheel act similar to the scale (slider) Widget. To control the behaviour, several options may be set through this mask. The orientation, if it is vertical or horizontal will be decided by its dimensions. The label is displayed above the Wheel, if any label is set. If the button "Show Value" is activated, the actual value will be displayed in a textfield below the widget. Both field are only displayable, if the size of the widget is big enough. The field "decimal points" changes the displayed value to float with n digits behind the decimal point. (this is done by dividing the value by a power of ten). All other fields are self-explaining. For more information, have a look at the documentation.









Widget specific PD Whistspectr widget

The upper six fields are used for scaling of the three axes. All need the min value and the range of values. In case of time it's the initial and visible value. (Time should be any increasing value, no need to be time)
The next six fields are used to set up annotation and grid. Again the minimum value is needed and the distance (Space) to the next grid. Further influence to annotation may be done using the RED, where the number of decimals and the number of annotation values may be set for each axis. To display the annotion, the left toggle button must be set. The other toggle defines, if the values shall be plotted as single points or as lines. The selection box beloow allows the selection of autoscaling for each axis, which will be done at first set of values. The label field will result in text being displayed at the bottom of the widget. The thumbwheel allows to modify the angle of the time axis, so influencing the 3D-effect, the default ist set to 45 degree.






WED widget editor Attachments




If any of the attach arrow buttons in the WED is pressed, this dialog will appear. The default is attach self, with the list and textfields empty. The option menu Attachment now is used to choose the type of attachment. If attach to Widget is chosen, the list field will be filled withe the Ids of all widgets in the same form. Choosing one of them will copy the Id in the Attached Widget field below. The Slider (Offset) allows to adjust the attachment by some pixels. All selections will be taken, when pressing the OK button, they will be activated after leaving the WED via its OK button. Active attachments will show up in the WED by a red arrow. The default button deletes this attachment, the Cancel ignores all changes and closes the dialog.











WED widget editor callbacks and events

WED callbacks

If callbacks is selected in the WED, the actual existing callbacks are displayed. selecting one of them or pressing the create button will raise a dialog to add or modify a callback. The dialog will display the possible Callback types, a selected type is displayed in the field below that list. In case of creation, this will be the mostly used callback type for the actual widget. If the callback needs any user parameter, the field Parameter should contain the C-name (or the value) as set at the time of adding the callback to the widget, the field Type must be set to the C-code variable type, p.e. char *. This type will appear in the prototype and the declaration of the callback function. Entering a Function name and pressing "enter" or Edit Sourcecode then will raise the editor with a callback template. So only the function body must be filled in. The name is checked for duplication in which case a warning message is raised. In case the Extern toggle is set, the two buttons Edit Sourcecode and Edit Documentation are insensitive, the callback may be already existing or added by some library. The Edit Documentation button will raise the editor with a documentation template to be filled in. This documentation will be added to the sourcecode just before the function code. The three buttons at the bottom close the dialog. Ok will take the changes, Cancel will ignore them (except code changes), Delete will remove the callback from the widget and remove Code and documentation as well.



WED events

If events is selected in the WED, the actual linked eventhandlers are displayed, as function name -> event mask, selecting one of them or pressing the link button will raise the events dialog. The left field displays the names of the created eventhandlers (create them using the Workbench) The right field displays the event masks. Selecting in either field will push the selected item into the textfield below. It is possible to transfer a parameter with this event, this should be type into the parameter field. The toggle Maskable defaults to set, which leaves this event maskable by Motif. After closing the dialog via OK or Cancel, the list in the WED is updated.
















RED resource editor

In the WED is a button Resources, pressing this will start a dialog displaying know resources for the actual widget. Selecting one of them allows the user to set it, or see the stored resource if already set. The option Menu Class displays the actual widget class, and let choose between all subclasses of the actual widget. Depending on the selected class, all resources (inclusive the inherited) are displayed in the list field below. The used font gives some indication, so if the resource is shown in italic, this resource is managed by the normal WED and shouldn't be set in the RED, if it is bold, it is already set by RED. Selecting a resource will display it in the Resource Name field below, and, if it was set by RED, display its value in the Actual value field. Its type is displayed in the Resource type field and depending on the type the corresponding selection buttons Colours >> and Fonts >> change to sensitive. If it is of type enum, the possible enum values are shown in the Resource values field. To set a value, type it into the Actual value field, select it from the Resource values or use the selector menus via the Colours or Fonts button. After entering the value press the Take Value button, otherwise the value is lost when selecting another resource. The Default does what it is assumed to do, deletes resource value for the selected resource and so uses the default. The options menu upper right Create for let you choose between resource file, fallbacks, sourcecode or both resource file and fallbacks, in addition the resource may be declared as global what means, that all widgets with the same resource-id will get this resource. This selection decides where the selected resource is activated. Of course, the resource file must be explicitly selected to be written. EasyMotif tries to use the selected resource as soon as the RED is closed.





RED resource editor font selection

After pressing the Fonts >> button, the standard fontselector will be raised, its usage should be well known. After selecting the font, press select and quit, the selected font will be copied into the Actual value field and may be used now








RED resource editor color selection


    After pressing the Colours >> button, a selection dialog appears. One may navigate through it using the slider at the bottom or the two arrows below the color field. Any mouse click into a color field will set the color and the name into the upper textfield, Quit will put the selected color name into the Actual value field, closing the color selector. If some fields appear without text and color (either black or white), the actual color cannot be allocated in the colormap due to Widget specific PD Index widget

    other programs using it. It is still selectable, but will produce strange results when EasyMotif tries to work with it.
















    GRED graphics editor

    The GRED displays the actual Form with object, primitive and vertex selected. In case it wasn't called from selecting a point, it just displays the forms as option button, selecting a form will display the objects, selecting an object will display its details and its primitives and so forth. As a difference to the WED, GRED handles changes immediately, this is the reason why there is no cancel option. The Add Object button will add an object and generate a name. Selecting an object allows to change its name in the textfield. Remember, the name is used to generate C-code. The two arrow buttons will move a selected object up or down to position it as last one (active) to receive new primitives. The other field of object are self explaining.
    The primitives area will be active only if an object is selected. Most of the features are self explaining, but the visible button should be used with care, as the primitive can't be seen anymore. Absolute button will change the behavior of the graphic in case of resizing the form at execution. It has no effect within EasyMotif.
    The Vertex area is used to directly influence single points. Remember, in case of a circle, the first point is the center, the second the radius. The two double-arrow buttons allows to attach a point to any widget, independently in both directions. If a point is attached, the corresponding button changes to red. Pressing a double-arrow button will raise the attachment editor.

    Attachment editor

    It shows the actual attachment direction as double arrow button right on top. The option field is used to select the side of a widget as top/left, middle, bottom/right. The scaler will add an offset in pixels and the list field shows all known widgets for selection of attachment. OK will take the selection and stores it into the point. Default will reset the point as not attached.




















    Workbench

The Workbench is central tool to create functions or eventhandlers, to create the code snippets called Init- or Finit-functions for dialogs and to edit and document all the manual written code. It is raised by the Workbench button in the main or the same button in the Controldialog. As it is a toplevel dialog, it is independent from other dialogs.The Workbench is divided into two parts, the left for functions and eventhandlers, the right for callbacks and dialogs. The buttons in the lower part allow access to the code selected in the textfields above. As callbacks cannot be deleted, the Delete button is not existing in the right half. The header (for all declarations) may be edited from here, use the Edit Header button. Typing in the textfield of the left half and pressing enter causes a new function to be created, the editor will be raised with a template. A selected function can be edited or its name changed by modifying the name in the editor. The two option buttons on top change the contents of the lists below. The left option switches between Functions and Event Handler, the right one between Callbacks and Dialogs. The picture shows the situation, where Event Handler and Dialogs is selected. All changes done using the editor (exiting from there with save) are permanent, at this point there is no undo or cancel. Creating new functions, eventhandlers or dialog functions always will start the editor with a template, as well as creating documentation. Editing will never change the text except the user does it. Using the button Search will raise the search dialog, known from the Texteditor, for a search through all code pieces. It is possible as well to switch off the search only button and now replace within all code pieces. The Textfield, labeled "GOTO" can be used to jump directly to a line from the C-code. (In case a compile error was flagged). If the line-number is within some hand-written code, the Editor will raise with tahat code. Otherwise, nothing will happen.




Texteditor (syntax sensitive)



The editor is a simple dialog containing the editing part of "nedit" The user may write what ever he wants with any linesize. Normally it comes up with a template, either, as in the picture, with the documentation template, or with a function template, for eventhandlers and callbacks already completed with the required parameters and type. It is syntax sensitive and does syntax-highlighting based on C. Most of the useful functions from nedit are integrated, but reduced to the actual needs (C-only). You may use the standard copy/cut/paste functionality, but using the middle mouse, you may move a selected part of the text around. It is possible as well, to select a rectangular area using <strg>+left mouse and do all copy-/moving functions with this area. A click just right of any parenthesis will highlight the range to the corresponding parenthesis for a few seconds. The editor is started via the Workbench, the Callback-editor or from the Dialog editor. It is internally made “modal” on a per code base. I.e. A function, being edited, cannot be activated a second time in the editor. But it is possible to hold as many different functions in the editor.
Printing will raise a selection dialog to choose printing with syntax-highlighting or plain text. The highlighted print generates PostScript code. In addition, this dialog chooses between direct printing and printing to a file.






Using the pulldown menus, you will get selection dialogs to insert functions, widgets, dialogs etc. into the code.


Left are two examples of insertion menus, one for the embedded brainlib functions, the other for user created functions.













The Edit pulldown and a popup contain helper functions to deal with selected text.Left picture is the pulldown,

the next is popup menu.

In addition the File menu gives a selection to save quit etc. the text or to output it to the default printer.


The Functions menu will be dynamically changed, depending on the dialog from which the editor was called, in case of documentation it shouldn't appear at all. All items here will raise a selector dialog filled with a list of entries.





This is an example of the selector menu, raised from the functions pulldown. Any item may be selected and pressing the add button inserted at the current cursor postion into the text.




Searching

Searching can be started from inside the Texteditor and will search then locally in the actual code. It may be started from the Workbench as well and then search through all the stored code, raising the Texteditor at any hit.


Search or Replace will raise a dialog to control the searching. In case of Search, parts of the dialog are invisible, as these are only used in replace mode. The possible options are to be set via toggle buttons at the left side, so even in replace mode, the replace may be switched off. The pattern to be searched for must be typed into the upper textfield, pressing Find will start the search and result in highlighting the hit. (if nothing happens, no match was found). If Only Find is not set, replace mode is activated. The lower text field will be active and should get the new pattern. Replacing may be done (after Find), by pressing the Replace button or the Replace &Find, which will continue searching after replacing. In addition, there are four buttons atomizing the replace. Selection will replace all in the actual highlighted area, Window will replace all in the actual editor window, Project runs through the whole project, replacing all in the users code areas, and finally in case of Complex project, Complex does the same for all projects. The latter two are dangerous, as one should know if the search is selective enough.
The toggle button Complex will, if set, expand the search for all projects in a Complex project.


Hierarchy browser



This browser is started via a button in the main dialog. It displays the project structure as a tree. The green icons reflect the widgets stored. Initially the browser comes up with all trees collapsed, clicking on an icon with a + (plus) will expand the corresponding part of the tree and change the icon to a - (minus). Klicking with the right button on any icon will raise the “WED” for the corresponding item. The radio box in the lower part will change the annotations. Default is the id of each item, others are the resourcename or the widget Class. Using the button "select printer" will raise a little dialog displaying the possible printers (in a comboBox) and two buttons to select printig to file or selected printer. Print then will output the complete (expanded) tree as PostScript for DIN A4 paper, each Dialog starting with a new page.

For printing the libpsplot.a is used. You may download the sourcecode from:

https://sourceforge.net/projects/psplots

It should be included as well in the release
















libeasymotif.a (Brainlib)

This library contains a set of helpful functions that will work together with a selection dialog in the TextEditor.
The functions are grouped by associated widget.

Textfield associated functions:

int MTextGetInt (Widget parent);
double MTextGetFloat (Widget parent);
unsigned int MtextGetHex (Widget parent);
char * MTextGetString (Widget parent);
Bool MTextSetInt (Widget parent, int value);
Bool MTextSetFloat (Widget parent, double value);
Bool MtextSetHex (Widget parent, int value);
Bool MTextSetString (Widget parent, char *value);
Bool MTextInsert (Widget parent, char *filename);
Bool MTextWrite (Widget parent, char *filename);
Bool MTextRead (Widget parent, char *filename);

The first four get a value from the Textfield, the latter four set a value to the Textfield.
Using MtextGetString, the user is responsible to free the textstring, using XtFree. All other getting functions return a value and will handle memory freeing theirself.

Finally MtextRead and MtextWrite are dealing with text in files. They fill in the contents of the given file(name) to the widget, write the widget's text to a file, or insert the file at the selected InsertionPosition.

Scaler associated functions:

Bool MScaleSetFloat (Widget parent, double value);
double MScaleGetFloat (Widget parent);

In case, you want to control a floating point value with a scaler widget, use these convenience functions. If any not-double value exists, the "Get" function will return zero (0.0).

XmList associated functions:

char *MListGetString (Widget parent);
Bool MListSetString (Widget parent, char *item);
char **MListGetStrings (Widget parent);
int MListGetPosition (Widget parent);
void MListDeleteAllItems (Widget parent);
Bool MListReplaceItem(Widget parent, XmString item, XmString newItem);
void MListSelectAllItems (Widget parent);
void MListPositionVisible (Widget parent, int ThePosition);
Bool MListAddString (Widget parent, char *item));
Bool MListAddStrings (Widget parent, char **items, int number);
int *MListGetPositions (Widget parent);
int MListGetSelectedCount (Widget parent);
Bool MListSort (Widget parent);

Remarks:
MlistGetStrings the user should free the returned string using free().
MlistGetString the user should free the returned string using XtFree.
MListAddString takes a char string, use the simple method and adds the result to the list-widget.
MlistAddStrings takes number char strings, use the simple method and adds the result to the list-widget.
MlistSort tries to sort the actual contents of the list widget.

These functions may life easier, but please do a test on their behavior prior to use them.

Xm..RadioBox associated functions:

This are functions, working together with the "RadioBox".


char *MRadioGetSelectedItem (Widget parent);
int MRadioGetSelectedPos (Widget parent);
Bool MRadioSetPosition(Widget parent, int pos);
Widget MRadioGetWidget(Widget parent, int pos);

Widget patent is allways the RadioBox type of a Form. As it will contain only ToggleButtons, the functions refer to the position of the ToggleButton .
MradioSetPosition will set the toggle Button at the given Position to True.


XmOptionButton associated functions:

Widget MOptionAddItem(Widget OptionMenu, char *item);
Boolean MOptionSetPosition(Widget parent, int pos);
char *MOptionGetItem (Widget parent);
int MOptionGetPosition (Widget parent);
Widget MOptionGetWidget(Widget parent, int pos);

The first two functions refer to the organization of an option menu, eithe an item is added, or its position changed.
The next two refer to the history of an option menu, i.e. They return the item actually displayed. If the user calls these function from a callback of the option menu itself, he gets the item prior of changing.

String functions:

XmString MStringCreate (char *str);
char *MgetString (XmString xstr);

Two functions to convert XmString to char or vice versa.

Getting color (with allocating):

Pixel MGetPixel(char *str, Widget w);

For the given character string, the function tries to get the corresponding system wide colo-definition and allocates a colormap cell. It the allocation fails, the "black" color is used. The Pixel value returned may be used in any color setting.

Dealing with pixmaps:

Pixmap MLoadPixmap (Widget parent, char *filename);
Pixmap MLoadXBM (Widget parent, char *filename);
Pixmap MLoadXPM (Widget parent, char *filename);
Pixmap MLoadGraphic (Widget parent, char *filename, int *format);
Pixmap MLoadGraphics (Widget parent, char *filename, int format);
Bool MWritePixmap (Widget parent, char *filename, Pixmap pix);

MLoadPixmap reads an image (XWD-format) and converts it to a pixmap.
MLoadXBM and MLoadXPM load the pixmaps from corresponding type into memory and return the Pixmap.
MLoadGraphics reads XBM- or XPM-format pixmaps
MLoadGraphic tries to read the pixmap in the format given in the 'format' flag. If format is 0,. MLoadGraphic read XBM at first.
NOTICE: If the filename contains an extension such as xpm, in order to get a valid C variable name, the dot character is replaced by an underscore (_) when reading the file.
MwritePixmap converts the given pixmap to an image and writes this to the given file.


Miscellaneous functions:

void MCloseDialog (Widget wid);
char *MMakeFilename (char *Fn, char *Path);
void MSetFocus(Widget destination);
Bool MGrabDelete (Widget wid, XtCallbackProc call, XtPointer closure);
void commline_dec (int argc , char *argv[] , COMMarg *def , int nentries);
void nav_highlight(Widget w);
Widget CreatefilteredFBox (Widget parent, char *path_mask ,void (*ActionCallback)(char *), char *titel);

McloseDialog: This function is useful to close a DialogShell Window. The input widget can be any widget, that is child or subchild of DialogShell. DialogShells are windows that are NOT the first window in your application. This function is one of the most used functions in a motif application. (At least once per dialog)

MMakeFilename : In FileSelectionDialogs its possible, that Motif returns the filename WITH the directorypath. To get only the filename, use MMakeFilename.

MGrabDelete : MGrabDelete permits the double-click on the upper-left window to close a dialog. Instead of the destroy-function the function "call" is called. Widget can be any widget in the dialog or the dialog shell. Call is an existing function, i.e. a callback. closure is the same as client_data in callbacks. If something goes wrong, return is FALSE, otherwise MGrabDelete returns TRUE.

commline_dec: A function, to decode easily the commandline of the application. Usually, it is called as one of first statements in the main.
typedef struct d_f {
char key[8];
char *result;
int (*func)(char argv[],struct d_f *def) ;
} COMMarg;
Typically there will be an array of COMMarg structures, filled with the requested keys and actions.
The given structure array COMMarg defines the keys and actions.
COMMarg.key character string ([8]) defining the key to react on. It should be a standard UNIX definition as -something
COMMarg.result is a character pointer (where a string may be stored to)
COMMarg.func is an address of a function to be called if actual key detected. It is an int function, where arguments are the character string as char containing the next item after key and the COMMarg entry pointer (actual entry) The next item after key ( result )is used as function argument, NOT decoded as key .A NULL pointer inhibits calling. If a function is given, it is called, if no function given, the actual key is marked in *result.

nav_highlight: This function does not really conform to the Motif-Style-Guide, but in some applications it might be useful. Using one resource "highlight" to set the highlight color, it may be added to any widget in the actual application. The widget will change its background-color to highlight color as soon as the cursor enters the widget. This is can be seen much better than the normal highlighting. Using the button "highlight" in the WED will have the same effect.

CreatefilteredFBox : This is an easier to use fileSelectionBox. The function creates a FileSelectionDialog with just one callback. The callback given by the third argument " ActionCallback" takes only one argument, the path as a character string. The second argument "path_mask " delivers a mask for searching like "directory/*XYZ*.abc", the last argument delivers a Title String to the selection box.
As this functions is handy, there is no direct FileSelectionBox or dialog in EasyMotif.

PD functions (libPD.a)

The editor shows as option a lot of functions which deal with PD-widgets. These functions are described in the widget documentation.

Resourcefile and useful resources:

EasyMotif may be user configured using the standard resourcefile, "EAsyMotif", either system-wide in /usr/lib/X11/app-defaults/ or user local in her home-directory. The internal resources are merged with the resourcefile, so only the resources to be changed should be defined in the resourcefile. The default resource-value is enclosed in brackets (<xx>).


EAsyMotif*HTML: < netscape> Browser to display the Help, may be it need the full path
EAsyMotif*help.background: <LightGreen> Color of all help fields (for quickhelp)
EAsyMotif*help.foreground: <black>
EAsyMotif*printer: <lp> Printer command to be used
EAsyMotif*.fontList: <7x13> default fontlist
EAsyMotif*Editor.background: <moccasin> Editor text background
EAsyMotif*Editor.lineNumBackground: <wheat> Editor line-numbers background
EAsyMotif*Editor.lineNumForeground: <#666666> Editor line-numbers text color
EasyMotif**Highlight: <cyan>
The button highlight color, if the mouse touches the button
EAsyMotif*Editor.emulateTabs: <8> Tab distance (all tabs are emulated by blanks)
EAsyMotif*Editor.autoIndent: <True>
EAsyMotif*Editor.smartIndent: <False>

The following resources are used in RED only, in case of font-trouble, try to set to an existing font.
EAsyMotif*.bold: <-*-*-bold-r-*-*-12-*-*-*-*-*-*-*>
EAsyMotif*.italic: <-*-*-*-i-*-*-12-*-*-*-*-*-*-*>
EAsyMotif*.bolditalic:< -*-*-bold-i-*-*-12-*-*-*-*-*-*-*>
EAsyMotif*.norm: <-*-*-*-r-*-*-12-*-*-*-*-*-*-*>

Related documents and URL:

Scrolling widget , Histbar widget , Ezdraw widget , Rotlabel widget , Histspectr widget:

https://sourceforge.net/projects/movingmotif
Doc/rotlabel.html
Doc/scrollingwidget.htm
Doc/histspectr.htm
Doc/ezdrawdocumentation.htm
Doc/histbar.htm


psplot library:

https://sourceforge.net/projects/psplots


Index widget, Counter widget , ThumbWheel Widget, GrForm:

Doc/counter.html
Doc/thumbindex.html

Doc/thumbwheel.html

Doc/Grform.html

https://sourceforge.net/projects/helpfullmotif


ListTree Widget:

Doc/ListTree.html
Doc/ListTreeProg.html

ftp.x.org.

http://www.ae.utexas.edu/~rwmcm