User interface

There are two basic architectures for an imbACE Application, both sharing common base class (aceApplicationBase) and its features:

  • Console Application, resembling typical shell command line, where command is typed at bottom of the screen and response is scrolling vertically, for height of console buffer;
  • Terminal Application with Text User Interface, where commands are navigated with arrows and selected by key shortcuts

Basic application architectures: Terminal and Console based.

The main building blocks of an imbACE Application are Consoles. The console application may have a number of Consoles, where the Main Console is the one that is started with application boot. Commands available at command line are actually Console class methods, with few extra annotation attributes with display specifications, description and user help content. Your Console classes may inherit from one of two bases:

  • aceCommandConsole
    • beside few basic commands (like: help, exportHelpThe command will export an auto-generated help file (Markdown) to the specified filename in currents console session (called state) path. If filename is not specified, it will be: "help.txt". Example: ExportHelp filename="help.txt";open=True;onlyThisConsole=False; open - will try to open the generated file with Notepad++ onlyThisConsole  - it will export only commands at the current level of class type, it will not..., cls, exit…) it is also capable loading and executing an external ACE Script (commands: executeScript, templateScript).
  • aceAdvancedConsole
    • has its own State class (i.e. project, job, task settings…) and its own Workspace (i.e. dedicated directory and application specific input/output methods)

Command Console application interface, imbACE v0.1

Consoles are easy to extend with customized or pre-built console plugins, simply by adding it as public property to the console class. To access the methods of the plugin, user just has to type property name as prefix, separated by dot, with the method name: pretty same as one would call any C# method. For Command Console user interface there is a number of special input (select options, press any key in given time, sound signals….) modes, other then simple command line input.


Terminal Application has several use-ready screen classes, base classes that you should adjust according to your needs and also few dialog boxes.

Welcome Screen in Terminal Application

Code example calling the welcome screen shown above:

public string TEXT_WELCOME = @"This is imbACE: Advanced Console Environment application with Text User Interface called TextBlocks."
        + "This is Welcome Screen customizable preset class, showing this message and given number of menu options in block below this text box. You maybe noticed there is whole-word line break algorithm applied!";

public ApplicationDemo()
{
  welcomeScreen = new aceTerminalWelcomeScreen<ApplicationDemo>(this, TEXT_WELCOME, "ACE Terminal Application DEMO", "Welcome screen");
  current = welcomeScreen;
}

 

File Select Dialog in Terminal Application

Code example that opens file selection dialog shown above:

dialogSelectFile dSelectFile = new dialogSelectFile(platform, folder_projects.path, dialogSelectFileMode.selectFileToOpen, "*.*", "DEMO for dialogSelectFile");
var results = dSelectFile.open(platform, new dialogFormatSettings(dialogStyle.greenDialog, dialogSize.mediumBox));

Spread the love