Add the file faq.md
This commit is contained in:
parent
77ad698c45
commit
4afa988232
|
@ -11,7 +11,7 @@
|
|||
*Class Reference:*<br />
|
||||
     [![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html)
|
||||
|
||||
The Final Cut is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen.
|
||||
The FINAL CUT is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen.
|
||||
The C++ class design was inspired by the Qt framework. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
|
||||
|
||||
### Installation
|
||||
|
@ -141,6 +141,7 @@ printf(...)
|
|||
|
||||
Class digramm
|
||||
-------------
|
||||
|
||||
<pre style="line-height: 1 !important;">
|
||||
1┌──────────────┐
|
||||
┌-----------┤ FTermFreeBSD │
|
||||
|
|
|
@ -23,6 +23,7 @@ Depends:
|
|||
, ${misc:Depends}
|
||||
Suggests:
|
||||
coreutils
|
||||
, ncurses-term
|
||||
, grep
|
||||
, sed
|
||||
, vim-common
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
Frequently Asked Questions
|
||||
==========================
|
||||
|
||||
|
||||
What is FINAL CUT?
|
||||
------------------
|
||||
|
||||
The Final Cut is a C++ class library and a widget toolkit with full mouse
|
||||
support for creating a text-based user interface. It's based on the Termcap
|
||||
library and has its own cursor optimization and window management.
|
||||
|
||||
|
||||
Are Windows and DOS supported by FINAL CUT?
|
||||
-------------------------------------------
|
||||
|
||||
You need an operating system environment that implements a POSIX system
|
||||
call API. This can be realized in Windows with the Cygwin project.
|
||||
|
||||
|
||||
Is my platform supported?
|
||||
-------------------------
|
||||
|
||||
The supported platforms are Linux, FreeBSD, NetBSD, OpenBSD, macOS,
|
||||
Cygwin on Microsoft Windows and Oracle Solaris
|
||||
|
||||
|
||||
What do I need to write my own programs with FINAL CUT?
|
||||
-------------------------------------------------------
|
||||
|
||||
You need a C++ compiler like GCC (g++) or Clang (clang++).
|
||||
|
||||
|
||||
What do I need to build this library?
|
||||
-------------------------------------
|
||||
|
||||
You need three things:
|
||||
|
||||
1. C++ compiler like GCC (g++) or Clang (clang++).
|
||||
|
||||
2. The GNU building tools
|
||||
|
||||
*For example, in a Debian-based distribution it would be
|
||||
the following packages:*
|
||||
|
||||
* autotools-dev
|
||||
* automake
|
||||
* autoconf
|
||||
* autoconf-archive
|
||||
* libtool
|
||||
|
||||
3. Development packages for following libraries:
|
||||
|
||||
* C standard library
|
||||
* C++ standard library
|
||||
* Termcap library *(mostly part of the curses library)*
|
||||
* General Purpose Mouse library *(optional, only if you need
|
||||
mouse support on the Linux console)*
|
||||
|
||||
*For example, in a Debian-based distribution it would be the following
|
||||
packages:*
|
||||
|
||||
* libglib2.0-dev
|
||||
* libstdc++-6-dev
|
||||
* libtinfo-dev
|
||||
* libncurses5-dev
|
||||
* libgpm-dev
|
||||
|
||||
|
||||
How to compile FINAL CUT without gpm support?
|
||||
---------------------------------------------
|
||||
|
||||
```bash
|
||||
./configure --without-gpm
|
||||
```
|
||||
|
||||
|
||||
What do I need to compile the unit tests?
|
||||
-----------------------------------------
|
||||
|
||||
You need the unit testing framework CppUnit.
|
||||
|
||||
|
||||
How can I fix display problems?
|
||||
-------------------------------
|
||||
|
||||
* Make sure that the environment variable TERM has the right
|
||||
terminal name.
|
||||
|
||||
* With the command "`msgcat --color=test`" you can test whether
|
||||
the colors are displayed correctly in the terminal
|
||||
|
||||
* If characters are not displayed in the right place on the screen,
|
||||
it may help to disable cursor optimization for your program with
|
||||
the parameter *--no-optimized-cursor*.
|
||||
|
||||
* If terminal detection did not work, it is useful to turn off the terminal
|
||||
detection with the parameter *--no-terminal-detection*.
|
||||
|
||||
* If the color palette redefinition causes problems, you can switch off
|
||||
the color mapping with the parameter *--no-color-change*.
|
|
@ -9,7 +9,7 @@ How to use the library
|
|||
At the beginning of this introduction to the Final Cut
|
||||
we will start with a small example.
|
||||
|
||||
It creates an empty 30×10 character dialog.
|
||||
The following example creates an empty 30×10 character dialog.
|
||||
|
||||
**File:** *dialog.cpp*
|
||||
```cpp
|
||||
|
@ -49,12 +49,11 @@ All final cut programs must include the *final.h* header.
|
|||
```cpp
|
||||
finalcut::FApplication app(argc, argv);
|
||||
```
|
||||
In this line creates the `finalcut::FApplication` object `app` with
|
||||
This line creates the `finalcut::FApplication` object `app` with
|
||||
the command line arguments `argc` and `argv`. This object manages
|
||||
the application main event loop. It receives keyboard and mouse events
|
||||
and sends them to the target widgets. Before widgets can be created,
|
||||
an application object must be created! Only one `finalcut::FApplication`
|
||||
object should be created.
|
||||
and sends them to the target widgets. You must create an application
|
||||
object before you can create a widgets object.
|
||||
|
||||
The next line
|
||||
```cpp
|
||||
|
@ -72,16 +71,16 @@ The title bar of the dialog box gets the text "A dialog".
|
|||
```cpp
|
||||
dialog.setGeometry (25, 5, 30, 10);
|
||||
```
|
||||
The dialog window geometry is set to a width of 30 characters and
|
||||
a height of 10 characters. The window in the terminal is positioned
|
||||
at the positions x=25 and y=5 (note: x=1 and y=1 represents the upper
|
||||
left corner).
|
||||
The dialog window gets a width of 30 and a height of 10 characters.
|
||||
The window in the terminal is located at the positions x=25 and
|
||||
y=5 (note: x=1 and y=1 represents the upper left corner).
|
||||
|
||||
```cpp
|
||||
app.setMainWidget(&dialog);
|
||||
```
|
||||
The `dialog` object is selected as the main widget for the application.
|
||||
When the user closes a main widget, the application will be closed.
|
||||
The `dialog` object was now selected as the main widget for the application.
|
||||
When you close the main widget, the entire application quits.
|
||||
|
||||
|
||||
```cpp
|
||||
dialog.show();
|
||||
|
|
|
@ -560,47 +560,6 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FOptiMove::printDurations()
|
||||
{
|
||||
std::cout << " speed: "
|
||||
<< baudrate << " baud\r\n";
|
||||
std::cout << " char_duration: "
|
||||
<< char_duration << " ms\r\n";
|
||||
std::cout << " cursor_home: "
|
||||
<< F_cursor_home.duration << " ms\r\n";
|
||||
std::cout << " cursor_to_ll: "
|
||||
<< F_cursor_to_ll.duration << " ms\r\n";
|
||||
std::cout << " carriage_return: "
|
||||
<< F_carriage_return.duration << " ms\r\n";
|
||||
std::cout << " tab: "
|
||||
<< F_tab.duration << " ms\r\n";
|
||||
std::cout << " back_tab: "
|
||||
<< F_back_tab.duration << " ms\r\n";
|
||||
std::cout << " cursor_up: "
|
||||
<< F_cursor_up.duration << " ms\r\n";
|
||||
std::cout << " cursor_down: "
|
||||
<< F_cursor_down.duration << " ms\r\n";
|
||||
std::cout << " cursor_left: "
|
||||
<< F_cursor_left.duration << " ms\r\n";
|
||||
std::cout << " cursor_right: "
|
||||
<< F_cursor_right.duration << " ms\r\n";
|
||||
std::cout << " cursor_address: "
|
||||
<< F_cursor_address.duration << " ms\r\n";
|
||||
std::cout << " column_address: "
|
||||
<< F_column_address.duration << " ms\r\n";
|
||||
std::cout << " row_address: "
|
||||
<< F_row_address.duration << " ms\r\n";
|
||||
std::cout << " parm_up_cursor: "
|
||||
<< F_parm_up_cursor.duration << " ms\r\n";
|
||||
std::cout << " parm_down_cursor: "
|
||||
<< F_parm_down_cursor.duration << " ms\r\n";
|
||||
std::cout << " parm_left_cursor: "
|
||||
<< F_parm_left_cursor.duration << " ms\r\n";
|
||||
std::cout << "parm_right_cursor: "
|
||||
<< F_parm_right_cursor.duration << " ms\r\n";
|
||||
}
|
||||
|
||||
|
||||
// private methods of FApplication
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -403,7 +403,7 @@ char* FTerm::cursorsVisibility (bool on)
|
|||
//----------------------------------------------------------------------
|
||||
void FTerm::printMoveDurations()
|
||||
{
|
||||
opti_move->printDurations();
|
||||
finalcut::printDurations(*opti_move);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -166,7 +166,6 @@ class FOptiMove
|
|||
// Methods
|
||||
void check_boundaries (int&, int&, int&, int&);
|
||||
char* moveCursor (int, int, int, int);
|
||||
void printDurations();
|
||||
|
||||
private:
|
||||
// Constant
|
||||
|
@ -208,6 +207,9 @@ class FOptiMove
|
|||
bool isMethod5Faster (int&, int, int, int);
|
||||
void moveByMethod (int, int, int, int, int);
|
||||
|
||||
// Friend function
|
||||
friend void printDurations (const FOptiMove&);
|
||||
|
||||
// Data Members
|
||||
capability F_cursor_home;
|
||||
capability F_carriage_return;
|
||||
|
@ -336,6 +338,49 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap)
|
|||
inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
|
||||
{ eat_nl_glitch = bcap; }
|
||||
|
||||
|
||||
// FOptiMove non-member function
|
||||
//----------------------------------------------------------------------
|
||||
inline void printDurations (const FOptiMove& om)
|
||||
{
|
||||
std::cout << " speed: "
|
||||
<< om.baudrate << " baud\r\n";
|
||||
std::cout << " char_duration: "
|
||||
<< om.char_duration << " ms\r\n";
|
||||
std::cout << " cursor_home: "
|
||||
<< om.F_cursor_home.duration << " ms\r\n";
|
||||
std::cout << " cursor_to_ll: "
|
||||
<< om.F_cursor_to_ll.duration << " ms\r\n";
|
||||
std::cout << " carriage_return: "
|
||||
<< om.F_carriage_return.duration << " ms\r\n";
|
||||
std::cout << " tab: "
|
||||
<< om.F_tab.duration << " ms\r\n";
|
||||
std::cout << " back_tab: "
|
||||
<< om.F_back_tab.duration << " ms\r\n";
|
||||
std::cout << " cursor_up: "
|
||||
<< om.F_cursor_up.duration << " ms\r\n";
|
||||
std::cout << " cursor_down: "
|
||||
<< om.F_cursor_down.duration << " ms\r\n";
|
||||
std::cout << " cursor_left: "
|
||||
<< om.F_cursor_left.duration << " ms\r\n";
|
||||
std::cout << " cursor_right: "
|
||||
<< om.F_cursor_right.duration << " ms\r\n";
|
||||
std::cout << " cursor_address: "
|
||||
<< om.F_cursor_address.duration << " ms\r\n";
|
||||
std::cout << " column_address: "
|
||||
<< om.F_column_address.duration << " ms\r\n";
|
||||
std::cout << " row_address: "
|
||||
<< om.F_row_address.duration << " ms\r\n";
|
||||
std::cout << " parm_up_cursor: "
|
||||
<< om.F_parm_up_cursor.duration << " ms\r\n";
|
||||
std::cout << " parm_down_cursor: "
|
||||
<< om.F_parm_down_cursor.duration << " ms\r\n";
|
||||
std::cout << " parm_left_cursor: "
|
||||
<< om.F_parm_left_cursor.duration << " ms\r\n";
|
||||
std::cout << "parm_right_cursor: "
|
||||
<< om.F_parm_right_cursor.duration << " ms\r\n";
|
||||
}
|
||||
|
||||
} // namespace finalcut
|
||||
|
||||
#endif // FOPTIMOVE_H
|
||||
|
|
Loading…
Reference in New Issue