Introduction !DrWimpC Features DrWimpC library Examples


!DrWimpC Features


!DrWimpC is the normal start point for building an application that uses the DrWimpC library. With it, you can create a skeleton application containing the minimal set of C source (and header) user files for a wimp application that uses the DrWimpC library. !DrWimpC can be used to edit and add more user source files. Existing DrWimpC applications can be dragged to the !DrWimpC Icon Bar icon to load them into !DrWimpC for further edits and additons of C source files using the !DrWimpc menu system.

Caveat 2012: Since this manual was written the menus and dialogues of !DrWimpC have changed alot. Menu items have moved between existing or placed in new menus and the main DrWimpC App Builder Projects window has been introduced as the main way of wrking with applications. So the information provided here is out of date but is still of interest. Just don't rely on it reflecting the current design of !DrWimpC menus and dialogues. It will take some time to progressively update this manual. The Getting started pages of the DrWimpC web site are up to date so check anything here with those pages.




Icon Bar Icon and Menu Creating Applications Application Details
Application Management Source File Editing Adding New Source Files
Wimp Library Actions Templates and functions Dev Tool Choices





The Icon Bar Icon and Menu


With the mouse pointer over the Icon Bar icon, clicking the middle button will display the DRwimpC Icon Bar menu described below. Clicking the SELECT button will cause the list of functions of the most recently started source file edit to be brought to the top of the window stack. Clicking with he ADJUST button will cause a list of all the files currently being edited to be shown. This makes it easy to get an edit window to the front of the window stack, by clicking SELECT or ADJUST on its entry in the list. Using ADJUST will also close the edit list window.

The Iconbar Menu ...





Info and Help


These are the standard Risc Os wimp application Info and Help items. Selecting the Help item with a mouse click leads to the HTML help document being displayed in a browser window.

New App ...


This is the start point to create a new application. It leads to the New Application dialogue.

Applications


This item has a submenu list of the currently loaded applications. The currently selected application will have a tick by its name. You can select an application by clicking ion its name in the list. You can only edit or add new files for the currently selected application. Some menu options apply only to the currently selected application. The title of the main Icon Bar menu will be the name of the currently selected application, or DrWimpC if none is selected. When you select an application, if you have any unsaved data from edits of the presently selected application, you will see a Discard/Save/cabcel box appear asking what you would like to to with these changes.

Each application listed in the menu has an application actions submenu that can be applied to it, such as Build, Make, regenerate the makefiles for the project, run the application, etc.

App Initialise


This item applies only to the currently selected application and leads to a file name list submenu of standard user files (i.e. those that the DrWimpC calls to interact with a n application) along with the application shell file containing the C entry function main. there are two standard user files in the submenu list. One is generated by !DrWimpC - drwUli which contains a single function which performs the task of initialising the DrWimpC library for the application for each library facility used by the application, such as window events, mouse events, etc. The second standard user file in the list is drwuwinit which contains user functions called by the DrWimpC library at initialisation time. This is normally the first file you would start editing to do your own application's initialisation such as loading windows, fonts, etc. This should be done in the function drw_uw_init().

Wimp Lib Actions


This is an important item for adding default files of standard user functions to your application for each library facility. It leads to the wimp library action submenu list of DrWimpC library actions, each with its own submenu of standard user files which are required to use the facility. clicking on an item in the list causes !DrWimpC to create default vrersions of the required user source files that you can subsequently edit and place your own code in the functions therein, as your application requires. When all the user files for a facility are present in the c source directory of an application, then the item in the list is ticked. This menu list also applies only to the currently selected application.

Template Files and Templates


As mentioned in the introduction, !DrWimpC has a feature to associate icons in template window definitions with C functions which can be called automatically by the DrWimpC library according to the function type, or by the user application as required, either individually, or as a group action such as displaying or inputting data. This menu item applies to the currently selected application and leads to a file name list submenu listing all of the template files found in the application directory. Note that the library also takes into account the currently loaded territory and will search the application's Resources directory for template files in directories with Risc Os territory names (eg. UK, Germany, etc) or territory nnumbers (which can have a user specified prefix), e.g. terr_1. The Defaults directory is also searched for template files, along with the application directory itself. This search mechanism is also applied to other resources such as message files.

!DrWimpC allows a template file to be selected whose template names are then listed in the bar menu Templates item's submenu.

Each item in the Template Files list also has a submenu which allows the creation and editing of your own C source and header files - i.e. not asociated with a particular template, but support the code in template functions and the library produced. This allows self contained libraries to be produced which can be reused in other applications as described in the introduction. The created files are stored in the FormSrce directory, in a sub directory with the same name as the template file. (Either in the c or h directory as appropriate). There are also options to tidy up the template object directories (Clean and Clean all) as for the application objects. The Includes option allows the specification of header file include paths for use in compiling the library code for the template files. This is done from alist window as for the application includes.

Template List


This is a submenu list of names of the window definitions found in the currently selected template file (of the currently selected application). Clicking on a name in the list causes the window to be displayed on screen.

