Build fix for non linux in FKeyboard::keyCorrection

This commit is contained in:
Markus Gans 2018-09-26 18:01:44 +02:00
parent 1eff94aead
commit 9671586be0
6 changed files with 34 additions and 26 deletions

View File

@ -6,8 +6,8 @@ First steps with the Final Cut widget toolkit
How to use the library
----------------------
At the beginning of this introduction to the Final Cut usage,
we start with a little example.
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.
@ -26,11 +26,11 @@ int main (int argc, char* argv[])
return app.exec();
}
```
*(Note: Use mouse or <kbd>Shift</kbd>+<kbd>F10</kbd> or
*(Note: Use mouse or <kbd>Shift</kbd>+<kbd>F10</kbd> or
<kbd>Ctrl</kbd>+<kbd>^</kbd> to close the dialog)*
After entering the source code in *dialog.cpp* you can compile
After entering the source code in *dialog.cpp* you can compile
the above program with gcc:
```cpp
g++ -O2 -lfinal dialog.cpp -o dialog
@ -44,24 +44,24 @@ How it works
```cpp
#include <final/final.h>
```
All final cut programs must include the *final.h* header.
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
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`
In 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.
The next line
```cpp
finalcut::FDialog dialog(&app);
```
creates the `finalcut::FDialog` object `dialog` with the object `app`
as parent object. The `finalcut::FDialog` class is the base class for
creates the `finalcut::FDialog` object `dialog` with the object `app`
as parent object. The `finalcut::FDialog` class is the base class for
creating dialog windows.
```cpp
@ -73,28 +73,28 @@ The title bar of the dialog box gets the text "A dialog".
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 is positioned in the terminal
at the positions x=25 and y=5. (Note: x=1 and y=1 represents the upper
left corner )
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).
```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 exits.
The `dialog` object is selected as the main widget for the application.
When the user closes a main widget, the application will be closed.
```cpp
dialog.show();
```
A window or widget is not visible directly after its creation.
Only the call of `show()` makes it (and its child objects,
Only the call of `show()` makes it (and its child objects,
if available) visible.
```cpp
return app.exec();
```
The last line calls `exec()` to start the application and return
the result to the operating system. When the application starts,
it enters the main event loop. This loop doesn't end until the
The last line calls `exec()` to start the application and return
the result to the operating system. When the application starts,
it enters the main event loop. This loop doesn't end until the
window/application is closed.

View File

@ -515,9 +515,9 @@ int FKeyboard::keyCorrection (const int& keycode)
if ( linux )
key_correction = linux->modifierKeyCorrection(keycode);
else
key_correction = key;
key_correction = keycode;
#else
key_correction = key;
key_correction = keycode;
#endif
return key_correction;

View File

@ -64,7 +64,7 @@ FToggleButton::FToggleButton (const FString& txt, FWidget* parent)
, focus_inside_group(true)
, text()
{
FToggleButton::setText(txt); // call own method
FToggleButton::setText(txt); // call own method
init();
if ( parent && parent->isInstanceOf("FButtonGroup") )

View File

@ -195,8 +195,6 @@ inline bool FObject::isInstanceOf (const char classname[]) const
inline bool FObject::isTimerInUpdating() const
{ return timer_modify_lock; }
} // namespace finalcut
//----------------------------------------------------------------------
// Operator functions for timeval
@ -252,4 +250,6 @@ static inline bool operator < (const timeval& t1, const timeval& t2)
|| (t1.tv_sec == t2.tv_sec && t1.tv_usec < t2.tv_usec);
}
} // namespace finalcut
#endif // FOBJECT_H

View File

@ -199,6 +199,8 @@ void FMouseTest::noArgumentTest()
//----------------------------------------------------------------------
void FMouseTest::doubleClickTest()
{
using finalcut::operator -;
FMouse_protected mouse;
CPPUNIT_ASSERT ( mouse.getDblclickInterval() == 500000 ); // 500 ms
timeval tv = { 0, 0 };

View File

@ -258,6 +258,7 @@ void FObjectTest::delTest()
*/
finalcut::FObject* obj = new finalcut::FObject();
finalcut::FObject* child = new finalcut::FObject(obj);
CPPUNIT_ASSERT ( obj->hasChildren() );
CPPUNIT_ASSERT ( obj->numOfChildren() == 1 );
CPPUNIT_ASSERT ( obj->isChild(child) );
@ -338,6 +339,11 @@ void FObjectTest::timeTest()
//----------------------------------------------------------------------
void FObjectTest::timerTest()
{
using finalcut::operator +;
using finalcut::operator -;
using finalcut::operator +=;
using finalcut::operator <;
FObject_protected t1;
FObject_protected t2;
int id1, id2;