AxeDCS is an Axe Axiom which provides bindings to the majority of the Doors CS 7 GUI API. You can use it only with Doors CS 7 or higher; it will throw an “Invalid token” error if you try to compile a program with it for a shell other than Doors CS.

You use the GUI API with AxeDCS the same way you would use it with ASM: you push the widgets to the GUI stack, and then call a render function or a mouse function.

GUI Widget Tokens #

AxeDCS Token Function ASM equivalent
Alert Draws a modal message box with custom text.
NullContain Adds an invisible container with opaque or transparent background to the GUIStack. With LargeWin and SmallWin, it’s one of the three widgets that must starts a GUI form. GUIRnull
LargeWin Adds a fullscreen window to the GUIStack. With NullContain and SmallWin, it’s one of the three groupmasters. GUIRLargeWin
SmallWin Adds a 81*49 window to the GUIStack. With NullContain and LargeWin, it’s one of the three groupmasters. GUIRSmallWin
WinBtn Adds window buttons to the GUIStack. They’ll be drawn on the current groupmaster (except NullContain; it’ll surely crash). GUIRWinButtons
BtnText Adds a clickable button with text to the GUIStack. GUIRButtonText
BtnImg Adds a clickable button with 5*5 sprite to the GUIStack. GUIRButtonImg
HotSpot Adds an invisible clickable area to the GUIStack. GUIRHotspot
GUIText Adds text with position relative to the groupmaster to the GUIStack. GUIRText
TextLineIn Adds a single-line text prompter to the GUIStack. GUIRTextLineIn
PassIn Adds a single-line password prompter to the GUIStack. GUIRPassIn
TextMultiline Adds a multiline text prompter to the GUIStack. GUIRTextMultiline
ByteIn Adds an integer spinner in range [0,255] to the GUIStack. GUIRByteInt
WordIn Adds an integer spinner in range [0,65535] to the GUIStack. GUIRWordInt
Radio Adds a radio button to the GUIStack. GUIRRadio
Chkbox Adds a checkbox to the GUIStack. GUIRCheckbox

GUI functions #

  • GUIEvent - Specify that the following code is part of a routine called by Mouse. Always put it as first instruction in this case !
  • Mouse - Renders the GUI and begin input functions.
  • FindFirst - Returns the starting of the data of the first non-groupmaster widget of the GUIStack.
  • FindNext - Returns the starting of the data of the widget following the current one in the GUIStack. Always call it directly after FindFirst or FindNext since it uses ASM registers !
  • ClearGUI - Removes all the widgets from the GUIStack.

Associated Programs #

Refer to the Associated Programs page for more info on the AP system.

AxeDCS Token Function ASM equivalent
FileOpen Starts a GUI input for the user to choose a file to open with the current program. FileOpen
FileSaveAs Starts a GUI input for the user to choose a name for a file to be saved. FileSaveAs

Setting up AP-enabled programs #

AxeDCS works a bit differently with AP-enabled program, a.k.a viewers.

Your AP-enabled programs will need a special header to work correctly ; a header that Axe can’t provide. So if you want to compile an AP-enabled program :

  • copy the content of DCSAP.8xp at the really beginning of your file, before any code and right after the Axe source header

  • AP-enabled programs starts at a different address than the beginning of the code when it’s opened through a file. Set the beginning of the code that open the current file with

    :Lbl APStart
    :Asm(DDE5E1)->*variable name here*

    and then the indicated variable will contain a pointer on the opened file (see below for more info).

  • compile it for Noshell ; that’s very important. The program will still not run without DCS7.

Don’t forget that these parts are only required if your program is AP-enabled. If it’s not, don’t apply any of these latters and compile your program for DoorsCS 7.

Using files for AP-enabled programs #

Files are special ASM programs that contains data to be interpreted by a particular program called a viewer. If you program a viewer (or as I said before, an AP-enabled program), you might want to make it able to open and read files.

First, set the number of supported file types at the end of the header, at the address 9DA5h (see the comments in the header or DCSAP.8xp), and once you’re done with it you can set the supported file types. A file type is a set of 3 bytes which doesn’t have any other sense than the one you give to it.

But how to create recognizable files ? That’s pretty easy. All files have a common format that is to be respected :

BB6D              <- if you compile your file for Noshell with Axe, it's automatically added
C9                <- Return in Axe
3180              <- required, indicates that it's an AP file
000000            <- the 3-byte filetype
...datas here...

And that’s all. Then, when the user clicks on a file that has one of the type you set, DCS7 automatically opens the corresponding viewer, load the file, and using the Asm() line I provided above, returns the first byte of data of the file (that is, the byte after the 8-bytes header, so you don’t have to add any value to access the file’s core).