Two menus are available for use with these windows, one is the Source File action menu which you can access by clicking the middle MENU button with the mouse pointer over the window, and use the FN LIST menu item to get a list of functions for icons in the template window definitin, and by selecting a name in the function list you can load the source file containing the functions. Secondly, by clicking the ADJUST mouse button with the mouse pointer over an icon in the window (that has a name defined for it) you can access a menu of type of functions that can be defined for an icon. Selecting an item in the list causes the C source file for the template window to be loaded itno an editor with the caret either at the start of the code for the function of that type for the icon, if there is one, or at the end of the file at the beginning of a new function definition for the icon. (Clicking the SELECT button with the mouse pointer over an icon selects the first item in the menu and takes the above action accordingly). For more details on linking C functions to template window definitions see Linking Template Definitions to C functions.

Elixirs


The BASIC version of DrWimp has, at the time of writing, seven support libraries, known as elixirs, which perform specific actions that would not be widely used in a DrWimp applicaiton, so are placed in these support libraries. !DrWimpC also supports these Elixirs (Up to Elixir05 at present as I'm not convinced that the C version should make Elixir06 and Elixir07 separate libraries - or there are more general ways of implementing the features, such as the group icon actions of Elixir07 - but these will be included in some form). Where the Elixir calls user functions to interact with an application, then default versions are supplied and place into the application's C source directory in the same way as for DrWimpC wimp lib actions. At present only Elixir01, Elixir03 and Elixir04 have a user file.

Source Files


Again this item applies to the currently selected application. This leads to a submenu listing the different types of source file that !DrWimpC recognises for an application. For each item there will be a submenu listing the files of that particular type. Basically, these are

Standard actions and their file names


These are the files containing default user functions called by the DrWimpC library for a particular wimp library facility. I provided these two lists since sometimes it is easier to identify the file from the action it performs, while in other cases you may know the filename involved, such as form a compiler's throwback messages.

Elixir Actions and Files


A Similar list to the above this time for the default Elixir functions

User Files


This is a list of files from the application's c source directory of files you have produced containing your own code.

Selecting a name from one of these by placing the mouse pointer oever the name and clicking the SELECT or ADJUST mouse button causes !DrWimpC to load the file into an editor using the External Edit protocol so you can modify the file and save it back to the !DrWimpC application which then stores it in the appropriate c source directory.
In all cases, for each file, you can eventually navigate to a sub menu listing the actions that can be performed on a source file from !DrWimpC. This is the most used submenu in !DrWimpC. Briefly, the actions are




The Source File Action Submenu

DrWimpC supports the editing of source files by means of the external edit protocol. So you need a source editor that is able to respond to external edit requests, and be loaded. (Which currently, means you require !Zap or !StrongEd).

The DrWimpC Source File Menu Actions are ...



Save File
Saves the file back to the application, and ends the external edit. (The editor's window for the file will be closed).
Return File
Returns the modified file back to the application, but allows the edit to continue.
Abort Edit
Causes the edit to be stopped without saving the file back to the application.
Goto Line ...
Causes a dialogue to appear allowing you to enter a source line number where the editor should place the caret in a currently edited file. I don't expect this to be used much, but its there for completeness.
FN List ...
This results in a !DrWimpC list window being opened containing a list of the file's functions. If the file is being edited, the list reflects the edit by including any new function names in the list. By selecting the function name in the list you cause the editor to place the caret at the start of the function body. This is also a slight duplication of what editors have, but I have found it very useful as a pop up window rather than always having it taking up space on a desktop, and using the !DrWimpC menu system you can easily get a function list for any source file in the application. It is also very useful when it comes to locating template functions for a template/icon definition. You can also save the list as a C header file to the appropriate h directory in the application by clicking menu when the mouse pointer is over the function list to get a menu for this purpose. Note that if the source file is already loaded into an editor as a !DrWimpC external edit, then the Function list window is opened behind the editor window. To bring the list window to the front click <SELECT> with the mouse pointer inside the list's header pane.
Refresh
This just refreshes the !DrWimpC buffer for the source file from the editor and causes !DrWimpC to update its function list for the file. It is probably not a required function now.
Touch
Time stamps the source file so that the make process will recompile it.
Debug
Causes debug information to be produced when compiling this source file. This allows debug information to be produced for individual source files, rather than for the whole application.
Clean
Deletes the object file produced by the compilation process from the o directory that contains it.
Clean gcc
I have provided a method of keeping project object files compiled with the ROOL tools and the GCC compiler in separate directories, so they can coexist. This is an attempt to reduce or avoid constant recompiling in the case that you use both sets of tools on a project. (See the Dev Choices dialogue for selecting which tools !DrWimpC will use in the make process). When set, the clean gcc flag causes the gcc object to be removed from the o directory containing it.
Template
This leads to a submenu of actions and options for templates. When this manual was first written this item was only a 'Close Template' action which was described here. Thetem;lates actions submenu is newer and is described in more detail in the web site introductory pages.




Header Files


This is similar to the Source Files item above except that the only actions that can be applied are Save File, Return File and Abort Edit.

Quit


This is the standard Risc Os Quit option for an application that initiates application closedown. If you have any unsaved data for the currently selected application, then a Discard/Save/Cancel dialogue is displayed so you can decide whether to save the data or just contnue the Quit action.




[Top]