The entire library source code is now encapsulated under the namespace finalcut
This commit is contained in:
parent
7b2257e538
commit
b0039e78c4
|
@ -1,5 +1,8 @@
|
||||||
2018-09-20 Markus Gans <guru.mail@muenster.de>
|
2018-09-20 Markus Gans <guru.mail@muenster.de>
|
||||||
* Added pkg-config file finalcut.pc
|
* Added pkg-config file finalcut.pc
|
||||||
|
* The entire library source code is now encapsulated under
|
||||||
|
the namespace finalcut. All examples and tests have been
|
||||||
|
modified to fit the namespace.
|
||||||
|
|
||||||
2018-09-16 Markus Gans <guru.mail@muenster.de>
|
2018-09-16 Markus Gans <guru.mail@muenster.de>
|
||||||
* Implement a ttytype test for the FTermDetection unit test
|
* Implement a ttytype test for the FTermDetection unit test
|
||||||
|
|
|
@ -22,6 +22,9 @@
|
||||||
|
|
||||||
#include "final/fclassname.h"
|
#include "final/fclassname.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,3 +52,5 @@ FClassName::~FClassName() // destructor
|
||||||
// private methods of FClassName
|
// private methods of FClassName
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
//#include ...
|
//#include ...
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FClassName
|
// class FClassName
|
||||||
|
@ -124,6 +126,7 @@ class FClassName
|
||||||
// FClassName inline functions
|
// FClassName inline functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCLASSNAME_H
|
#endif // FCLASSNAME_H
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2016-2017 Markus Gans *
|
* Copyright 2016-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -39,7 +39,7 @@ const lDouble PI = 3.141592653589793238L;
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Button : public FButton
|
class Button : public finalcut::FButton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -49,7 +49,7 @@ class Button : public FButton
|
||||||
void setChecked(bool);
|
void setChecked(bool);
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onKeyPress (FKeyEvent*);
|
void onKeyPress (finalcut::FKeyEvent*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data Member
|
// Data Member
|
||||||
|
@ -58,8 +58,8 @@ class Button : public FButton
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Button::Button (FWidget* parent)
|
Button::Button (finalcut::FWidget* parent)
|
||||||
: FButton(parent)
|
: finalcut::FButton(parent)
|
||||||
, checked(false)
|
, checked(false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -73,9 +73,9 @@ void Button::setChecked (bool on)
|
||||||
|
|
||||||
if ( checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
setBackgroundColor(fc::Cyan);
|
setBackgroundColor(finalcut::fc::Cyan);
|
||||||
setFocusForegroundColor(fc::White);
|
setFocusForegroundColor(finalcut::fc::White);
|
||||||
setFocusBackgroundColor(fc::Cyan);
|
setFocusBackgroundColor(finalcut::fc::Cyan);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -88,15 +88,16 @@ void Button::setChecked (bool on)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Button::onKeyPress (FKeyEvent* ev)
|
void Button::onKeyPress (finalcut::FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
int key = ev->key();
|
int key = ev->key();
|
||||||
|
|
||||||
// catch the enter key
|
// catch the enter key
|
||||||
if ( key == fc::Fkey_return || key == fc::Fkey_enter )
|
if ( key == finalcut::fc::Fkey_return
|
||||||
|
|| key == finalcut::fc::Fkey_enter )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FButton::onKeyPress(ev);
|
finalcut::FButton::onKeyPress(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,22 +108,22 @@ void Button::onKeyPress (FKeyEvent* ev)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Calc : public FDialog
|
class Calc : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Calc (FWidget* parent = 0);
|
explicit Calc (finalcut::FWidget* parent = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Calc();
|
~Calc();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onKeyPress (FKeyEvent*);
|
void onKeyPress (finalcut::FKeyEvent*);
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_buttonClicked (FWidget*, data_ptr);
|
void cb_buttonClicked (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef and Enumeration
|
// Typedef and Enumeration
|
||||||
|
@ -219,14 +220,13 @@ class Calc : public FDialog
|
||||||
bool error;
|
bool error;
|
||||||
bool arcus_mode;
|
bool arcus_mode;
|
||||||
bool hyperbolic_mode;
|
bool hyperbolic_mode;
|
||||||
|
|
||||||
lDouble a, b;
|
lDouble a, b;
|
||||||
lDouble infinity;
|
lDouble infinity;
|
||||||
uInt max_char;
|
uInt max_char;
|
||||||
int last_key;
|
int last_key;
|
||||||
char infix_operator;
|
char infix_operator;
|
||||||
char last_infix_operator;
|
char last_infix_operator;
|
||||||
FString input;
|
finalcut::FString input;
|
||||||
int button_no[Calc::NUM_OF_BUTTONS];
|
int button_no[Calc::NUM_OF_BUTTONS];
|
||||||
|
|
||||||
struct stack_data
|
struct stack_data
|
||||||
|
@ -243,7 +243,7 @@ class Calc : public FDialog
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Calc::Calc (FWidget* parent)
|
Calc::Calc (FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, error(false)
|
, error(false)
|
||||||
, arcus_mode(false)
|
, arcus_mode(false)
|
||||||
, hyperbolic_mode(false)
|
, hyperbolic_mode(false)
|
||||||
|
@ -285,8 +285,8 @@ Calc::Calc (FWidget* parent)
|
||||||
btn->setFlat();
|
btn->setFlat();
|
||||||
btn->setNoUnderline();
|
btn->setNoUnderline();
|
||||||
btn->setText(getButtonText(key));
|
btn->setText(getButtonText(key));
|
||||||
btn->setDoubleFlatLine(fc::top);
|
btn->setDoubleFlatLine(finalcut::fc::top);
|
||||||
btn->setDoubleFlatLine(fc::bottom);
|
btn->setDoubleFlatLine(finalcut::fc::bottom);
|
||||||
|
|
||||||
if ( isNewFont() )
|
if ( isNewFont() )
|
||||||
btn->unsetClickAnimation();
|
btn->unsetClickAnimation();
|
||||||
|
@ -301,7 +301,7 @@ Calc::Calc (FWidget* parent)
|
||||||
calculator_buttons[button(key)] = btn;
|
calculator_buttons[button(key)] = btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
calculator_buttons[On]->addAccelerator(fc::Fkey_dc); // Del key
|
calculator_buttons[On]->addAccelerator(finalcut::fc::Fkey_dc); // Del key
|
||||||
calculator_buttons[On]->setFocus();
|
calculator_buttons[On]->setFocus();
|
||||||
calculator_buttons[Pi]->addAccelerator('p');
|
calculator_buttons[Pi]->addAccelerator('p');
|
||||||
calculator_buttons[Power]->addAccelerator('^');
|
calculator_buttons[Power]->addAccelerator('^');
|
||||||
|
@ -310,8 +310,8 @@ Calc::Calc (FWidget* parent)
|
||||||
calculator_buttons[Multiply]->addAccelerator('*');
|
calculator_buttons[Multiply]->addAccelerator('*');
|
||||||
calculator_buttons[Decimal_point]->addAccelerator(',');
|
calculator_buttons[Decimal_point]->addAccelerator(',');
|
||||||
calculator_buttons[Change_sign]->addAccelerator('#');
|
calculator_buttons[Change_sign]->addAccelerator('#');
|
||||||
calculator_buttons[Equals]->addAccelerator(fc::Fkey_return);
|
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_return);
|
||||||
calculator_buttons[Equals]->addAccelerator(fc::Fkey_enter);
|
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_enter);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -322,7 +322,7 @@ Calc::~Calc()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Calc::drawDispay()
|
void Calc::drawDispay()
|
||||||
{
|
{
|
||||||
FString display = input;
|
finalcut::FString display = input;
|
||||||
|
|
||||||
if ( display.isNull() || display.isEmpty() )
|
if ( display.isNull() || display.isEmpty() )
|
||||||
display = L'0';
|
display = L'0';
|
||||||
|
@ -334,7 +334,7 @@ void Calc::drawDispay()
|
||||||
display = display.left(display.getLength() - 1);
|
display = display.left(display.getLength() - 1);
|
||||||
|
|
||||||
if ( ! display.isEmpty() && display.getLength() < max_char )
|
if ( ! display.isEmpty() && display.getLength() < max_char )
|
||||||
display.insert(FString(max_char - display.getLength(), L' '), 0);
|
display.insert(finalcut::FString(max_char - display.getLength(), L' '), 0);
|
||||||
|
|
||||||
if ( display.getLength() > max_char )
|
if ( display.getLength() > max_char )
|
||||||
display = display.left(max_char);
|
display = display.left(max_char);
|
||||||
|
@ -345,7 +345,7 @@ void Calc::drawDispay()
|
||||||
if ( error )
|
if ( error )
|
||||||
display = " Error ";
|
display = " Error ";
|
||||||
|
|
||||||
setColor(fc::Black, fc::LightGray);
|
setColor(finalcut::fc::Black, finalcut::fc::LightGray);
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
@ -360,16 +360,20 @@ void Calc::drawDispay()
|
||||||
|
|
||||||
if ( isNewFont() )
|
if ( isNewFont() )
|
||||||
{
|
{
|
||||||
FString bottom_line (33, wchar_t(fc::NF_border_line_bottom));
|
wchar_t bottom_line = wchar_t(finalcut::fc::NF_border_line_bottom);
|
||||||
|
wchar_t top_bottom_line = wchar_t(finalcut::fc::NF_border_line_up_and_down);
|
||||||
|
wchar_t top_line = wchar_t(finalcut::fc::NF_border_line_upper);
|
||||||
|
wchar_t right_line = wchar_t(finalcut::fc::NF_rev_border_line_right);
|
||||||
|
wchar_t left_line = wchar_t(finalcut::fc::NF_border_line_left);
|
||||||
setPrintPos (3, 2);
|
setPrintPos (3, 2);
|
||||||
print (bottom_line);
|
print (finalcut::FString(33, bottom_line));
|
||||||
setPrintPos (2, 3);
|
setPrintPos (2, 3);
|
||||||
print (wchar_t(fc::NF_rev_border_line_right));
|
print (right_line);
|
||||||
setPrintPos (36, 3);
|
setPrintPos (36, 3);
|
||||||
print (wchar_t(fc::NF_border_line_left));
|
print (left_line);
|
||||||
FString top_bottom_line_5 (5, wchar_t(fc::NF_border_line_up_and_down));
|
|
||||||
FString top_line_2 (2, wchar_t(fc::NF_border_line_upper));
|
|
||||||
setPrintPos (3, 4);
|
setPrintPos (3, 4);
|
||||||
|
finalcut::FString top_bottom_line_5 (5, top_bottom_line);
|
||||||
|
finalcut::FString top_line_2 (2, top_line);
|
||||||
print ( top_bottom_line_5 + top_line_2
|
print ( top_bottom_line_5 + top_line_2
|
||||||
+ top_bottom_line_5 + top_line_2
|
+ top_bottom_line_5 + top_line_2
|
||||||
+ top_bottom_line_5 + top_line_2
|
+ top_bottom_line_5 + top_line_2
|
||||||
|
@ -378,9 +382,12 @@ void Calc::drawDispay()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FString separator = FString(wchar_t(fc::BoxDrawingsVerticalAndRight))
|
wchar_t vertical_and_right = wchar_t(finalcut::fc::BoxDrawingsVerticalAndRight);
|
||||||
+ FString(35, wchar_t(fc::BoxDrawingsHorizontal))
|
wchar_t horizontal = wchar_t(finalcut::fc::BoxDrawingsHorizontal);
|
||||||
+ FString(wchar_t(fc::BoxDrawingsVerticalAndLeft));
|
wchar_t vertical_and_left = wchar_t(finalcut::fc::BoxDrawingsVerticalAndLeft);
|
||||||
|
finalcut::FString separator = finalcut::FString(vertical_and_right)
|
||||||
|
+ finalcut::FString(35, horizontal)
|
||||||
|
+ finalcut::FString(vertical_and_left);
|
||||||
setPrintPos (1, 4);
|
setPrintPos (1, 4);
|
||||||
print(separator);
|
print(separator);
|
||||||
}
|
}
|
||||||
|
@ -848,10 +855,10 @@ void Calc::tangent (lDouble& x)
|
||||||
void Calc::draw()
|
void Calc::draw()
|
||||||
{
|
{
|
||||||
setBold();
|
setBold();
|
||||||
setColor (fc::Blue, fc::Cyan);
|
setColor (finalcut::fc::Blue, finalcut::fc::Cyan);
|
||||||
clearArea (vdesktop, fc::MediumShade);
|
clearArea (vdesktop, finalcut::fc::MediumShade);
|
||||||
unsetBold();
|
unsetBold();
|
||||||
FDialog::draw();
|
finalcut::FDialog::draw();
|
||||||
drawDispay();
|
drawDispay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,15 +1005,15 @@ void Calc::calcInfixOperator()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Calc::onKeyPress (FKeyEvent* ev)
|
void Calc::onKeyPress (finalcut::FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
int len = int(input.getLength());
|
int len = int(input.getLength());
|
||||||
int key = ev->key();
|
int key = ev->key();
|
||||||
|
|
||||||
switch ( key )
|
switch ( key )
|
||||||
{
|
{
|
||||||
case fc::Fkey_erase:
|
case finalcut::fc::Fkey_erase:
|
||||||
case fc::Fkey_backspace:
|
case finalcut::fc::Fkey_backspace:
|
||||||
if ( len > 0 )
|
if ( len > 0 )
|
||||||
{
|
{
|
||||||
lDouble& x = getValue();
|
lDouble& x = getValue();
|
||||||
|
@ -1029,36 +1036,37 @@ void Calc::onKeyPress (FKeyEvent* ev)
|
||||||
ev->accept();
|
ev->accept();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case fc::Fkey_escape:
|
case finalcut::fc::Fkey_escape:
|
||||||
case fc::Fkey_escape_mintty:
|
case finalcut::fc::Fkey_escape_mintty:
|
||||||
{
|
{
|
||||||
FAccelEvent a_ev(fc::Accelerator_Event, getFocusWidget());
|
finalcut::FAccelEvent a_ev( finalcut::fc::Accelerator_Event
|
||||||
|
, getFocusWidget() );
|
||||||
calculator_buttons[On]->onAccel(&a_ev);
|
calculator_buttons[On]->onAccel(&a_ev);
|
||||||
}
|
}
|
||||||
ev->accept();
|
ev->accept();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FDialog::onKeyPress(ev);
|
finalcut::FDialog::onKeyPress(ev);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Calc::onAccel (FAccelEvent* ev)
|
void Calc::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Calc::onClose (FCloseEvent* ev)
|
void Calc::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Calc::cb_buttonClicked (FWidget*, data_ptr data)
|
void Calc::cb_buttonClicked (finalcut::FWidget*, data_ptr data)
|
||||||
{
|
{
|
||||||
lDouble& x = getValue();
|
lDouble& x = getValue();
|
||||||
Calc::button key = *(static_cast<Calc::button*>(data));
|
Calc::button key = *(static_cast<Calc::button*>(data));
|
||||||
|
@ -1096,7 +1104,7 @@ void Calc::adjustSize()
|
||||||
int ph = getParentWidget()->getHeight();
|
int ph = getParentWidget()->getHeight();
|
||||||
setX (1 + (pw - getWidth()) / 2, false);
|
setX (1 + (pw - getWidth()) / 2, false);
|
||||||
setY (1 + (ph - getHeight()) / 2, false);
|
setY (1 + (ph - getHeight()) / 2, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1189,7 +1197,7 @@ void Calc::mapKeyFunctions()
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a calculator object
|
// Create a calculator object
|
||||||
Calc calculator(&app);
|
Calc calculator(&app);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2017 Markus Gans *
|
* Copyright 2017-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -24,35 +24,36 @@
|
||||||
|
|
||||||
|
|
||||||
// function prototypes
|
// function prototypes
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr);
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
|
||||||
void populateChoice (std::vector<FRadioButton*>&, FButtonGroup*);
|
void populateChoice (std::vector<finalcut::FRadioButton*>&, finalcut::FButtonGroup*);
|
||||||
void preset (std::vector<FRadioButton*>&);
|
void preset (std::vector<finalcut::FRadioButton*>&);
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// callback functions
|
// callback functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr data)
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
|
||||||
{
|
{
|
||||||
FDialog* dlg = static_cast<FDialog*>(data);
|
finalcut::FDialog* dlg = static_cast<finalcut::FDialog*>(data);
|
||||||
dlg->close();
|
dlg->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void populateChoice (std::vector<FRadioButton*>& os, FButtonGroup* group)
|
void populateChoice ( std::vector<finalcut::FRadioButton*>& os
|
||||||
|
, finalcut::FButtonGroup* group )
|
||||||
{
|
{
|
||||||
os[0] = new FRadioButton("AIX", group);
|
os[0] = new finalcut::FRadioButton("AIX", group);
|
||||||
os[1] = new FRadioButton("Cygwin", group);
|
os[1] = new finalcut::FRadioButton("Cygwin", group);
|
||||||
os[2] = new FRadioButton("FreeBSD", group);
|
os[2] = new finalcut::FRadioButton("FreeBSD", group);
|
||||||
os[3] = new FRadioButton("HP-UX", group);
|
os[3] = new finalcut::FRadioButton("HP-UX", group);
|
||||||
os[4] = new FRadioButton("Linux", group);
|
os[4] = new finalcut::FRadioButton("Linux", group);
|
||||||
os[5] = new FRadioButton("Mac OS X", group);
|
os[5] = new finalcut::FRadioButton("Mac OS X", group);
|
||||||
os[6] = new FRadioButton("NetBSD", group);
|
os[6] = new finalcut::FRadioButton("NetBSD", group);
|
||||||
os[7] = new FRadioButton("OpenBSD", group);
|
os[7] = new finalcut::FRadioButton("OpenBSD", group);
|
||||||
os[8] = new FRadioButton("Solaris", group);
|
os[8] = new finalcut::FRadioButton("Solaris", group);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void preset (std::vector<FRadioButton*>& os)
|
void preset (std::vector<finalcut::FRadioButton*>& os)
|
||||||
{
|
{
|
||||||
#if defined(_AIX)
|
#if defined(_AIX)
|
||||||
os[0]->setChecked();
|
os[0]->setChecked();
|
||||||
|
@ -90,13 +91,13 @@ void preset (std::vector<FRadioButton*>& os)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
FString label_text = "no OS";
|
finalcut::FString label_text = "no OS";
|
||||||
|
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple modal dialog box
|
// Create a simple modal dialog box
|
||||||
FDialog* dgl = new FDialog(&app);
|
finalcut::FDialog* dgl = new finalcut::FDialog(&app);
|
||||||
dgl->setModal();
|
dgl->setModal();
|
||||||
dgl->setText ("UNIX select");
|
dgl->setText ("UNIX select");
|
||||||
w = 20;
|
w = 20;
|
||||||
|
@ -106,11 +107,11 @@ int main (int argc, char* argv[])
|
||||||
dgl->setGeometry (x, y, w, h);
|
dgl->setGeometry (x, y, w, h);
|
||||||
|
|
||||||
// Create a button group
|
// Create a button group
|
||||||
FButtonGroup* checkButtonGroup = new FButtonGroup("choice", dgl);
|
finalcut::FButtonGroup* checkButtonGroup = new finalcut::FButtonGroup("choice", dgl);
|
||||||
checkButtonGroup->setGeometry (2, 1, 16, 7);
|
checkButtonGroup->setGeometry (2, 1, 16, 7);
|
||||||
|
|
||||||
// Create radio buttons
|
// Create radio buttons
|
||||||
std::vector<FRadioButton*> os (9);
|
std::vector<finalcut::FRadioButton*> os (9);
|
||||||
populateChoice (os, checkButtonGroup);
|
populateChoice (os, checkButtonGroup);
|
||||||
|
|
||||||
// Set the radio button geometry
|
// Set the radio button geometry
|
||||||
|
@ -122,11 +123,11 @@ int main (int argc, char* argv[])
|
||||||
preset(os);
|
preset(os);
|
||||||
|
|
||||||
// Scroll to the focused child element
|
// Scroll to the focused child element
|
||||||
FFocusEvent cfi (fc::ChildFocusIn_Event);
|
finalcut::FFocusEvent cfi (finalcut::fc::ChildFocusIn_Event);
|
||||||
FApplication::sendEvent(checkButtonGroup, &cfi);
|
finalcut::FApplication::sendEvent(checkButtonGroup, &cfi);
|
||||||
|
|
||||||
// Create a OK button
|
// Create a OK button
|
||||||
FButton* ok = new FButton("&OK", dgl);
|
finalcut::FButton* ok = new finalcut::FButton("&OK", dgl);
|
||||||
ok->setGeometry (10, 9, 8, 1);
|
ok->setGeometry (10, 9, 8, 1);
|
||||||
|
|
||||||
// Connect the button signal "clicked" with the callback function
|
// Connect the button signal "clicked" with the callback function
|
||||||
|
@ -154,7 +155,7 @@ int main (int argc, char* argv[])
|
||||||
delete dgl;
|
delete dgl;
|
||||||
|
|
||||||
// Create and show tooltip for two seconds
|
// Create and show tooltip for two seconds
|
||||||
FToolTip* tooltip = new FToolTip(&app);
|
finalcut::FToolTip* tooltip = new finalcut::FToolTip(&app);
|
||||||
tooltip->setText ("You have chosen " + label_text);
|
tooltip->setText ("You have chosen " + label_text);
|
||||||
tooltip->show();
|
tooltip->show();
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -23,15 +23,15 @@
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
// function prototype
|
// function prototype
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr);
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// callback function
|
// callback function
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr data)
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
|
||||||
{
|
{
|
||||||
FApplication* app = static_cast<FApplication*>(data);
|
finalcut::FApplication* app = static_cast<finalcut::FApplication*>(data);
|
||||||
app->quit();
|
app->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,21 +42,21 @@ void cb_quit (FWidget*, FWidget::data_ptr data)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
FDialog dgl(&app);
|
finalcut::FDialog dgl(&app);
|
||||||
dgl.setText ("FDialog");
|
dgl.setText ("FDialog");
|
||||||
dgl.setGeometry (4, 3, 41, 11);
|
dgl.setGeometry (4, 3, 41, 11);
|
||||||
|
|
||||||
// Create text labels
|
// Create text labels
|
||||||
FLabel label_1(&dgl);
|
finalcut::FLabel label_1(&dgl);
|
||||||
FLabel label_2(&dgl);
|
finalcut::FLabel label_2(&dgl);
|
||||||
|
|
||||||
label_1 << wchar_t(fc::BlackUpPointingTriangle)
|
label_1 << wchar_t(finalcut::fc::BlackUpPointingTriangle)
|
||||||
<< std::wstring(L"\n")
|
<< std::wstring(L"\n")
|
||||||
<< wchar_t(fc::BoxDrawingsUpAndRight)
|
<< wchar_t(finalcut::fc::BoxDrawingsUpAndRight)
|
||||||
<< FString(2, wchar_t(fc::BoxDrawingsHorizontal))
|
<< finalcut::FString(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal))
|
||||||
<< " Double click the title bar button,";
|
<< " Double click the title bar button,";
|
||||||
label_2 << "press Q on the keyboard,\n"
|
label_2 << "press Q on the keyboard,\n"
|
||||||
<< "or push the button below to exit\n"
|
<< "or push the button below to exit\n"
|
||||||
|
@ -66,7 +66,7 @@ int main (int argc, char* argv[])
|
||||||
label_2.setGeometry (5, 3, 34, 3);
|
label_2.setGeometry (5, 3, 34, 3);
|
||||||
|
|
||||||
// Create the quit button
|
// Create the quit button
|
||||||
FButton btn("&Quit", &dgl);
|
finalcut::FButton btn("&Quit", &dgl);
|
||||||
btn.setGeometry (16, 7, 9, 1);
|
btn.setGeometry (16, 7, 9, 1);
|
||||||
|
|
||||||
// Connect the button signal "clicked" with the callback function
|
// Connect the button signal "clicked" with the callback function
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -26,10 +26,10 @@
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
FMessageBox mbox(&app);
|
finalcut::FMessageBox mbox(&app);
|
||||||
mbox.setText("Hello world");
|
mbox.setText("Hello world");
|
||||||
|
|
||||||
// Start the application
|
// Start the application
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -24,22 +24,22 @@
|
||||||
|
|
||||||
|
|
||||||
// function prototypes
|
// function prototypes
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr);
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr);
|
||||||
void cb_publish (FWidget*, FWidget::data_ptr);
|
void cb_publish (finalcut::FWidget*, finalcut::FWidget::data_ptr);
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// callback functions
|
// callback functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void cb_quit (FWidget*, FWidget::data_ptr data)
|
void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data)
|
||||||
{
|
{
|
||||||
FApplication* app = static_cast<FApplication*>(data);
|
finalcut::FApplication* app = static_cast<finalcut::FApplication*>(data);
|
||||||
app->quit();
|
app->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cb_publish (FWidget* widget, FWidget::data_ptr data)
|
void cb_publish (finalcut::FWidget* widget, finalcut::FWidget::data_ptr data)
|
||||||
{
|
{
|
||||||
FCheckBox* cbox1 = static_cast<FCheckBox*>(widget);
|
finalcut::FCheckBox* cbox1 = static_cast<finalcut::FCheckBox*>(widget);
|
||||||
FCheckBox* cbox2 = static_cast<FCheckBox*>(data);
|
finalcut::FCheckBox* cbox2 = static_cast<finalcut::FCheckBox*>(data);
|
||||||
|
|
||||||
if ( cbox1->isChecked() )
|
if ( cbox1->isChecked() )
|
||||||
cbox2->setEnable();
|
cbox2->setEnable();
|
||||||
|
@ -57,21 +57,21 @@ void cb_publish (FWidget* widget, FWidget::data_ptr data)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
FDialog dgl(&app);
|
finalcut::FDialog dgl(&app);
|
||||||
dgl.setText ("Data input");
|
dgl.setText ("Data input");
|
||||||
dgl.setGeometry (4, 2, 37, 22);
|
dgl.setGeometry (4, 2, 37, 22);
|
||||||
dgl.setShadow();
|
dgl.setShadow();
|
||||||
|
|
||||||
// Create input fields
|
// Create input fields
|
||||||
FLineEdit* name_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* name_field = new finalcut::FLineEdit(&dgl);
|
||||||
FLineEdit* email_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* email_field = new finalcut::FLineEdit(&dgl);
|
||||||
FLineEdit* org_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* org_field = new finalcut::FLineEdit(&dgl);
|
||||||
FLineEdit* city_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* city_field = new finalcut::FLineEdit(&dgl);
|
||||||
FLineEdit* st_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* st_field = new finalcut::FLineEdit(&dgl);
|
||||||
FLineEdit* c_field = new FLineEdit(&dgl);
|
finalcut::FLineEdit* c_field = new finalcut::FLineEdit(&dgl);
|
||||||
|
|
||||||
name_field->setLabelText(L"&Name");
|
name_field->setLabelText(L"&Name");
|
||||||
email_field->setLabelText(L"&Email");
|
email_field->setLabelText(L"&Email");
|
||||||
|
@ -88,28 +88,34 @@ int main (int argc, char* argv[])
|
||||||
c_field->setGeometry(15, 11, 4, 1);
|
c_field->setGeometry(15, 11, 4, 1);
|
||||||
|
|
||||||
// Create the button group
|
// Create the button group
|
||||||
FButtonGroup* radioButtonGroup = new FButtonGroup("Sex", &dgl);
|
finalcut::FButtonGroup* radioButtonGroup = \
|
||||||
|
new finalcut::FButtonGroup("Sex", &dgl);
|
||||||
radioButtonGroup->setGeometry(2, 13, 13, 4);
|
radioButtonGroup->setGeometry(2, 13, 13, 4);
|
||||||
|
|
||||||
// Create radio buttons
|
// Create radio buttons
|
||||||
FRadioButton* male = new FRadioButton("&Male", radioButtonGroup);
|
finalcut::FRadioButton* male = \
|
||||||
FRadioButton* female = new FRadioButton("&Female", radioButtonGroup);
|
new finalcut::FRadioButton("&Male", radioButtonGroup);
|
||||||
|
finalcut::FRadioButton* female = \
|
||||||
|
new finalcut::FRadioButton("&Female", radioButtonGroup);
|
||||||
male->setGeometry(1, 1, 8, 1);
|
male->setGeometry(1, 1, 8, 1);
|
||||||
female->setGeometry(1, 2, 10, 1);
|
female->setGeometry(1, 2, 10, 1);
|
||||||
|
|
||||||
// Create another button group
|
// Create another button group
|
||||||
FButtonGroup* checkButtonGroup = new FButtonGroup("&Data options", &dgl);
|
finalcut::FButtonGroup* checkButtonGroup = \
|
||||||
|
new finalcut::FButtonGroup("&Data options", &dgl);
|
||||||
checkButtonGroup->setGeometry(16, 13, 19, 4);
|
checkButtonGroup->setGeometry(16, 13, 19, 4);
|
||||||
|
|
||||||
// Create checkbox buttons
|
// Create checkbox buttons
|
||||||
FCheckBox* check1 = new FCheckBox("Save data", checkButtonGroup);
|
finalcut::FCheckBox* check1 = \
|
||||||
FCheckBox* check2 = new FCheckBox("Encrypt data", checkButtonGroup);
|
new finalcut::FCheckBox("Save data", checkButtonGroup);
|
||||||
|
finalcut::FCheckBox* check2 = \
|
||||||
|
new finalcut::FCheckBox("Encrypt data", checkButtonGroup);
|
||||||
check1->setGeometry(1, 1, 13, 1);
|
check1->setGeometry(1, 1, 13, 1);
|
||||||
check2->setGeometry(1, 2, 16, 1);
|
check2->setGeometry(1, 2, 16, 1);
|
||||||
check2->setDisable();
|
check2->setDisable();
|
||||||
|
|
||||||
// Create a OK button
|
// Create a OK button
|
||||||
FButton btn("&OK", &dgl);
|
finalcut::FButton btn("&OK", &dgl);
|
||||||
btn.setGeometry (24, 18, 10, 1);
|
btn.setGeometry (24, 18, 10, 1);
|
||||||
|
|
||||||
// Connect checkbox signal "clicked" with a callback function
|
// Connect checkbox signal "clicked" with a callback function
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -26,30 +26,30 @@
|
||||||
// class Keyboard
|
// class Keyboard
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
class Keyboard : public FWidget
|
class Keyboard : public finalcut::FWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Keyboard (FWidget* = 0);
|
explicit Keyboard (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onKeyPress (FKeyEvent*);
|
void onKeyPress (finalcut::FKeyEvent*);
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
|
|
||||||
void draw();
|
void draw();
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Keyboard::Keyboard (FWidget* parent)
|
Keyboard::Keyboard (finalcut::FWidget* parent)
|
||||||
: FWidget(parent)
|
: finalcut::FWidget(parent)
|
||||||
{
|
{
|
||||||
wc.term_fg = fc::Default;
|
wc.term_fg = finalcut::fc::Default;
|
||||||
wc.term_bg = fc::Default;
|
wc.term_bg = finalcut::fc::Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Keyboard::onKeyPress (FKeyEvent* ev)
|
void Keyboard::onKeyPress (finalcut::FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
int key_id = ev->key();
|
int key_id = ev->key();
|
||||||
bool is_last_line = false;
|
bool is_last_line = false;
|
||||||
|
@ -67,7 +67,7 @@ void Keyboard::onKeyPress (FKeyEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Keyboard::onAccel (FAccelEvent* ev)
|
void Keyboard::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
quit();
|
quit();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
|
@ -89,9 +89,9 @@ void Keyboard::draw()
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
app.setForegroundColor(fc::Default);
|
app.setForegroundColor(finalcut::fc::Default);
|
||||||
app.setBackgroundColor(fc::Default);
|
app.setBackgroundColor(finalcut::fc::Default);
|
||||||
|
|
||||||
// Create a keyboard object
|
// Create a keyboard object
|
||||||
Keyboard key(&app);
|
Keyboard key(&app);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2017 Markus Gans *
|
* Copyright 2017-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -29,31 +29,38 @@
|
||||||
|
|
||||||
|
|
||||||
// Global application object
|
// Global application object
|
||||||
static FString* temp_str = 0;
|
static finalcut::FString* temp_str = 0;
|
||||||
|
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
void doubleToItem (FListBoxItem&, FWidget::data_ptr container, int index);
|
void doubleToItem ( finalcut::FListBoxItem&
|
||||||
FString& doubleToString (std::list<double>::const_iterator iter);
|
, finalcut::FWidget::data_ptr container
|
||||||
FString& mapToString (std::map<FString, FString>::const_iterator iter);
|
, int index) ;
|
||||||
|
finalcut::FString& doubleToString (std::list<double>::const_iterator iter);
|
||||||
|
finalcut::FString& mapToString ( std::map<finalcut::FString
|
||||||
|
, finalcut::FString>::const_iterator iter );
|
||||||
|
|
||||||
|
|
||||||
// Lazy conversion import function
|
// Lazy conversion import function
|
||||||
void doubleToItem (FListBoxItem& item, FWidget::data_ptr container, int index)
|
void doubleToItem ( finalcut::FListBoxItem& item
|
||||||
|
, finalcut::FWidget::data_ptr container, int index)
|
||||||
{
|
{
|
||||||
typedef std::list<double>* double_list_ptr;
|
typedef std::list<double>* double_list_ptr;
|
||||||
double_list_ptr dbllist = static_cast<double_list_ptr>(container);
|
double_list_ptr dbllist = static_cast<double_list_ptr>(container);
|
||||||
std::list<double>::iterator iter = dbllist->begin();
|
std::list<double>::iterator iter = dbllist->begin();
|
||||||
std::advance (iter, index);
|
std::advance (iter, index);
|
||||||
item.setText (FString() << *iter);
|
item.setText (finalcut::FString() << *iter);
|
||||||
item.setData (FWidget::data_ptr(&(*iter)));
|
item.setData (finalcut::FWidget::data_ptr(&(*iter)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import converter functions
|
// Import converter functions
|
||||||
FString& doubleToString (std::list<double>::const_iterator iter)
|
finalcut::FString& doubleToString (std::list<double>::const_iterator iter)
|
||||||
{
|
{
|
||||||
return temp_str->setNumber(*iter);
|
return temp_str->setNumber(*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
FString& mapToString (std::map<FString, FString>::const_iterator iter)
|
finalcut::FString& mapToString ( std::map<finalcut::FString
|
||||||
|
, finalcut::FString>::const_iterator iter )
|
||||||
{
|
{
|
||||||
return *temp_str = iter->first + ": " + iter->second;
|
return *temp_str = iter->first + ": " + iter->second;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +73,7 @@ FString& mapToString (std::map<FString, FString>::const_iterator iter)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Listbox : public FDialog
|
class Listbox : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -81,7 +88,7 @@ class Listbox : public FDialog
|
||||||
Listbox& operator = (const Listbox&);
|
Listbox& operator = (const Listbox&);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Data Member
|
// Data Member
|
||||||
std::list<double>* double_list;
|
std::list<double>* double_list;
|
||||||
|
@ -89,19 +96,19 @@ class Listbox : public FDialog
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Listbox::Listbox (FWidget* parent)
|
Listbox::Listbox (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, double_list()
|
, double_list()
|
||||||
{
|
{
|
||||||
temp_str = new FString;
|
temp_str = new finalcut::FString;
|
||||||
|
|
||||||
// listbox 1
|
// listbox 1
|
||||||
FListBox* list1 = new FListBox (this);
|
finalcut::FListBox* list1 = new finalcut::FListBox (this);
|
||||||
list1->setGeometry(2, 1, 18, 10);
|
list1->setGeometry(2, 1, 18, 10);
|
||||||
list1->setText ("FListBoxItem");
|
list1->setText ("FListBoxItem");
|
||||||
|
|
||||||
for (int i = 1; i < 30; i++)
|
for (int i = 1; i < 30; i++)
|
||||||
list1->insert (L"----- " + (FString() << i) + L" -----");
|
list1->insert (L"----- " + (finalcut::FString() << i) + L" -----");
|
||||||
|
|
||||||
// listbox 2
|
// listbox 2
|
||||||
double_list = new std::list<double>;
|
double_list = new std::list<double>;
|
||||||
|
@ -109,7 +116,7 @@ Listbox::Listbox (FWidget* parent)
|
||||||
for (double i = 1; i<=15; i++)
|
for (double i = 1; i<=15; i++)
|
||||||
double_list->push_back(2 * i + (i / 100));
|
double_list->push_back(2 * i + (i / 100));
|
||||||
|
|
||||||
FListBox* list2 = new FListBox (this);
|
finalcut::FListBox* list2 = new finalcut::FListBox (this);
|
||||||
list2->setGeometry(21, 1, 10, 10);
|
list2->setGeometry(21, 1, 10, 10);
|
||||||
list2->setText ("double");
|
list2->setText ("double");
|
||||||
|
|
||||||
|
@ -124,20 +131,20 @@ Listbox::Listbox (FWidget* parent)
|
||||||
//list2->insert (double_list->begin(), double_list->end(), doubleToString);
|
//list2->insert (double_list->begin(), double_list->end(), doubleToString);
|
||||||
|
|
||||||
// listbox 3
|
// listbox 3
|
||||||
std::map<FString, FString> TLD;
|
std::map<finalcut::FString, finalcut::FString> TLD;
|
||||||
TLD["com"] = "Commercial";
|
TLD["com"] = "Commercial";
|
||||||
TLD["org"] = "Organization";
|
TLD["org"] = "Organization";
|
||||||
TLD["net"] = "Network";
|
TLD["net"] = "Network";
|
||||||
TLD["edu"] = "Education";
|
TLD["edu"] = "Education";
|
||||||
TLD["gov"] = "Government";
|
TLD["gov"] = "Government";
|
||||||
|
|
||||||
FListBox* list3;
|
finalcut::FListBox* list3;
|
||||||
list3 = new FListBox (TLD.begin(), TLD.end(), mapToString, this);
|
list3 = new finalcut::FListBox (TLD.begin(), TLD.end(), mapToString, this);
|
||||||
list3->setGeometry(32, 1, 21, 10);
|
list3->setGeometry(32, 1, 21, 10);
|
||||||
list3->setText ("key: value");
|
list3->setText ("key: value");
|
||||||
|
|
||||||
// Quit button
|
// Quit button
|
||||||
FButton* Quit = new FButton (this);
|
finalcut::FButton* Quit = new finalcut::FButton (this);
|
||||||
Quit->setGeometry(42, 12, 10, 1);
|
Quit->setGeometry(42, 12, 10, 1);
|
||||||
Quit->setText (L"&Quit");
|
Quit->setText (L"&Quit");
|
||||||
|
|
||||||
|
@ -145,7 +152,7 @@ Listbox::Listbox (FWidget* parent)
|
||||||
Quit->addCallback
|
Quit->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,9 +164,9 @@ Listbox::~Listbox() // destructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Listbox::onClose (FCloseEvent* ev)
|
void Listbox::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,7 +177,7 @@ void Listbox::onClose (FCloseEvent* ev)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
Listbox d(&app);
|
Listbox d(&app);
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Listview : public FDialog
|
class Listview : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Listview (FWidget* = 0);
|
explicit Listview (finalcut::FWidget* = 0);
|
||||||
// Destructor
|
// Destructor
|
||||||
~Listview();
|
~Listview();
|
||||||
|
|
||||||
|
@ -50,22 +50,22 @@ class Listview : public FDialog
|
||||||
Listview& operator = (const Listview&);
|
Listview& operator = (const Listview&);
|
||||||
|
|
||||||
// Method
|
// Method
|
||||||
void populate (FListView*);
|
void populate (finalcut::FListView*);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_showInMessagebox (FWidget*, data_ptr);
|
void cb_showInMessagebox (finalcut::FWidget*, data_ptr);
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Listview::Listview (FWidget* parent)
|
Listview::Listview (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
{
|
{
|
||||||
// Create FListView object
|
// Create FListView object
|
||||||
FListView* listView = new FListView (this);
|
finalcut::FListView* listView = new finalcut::FListView (this);
|
||||||
listView->setGeometry(2, 1, 33, 14);
|
listView->setGeometry(2, 1, 33, 14);
|
||||||
|
|
||||||
// Add columns to the view
|
// Add columns to the view
|
||||||
|
@ -76,15 +76,15 @@ Listview::Listview (FWidget* parent)
|
||||||
listView->addColumn ("Pressure", 10);
|
listView->addColumn ("Pressure", 10);
|
||||||
|
|
||||||
// Set right alignment for the third, fourth, and fifth column
|
// Set right alignment for the third, fourth, and fifth column
|
||||||
listView->setColumnAlignment (3, fc::alignRight);
|
listView->setColumnAlignment (3, finalcut::fc::alignRight);
|
||||||
listView->setColumnAlignment (4, fc::alignRight);
|
listView->setColumnAlignment (4, finalcut::fc::alignRight);
|
||||||
listView->setColumnAlignment (5, fc::alignRight);
|
listView->setColumnAlignment (5, finalcut::fc::alignRight);
|
||||||
|
|
||||||
// Populate FListView with a list of items
|
// Populate FListView with a list of items
|
||||||
populate (listView);
|
populate (listView);
|
||||||
|
|
||||||
// Quit button
|
// Quit button
|
||||||
FButton* Quit = new FButton (this);
|
finalcut::FButton* Quit = new finalcut::FButton (this);
|
||||||
Quit->setGeometry(24, 16, 10, 1);
|
Quit->setGeometry(24, 16, 10, 1);
|
||||||
Quit->setText (L"&Quit");
|
Quit->setText (L"&Quit");
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ Listview::Listview (FWidget* parent)
|
||||||
Quit->addCallback
|
Quit->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
|
|
||||||
listView->addCallback
|
listView->addCallback
|
||||||
|
@ -107,7 +107,7 @@ Listview::~Listview() // destructor
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Listview::populate (FListView* listView)
|
void Listview::populate (finalcut::FListView* listView)
|
||||||
{
|
{
|
||||||
std::string weather[][5] =
|
std::string weather[][5] =
|
||||||
{
|
{
|
||||||
|
@ -158,31 +158,32 @@ void Listview::populate (FListView* listView)
|
||||||
|
|
||||||
for (int i = 0; i <= lastItem; i++)
|
for (int i = 0; i <= lastItem; i++)
|
||||||
{
|
{
|
||||||
FStringList line (&weather[i][0], &weather[i][0] + 5);
|
finalcut::FStringList line (&weather[i][0], &weather[i][0] + 5);
|
||||||
listView->insert (line);
|
listView->insert (line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Listview::onClose (FCloseEvent* ev)
|
void Listview::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Listview::cb_showInMessagebox (FWidget* widget, data_ptr)
|
void Listview::cb_showInMessagebox (finalcut::FWidget* widget, data_ptr)
|
||||||
{
|
{
|
||||||
FListView* listView = static_cast<FListView*>(widget);
|
finalcut::FListView* listView = static_cast<finalcut::FListView*>(widget);
|
||||||
FListViewItem* item = listView->getCurrentItem();
|
finalcut::FListViewItem* item = listView->getCurrentItem();
|
||||||
FMessageBox info ( "Weather in " + item->getText(1)
|
finalcut::FMessageBox info ( "Weather in " + item->getText(1)
|
||||||
, " Condition: " + item->getText(2) + "\n"
|
, " Condition: " + item->getText(2) + "\n"
|
||||||
"Temperature: " + item->getText(3) + "\n"
|
"Temperature: " + item->getText(3) + "\n"
|
||||||
" Humidity: " + item->getText(4) + "\n"
|
" Humidity: " + item->getText(4) + "\n"
|
||||||
" Pressure: " + item->getText(5)
|
" Pressure: " + item->getText(5)
|
||||||
, FMessageBox::Ok, 0, 0, this );
|
, finalcut::FMessageBox::Ok, 0, 0, this );
|
||||||
info.show();
|
info.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// main part
|
// main part
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -190,7 +191,7 @@ void Listview::cb_showInMessagebox (FWidget* widget, data_ptr)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
Listview d(&app);
|
Listview d(&app);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -30,18 +30,18 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Mandelbrot : public FDialog
|
class Mandelbrot : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Mandelbrot (FWidget* = 0);
|
explicit Mandelbrot (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Mandelbrot();
|
~Mandelbrot();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
|
@ -51,8 +51,8 @@ class Mandelbrot : public FDialog
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Mandelbrot::Mandelbrot (FWidget* parent)
|
Mandelbrot::Mandelbrot (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
{
|
{
|
||||||
setText ("Mandelbrot set");
|
setText ("Mandelbrot set");
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ void Mandelbrot::draw()
|
||||||
double x, y, xtemp, x0, y0, dX, dY;
|
double x, y, xtemp, x0, y0, dX, dY;
|
||||||
double x_min, x_max, y_min, y_max;
|
double x_min, x_max, y_min, y_max;
|
||||||
|
|
||||||
FDialog::draw();
|
finalcut::FDialog::draw();
|
||||||
|
|
||||||
x_min = -2.20;
|
x_min = -2.20;
|
||||||
x_max = 1.00;
|
x_max = 1.00;
|
||||||
|
@ -106,9 +106,9 @@ void Mandelbrot::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( iter < max_iter )
|
if ( iter < max_iter )
|
||||||
setColor(fc::Black, iter % 16);
|
setColor(finalcut::fc::Black, iter % 16);
|
||||||
else
|
else
|
||||||
setColor(fc::Black, 0);
|
setColor(finalcut::fc::Black, 0);
|
||||||
|
|
||||||
print(' ');
|
print(' ');
|
||||||
}
|
}
|
||||||
|
@ -116,16 +116,16 @@ void Mandelbrot::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Mandelbrot::onAccel (FAccelEvent* ev)
|
void Mandelbrot::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Mandelbrot::onClose (FCloseEvent* ev)
|
void Mandelbrot::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -134,7 +134,7 @@ void Mandelbrot::adjustSize()
|
||||||
int h = getParentWidget()->getHeight() - 1;
|
int h = getParentWidget()->getHeight() - 1;
|
||||||
int w = getParentWidget()->getWidth() - 10;
|
int w = getParentWidget()->getWidth() - 10;
|
||||||
setGeometry(6, 1, w, h, false);
|
setGeometry(6, 1, w, h, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -143,7 +143,7 @@ void Mandelbrot::adjustSize()
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
Mandelbrot mb(&app);
|
Mandelbrot mb(&app);
|
||||||
|
|
|
@ -30,11 +30,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Menu : public FDialog
|
class Menu : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Menu (FWidget* = 0);
|
explicit Menu (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Menu();
|
~Menu();
|
||||||
|
@ -47,42 +47,47 @@ class Menu : public FDialog
|
||||||
Menu& operator = (const Menu&);
|
Menu& operator = (const Menu&);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void createFileMenuItems (FMenu*);
|
void createFileMenuItems (finalcut::FMenu*);
|
||||||
void createEditMenuItems (FMenu*);
|
void createEditMenuItems (finalcut::FMenu*);
|
||||||
void createChoiceMenuItems (FMenu*);
|
void createChoiceMenuItems (finalcut::FMenu*);
|
||||||
void createColorMenuItems (FMenu*);
|
void createColorMenuItems (finalcut::FMenu*);
|
||||||
void createStyleMenuItems (FMenu*);
|
void createStyleMenuItems (finalcut::FMenu*);
|
||||||
void createBorderMenuItems (FMenu*);
|
void createBorderMenuItems (finalcut::FMenu*);
|
||||||
void createBorderColorMenuItems (FMenu*);
|
void createBorderColorMenuItems (finalcut::FMenu*);
|
||||||
void createBorderStyleMenuItems (FMenu*);
|
void createBorderStyleMenuItems (finalcut::FMenu*);
|
||||||
void defaultCallback (FMenuList*);
|
void defaultCallback (finalcut::FMenuList*);
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_message (FWidget*, data_ptr);
|
void cb_message (finalcut::FWidget*, data_ptr);
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Menu::Menu (FWidget* parent)
|
Menu::Menu (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
{
|
{
|
||||||
// Menu bar
|
// Menu bar
|
||||||
FMenuBar* Menubar = new FMenuBar (this);
|
finalcut::FMenuBar* Menubar = new finalcut::FMenuBar(this);
|
||||||
|
|
||||||
// Menu bar items
|
// Menu bar items
|
||||||
FMenu* File = new FMenu ("&File", Menubar);
|
finalcut::FMenu* File = \
|
||||||
|
new finalcut::FMenu ("&File", Menubar);
|
||||||
File->setStatusbarMessage ("File management commands");
|
File->setStatusbarMessage ("File management commands");
|
||||||
FMenu* Edit = new FMenu ("&Edit", Menubar);
|
finalcut::FMenu* Edit = \
|
||||||
|
new finalcut::FMenu ("&Edit", Menubar);
|
||||||
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
|
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
|
||||||
FMenu* Choice = new FMenu ("&Choice", Menubar);
|
finalcut::FMenu* Choice = \
|
||||||
|
new finalcut::FMenu ("&Choice", Menubar);
|
||||||
Choice->setStatusbarMessage ("Choice menu");
|
Choice->setStatusbarMessage ("Choice menu");
|
||||||
FMenuItem* Window = new FMenuItem ("&Window", Menubar);
|
finalcut::FMenuItem* Window = \
|
||||||
|
new finalcut::FMenuItem ("&Window", Menubar);
|
||||||
Window->setDisable();
|
Window->setDisable();
|
||||||
FMenuItem* Help = new FMenuItem ("&Help", Menubar);
|
finalcut::FMenuItem* Help = \
|
||||||
|
new finalcut::FMenuItem ("&Help", Menubar);
|
||||||
Help->setStatusbarMessage ("Show version and copyright information");
|
Help->setStatusbarMessage ("Show version and copyright information");
|
||||||
|
|
||||||
// Menu items
|
// Menu items
|
||||||
|
@ -94,22 +99,26 @@ Menu::Menu (FWidget* parent)
|
||||||
defaultCallback (Menubar);
|
defaultCallback (Menubar);
|
||||||
|
|
||||||
// Statusbar at the bottom
|
// Statusbar at the bottom
|
||||||
FStatusBar* Statusbar = new FStatusBar (this);
|
finalcut::FStatusBar* Statusbar = \
|
||||||
|
new finalcut::FStatusBar (this);
|
||||||
Statusbar->setMessage("Status bar message");
|
Statusbar->setMessage("Status bar message");
|
||||||
|
|
||||||
// Headline labels
|
// Headline labels
|
||||||
FLabel* Headline1 = new FLabel(" Key ", this);
|
finalcut::FLabel* Headline1 = \
|
||||||
|
new finalcut::FLabel(" Key ", this);
|
||||||
Headline1->ignorePadding();
|
Headline1->ignorePadding();
|
||||||
Headline1->setGeometry(3, 2, 5, 1);
|
Headline1->setGeometry(3, 2, 5, 1);
|
||||||
Headline1->setEmphasis();
|
Headline1->setEmphasis();
|
||||||
|
|
||||||
FLabel* Headline2 = new FLabel(" Function ", this);
|
finalcut::FLabel* Headline2 = \
|
||||||
|
new finalcut::FLabel(" Function ", this);
|
||||||
Headline2->ignorePadding();
|
Headline2->ignorePadding();
|
||||||
Headline2->setGeometry(19, 2, 10, 1);
|
Headline2->setGeometry(19, 2, 10, 1);
|
||||||
Headline2->setEmphasis();
|
Headline2->setEmphasis();
|
||||||
|
|
||||||
// Info label
|
// Info label
|
||||||
FLabel* Info = new FLabel("<F10> Activate menu bar\n"
|
finalcut::FLabel* Info = \
|
||||||
|
new finalcut::FLabel( "<F10> Activate menu bar\n"
|
||||||
"<Ctrl>+<Space> Activate menu bar\n"
|
"<Ctrl>+<Space> Activate menu bar\n"
|
||||||
"<Meta>+<X> Exit", this );
|
"<Meta>+<X> Exit", this );
|
||||||
Info->setGeometry(2, 1, 36, 3);
|
Info->setGeometry(2, 1, 36, 3);
|
||||||
|
@ -120,80 +129,100 @@ Menu::~Menu()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createFileMenuItems (FMenu* File)
|
void Menu::createFileMenuItems (finalcut::FMenu* File)
|
||||||
{
|
{
|
||||||
// "File" menu items
|
// "File" menu items
|
||||||
FMenuItem* New = new FMenuItem ("&New", File);
|
finalcut::FMenuItem* New = \
|
||||||
New->addAccelerator (fc::Fckey_n); // Ctrl + N
|
new finalcut::FMenuItem ("&New", File);
|
||||||
|
New->addAccelerator (finalcut::fc::Fckey_n); // Ctrl + N
|
||||||
New->setStatusbarMessage ("Create a new file");
|
New->setStatusbarMessage ("Create a new file");
|
||||||
FMenuItem* Open = new FMenuItem ("&Open...", File);
|
finalcut::FMenuItem* Open = \
|
||||||
Open->addAccelerator (fc::Fckey_o); // Ctrl + O
|
new finalcut::FMenuItem ("&Open...", File);
|
||||||
|
Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
|
||||||
Open->setStatusbarMessage ("Locate and open a text file");
|
Open->setStatusbarMessage ("Locate and open a text file");
|
||||||
FMenuItem* Save = new FMenuItem ("&Save", File);
|
finalcut::FMenuItem* Save = \
|
||||||
Save->addAccelerator (fc::Fckey_s); // Ctrl + S
|
new finalcut::FMenuItem ("&Save", File);
|
||||||
|
Save->addAccelerator (finalcut::fc::Fckey_s); // Ctrl + S
|
||||||
Save->setStatusbarMessage ("Save the file");
|
Save->setStatusbarMessage ("Save the file");
|
||||||
FMenuItem* SaveAs = new FMenuItem ("&Save as...", File);
|
finalcut::FMenuItem* SaveAs = \
|
||||||
|
new finalcut::FMenuItem ("&Save as...", File);
|
||||||
SaveAs->setStatusbarMessage ("Save the current file under a different name");
|
SaveAs->setStatusbarMessage ("Save the current file under a different name");
|
||||||
FMenuItem* Close = new FMenuItem ("&Close", File);
|
finalcut::FMenuItem* Close = \
|
||||||
Close->addAccelerator (fc::Fckey_w); // Ctrl + W
|
new finalcut::FMenuItem ("&Close", File);
|
||||||
|
Close->addAccelerator (finalcut::fc::Fckey_w); // Ctrl + W
|
||||||
Close->setStatusbarMessage ("Close the current file");
|
Close->setStatusbarMessage ("Close the current file");
|
||||||
FMenuItem* Line1 = new FMenuItem (File);
|
finalcut::FMenuItem* Line1 = \
|
||||||
|
new finalcut::FMenuItem (File);
|
||||||
Line1->setSeparator();
|
Line1->setSeparator();
|
||||||
FMenuItem* Print = new FMenuItem ("&Print", File);
|
finalcut::FMenuItem* Print = \
|
||||||
Print->addAccelerator (fc::Fckey_p); // Ctrl + P
|
new finalcut::FMenuItem ("&Print", File);
|
||||||
|
Print->addAccelerator (finalcut::fc::Fckey_p); // Ctrl + P
|
||||||
Print->setStatusbarMessage ("Print the current file");
|
Print->setStatusbarMessage ("Print the current file");
|
||||||
FMenuItem* Line2 = new FMenuItem (File);
|
finalcut::FMenuItem* Line2 = \
|
||||||
|
new finalcut::FMenuItem (File);
|
||||||
Line2->setSeparator();
|
Line2->setSeparator();
|
||||||
FMenuItem* Quit = new FMenuItem ("&Quit", File);
|
finalcut::FMenuItem* Quit = \
|
||||||
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
|
new finalcut::FMenuItem ("&Quit", File);
|
||||||
|
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
|
||||||
Quit->setStatusbarMessage ("Exit the program");
|
Quit->setStatusbarMessage ("Exit the program");
|
||||||
|
|
||||||
// Add quit menu item callback
|
// Add quit menu item callback
|
||||||
Quit->addCallback
|
Quit->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createEditMenuItems (FMenu* Edit)
|
void Menu::createEditMenuItems (finalcut::FMenu* Edit)
|
||||||
{
|
{
|
||||||
// "Edit" menu items
|
// "Edit" menu items
|
||||||
FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "&Undo", Edit);
|
finalcut::FMenuItem* Undo = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_z, "&Undo", Edit);
|
||||||
Undo->setStatusbarMessage ("Undo the previous operation");
|
Undo->setStatusbarMessage ("Undo the previous operation");
|
||||||
FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "&Redo", Edit);
|
finalcut::FMenuItem* Redo = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_y, "&Redo", Edit);
|
||||||
Redo->setDisable();
|
Redo->setDisable();
|
||||||
FMenuItem* Line3 = new FMenuItem (Edit);
|
finalcut::FMenuItem* Line3 = \
|
||||||
|
new finalcut::FMenuItem (Edit);
|
||||||
Line3->setSeparator();
|
Line3->setSeparator();
|
||||||
FMenuItem* Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit);
|
finalcut::FMenuItem* Cut = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit);
|
||||||
Cut->setStatusbarMessage ( "Remove the input text "
|
Cut->setStatusbarMessage ( "Remove the input text "
|
||||||
"and put it in the clipboard" );
|
"and put it in the clipboard" );
|
||||||
FMenuItem* Copy = new FMenuItem (fc::Fckey_c, "&Copy", Edit);
|
finalcut::FMenuItem* Copy = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit);
|
||||||
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
|
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
|
||||||
FMenuItem* Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit);
|
finalcut::FMenuItem* Paste = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit);
|
||||||
Paste->setStatusbarMessage ("Insert text form clipboard");
|
Paste->setStatusbarMessage ("Insert text form clipboard");
|
||||||
FMenuItem* Line4 = new FMenuItem (Edit);
|
finalcut::FMenuItem* Line4 = \
|
||||||
|
new finalcut::FMenuItem (Edit);
|
||||||
Line4->setSeparator();
|
Line4->setSeparator();
|
||||||
FMenuItem* Search = new FMenuItem (fc::Fckey_f, "&Search", Edit);
|
finalcut::FMenuItem* Search = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_f, "&Search", Edit);
|
||||||
Search->setStatusbarMessage ("Search for text");
|
Search->setStatusbarMessage ("Search for text");
|
||||||
FMenuItem* Next = new FMenuItem (fc::Fkey_f3, "Search &next", Edit);
|
finalcut::FMenuItem* Next = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fkey_f3, "Search &next", Edit);
|
||||||
Next->setStatusbarMessage ("Repeat the last search command");
|
Next->setStatusbarMessage ("Repeat the last search command");
|
||||||
FMenuItem* Line5 = new FMenuItem (Edit);
|
finalcut::FMenuItem* Line5 = \
|
||||||
|
new finalcut::FMenuItem (Edit);
|
||||||
Line5->setSeparator();
|
Line5->setSeparator();
|
||||||
FMenuItem* SelectAll = new FMenuItem (fc::Fckey_a, "Select &all", Edit);
|
finalcut::FMenuItem* SelectAll = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_a, "Select &all", Edit);
|
||||||
SelectAll->setStatusbarMessage ("Select the whole text");
|
SelectAll->setStatusbarMessage ("Select the whole text");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createChoiceMenuItems (FMenu* Choice)
|
void Menu::createChoiceMenuItems (finalcut::FMenu* Choice)
|
||||||
{
|
{
|
||||||
// "Choice" menu items
|
// "Choice" menu items
|
||||||
FMenu* Color = new FMenu ("&Color", Choice);
|
finalcut::FMenu* Color = new finalcut::FMenu ("&Color", Choice);
|
||||||
Color->setStatusbarMessage ("Choose a color");
|
Color->setStatusbarMessage ("Choose a color");
|
||||||
FMenu* Style = new FMenu ("&Style", Choice);
|
finalcut::FMenu* Style = new finalcut::FMenu ("&Style", Choice);
|
||||||
Style->setStatusbarMessage ("Choose a Style");
|
Style->setStatusbarMessage ("Choose a Style");
|
||||||
FMenu* Border = new FMenu ("&Border", Choice);
|
finalcut::FMenu* Border = new finalcut::FMenu ("&Border", Choice);
|
||||||
Border->setStatusbarMessage ("Choose Border");
|
Border->setStatusbarMessage ("Choose Border");
|
||||||
|
|
||||||
createColorMenuItems (Color);
|
createColorMenuItems (Color);
|
||||||
|
@ -202,39 +231,46 @@ void Menu::createChoiceMenuItems (FMenu* Choice)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createColorMenuItems (FMenu* Color)
|
void Menu::createColorMenuItems (finalcut::FMenu* Color)
|
||||||
{
|
{
|
||||||
// "Color" menu items
|
// "Color" menu items
|
||||||
FRadioMenuItem* Color1 = new FRadioMenuItem ("Red", Color);
|
finalcut::FRadioMenuItem* Color1 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Red", Color);
|
||||||
Color1->setStatusbarMessage ("Set text red");
|
Color1->setStatusbarMessage ("Set text red");
|
||||||
FRadioMenuItem* Color2 = new FRadioMenuItem ("Green", Color);
|
finalcut::FRadioMenuItem* Color2 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Green", Color);
|
||||||
Color2->setStatusbarMessage ("Set text green");
|
Color2->setStatusbarMessage ("Set text green");
|
||||||
FRadioMenuItem* Color3 = new FRadioMenuItem ("Yellow", Color);
|
finalcut::FRadioMenuItem* Color3 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Yellow", Color);
|
||||||
Color3->setStatusbarMessage ("Set text yellow");
|
Color3->setStatusbarMessage ("Set text yellow");
|
||||||
FRadioMenuItem* Color4 = new FRadioMenuItem ("Brue", Color);
|
finalcut::FRadioMenuItem* Color4 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Brue", Color);
|
||||||
Color4->setStatusbarMessage ("Set text brue");
|
Color4->setStatusbarMessage ("Set text brue");
|
||||||
FRadioMenuItem* Color5 = new FRadioMenuItem ("Black", Color);
|
finalcut::FRadioMenuItem* Color5 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Black", Color);
|
||||||
Color5->setStatusbarMessage ("Set text black");
|
Color5->setStatusbarMessage ("Set text black");
|
||||||
Color5->setChecked();
|
Color5->setChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createStyleMenuItems (FMenu* Style)
|
void Menu::createStyleMenuItems (finalcut::FMenu* Style)
|
||||||
{
|
{
|
||||||
// "Style" menu items
|
// "Style" menu items
|
||||||
FCheckMenuItem* Bold = new FCheckMenuItem ("Bold", Style);
|
finalcut::FCheckMenuItem* Bold = \
|
||||||
|
new finalcut::FCheckMenuItem ("Bold", Style);
|
||||||
Bold->setStatusbarMessage ("Set text bold");
|
Bold->setStatusbarMessage ("Set text bold");
|
||||||
FCheckMenuItem* Italic = new FCheckMenuItem ("Italic", Style);
|
finalcut::FCheckMenuItem* Italic = \
|
||||||
|
new finalcut::FCheckMenuItem ("Italic", Style);
|
||||||
Italic->setStatusbarMessage ("Set text italic");
|
Italic->setStatusbarMessage ("Set text italic");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createBorderMenuItems (FMenu* Border)
|
void Menu::createBorderMenuItems (finalcut::FMenu* Border)
|
||||||
{
|
{
|
||||||
// "Border" menu items
|
// "Border" menu items
|
||||||
FMenu* BColor = new FMenu ("&Color", Border);
|
finalcut::FMenu* BColor = new finalcut::FMenu ("&Color", Border);
|
||||||
BColor->setStatusbarMessage ("Choose the border color");
|
BColor->setStatusbarMessage ("Choose the border color");
|
||||||
FMenu* BStyle = new FMenu ("&Style", Border);
|
finalcut::FMenu* BStyle = new finalcut::FMenu ("&Style", Border);
|
||||||
BStyle->setStatusbarMessage ("Choose the border Style");
|
BStyle->setStatusbarMessage ("Choose the border Style");
|
||||||
|
|
||||||
createBorderColorMenuItems (BColor);
|
createBorderColorMenuItems (BColor);
|
||||||
|
@ -242,37 +278,43 @@ void Menu::createBorderMenuItems (FMenu* Border)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createBorderColorMenuItems (FMenu* BColor)
|
void Menu::createBorderColorMenuItems (finalcut::FMenu* BColor)
|
||||||
{
|
{
|
||||||
// "BColor" menu items
|
// "BColor" menu items
|
||||||
FRadioMenuItem* BColor1 = new FRadioMenuItem ("Red", BColor);
|
finalcut::FRadioMenuItem* BColor1 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Red", BColor);
|
||||||
BColor1->setStatusbarMessage ("Set red border");
|
BColor1->setStatusbarMessage ("Set red border");
|
||||||
FRadioMenuItem* BColor2 = new FRadioMenuItem ("Blue", BColor);
|
finalcut::FRadioMenuItem* BColor2 = \
|
||||||
|
new finalcut::FRadioMenuItem ("Blue", BColor);
|
||||||
BColor2->setStatusbarMessage ("Set blue border");
|
BColor2->setStatusbarMessage ("Set blue border");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::createBorderStyleMenuItems (FMenu* BStyle)
|
void Menu::createBorderStyleMenuItems (finalcut::FMenu* BStyle)
|
||||||
{
|
{
|
||||||
// "BStyle" menu items
|
// "BStyle" menu items
|
||||||
FString line(13, wchar_t(fc::BoxDrawingsHorizontal));
|
finalcut::FString line(13, wchar_t(finalcut::fc::BoxDrawingsHorizontal));
|
||||||
FRadioMenuItem* BStyle1 = new FRadioMenuItem (line, BStyle);
|
finalcut::FRadioMenuItem* BStyle1 = \
|
||||||
|
new finalcut::FRadioMenuItem (line, BStyle);
|
||||||
BStyle1->setChecked();
|
BStyle1->setChecked();
|
||||||
BStyle1->setStatusbarMessage ("Set border 1");
|
BStyle1->setStatusbarMessage ("Set border 1");
|
||||||
FRadioMenuItem* BStyle2 = new FRadioMenuItem ("-------------", BStyle);
|
finalcut::FRadioMenuItem* BStyle2 = \
|
||||||
|
new finalcut::FRadioMenuItem ("-------------", BStyle);
|
||||||
BStyle2->setStatusbarMessage ("Set border 2");
|
BStyle2->setStatusbarMessage ("Set border 2");
|
||||||
FRadioMenuItem* BStyle3 = new FRadioMenuItem ("- - - - - - -", BStyle);
|
finalcut::FRadioMenuItem* BStyle3 = \
|
||||||
|
new finalcut::FRadioMenuItem ("- - - - - - -", BStyle);
|
||||||
BStyle3->setStatusbarMessage ("Set border 3");
|
BStyle3->setStatusbarMessage ("Set border 3");
|
||||||
FRadioMenuItem* BStyle4 = new FRadioMenuItem ("- - - - -", BStyle);
|
finalcut::FRadioMenuItem* BStyle4 = \
|
||||||
|
new finalcut::FRadioMenuItem ("- - - - -", BStyle);
|
||||||
BStyle4->setStatusbarMessage ("Set border 4");
|
BStyle4->setStatusbarMessage ("Set border 4");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::defaultCallback (FMenuList* mb)
|
void Menu::defaultCallback (finalcut::FMenuList* mb)
|
||||||
{
|
{
|
||||||
for (uInt i = 1; i <= mb->getCount(); i++)
|
for (uInt i = 1; i <= mb->getCount(); i++)
|
||||||
{
|
{
|
||||||
FMenuItem* item = mb->getItem(int(i));
|
finalcut::FMenuItem* item = mb->getItem(int(i));
|
||||||
|
|
||||||
if ( item
|
if ( item
|
||||||
&& item->isEnabled()
|
&& item->isEnabled()
|
||||||
|
@ -302,22 +344,25 @@ void Menu::adjustSize()
|
||||||
int ph = getParentWidget()->getHeight();
|
int ph = getParentWidget()->getHeight();
|
||||||
setX (1 + (pw - getWidth()) / 2, false);
|
setX (1 + (pw - getWidth()) / 2, false);
|
||||||
setY (1 + (ph - getHeight()) / 4, false);
|
setY (1 + (ph - getHeight()) / 4, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::onClose (FCloseEvent* ev)
|
void Menu::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Menu::cb_message (FWidget* widget, data_ptr)
|
void Menu::cb_message (finalcut::FWidget* widget, data_ptr)
|
||||||
{
|
{
|
||||||
FMenuItem* menuitem = static_cast<FMenuItem*>(widget);
|
finalcut::FMenuItem* menuitem = \
|
||||||
FString text = menuitem->getText();
|
static_cast<finalcut::FMenuItem*>(widget);
|
||||||
|
finalcut::FString text = menuitem->getText();
|
||||||
text = text.replace('&', "");
|
text = text.replace('&', "");
|
||||||
FMessageBox::info (this, "Info", "You have chosen \"" + text + "\"");
|
finalcut::FMessageBox::info ( this
|
||||||
|
, "Info"
|
||||||
|
, "You have chosen \"" + text + "\"" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -328,7 +373,7 @@ void Menu::cb_message (FWidget* widget, data_ptr)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app (argc, argv);
|
finalcut::FApplication app (argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
Menu main_dlg (&app);
|
Menu main_dlg (&app);
|
||||||
|
|
|
@ -30,11 +30,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class ColorChooser : public FWidget
|
class ColorChooser : public finalcut::FWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit ColorChooser (FWidget* = 0);
|
explicit ColorChooser (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~ColorChooser();
|
~ColorChooser();
|
||||||
|
@ -53,7 +53,7 @@ class ColorChooser : public FWidget
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onMouseDown (FMouseEvent*);
|
void onMouseDown (finalcut::FMouseEvent*);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
short fg_color;
|
short fg_color;
|
||||||
|
@ -62,10 +62,10 @@ class ColorChooser : public FWidget
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
ColorChooser::ColorChooser (FWidget* parent)
|
ColorChooser::ColorChooser (finalcut::FWidget* parent)
|
||||||
: FWidget(parent)
|
: FWidget(parent)
|
||||||
, fg_color(fc::White)
|
, fg_color(finalcut::fc::White)
|
||||||
, bg_color(fc::Black)
|
, bg_color(finalcut::fc::Black)
|
||||||
{
|
{
|
||||||
setSize (8, 12);
|
setSize (8, 12);
|
||||||
setFixedSize (8, 12);
|
setFixedSize (8, 12);
|
||||||
|
@ -78,10 +78,10 @@ ColorChooser::ColorChooser (FWidget* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text label
|
// Text label
|
||||||
FLabel* headline = new FLabel (this);
|
finalcut::FLabel* headline = new finalcut::FLabel (this);
|
||||||
headline->setGeometry(1, 1, 8, 1);
|
headline->setGeometry(1, 1, 8, 1);
|
||||||
headline->setEmphasis();
|
headline->setEmphasis();
|
||||||
headline->setAlignment (fc::alignCenter);
|
headline->setAlignment (finalcut::fc::alignCenter);
|
||||||
*headline << "Color";
|
*headline << "Color";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,12 +90,12 @@ ColorChooser::~ColorChooser()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ColorChooser::onMouseDown (FMouseEvent* ev)
|
void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
int mouse_x = ev->getX();
|
int mouse_x = ev->getX();
|
||||||
int mouse_y = ev->getY();
|
int mouse_y = ev->getY();
|
||||||
|
|
||||||
if ( ev->getButton() == fc::MiddleButton )
|
if ( ev->getButton() == finalcut::fc::MiddleButton )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int c = 0; c < 16; c++)
|
for (int c = 0; c < 16; c++)
|
||||||
|
@ -106,9 +106,9 @@ void ColorChooser::onMouseDown (FMouseEvent* ev)
|
||||||
|
|
||||||
if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y )
|
if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y )
|
||||||
{
|
{
|
||||||
if ( ev->getButton() == fc::LeftButton )
|
if ( ev->getButton() == finalcut::fc::LeftButton )
|
||||||
bg_color = short(c);
|
bg_color = short(c);
|
||||||
else if ( ev->getButton() == fc::RightButton )
|
else if ( ev->getButton() == finalcut::fc::RightButton )
|
||||||
fg_color = short(c);
|
fg_color = short(c);
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
|
@ -121,23 +121,23 @@ void ColorChooser::onMouseDown (FMouseEvent* ev)
|
||||||
void ColorChooser::draw()
|
void ColorChooser::draw()
|
||||||
{
|
{
|
||||||
setColor();
|
setColor();
|
||||||
FWidget::drawBorder (1, 2, 8, 11);
|
finalcut::FWidget::drawBorder (1, 2, 8, 11);
|
||||||
|
|
||||||
for (short c = 0; c < 16; c++)
|
for (short c = 0; c < 16; c++)
|
||||||
{
|
{
|
||||||
setPrintPos (2 + (c / 8) * 3, 3 + c % 8);
|
setPrintPos (2 + (c / 8) * 3, 3 + c % 8);
|
||||||
|
|
||||||
if ( c < 6 )
|
if ( c < 6 )
|
||||||
setColor (fc::LightGray, c);
|
setColor (finalcut::fc::LightGray, c);
|
||||||
else if ( c > 8 )
|
else if ( c > 8 )
|
||||||
setColor (fc::DarkGray, c);
|
setColor (finalcut::fc::DarkGray, c);
|
||||||
else
|
else
|
||||||
setColor (fc::White, c);
|
setColor (finalcut::fc::White, c);
|
||||||
|
|
||||||
if ( c == bg_color )
|
if ( c == bg_color )
|
||||||
{
|
{
|
||||||
print (' ');
|
print (' ');
|
||||||
print (fc::Times);
|
print (finalcut::fc::Times);
|
||||||
print (' ');
|
print (' ');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -165,11 +165,11 @@ inline short ColorChooser::getBackground()
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Brushes : public FWidget
|
class Brushes : public finalcut::FWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Brushes (FWidget* = 0);
|
explicit Brushes (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Brushes();
|
~Brushes();
|
||||||
|
@ -191,7 +191,7 @@ class Brushes : public FWidget
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onMouseDown (FMouseEvent*);
|
void onMouseDown (finalcut::FMouseEvent*);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
wchar_t brush;
|
wchar_t brush;
|
||||||
|
@ -201,11 +201,11 @@ class Brushes : public FWidget
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Brushes::Brushes (FWidget* parent)
|
Brushes::Brushes (finalcut::FWidget* parent)
|
||||||
: FWidget(parent)
|
: FWidget(parent)
|
||||||
, brush(L' ')
|
, brush(L' ')
|
||||||
, fg_color(fc::White)
|
, fg_color(finalcut::fc::White)
|
||||||
, bg_color(fc::Black)
|
, bg_color(finalcut::fc::Black)
|
||||||
{
|
{
|
||||||
setSize (8, 4);
|
setSize (8, 4);
|
||||||
setFixedSize (8, 4);
|
setFixedSize (8, 4);
|
||||||
|
@ -218,10 +218,10 @@ Brushes::Brushes (FWidget* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text label
|
// Text label
|
||||||
FLabel* headline = new FLabel (this);
|
finalcut::FLabel* headline = new finalcut::FLabel (this);
|
||||||
headline->setGeometry(1, 1, 8, 1);
|
headline->setGeometry(1, 1, 8, 1);
|
||||||
headline->setEmphasis();
|
headline->setEmphasis();
|
||||||
headline->setAlignment (fc::alignCenter);
|
headline->setAlignment (finalcut::fc::alignCenter);
|
||||||
*headline << "Brush";
|
*headline << "Brush";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,11 +235,11 @@ void Brushes::draw()
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
setColor();
|
setColor();
|
||||||
FWidget::drawBorder (1, 2, 8, 4);
|
finalcut::FWidget::drawBorder (1, 2, 8, 4);
|
||||||
setColor (fg_color, bg_color);
|
setColor (fg_color, bg_color);
|
||||||
setPrintPos (2, 3);
|
setPrintPos (2, 3);
|
||||||
print(" ");
|
print(" ");
|
||||||
print(FString(3, wchar_t(fc::MediumShade)));
|
print(finalcut::FString(3, wchar_t(finalcut::fc::MediumShade)));
|
||||||
|
|
||||||
if ( brush == L' ' )
|
if ( brush == L' ' )
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
@ -248,18 +248,18 @@ void Brushes::draw()
|
||||||
|
|
||||||
setColor();
|
setColor();
|
||||||
setPrintPos (3 + pos, 2);
|
setPrintPos (3 + pos, 2);
|
||||||
print(wchar_t(fc::BlackDownPointingTriangle));
|
print(wchar_t(finalcut::fc::BlackDownPointingTriangle));
|
||||||
setPrintPos (3 + pos, 4);
|
setPrintPos (3 + pos, 4);
|
||||||
print(wchar_t(fc::BlackUpPointingTriangle));
|
print(wchar_t(finalcut::fc::BlackUpPointingTriangle));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Brushes::onMouseDown (FMouseEvent* ev)
|
void Brushes::onMouseDown (finalcut::FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
int mouse_x = ev->getX();
|
int mouse_x = ev->getX();
|
||||||
int mouse_y = ev->getY();
|
int mouse_y = ev->getY();
|
||||||
|
|
||||||
if ( ev->getButton() != fc::LeftButton )
|
if ( ev->getButton() != finalcut::fc::LeftButton )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( mouse_x >= 2 && mouse_x <= 4 && mouse_y == 3 )
|
if ( mouse_x >= 2 && mouse_x <= 4 && mouse_y == 3 )
|
||||||
|
@ -269,7 +269,7 @@ void Brushes::onMouseDown (FMouseEvent* ev)
|
||||||
}
|
}
|
||||||
else if ( mouse_x >= 5 && mouse_x <= 7 && mouse_y == 3 )
|
else if ( mouse_x >= 5 && mouse_x <= 7 && mouse_y == 3 )
|
||||||
{
|
{
|
||||||
brush = wchar_t(fc::MediumShade);
|
brush = wchar_t(finalcut::fc::MediumShade);
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,14 +300,14 @@ inline void Brushes::setBackground (short color)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class MouseDraw : public FDialog
|
class MouseDraw : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Using-declaration
|
// Using-declaration
|
||||||
using FWidget::setGeometry;
|
using FWidget::setGeometry;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit MouseDraw (FWidget* = 0);
|
explicit MouseDraw (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~MouseDraw();
|
~MouseDraw();
|
||||||
|
@ -316,8 +316,8 @@ class MouseDraw : public FDialog
|
||||||
void setGeometry (int, int, int, int, bool = true);
|
void setGeometry (int, int, int, int, bool = true);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
|
@ -332,11 +332,11 @@ class MouseDraw : public FDialog
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onMouseDown (FMouseEvent*);
|
void onMouseDown (finalcut::FMouseEvent*);
|
||||||
void onMouseMove (FMouseEvent*);
|
void onMouseMove (finalcut::FMouseEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_colorChanged (FWidget*, data_ptr);
|
void cb_colorChanged (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
term_area* canvas;
|
term_area* canvas;
|
||||||
|
@ -346,8 +346,8 @@ class MouseDraw : public FDialog
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
MouseDraw::MouseDraw (FWidget* parent)
|
MouseDraw::MouseDraw (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, canvas(0)
|
, canvas(0)
|
||||||
, c_chooser()
|
, c_chooser()
|
||||||
, brush()
|
, brush()
|
||||||
|
@ -364,8 +364,8 @@ MouseDraw::MouseDraw (FWidget* parent)
|
||||||
brush = new Brushes(this);
|
brush = new Brushes(this);
|
||||||
brush->setPos (1, 12);
|
brush->setPos (1, 12);
|
||||||
|
|
||||||
FPoint no_shadow(0,0);
|
finalcut::FPoint no_shadow(0,0);
|
||||||
FRect scroll_geometry(0, 0, 1, 1);
|
finalcut::FRect scroll_geometry(0, 0, 1, 1);
|
||||||
createArea (scroll_geometry, no_shadow, canvas);
|
createArea (scroll_geometry, no_shadow, canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,10 +377,10 @@ MouseDraw::~MouseDraw()
|
||||||
void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust)
|
void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust)
|
||||||
{
|
{
|
||||||
int old_w, old_h;
|
int old_w, old_h;
|
||||||
FDialog::setGeometry (x, y, w, h, adjust);
|
finalcut::FDialog::setGeometry (x, y, w, h, adjust);
|
||||||
|
|
||||||
FPoint no_shadow(0,0);
|
finalcut::FPoint no_shadow(0,0);
|
||||||
FRect scroll_geometry (0, 0, w - 11, h - 3);
|
finalcut::FRect scroll_geometry (0, 0, w - 11, h - 3);
|
||||||
old_w = canvas->width;
|
old_w = canvas->width;
|
||||||
old_h = canvas->height;
|
old_h = canvas->height;
|
||||||
resizeArea (scroll_geometry, no_shadow, canvas);
|
resizeArea (scroll_geometry, no_shadow, canvas);
|
||||||
|
@ -393,23 +393,23 @@ void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::onAccel (FAccelEvent* ev)
|
void MouseDraw::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::onClose (FCloseEvent* ev)
|
void MouseDraw::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::draw()
|
void MouseDraw::draw()
|
||||||
{
|
{
|
||||||
int y_max = getHeight();
|
int y_max = getHeight();
|
||||||
FDialog::draw();
|
finalcut::FDialog::draw();
|
||||||
setColor();
|
setColor();
|
||||||
|
|
||||||
if ( isNewFont() )
|
if ( isNewFont() )
|
||||||
|
@ -417,25 +417,25 @@ void MouseDraw::draw()
|
||||||
for (int y = 2; y < y_max; y++)
|
for (int y = 2; y < y_max; y++)
|
||||||
{
|
{
|
||||||
setPrintPos (10, y);
|
setPrintPos (10, y);
|
||||||
print (wchar_t(fc::NF_rev_border_line_right));
|
print (wchar_t(finalcut::fc::NF_rev_border_line_right));
|
||||||
}
|
}
|
||||||
|
|
||||||
setPrintPos (10, y_max);
|
setPrintPos (10, y_max);
|
||||||
print (wchar_t(fc::NF_rev_border_corner_lower_right));
|
print (wchar_t(finalcut::fc::NF_rev_border_corner_lower_right));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setPrintPos (10, 2);
|
setPrintPos (10, 2);
|
||||||
print (wchar_t(fc::BoxDrawingsDownAndHorizontal));
|
print (wchar_t(finalcut::fc::BoxDrawingsDownAndHorizontal));
|
||||||
|
|
||||||
for (int y = 3; y < y_max; y++)
|
for (int y = 3; y < y_max; y++)
|
||||||
{
|
{
|
||||||
setPrintPos (10, y);
|
setPrintPos (10, y);
|
||||||
print (wchar_t(fc::BoxDrawingsVertical));
|
print (wchar_t(finalcut::fc::BoxDrawingsVertical));
|
||||||
}
|
}
|
||||||
|
|
||||||
setPrintPos (10, y_max);
|
setPrintPos (10, y_max);
|
||||||
print (wchar_t(fc::BoxDrawingsUpAndHorizontal));
|
print (wchar_t(finalcut::fc::BoxDrawingsUpAndHorizontal));
|
||||||
}
|
}
|
||||||
|
|
||||||
drawCanvas();
|
drawCanvas();
|
||||||
|
@ -468,7 +468,7 @@ void MouseDraw::drawBrush (int x, int y, bool swap_color)
|
||||||
void MouseDraw::drawCanvas()
|
void MouseDraw::drawCanvas()
|
||||||
{
|
{
|
||||||
if ( ! hasPrintArea() )
|
if ( ! hasPrintArea() )
|
||||||
FVTerm::getPrintArea();
|
finalcut::FVTerm::getPrintArea();
|
||||||
|
|
||||||
if ( ! (hasPrintArea() && canvas) )
|
if ( ! (hasPrintArea() && canvas) )
|
||||||
return;
|
return;
|
||||||
|
@ -505,35 +505,39 @@ void MouseDraw::adjustSize()
|
||||||
, x = 1 + (getParentWidget()->getWidth() - w) / 2
|
, x = 1 + (getParentWidget()->getWidth() - w) / 2
|
||||||
, y = 1 + (getParentWidget()->getHeight() - h) / 2;
|
, y = 1 + (getParentWidget()->getHeight() - h) / 2;
|
||||||
setGeometry (x, y, w, h, false);
|
setGeometry (x, y, w, h, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::onMouseDown (FMouseEvent* ev)
|
void MouseDraw::onMouseDown (finalcut::FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
FDialog::onMouseDown(ev);
|
finalcut::FDialog::onMouseDown(ev);
|
||||||
|
|
||||||
if ( ev->getButton() != fc::LeftButton
|
if ( ev->getButton() != finalcut::fc::LeftButton
|
||||||
&& ev->getButton() != fc::RightButton )
|
&& ev->getButton() != finalcut::fc::RightButton )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton);
|
drawBrush ( ev->getX()
|
||||||
|
, ev->getY()
|
||||||
|
, ev->getButton() == finalcut::fc::RightButton );
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::onMouseMove (FMouseEvent* ev)
|
void MouseDraw::onMouseMove (finalcut::FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
FDialog::onMouseMove(ev);
|
FDialog::onMouseMove(ev);
|
||||||
|
|
||||||
if ( ev->getButton() != fc::LeftButton
|
if ( ev->getButton() != finalcut::fc::LeftButton
|
||||||
&& ev->getButton() != fc::RightButton )
|
&& ev->getButton() != finalcut::fc::RightButton )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton);
|
drawBrush ( ev->getX()
|
||||||
|
, ev->getY()
|
||||||
|
, ev->getButton() == finalcut::fc::RightButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MouseDraw::cb_colorChanged (FWidget*, data_ptr)
|
void MouseDraw::cb_colorChanged (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
brush->setForeground (c_chooser->getForeground());
|
brush->setForeground (c_chooser->getForeground());
|
||||||
brush->setBackground (c_chooser->getBackground());
|
brush->setBackground (c_chooser->getBackground());
|
||||||
|
@ -547,7 +551,7 @@ void MouseDraw::cb_colorChanged (FWidget*, data_ptr)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
MouseDraw mouse_draw(&app);
|
MouseDraw mouse_draw(&app);
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
|
|
||||||
|
|
||||||
// Global FVTerm object
|
// Global FVTerm object
|
||||||
static FVTerm* terminal;
|
static finalcut::FVTerm* terminal;
|
||||||
|
|
||||||
// Global FApplication object
|
// Global FApplication object
|
||||||
static FApplication* app;
|
static finalcut::FApplication* app;
|
||||||
|
|
||||||
// function prototype
|
// function prototype
|
||||||
bool keyPressed();
|
bool keyPressed();
|
||||||
|
@ -145,16 +145,16 @@ int main (int argc, char* argv[])
|
||||||
int xmax, ymax;
|
int xmax, ymax;
|
||||||
|
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication TermApp(argc, argv);
|
finalcut::FApplication TermApp(argc, argv);
|
||||||
|
|
||||||
// Pointer to the global virtual terminal object
|
// Pointer to the global virtual terminal object
|
||||||
terminal = static_cast<FVTerm*>(&TermApp);
|
terminal = static_cast<finalcut::FVTerm*>(&TermApp);
|
||||||
app = &TermApp;
|
app = &TermApp;
|
||||||
|
|
||||||
// Get screen dimension
|
// Get screen dimension
|
||||||
xmax = TermApp.getDesktopWidth() - 1;
|
xmax = TermApp.getDesktopWidth() - 1;
|
||||||
ymax = TermApp.getDesktopHeight() - 1;
|
ymax = TermApp.getDesktopHeight() - 1;
|
||||||
FString line(xmax + 1, '-');
|
finalcut::FString line(xmax + 1, '-');
|
||||||
|
|
||||||
// Place the cursor in the upper left corner
|
// Place the cursor in the upper left corner
|
||||||
TermApp.setTermXY(0,0);
|
TermApp.setTermXY(0,0);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2017 Markus Gans *
|
* Copyright 2017-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -30,11 +30,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Scrollview : public FScrollView
|
class Scrollview : public finalcut::FScrollView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Scrollview (FWidget* = 0);
|
explicit Scrollview (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Scrollview ();
|
~Scrollview ();
|
||||||
|
@ -52,38 +52,42 @@ class Scrollview : public FScrollView
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_go_east (FWidget*, data_ptr);
|
void cb_go_east (finalcut::FWidget*, data_ptr);
|
||||||
void cb_go_south (FWidget*, data_ptr);
|
void cb_go_south (finalcut::FWidget*, data_ptr);
|
||||||
void cb_go_west (FWidget*, data_ptr);
|
void cb_go_west (finalcut::FWidget*, data_ptr);
|
||||||
void cb_go_north (FWidget*, data_ptr);
|
void cb_go_north (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FButton* go_east;
|
finalcut::FButton* go_east;
|
||||||
FButton* go_south;
|
finalcut::FButton* go_south;
|
||||||
FButton* go_west;
|
finalcut::FButton* go_west;
|
||||||
FButton* go_north;
|
finalcut::FButton* go_north;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Scrollview::Scrollview (FWidget* parent)
|
Scrollview::Scrollview (finalcut::FWidget* parent)
|
||||||
: FScrollView(parent)
|
: finalcut::FScrollView(parent)
|
||||||
, go_east()
|
, go_east()
|
||||||
, go_south()
|
, go_south()
|
||||||
, go_west()
|
, go_west()
|
||||||
, go_north()
|
, go_north()
|
||||||
{
|
{
|
||||||
// Create the four navigation buttons
|
// Create the four navigation buttons
|
||||||
go_east = new FButton(wchar_t(fc::BlackRightPointingPointer), this);
|
wchar_t pointer_right = wchar_t(finalcut::fc::BlackRightPointingPointer);
|
||||||
|
go_east = new finalcut::FButton(pointer_right, this);
|
||||||
go_east->setGeometry (1, 1, 5, 1);
|
go_east->setGeometry (1, 1, 5, 1);
|
||||||
|
|
||||||
go_south = new FButton(wchar_t(fc::BlackDownPointingTriangle), this);
|
wchar_t pointer_down = wchar_t(finalcut::fc::BlackDownPointingTriangle);
|
||||||
|
go_south = new finalcut::FButton(pointer_down, this);
|
||||||
go_south->setGeometry (getScrollWidth() - 5, 1, 5, 1);
|
go_south->setGeometry (getScrollWidth() - 5, 1, 5, 1);
|
||||||
|
|
||||||
go_west = new FButton(wchar_t(fc::BlackLeftPointingPointer), this);
|
wchar_t pointer_left = wchar_t(finalcut::fc::BlackLeftPointingPointer);
|
||||||
|
go_west = new finalcut::FButton(pointer_left, this);
|
||||||
go_west->setGeometry (getScrollWidth() - 5, getScrollHeight() - 2, 5, 1);
|
go_west->setGeometry (getScrollWidth() - 5, getScrollHeight() - 2, 5, 1);
|
||||||
|
|
||||||
go_north = new FButton(wchar_t(fc::BlackUpPointingTriangle), this);
|
wchar_t pointer_up = wchar_t(finalcut::fc::BlackUpPointingTriangle);
|
||||||
|
go_north = new finalcut::FButton(pointer_up, this);
|
||||||
go_north->setGeometry (1, getScrollHeight() - 2, 5, 1);
|
go_north->setGeometry (1, getScrollHeight() - 2, 5, 1);
|
||||||
|
|
||||||
// Add scroll function callbacks to the buttons
|
// Add scroll function callbacks to the buttons
|
||||||
|
@ -149,7 +153,7 @@ void Scrollview::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollview::cb_go_east (FWidget*, data_ptr)
|
void Scrollview::cb_go_east (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
scrollToX (getScrollWidth() - getViewportWidth() + 1);
|
scrollToX (getScrollWidth() - getViewportWidth() + 1);
|
||||||
go_south->setFocus();
|
go_south->setFocus();
|
||||||
|
@ -158,7 +162,7 @@ void Scrollview::cb_go_east (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollview::cb_go_south (FWidget*, data_ptr)
|
void Scrollview::cb_go_south (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
scrollToY (getScrollHeight() - getViewportHeight() + 1);
|
scrollToY (getScrollHeight() - getViewportHeight() + 1);
|
||||||
go_west->setFocus();
|
go_west->setFocus();
|
||||||
|
@ -167,7 +171,7 @@ void Scrollview::cb_go_south (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollview::cb_go_west (FWidget*, data_ptr)
|
void Scrollview::cb_go_west (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
scrollToX (1);
|
scrollToX (1);
|
||||||
go_north->setFocus();
|
go_north->setFocus();
|
||||||
|
@ -176,7 +180,7 @@ void Scrollview::cb_go_west (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollview::cb_go_north (FWidget*, data_ptr)
|
void Scrollview::cb_go_north (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
scrollToY (1);
|
scrollToY (1);
|
||||||
go_east->setFocus();
|
go_east->setFocus();
|
||||||
|
@ -192,27 +196,27 @@ void Scrollview::cb_go_north (FWidget*, data_ptr)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Scrollviewdemo : public FDialog
|
class Scrollviewdemo : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Scrollviewdemo (FWidget* = 0);
|
explicit Scrollviewdemo (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Scrollviewdemo();
|
~Scrollviewdemo();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_quit (FWidget* = 0, data_ptr = 0);
|
void cb_quit (finalcut::FWidget* = 0, data_ptr = 0);
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Scrollviewdemo::Scrollviewdemo (FWidget* parent)
|
Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
{
|
{
|
||||||
setGeometry (16, 3, 50, 19);
|
setGeometry (16, 3, 50, 19);
|
||||||
setText ("Scrolling viewport example");
|
setText ("Scrolling viewport example");
|
||||||
|
@ -223,7 +227,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent)
|
||||||
sview->setScrollSize(188, 124);
|
sview->setScrollSize(188, 124);
|
||||||
|
|
||||||
// Quit button
|
// Quit button
|
||||||
FButton* button = new FButton("&Quit", this);
|
finalcut::FButton* button = new finalcut::FButton("&Quit", this);
|
||||||
button->setGeometry(37, 15, 10, 1);
|
button->setGeometry(37, 15, 10, 1);
|
||||||
|
|
||||||
// Add function callback
|
// Add function callback
|
||||||
|
@ -234,7 +238,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Text label
|
// Text label
|
||||||
FLabel* label = new FLabel (this);
|
finalcut::FLabel* label = new finalcut::FLabel (this);
|
||||||
label->setGeometry(2, 1, 46, 1);
|
label->setGeometry(2, 1, 46, 1);
|
||||||
label->setEmphasis();
|
label->setEmphasis();
|
||||||
*label << L"Use scrollbars to change the viewport position";
|
*label << L"Use scrollbars to change the viewport position";
|
||||||
|
@ -245,15 +249,15 @@ Scrollviewdemo::~Scrollviewdemo()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollviewdemo::cb_quit (FWidget*, data_ptr)
|
void Scrollviewdemo::cb_quit (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Scrollviewdemo::onClose (FCloseEvent* ev)
|
void Scrollviewdemo::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,7 +267,7 @@ void Scrollviewdemo::onClose (FCloseEvent* ev)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
Scrollviewdemo svdemo(&app);
|
Scrollviewdemo svdemo(&app);
|
||||||
|
|
|
@ -91,7 +91,7 @@ void init()
|
||||||
void inputStreamExample()
|
void inputStreamExample()
|
||||||
{
|
{
|
||||||
// Test: input stream (operator >>)
|
// Test: input stream (operator >>)
|
||||||
FString in;
|
finalcut::FString in;
|
||||||
std::cout << " Input: ";
|
std::cout << " Input: ";
|
||||||
std::cin >> in;
|
std::cin >> in;
|
||||||
std::cout << " instream >> " << in << std::endl;
|
std::cout << " instream >> " << in << std::endl;
|
||||||
|
@ -101,7 +101,7 @@ void inputStreamExample()
|
||||||
void outputStreamExample()
|
void outputStreamExample()
|
||||||
{
|
{
|
||||||
// Test: output stream (operator <<)
|
// Test: output stream (operator <<)
|
||||||
const FString& out = L"A test string for 0 \x20ac";
|
const finalcut::FString& out = L"A test string for 0 \x20ac";
|
||||||
std::cout << " outstream << " << out << std::endl;
|
std::cout << " outstream << " << out << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,62 +111,62 @@ void streamingIntoFStringExample()
|
||||||
// Test: Streaming into a FString (operator <<)...
|
// Test: Streaming into a FString (operator <<)...
|
||||||
|
|
||||||
// ...from FStrings
|
// ...from FStrings
|
||||||
FString streamer1;
|
finalcut::FString streamer1;
|
||||||
streamer1 << FString("FStr") << FString("ing");
|
streamer1 << finalcut::FString("FStr") << finalcut::FString("ing");
|
||||||
std::cout << " stream in: " << streamer1 << std::endl;
|
std::cout << " stream in: " << streamer1 << std::endl;
|
||||||
|
|
||||||
// ...from c++ wide string
|
// ...from c++ wide string
|
||||||
FString streamer2;
|
finalcut::FString streamer2;
|
||||||
streamer2 << std::wstring(L"std::wstring");
|
streamer2 << std::wstring(L"std::wstring");
|
||||||
std::cout << " stream in: " << streamer2 << std::endl;
|
std::cout << " stream in: " << streamer2 << std::endl;
|
||||||
|
|
||||||
// ...from wide string
|
// ...from wide string
|
||||||
FString streamer3;
|
finalcut::FString streamer3;
|
||||||
streamer3 << const_cast<wchar_t*>(L"wchar_t*");
|
streamer3 << const_cast<wchar_t*>(L"wchar_t*");
|
||||||
std::cout << " stream in: " << streamer3 << std::endl;
|
std::cout << " stream in: " << streamer3 << std::endl;
|
||||||
|
|
||||||
// ...from c++ string
|
// ...from c++ string
|
||||||
FString streamer4;
|
finalcut::FString streamer4;
|
||||||
streamer4 << std::string("std::string");
|
streamer4 << std::string("std::string");
|
||||||
std::cout << " stream in: " << streamer4 << std::endl;
|
std::cout << " stream in: " << streamer4 << std::endl;
|
||||||
|
|
||||||
// ...from c-string
|
// ...from c-string
|
||||||
FString streamer5;
|
finalcut::FString streamer5;
|
||||||
streamer5 << const_cast<char*>("char*");
|
streamer5 << const_cast<char*>("char*");
|
||||||
std::cout << " stream in: " << streamer5 << std::endl;
|
std::cout << " stream in: " << streamer5 << std::endl;
|
||||||
|
|
||||||
// ...from wide character
|
// ...from wide character
|
||||||
FString streamer6;
|
finalcut::FString streamer6;
|
||||||
streamer6 << wchar_t(L'w');
|
streamer6 << wchar_t(L'w');
|
||||||
std::cout << " stream in: " << streamer6 << std::endl;
|
std::cout << " stream in: " << streamer6 << std::endl;
|
||||||
|
|
||||||
// ...from character
|
// ...from character
|
||||||
FString streamer7;
|
finalcut::FString streamer7;
|
||||||
streamer7 << char('c');
|
streamer7 << char('c');
|
||||||
std::cout << " stream in: " << streamer7 << std::endl;
|
std::cout << " stream in: " << streamer7 << std::endl;
|
||||||
|
|
||||||
// ...from interger
|
// ...from interger
|
||||||
FString streamer8;
|
finalcut::FString streamer8;
|
||||||
streamer8 << int(-12345);
|
streamer8 << int(-12345);
|
||||||
std::cout << " stream in: " << streamer8 << std::endl;
|
std::cout << " stream in: " << streamer8 << std::endl;
|
||||||
|
|
||||||
// ...from unsigned interger
|
// ...from unsigned interger
|
||||||
FString streamer9;
|
finalcut::FString streamer9;
|
||||||
streamer9 << uInt(54321);
|
streamer9 << uInt(54321);
|
||||||
std::cout << " stream in: " << streamer9 << std::endl;
|
std::cout << " stream in: " << streamer9 << std::endl;
|
||||||
|
|
||||||
// ...from long double
|
// ...from long double
|
||||||
FString streamer10;
|
finalcut::FString streamer10;
|
||||||
streamer10 << lDouble(0.333333333333333333L);
|
streamer10 << lDouble(0.333333333333333333L);
|
||||||
std::cout << " stream in: " << streamer10 << std::endl;
|
std::cout << " stream in: " << streamer10 << std::endl;
|
||||||
|
|
||||||
// ...from double
|
// ...from double
|
||||||
FString streamer11;
|
finalcut::FString streamer11;
|
||||||
streamer11 << double(0.11111111111);
|
streamer11 << double(0.11111111111);
|
||||||
std::cout << " stream in: " << streamer11 << std::endl;
|
std::cout << " stream in: " << streamer11 << std::endl;
|
||||||
|
|
||||||
// ...from float
|
// ...from float
|
||||||
FString streamer12;
|
finalcut::FString streamer12;
|
||||||
streamer12 << float(0.22222222);
|
streamer12 << float(0.22222222);
|
||||||
std::cout << " stream in: " << streamer12 << std::endl;
|
std::cout << " stream in: " << streamer12 << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -177,23 +177,23 @@ void streamingFromFStringExample()
|
||||||
// Test: Streaming from a FString (operator >>)...
|
// Test: Streaming from a FString (operator >>)...
|
||||||
|
|
||||||
// ...to FStrings
|
// ...to FStrings
|
||||||
FString stream_fstring;
|
finalcut::FString stream_fstring;
|
||||||
FString("FString") >> stream_fstring;
|
finalcut::FString("FString") >> stream_fstring;
|
||||||
std::cout << "stream out: " << stream_fstring << std::endl;
|
std::cout << "stream out: " << stream_fstring << std::endl;
|
||||||
|
|
||||||
// ...to c++ wide string
|
// ...to c++ wide string
|
||||||
std::wstring stream_wstring;
|
std::wstring stream_wstring;
|
||||||
FString("std::wstring") >> stream_wstring;
|
finalcut::FString("std::wstring") >> stream_wstring;
|
||||||
std::wcout << "stream out: " << stream_wstring << std::endl;
|
std::wcout << "stream out: " << stream_wstring << std::endl;
|
||||||
|
|
||||||
// ...to wide character
|
// ...to wide character
|
||||||
wchar_t stream_wchar_t = 0;
|
wchar_t stream_wchar_t = 0;
|
||||||
FString("w") >> stream_wchar_t;
|
finalcut::FString("w") >> stream_wchar_t;
|
||||||
std::wcout << "stream out: " << stream_wchar_t << std::endl;
|
std::wcout << "stream out: " << stream_wchar_t << std::endl;
|
||||||
|
|
||||||
// ...to character
|
// ...to character
|
||||||
char stream_char;
|
char stream_char;
|
||||||
FString('c') >> stream_char;
|
finalcut::FString('c') >> stream_char;
|
||||||
std::cout << "stream out: " << stream_char << std::endl;
|
std::cout << "stream out: " << stream_char << std::endl;
|
||||||
|
|
||||||
// ...to interger
|
// ...to interger
|
||||||
|
@ -217,7 +217,7 @@ void streamToInterger()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int stream_int;
|
int stream_int;
|
||||||
FString("-321") >> stream_int;
|
finalcut::FString("-321") >> stream_int;
|
||||||
std::cout << "stream out: " << stream_int << std::endl;
|
std::cout << "stream out: " << stream_int << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -241,7 +241,7 @@ void streamToUnsignedInterger()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
uInt stream_uint;
|
uInt stream_uint;
|
||||||
FString("123") >> stream_uint;
|
finalcut::FString("123") >> stream_uint;
|
||||||
std::cout << "stream out: " << stream_uint << std::endl;
|
std::cout << "stream out: " << stream_uint << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -265,7 +265,7 @@ void streamToDouble()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
double stream_double;
|
double stream_double;
|
||||||
FString("0.123456e+2") >> stream_double;
|
finalcut::FString("0.123456e+2") >> stream_double;
|
||||||
std::cout << "stream out: " << stream_double << std::endl;
|
std::cout << "stream out: " << stream_double << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -285,7 +285,7 @@ void streamToFloat()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float stream_float;
|
float stream_float;
|
||||||
FString("0.123e-3") >> stream_float;
|
finalcut::FString("0.123e-3") >> stream_float;
|
||||||
std::cout << "stream out: " << stream_float << std::endl;
|
std::cout << "stream out: " << stream_float << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -302,7 +302,7 @@ void streamToFloat()
|
||||||
void CStringOutputExample()
|
void CStringOutputExample()
|
||||||
{
|
{
|
||||||
// Test: c-string output
|
// Test: c-string output
|
||||||
const FString& out = L"A test string for 0 \x20ac";
|
const finalcut::FString& out = L"A test string for 0 \x20ac";
|
||||||
printf (" c_str: \"%s\"\n", out.c_str());
|
printf (" c_str: \"%s\"\n", out.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,15 +310,15 @@ void CStringOutputExample()
|
||||||
void copyIntoFString()
|
void copyIntoFString()
|
||||||
{
|
{
|
||||||
// Test: copy a c++ string
|
// Test: copy a c++ string
|
||||||
const FString& cpp_str( std::string("c++ String") );
|
const finalcut::FString& cpp_str( std::string("c++ String") );
|
||||||
std::cout << " cpp_str: \"" << cpp_str << "\"" << std::endl;
|
std::cout << " cpp_str: \"" << cpp_str << "\"" << std::endl;
|
||||||
|
|
||||||
// Test: copy a character
|
// Test: copy a character
|
||||||
const FString ch('c');
|
const finalcut::FString ch('c');
|
||||||
std::cout << " char: '" << ch << "'" << std::endl;
|
std::cout << " char: '" << ch << "'" << std::endl;
|
||||||
|
|
||||||
// Test: copy a wide character
|
// Test: copy a wide character
|
||||||
const FString wch(L'w');
|
const finalcut::FString wch(L'w');
|
||||||
std::cout << " wchar_t: '" << wch << "'" << std::endl;
|
std::cout << " wchar_t: '" << wch << "'" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ void copyIntoFString()
|
||||||
void utf8StringOutputExample()
|
void utf8StringOutputExample()
|
||||||
{
|
{
|
||||||
// Test: utf-8 string
|
// Test: utf-8 string
|
||||||
const FString& len = "длина́";
|
const finalcut::FString& len = "длина́";
|
||||||
std::cout << " length: \"" << len << "\" has "
|
std::cout << " length: \"" << len << "\" has "
|
||||||
<< len.getLength() << " characters" << std::endl;
|
<< len.getLength() << " characters" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -335,11 +335,11 @@ void utf8StringOutputExample()
|
||||||
void letterCaseExample()
|
void letterCaseExample()
|
||||||
{
|
{
|
||||||
// Test: convert uppercase letter to lowercase
|
// Test: convert uppercase letter to lowercase
|
||||||
const FString& lower = FString(L"InPut").toLower();
|
const finalcut::FString& lower = finalcut::FString(L"InPut").toLower();
|
||||||
std::wcout << L" toLower: " << lower << std::endl;
|
std::wcout << L" toLower: " << lower << std::endl;
|
||||||
|
|
||||||
// Test: convert lowercase letter to uppercase
|
// Test: convert lowercase letter to uppercase
|
||||||
const FString& upper = FString("inPut").toUpper();
|
const finalcut::FString& upper = finalcut::FString("inPut").toUpper();
|
||||||
std::cout << " toUpper: " << upper << std::endl;
|
std::cout << " toUpper: " << upper << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,63 +347,66 @@ void letterCaseExample()
|
||||||
void stringConcatenationExample()
|
void stringConcatenationExample()
|
||||||
{
|
{
|
||||||
// Test: concatenate two FStrings (operator +)
|
// Test: concatenate two FStrings (operator +)
|
||||||
const FString& add1 = FString("FString + ") + FString("FString");
|
const finalcut::FString& add1 = finalcut::FString("FString + ")
|
||||||
|
+ finalcut::FString("FString");
|
||||||
std::cout << " add: " << add1 << std::endl;
|
std::cout << " add: " << add1 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a c++ wide string (operator +)
|
// Test: concatenate a FString and a c++ wide string (operator +)
|
||||||
const FString& add2 = FString("FString + ")
|
const finalcut::FString& add2 = finalcut::FString("FString + ")
|
||||||
+ std::wstring(L"std::wstring");
|
+ std::wstring(L"std::wstring");
|
||||||
std::cout << " add: " << add2 << std::endl;
|
std::cout << " add: " << add2 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a wide string (operator +)
|
// Test: concatenate a FString and a wide string (operator +)
|
||||||
const FString& add3 = FString("FString + ")
|
const finalcut::FString& add3 = finalcut::FString("FString + ")
|
||||||
+ const_cast<wchar_t*>(L"wchar_t*");
|
+ const_cast<wchar_t*>(L"wchar_t*");
|
||||||
std::cout << " add: " << add3 << std::endl;
|
std::cout << " add: " << add3 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a c++ string (operator +)
|
// Test: concatenate a FString and a c++ string (operator +)
|
||||||
const FString& add4 = FString("FString + ")
|
const finalcut::FString& add4 = finalcut::FString("FString + ")
|
||||||
+ std::string("std::string");
|
+ std::string("std::string");
|
||||||
std::cout << " add: " << add4 << std::endl;
|
std::cout << " add: " << add4 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a c-string (operator +)
|
// Test: concatenate a FString and a c-string (operator +)
|
||||||
const FString& add5 = FString("FString + ")
|
const finalcut::FString& add5 = finalcut::FString("FString + ")
|
||||||
+ const_cast<char*>("char*");
|
+ const_cast<char*>("char*");
|
||||||
std::cout << " add: " << add5 << std::endl;
|
std::cout << " add: " << add5 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a wide character (operator +)
|
// Test: concatenate a FString and a wide character (operator +)
|
||||||
const FString& add6 = FString("FString + ") + wchar_t(L'w');
|
const finalcut::FString& add6 = finalcut::FString("FString + ")
|
||||||
|
+ wchar_t(L'w');
|
||||||
std::cout << " add: " << add6 << std::endl;
|
std::cout << " add: " << add6 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a FString and a character (operator +)
|
// Test: concatenate a FString and a character (operator +)
|
||||||
const FString& add7 = FString("FString + ") + char('c');
|
const finalcut::FString& add7 = finalcut::FString("FString + ")
|
||||||
|
+ char('c');
|
||||||
std::cout << " add: " << add7 << std::endl;
|
std::cout << " add: " << add7 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a character and a FString (operator +)
|
// Test: concatenate a character and a FString (operator +)
|
||||||
const FString& add8 = 'c' + FString(" + FString");
|
const finalcut::FString& add8 = 'c' + finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add8 << std::endl;
|
std::cout << " add: " << add8 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a wide character and a FString (operator +)
|
// Test: concatenate a wide character and a FString (operator +)
|
||||||
const FString& add9 = L'w' + FString(" + FString");
|
const finalcut::FString& add9 = L'w' + finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add9 << std::endl;
|
std::cout << " add: " << add9 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a c-string and a FString (operator +)
|
// Test: concatenate a c-string and a FString (operator +)
|
||||||
const FString& add10 = const_cast<char*>("char*")
|
const finalcut::FString& add10 = const_cast<char*>("char*")
|
||||||
+ FString(" + FString");
|
+ finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add10 << std::endl;
|
std::cout << " add: " << add10 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a c++ string and a FString (operator +)
|
// Test: concatenate a c++ string and a FString (operator +)
|
||||||
const FString& add11 = std::string("std::string")
|
const finalcut::FString& add11 = std::string("std::string")
|
||||||
+ FString(" + FString");
|
+ finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add11 << std::endl;
|
std::cout << " add: " << add11 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a wide string and a FString (operator +)
|
// Test: concatenate a wide string and a FString (operator +)
|
||||||
const FString& add12 = const_cast<wchar_t*>(L"wchar_t*")
|
const finalcut::FString& add12 = const_cast<wchar_t*>(L"wchar_t*")
|
||||||
+ FString(" + FString");
|
+ finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add12 << std::endl;
|
std::cout << " add: " << add12 << std::endl;
|
||||||
|
|
||||||
// Test: concatenate a c++ wide string and a FString (operator +)
|
// Test: concatenate a c++ wide string and a FString (operator +)
|
||||||
const FString& add13 = std::wstring(L"std::wstring")
|
const finalcut::FString& add13 = std::wstring(L"std::wstring")
|
||||||
+ FString(" + FString");
|
+ finalcut::FString(" + FString");
|
||||||
std::cout << " add: " << add13 << std::endl;
|
std::cout << " add: " << add13 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,34 +414,34 @@ void stringConcatenationExample()
|
||||||
void stringCompareExample()
|
void stringCompareExample()
|
||||||
{
|
{
|
||||||
// Test: compare operators ==, <=, <, >=, >, !=
|
// Test: compare operators ==, <=, <, >=, >, !=
|
||||||
const FString& cmp = "compare";
|
const finalcut::FString& cmp = "compare";
|
||||||
|
|
||||||
if ( cmp == FString("compare") )
|
if ( cmp == finalcut::FString("compare") )
|
||||||
std::cout << " cmp: == Ok" << std::endl;
|
std::cout << " cmp: == Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: == Not Ok" << std::endl;
|
std::cout << " cmp: == Not Ok" << std::endl;
|
||||||
|
|
||||||
if ( cmp <= FString("d_compare") )
|
if ( cmp <= finalcut::FString("d_compare") )
|
||||||
std::cout << " cmp: <= Ok" << std::endl;
|
std::cout << " cmp: <= Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: <= Not Ok" << std::endl;
|
std::cout << " cmp: <= Not Ok" << std::endl;
|
||||||
|
|
||||||
if ( cmp < FString("e_compare") )
|
if ( cmp < finalcut::FString("e_compare") )
|
||||||
std::cout << " cmp: < Ok" << std::endl;
|
std::cout << " cmp: < Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: < Not Ok" << std::endl;
|
std::cout << " cmp: < Not Ok" << std::endl;
|
||||||
|
|
||||||
if ( cmp >= FString("b_compare") )
|
if ( cmp >= finalcut::FString("b_compare") )
|
||||||
std::cout << " cmp: >= Ok" << std::endl;
|
std::cout << " cmp: >= Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: >= Not Ok" << std::endl;
|
std::cout << " cmp: >= Not Ok" << std::endl;
|
||||||
|
|
||||||
if ( cmp > FString("a_compare") )
|
if ( cmp > finalcut::FString("a_compare") )
|
||||||
std::cout << " cmp: > Ok" << std::endl;
|
std::cout << " cmp: > Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: > Not Ok" << std::endl;
|
std::cout << " cmp: > Not Ok" << std::endl;
|
||||||
|
|
||||||
if ( cmp != FString("equal") )
|
if ( cmp != finalcut::FString("equal") )
|
||||||
std::cout << " cmp: != Ok" << std::endl;
|
std::cout << " cmp: != Ok" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " cmp: != Not Ok" << std::endl;
|
std::cout << " cmp: != Not Ok" << std::endl;
|
||||||
|
@ -448,11 +451,11 @@ void stringCompareExample()
|
||||||
void stringSplittingExample()
|
void stringSplittingExample()
|
||||||
{
|
{
|
||||||
// Test: split a string with a delimiter and returns a vector (array)
|
// Test: split a string with a delimiter and returns a vector (array)
|
||||||
FString split_str = "a,b,c,d";
|
finalcut::FString split_str = "a,b,c,d";
|
||||||
std::cout << " split: \""
|
std::cout << " split: \""
|
||||||
<< split_str << "\" into substrings ->";
|
<< split_str << "\" into substrings ->";
|
||||||
FStringList parts = split_str.split(",");
|
finalcut::FStringList parts = split_str.split(",");
|
||||||
FStringList::iterator it, end;
|
finalcut::FStringList::iterator it, end;
|
||||||
end = parts.end();
|
end = parts.end();
|
||||||
|
|
||||||
for (it = parts.begin(); it != end; ++it)
|
for (it = parts.begin(); it != end; ++it)
|
||||||
|
@ -465,7 +468,7 @@ void stringSplittingExample()
|
||||||
void fromatStringExample()
|
void fromatStringExample()
|
||||||
{
|
{
|
||||||
// Test: format a string with sprintf
|
// Test: format a string with sprintf
|
||||||
FString formatStr = "";
|
finalcut::FString formatStr = "";
|
||||||
std::cout << " formatted: "
|
std::cout << " formatted: "
|
||||||
<< formatStr.sprintf("sqrt(%d) = %d", 16, 4)
|
<< formatStr.sprintf("sqrt(%d) = %d", 16, 4)
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -477,7 +480,7 @@ void convertToNumberExample()
|
||||||
// Test: convert a string to a unsigned long interger
|
// Test: convert a string to a unsigned long interger
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const uLong ulong_num = FString("123456789").toULong();
|
const uLong ulong_num = finalcut::FString("123456789").toULong();
|
||||||
std::cout << " toULong: " << ulong_num << std::endl;
|
std::cout << " toULong: " << ulong_num << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -492,7 +495,7 @@ void convertToNumberExample()
|
||||||
// Test: convert a string to a signed long interger
|
// Test: convert a string to a signed long interger
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const long long_num = FString("-9876543210").toLong();
|
const long long_num = finalcut::FString("-9876543210").toLong();
|
||||||
std::cout << " toLong: " << long_num << std::endl;
|
std::cout << " toLong: " << long_num << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& ex)
|
catch (const std::invalid_argument& ex)
|
||||||
|
@ -509,7 +512,7 @@ void convertToNumberExample()
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const double double_num = FString("2.7182818284590452353").toDouble();
|
const double double_num = finalcut::FString("2.7182818284590452353").toDouble();
|
||||||
std::ios_base::fmtflags save_flags = std::cout.flags();
|
std::ios_base::fmtflags save_flags = std::cout.flags();
|
||||||
std::cout << " toDouble: " << std::setprecision(11)
|
std::cout << " toDouble: " << std::setprecision(11)
|
||||||
<< double_num << std::endl;
|
<< double_num << std::endl;
|
||||||
|
@ -529,7 +532,7 @@ void convertToNumberExample()
|
||||||
void convertNumberToStringExample()
|
void convertNumberToStringExample()
|
||||||
{
|
{
|
||||||
// Test: convert integer and double value to a string
|
// Test: convert integer and double value to a string
|
||||||
FString num1, num2, num3;
|
finalcut::FString num1, num2, num3;
|
||||||
num1.setNumber(137);
|
num1.setNumber(137);
|
||||||
num2.setNumber(-512);
|
num2.setNumber(-512);
|
||||||
num3.setNumber(3.141592653589793238L, 12);
|
num3.setNumber(3.141592653589793238L, 12);
|
||||||
|
@ -546,7 +549,7 @@ void formatedNumberExample()
|
||||||
{
|
{
|
||||||
// Test: convert and format a integer number with thousand separator
|
// Test: convert and format a integer number with thousand separator
|
||||||
std::setlocale (LC_NUMERIC, "");
|
std::setlocale (LC_NUMERIC, "");
|
||||||
FString fnum1, fnum2;
|
finalcut::FString fnum1, fnum2;
|
||||||
#if defined(__LP64__) || defined(_LP64)
|
#if defined(__LP64__) || defined(_LP64)
|
||||||
// 64-bit architecture
|
// 64-bit architecture
|
||||||
fnum1.setFormatedNumber(0xffffffffffffffff, '\'');
|
fnum1.setFormatedNumber(0xffffffffffffffff, '\'');
|
||||||
|
@ -566,7 +569,7 @@ void formatedNumberExample()
|
||||||
void trimExample()
|
void trimExample()
|
||||||
{
|
{
|
||||||
// Test: remove whitespace from the end of a string
|
// Test: remove whitespace from the end of a string
|
||||||
const FString& trim_str = " A string \t";
|
const finalcut::FString& trim_str = " A string \t";
|
||||||
std::wcout << " rtrim: \""
|
std::wcout << " rtrim: \""
|
||||||
<< trim_str.rtrim() << "\"" << std::endl;
|
<< trim_str.rtrim() << "\"" << std::endl;
|
||||||
|
|
||||||
|
@ -583,7 +586,7 @@ void trimExample()
|
||||||
void substringExample()
|
void substringExample()
|
||||||
{
|
{
|
||||||
// Test: 11 characters from the left of the string
|
// Test: 11 characters from the left of the string
|
||||||
const FString& alphabet = "a b c d e f g h i j k l m "
|
const finalcut::FString& alphabet = "a b c d e f g h i j k l m "
|
||||||
"n o p q r s t u v w x y z";
|
"n o p q r s t u v w x y z";
|
||||||
std::cout << " left: \""
|
std::cout << " left: \""
|
||||||
<< alphabet.left(11) << "\"" << std::endl;
|
<< alphabet.left(11) << "\"" << std::endl;
|
||||||
|
@ -601,7 +604,7 @@ void substringExample()
|
||||||
void insertExample()
|
void insertExample()
|
||||||
{
|
{
|
||||||
// Test: insert a string at index position 7
|
// Test: insert a string at index position 7
|
||||||
FString insert_str = "I am a string";
|
finalcut::FString insert_str = "I am a string";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -618,7 +621,7 @@ void insertExample()
|
||||||
void indexExample()
|
void indexExample()
|
||||||
{
|
{
|
||||||
// Test: get character access at a specified index position
|
// Test: get character access at a specified index position
|
||||||
FString index(5); // string with five characters
|
finalcut::FString index(5); // string with five characters
|
||||||
index = "index";
|
index = "index";
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -638,8 +641,8 @@ void indexExample()
|
||||||
void iteratorExample()
|
void iteratorExample()
|
||||||
{
|
{
|
||||||
// Test: character access with std::iterator
|
// Test: character access with std::iterator
|
||||||
const FString& stringIterator = "iterator";
|
const finalcut::FString& stringIterator = "iterator";
|
||||||
FString::iterator iter;
|
finalcut::FString::iterator iter;
|
||||||
iter = stringIterator.begin();
|
iter = stringIterator.begin();
|
||||||
std::cout << " " << stringIterator << ": ";
|
std::cout << " " << stringIterator << ": ";
|
||||||
|
|
||||||
|
@ -658,7 +661,7 @@ void iteratorExample()
|
||||||
void overwriteExample()
|
void overwriteExample()
|
||||||
{
|
{
|
||||||
// Test: overwrite string at position 10 with "for t"
|
// Test: overwrite string at position 10 with "for t"
|
||||||
FString overwrite_std = "Overwrite the rest";
|
finalcut::FString overwrite_std = "Overwrite the rest";
|
||||||
std::cout << "overwrite: "
|
std::cout << "overwrite: "
|
||||||
<< overwrite_std.overwrite("for t", 10) << std::endl;
|
<< overwrite_std.overwrite("for t", 10) << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +670,7 @@ void overwriteExample()
|
||||||
void removeExample()
|
void removeExample()
|
||||||
{
|
{
|
||||||
// Test: remove 2 characters at position 7
|
// Test: remove 2 characters at position 7
|
||||||
FString remove_std = "A fast remove";
|
finalcut::FString remove_std = "A fast remove";
|
||||||
std::cout << " remove: "
|
std::cout << " remove: "
|
||||||
<< remove_std.remove(7, 2) << std::endl;
|
<< remove_std.remove(7, 2) << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -676,7 +679,7 @@ void removeExample()
|
||||||
void substringIncludeExample()
|
void substringIncludeExample()
|
||||||
{
|
{
|
||||||
// Test: includes a substring (positive test)
|
// Test: includes a substring (positive test)
|
||||||
FString include_std = "string";
|
finalcut::FString include_std = "string";
|
||||||
|
|
||||||
if ( include_std.includes("ring") )
|
if ( include_std.includes("ring") )
|
||||||
std::cout << " includes: \""
|
std::cout << " includes: \""
|
||||||
|
@ -702,8 +705,9 @@ void substringIncludeExample()
|
||||||
void replaceExample()
|
void replaceExample()
|
||||||
{
|
{
|
||||||
// Test: find and replace a substring
|
// Test: find and replace a substring
|
||||||
FString source_str = "computer and software";
|
finalcut::FString source_str = "computer and software";
|
||||||
const FString& replace_str = source_str.replace("computer", "hard-");
|
const finalcut::FString& replace_str = \
|
||||||
|
source_str.replace("computer", "hard-");
|
||||||
std::cout << " replace: "
|
std::cout << " replace: "
|
||||||
<< replace_str << std::endl;
|
<< replace_str << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -712,7 +716,7 @@ void replaceExample()
|
||||||
void tabToSpaceExample()
|
void tabToSpaceExample()
|
||||||
{
|
{
|
||||||
// Test: convert tabs to spaces
|
// Test: convert tabs to spaces
|
||||||
const FString& tab_str = "1234\t5678";
|
const finalcut::FString& tab_str = "1234\t5678";
|
||||||
std::cout << " tab: "
|
std::cout << " tab: "
|
||||||
<< tab_str.expandTabs() << std::endl;
|
<< tab_str.expandTabs() << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -721,7 +725,7 @@ void tabToSpaceExample()
|
||||||
void backspaceControlCharacterExample()
|
void backspaceControlCharacterExample()
|
||||||
{
|
{
|
||||||
// Test: backspaces remove characters in the string
|
// Test: backspaces remove characters in the string
|
||||||
const FString& bs_str = "t\b\bTesT\bt";
|
const finalcut::FString& bs_str = "t\b\bTesT\bt";
|
||||||
std::cout << "backspace: "
|
std::cout << "backspace: "
|
||||||
<< bs_str.removeBackspaces() << std::endl;
|
<< bs_str.removeBackspaces() << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -730,7 +734,7 @@ void backspaceControlCharacterExample()
|
||||||
void deleteControlCharacterExample()
|
void deleteControlCharacterExample()
|
||||||
{
|
{
|
||||||
// Test: delete characters remove characters in the string
|
// Test: delete characters remove characters in the string
|
||||||
const FString& del_str = "apple \177\177\177pietree";
|
const finalcut::FString& del_str = "apple \177\177\177pietree";
|
||||||
std::cout << " delete: "
|
std::cout << " delete: "
|
||||||
<< del_str.removeDel() << std::endl;
|
<< del_str.removeDel() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -30,23 +30,23 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class AttribDlg : public FDialog
|
class AttribDlg : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit AttribDlg (FWidget* = 0);
|
explicit AttribDlg (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~AttribDlg();
|
~AttribDlg();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
void onWheel (FWheelEvent*);
|
void onWheel (finalcut::FWheelEvent*);
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_next (FWidget* = 0, data_ptr = 0);
|
void cb_next (finalcut::FWidget* = 0, data_ptr = 0);
|
||||||
void cb_back (FWidget* = 0, data_ptr = 0);
|
void cb_back (finalcut::FWidget* = 0, data_ptr = 0);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
short bgcolor;
|
short bgcolor;
|
||||||
|
@ -61,28 +61,28 @@ class AttribDlg : public FDialog
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FButton* next_button;
|
finalcut::FButton* next_button;
|
||||||
FButton* back_button;
|
finalcut::FButton* back_button;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
AttribDlg::AttribDlg (FWidget* parent)
|
AttribDlg::AttribDlg (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, bgcolor(wc.label_bg)
|
, bgcolor(wc.label_bg)
|
||||||
, next_button()
|
, next_button()
|
||||||
, back_button()
|
, back_button()
|
||||||
{
|
{
|
||||||
setText ( "A terminal attributes test ("
|
setText ( "A terminal attributes test ("
|
||||||
+ FString(getTermType())
|
+ finalcut::FString(getTermType())
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
next_button = new FButton("&Next >", this);
|
next_button = new finalcut::FButton("&Next >", this);
|
||||||
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1);
|
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1);
|
||||||
next_button->addAccelerator(fc::Fkey_right);
|
next_button->addAccelerator(finalcut::fc::Fkey_right);
|
||||||
back_button = new FButton("< &Back", this);
|
back_button = new finalcut::FButton("< &Back", this);
|
||||||
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1);
|
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1);
|
||||||
back_button->addAccelerator(fc::Fkey_left);
|
back_button->addAccelerator(finalcut::fc::Fkey_left);
|
||||||
|
|
||||||
// Add function callbacks
|
// Add function callbacks
|
||||||
next_button->addCallback
|
next_button->addCallback
|
||||||
|
@ -103,31 +103,31 @@ AttribDlg::~AttribDlg()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void AttribDlg::onAccel (FAccelEvent* ev)
|
void AttribDlg::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void AttribDlg::onWheel (FWheelEvent* ev)
|
void AttribDlg::onWheel (finalcut::FWheelEvent* ev)
|
||||||
{
|
{
|
||||||
int wheel = ev->getWheel();
|
int wheel = ev->getWheel();
|
||||||
|
|
||||||
if ( wheel == fc::WheelUp )
|
if ( wheel == finalcut::fc::WheelUp )
|
||||||
cb_next();
|
cb_next();
|
||||||
else if ( wheel == fc::WheelDown )
|
else if ( wheel == finalcut::fc::WheelDown )
|
||||||
cb_back();
|
cb_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void AttribDlg::onClose (FCloseEvent* ev)
|
void AttribDlg::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void AttribDlg::cb_next (FWidget*, data_ptr)
|
void AttribDlg::cb_next (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
return;
|
return;
|
||||||
|
@ -135,20 +135,20 @@ void AttribDlg::cb_next (FWidget*, data_ptr)
|
||||||
bgcolor++;
|
bgcolor++;
|
||||||
|
|
||||||
if ( bgcolor >= getMaxColor() )
|
if ( bgcolor >= getMaxColor() )
|
||||||
bgcolor = fc::Default;
|
bgcolor = finalcut::fc::Default;
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void AttribDlg::cb_back (FWidget*, data_ptr)
|
void AttribDlg::cb_back (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bgcolor--;
|
bgcolor--;
|
||||||
|
|
||||||
if ( bgcolor < fc::Default )
|
if ( bgcolor < finalcut::fc::Default )
|
||||||
bgcolor = short(getMaxColor() - 1);
|
bgcolor = short(getMaxColor() - 1);
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
|
@ -169,7 +169,7 @@ void AttribDlg::adjustSize()
|
||||||
setGeometry(x, y, 69, 21, false);
|
setGeometry(x, y, 69, 21, false);
|
||||||
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1, false);
|
next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1, false);
|
||||||
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1, false);
|
back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ void AttribDlg::adjustSize()
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class AttribDemo : public FWidget
|
class AttribDemo : public finalcut::FWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -191,7 +191,7 @@ class AttribDemo : public FWidget
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onWheel (FWheelEvent* ev)
|
void onWheel (finalcut::FWheelEvent* ev)
|
||||||
{
|
{
|
||||||
AttribDlg* p = static_cast<AttribDlg*>(getParentWidget());
|
AttribDlg* p = static_cast<AttribDlg*>(getParentWidget());
|
||||||
|
|
||||||
|
@ -224,8 +224,8 @@ class AttribDemo : public FWidget
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
AttribDemo::AttribDemo (FWidget* parent)
|
AttribDemo::AttribDemo (finalcut::FWidget* parent)
|
||||||
: FWidget(parent)
|
: finalcut::FWidget(parent)
|
||||||
, colors(getMaxColor())
|
, colors(getMaxColor())
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
|
@ -259,16 +259,16 @@ void AttribDemo::printAltCharset()
|
||||||
setPrintPos (1,1);
|
setPrintPos (1,1);
|
||||||
print("alternate charset: ");
|
print("alternate charset: ");
|
||||||
|
|
||||||
if ( parent->bgcolor == fc::Default )
|
if ( parent->bgcolor == finalcut::fc::Default )
|
||||||
{
|
{
|
||||||
setColor (fc::Default, fc::Default);
|
setColor (finalcut::fc::Default, finalcut::fc::Default);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( parent->bgcolor == 0 || parent->bgcolor == 16 )
|
if ( parent->bgcolor == 0 || parent->bgcolor == 16 )
|
||||||
setColor (fc::White, parent->bgcolor);
|
setColor (finalcut::fc::White, parent->bgcolor);
|
||||||
else
|
else
|
||||||
setColor (fc::Black, parent->bgcolor);
|
setColor (finalcut::fc::Black, parent->bgcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
setAltCharset();
|
setAltCharset();
|
||||||
|
@ -471,7 +471,7 @@ void AttribDemo::draw()
|
||||||
short bg = static_cast<AttribDlg*>(getParent())->bgcolor;
|
short bg = static_cast<AttribDlg*>(getParent())->bgcolor;
|
||||||
print (" Background color:");
|
print (" Background color:");
|
||||||
|
|
||||||
if ( bg == fc::Default )
|
if ( bg == finalcut::fc::Default )
|
||||||
print (" default");
|
print (" default");
|
||||||
else
|
else
|
||||||
printf ( " %d", bg);
|
printf ( " %d", bg);
|
||||||
|
@ -487,7 +487,7 @@ void AttribDemo::draw()
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app (argc, argv);
|
finalcut::FApplication app (argc, argv);
|
||||||
|
|
||||||
// Create a dialog box object.
|
// Create a dialog box object.
|
||||||
// This object will be automatically deleted by
|
// This object will be automatically deleted by
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
|
|
||||||
|
|
||||||
// Global FVTerm object
|
// Global FVTerm object
|
||||||
static FVTerm* terminal;
|
static finalcut::FVTerm* terminal;
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
void tcapBoolean (const std::string&, bool);
|
void tcapBoolean (const std::string&, bool);
|
||||||
void tcapNumeric (const std::string&, int);
|
void tcapNumeric (const std::string&, int);
|
||||||
void tcapString (const std::string&, const char[]);
|
void tcapString (const std::string&, const char[]);
|
||||||
void debug (FApplication&);
|
void debug (finalcut::FApplication&);
|
||||||
void booleans();
|
void booleans();
|
||||||
void numeric();
|
void numeric();
|
||||||
void string(FTermcap::tcap_map*&);
|
void string(finalcut::FTermcap::tcap_map*&);
|
||||||
|
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
@ -45,95 +45,95 @@ void string(FTermcap::tcap_map*&);
|
||||||
struct termcap_string
|
struct termcap_string
|
||||||
{
|
{
|
||||||
const std::string name;
|
const std::string name;
|
||||||
const fc::termcaps cap;
|
const finalcut::fc::termcaps cap;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
// String data array
|
// String data array
|
||||||
static const termcap_string strings[] =
|
static const termcap_string strings[] =
|
||||||
{
|
{
|
||||||
{ "t_bell", fc::t_bell },
|
{ "t_bell", finalcut::fc::t_bell },
|
||||||
{ "t_erase_chars", fc::t_erase_chars },
|
{ "t_erase_chars", finalcut::fc::t_erase_chars },
|
||||||
{ "t_clear_screen", fc::t_clear_screen },
|
{ "t_clear_screen", finalcut::fc::t_clear_screen },
|
||||||
{ "t_clr_eos", fc::t_clr_eos },
|
{ "t_clr_eos", finalcut::fc::t_clr_eos },
|
||||||
{ "t_clr_eol", fc::t_clr_eol },
|
{ "t_clr_eol", finalcut::fc::t_clr_eol },
|
||||||
{ "t_clr_bol", fc::t_clr_bol },
|
{ "t_clr_bol", finalcut::fc::t_clr_bol },
|
||||||
{ "t_cursor_home", fc::t_cursor_home },
|
{ "t_cursor_home", finalcut::fc::t_cursor_home },
|
||||||
{ "t_cursor_to_ll", fc::t_cursor_to_ll },
|
{ "t_cursor_to_ll", finalcut::fc::t_cursor_to_ll },
|
||||||
{ "t_carriage_return", fc::t_carriage_return },
|
{ "t_carriage_return", finalcut::fc::t_carriage_return },
|
||||||
{ "t_tab", fc::t_tab },
|
{ "t_tab", finalcut::fc::t_tab },
|
||||||
{ "t_back_tab", fc::t_back_tab },
|
{ "t_back_tab", finalcut::fc::t_back_tab },
|
||||||
{ "t_insert_padding", fc::t_insert_padding },
|
{ "t_insert_padding", finalcut::fc::t_insert_padding },
|
||||||
{ "t_insert_character", fc::t_insert_character },
|
{ "t_insert_character", finalcut::fc::t_insert_character },
|
||||||
{ "t_parm_ich", fc::t_parm_ich },
|
{ "t_parm_ich", finalcut::fc::t_parm_ich },
|
||||||
{ "t_repeat_char", fc::t_repeat_char },
|
{ "t_repeat_char", finalcut::fc::t_repeat_char },
|
||||||
{ "t_initialize_color", fc::t_initialize_color },
|
{ "t_initialize_color", finalcut::fc::t_initialize_color },
|
||||||
{ "t_initialize_pair", fc::t_initialize_pair },
|
{ "t_initialize_pair", finalcut::fc::t_initialize_pair },
|
||||||
{ "t_set_a_foreground", fc::t_set_a_foreground },
|
{ "t_set_a_foreground", finalcut::fc::t_set_a_foreground },
|
||||||
{ "t_set_a_background", fc::t_set_a_background },
|
{ "t_set_a_background", finalcut::fc::t_set_a_background },
|
||||||
{ "t_set_foreground", fc::t_set_foreground },
|
{ "t_set_foreground", finalcut::fc::t_set_foreground },
|
||||||
{ "t_set_background", fc::t_set_background },
|
{ "t_set_background", finalcut::fc::t_set_background },
|
||||||
{ "t_set_color_pair", fc::t_set_color_pair },
|
{ "t_set_color_pair", finalcut::fc::t_set_color_pair },
|
||||||
{ "t_orig_pair", fc::t_orig_pair },
|
{ "t_orig_pair", finalcut::fc::t_orig_pair },
|
||||||
{ "t_orig_colors", fc::t_orig_colors },
|
{ "t_orig_colors", finalcut::fc::t_orig_colors },
|
||||||
{ "t_no_color_video", fc::t_no_color_video },
|
{ "t_no_color_video", finalcut::fc::t_no_color_video },
|
||||||
{ "t_cursor_address", fc::t_cursor_address },
|
{ "t_cursor_address", finalcut::fc::t_cursor_address },
|
||||||
{ "t_column_address", fc::t_column_address },
|
{ "t_column_address", finalcut::fc::t_column_address },
|
||||||
{ "t_row_address", fc::t_row_address },
|
{ "t_row_address", finalcut::fc::t_row_address },
|
||||||
{ "t_cursor_visible", fc::t_cursor_visible },
|
{ "t_cursor_visible", finalcut::fc::t_cursor_visible },
|
||||||
{ "t_cursor_invisible", fc::t_cursor_invisible },
|
{ "t_cursor_invisible", finalcut::fc::t_cursor_invisible },
|
||||||
{ "t_cursor_normal", fc::t_cursor_normal },
|
{ "t_cursor_normal", finalcut::fc::t_cursor_normal },
|
||||||
{ "t_cursor_up", fc::t_cursor_up },
|
{ "t_cursor_up", finalcut::fc::t_cursor_up },
|
||||||
{ "t_cursor_down", fc::t_cursor_down },
|
{ "t_cursor_down", finalcut::fc::t_cursor_down },
|
||||||
{ "t_cursor_left", fc::t_cursor_left },
|
{ "t_cursor_left", finalcut::fc::t_cursor_left },
|
||||||
{ "t_cursor_right", fc::t_cursor_right },
|
{ "t_cursor_right", finalcut::fc::t_cursor_right },
|
||||||
{ "t_parm_up_cursor", fc::t_parm_up_cursor },
|
{ "t_parm_up_cursor", finalcut::fc::t_parm_up_cursor },
|
||||||
{ "t_parm_down_cursor", fc::t_parm_down_cursor },
|
{ "t_parm_down_cursor", finalcut::fc::t_parm_down_cursor },
|
||||||
{ "t_parm_left_cursor", fc::t_parm_left_cursor },
|
{ "t_parm_left_cursor", finalcut::fc::t_parm_left_cursor },
|
||||||
{ "t_parm_right_cursor", fc::t_parm_right_cursor },
|
{ "t_parm_right_cursor", finalcut::fc::t_parm_right_cursor },
|
||||||
{ "t_save_cursor", fc::t_save_cursor },
|
{ "t_save_cursor", finalcut::fc::t_save_cursor },
|
||||||
{ "t_restore_cursor", fc::t_restore_cursor },
|
{ "t_restore_cursor", finalcut::fc::t_restore_cursor },
|
||||||
{ "t_scroll_forward", fc::t_scroll_forward },
|
{ "t_scroll_forward", finalcut::fc::t_scroll_forward },
|
||||||
{ "t_scroll_reverse", fc::t_scroll_reverse },
|
{ "t_scroll_reverse", finalcut::fc::t_scroll_reverse },
|
||||||
{ "t_enter_ca_mode", fc::t_enter_ca_mode },
|
{ "t_enter_ca_mode", finalcut::fc::t_enter_ca_mode },
|
||||||
{ "t_exit_ca_mode", fc::t_exit_ca_mode },
|
{ "t_exit_ca_mode", finalcut::fc::t_exit_ca_mode },
|
||||||
{ "t_enable_acs", fc::t_enable_acs },
|
{ "t_enable_acs", finalcut::fc::t_enable_acs },
|
||||||
{ "t_enter_bold_mode", fc::t_enter_bold_mode },
|
{ "t_enter_bold_mode", finalcut::fc::t_enter_bold_mode },
|
||||||
{ "t_exit_bold_mode", fc::t_exit_bold_mode },
|
{ "t_exit_bold_mode", finalcut::fc::t_exit_bold_mode },
|
||||||
{ "t_enter_dim_mode", fc::t_enter_dim_mode },
|
{ "t_enter_dim_mode", finalcut::fc::t_enter_dim_mode },
|
||||||
{ "t_exit_dim_mode", fc::t_exit_dim_mode },
|
{ "t_exit_dim_mode", finalcut::fc::t_exit_dim_mode },
|
||||||
{ "t_enter_italics_mode", fc::t_enter_italics_mode },
|
{ "t_enter_italics_mode", finalcut::fc::t_enter_italics_mode },
|
||||||
{ "t_exit_italics_mode", fc::t_exit_italics_mode },
|
{ "t_exit_italics_mode", finalcut::fc::t_exit_italics_mode },
|
||||||
{ "t_enter_underline_mode", fc::t_enter_underline_mode },
|
{ "t_enter_underline_mode", finalcut::fc::t_enter_underline_mode },
|
||||||
{ "t_exit_underline_mode", fc::t_exit_underline_mode },
|
{ "t_exit_underline_mode", finalcut::fc::t_exit_underline_mode },
|
||||||
{ "t_enter_blink_mode", fc::t_enter_blink_mode },
|
{ "t_enter_blink_mode", finalcut::fc::t_enter_blink_mode },
|
||||||
{ "t_exit_blink_mode", fc::t_exit_blink_mode },
|
{ "t_exit_blink_mode", finalcut::fc::t_exit_blink_mode },
|
||||||
{ "t_enter_reverse_mode", fc::t_enter_reverse_mode },
|
{ "t_enter_reverse_mode", finalcut::fc::t_enter_reverse_mode },
|
||||||
{ "t_exit_reverse_mode", fc::t_exit_reverse_mode },
|
{ "t_exit_reverse_mode", finalcut::fc::t_exit_reverse_mode },
|
||||||
{ "t_enter_standout_mode", fc::t_enter_standout_mode },
|
{ "t_enter_standout_mode", finalcut::fc::t_enter_standout_mode },
|
||||||
{ "t_exit_standout_mode", fc::t_exit_standout_mode },
|
{ "t_exit_standout_mode", finalcut::fc::t_exit_standout_mode },
|
||||||
{ "t_enter_secure_mode", fc::t_enter_secure_mode },
|
{ "t_enter_secure_mode", finalcut::fc::t_enter_secure_mode },
|
||||||
{ "t_exit_secure_mode", fc::t_exit_secure_mode },
|
{ "t_exit_secure_mode", finalcut::fc::t_exit_secure_mode },
|
||||||
{ "t_enter_protected_mode", fc::t_enter_protected_mode },
|
{ "t_enter_protected_mode", finalcut::fc::t_enter_protected_mode },
|
||||||
{ "t_exit_protected_mode", fc::t_exit_protected_mode },
|
{ "t_exit_protected_mode", finalcut::fc::t_exit_protected_mode },
|
||||||
{ "t_enter_crossed_out_mode", fc::t_enter_crossed_out_mode },
|
{ "t_enter_crossed_out_mode", finalcut::fc::t_enter_crossed_out_mode },
|
||||||
{ "t_exit_crossed_out_mode", fc::t_exit_crossed_out_mode },
|
{ "t_exit_crossed_out_mode", finalcut::fc::t_exit_crossed_out_mode },
|
||||||
{ "t_enter_dbl_underline_mode", fc::t_enter_dbl_underline_mode },
|
{ "t_enter_dbl_underline_mode", finalcut::fc::t_enter_dbl_underline_mode },
|
||||||
{ "t_exit_dbl_underline_mode", fc::t_exit_dbl_underline_mode },
|
{ "t_exit_dbl_underline_mode", finalcut::fc::t_exit_dbl_underline_mode },
|
||||||
{ "t_set_attributes", fc::t_set_attributes },
|
{ "t_set_attributes", finalcut::fc::t_set_attributes },
|
||||||
{ "t_exit_attribute_mode", fc::t_exit_attribute_mode },
|
{ "t_exit_attribute_mode", finalcut::fc::t_exit_attribute_mode },
|
||||||
{ "t_enter_alt_charset_mode", fc::t_enter_alt_charset_mode },
|
{ "t_enter_alt_charset_mode", finalcut::fc::t_enter_alt_charset_mode },
|
||||||
{ "t_exit_alt_charset_mode", fc::t_exit_alt_charset_mode },
|
{ "t_exit_alt_charset_mode", finalcut::fc::t_exit_alt_charset_mode },
|
||||||
{ "t_enter_pc_charset_mode", fc::t_enter_pc_charset_mode },
|
{ "t_enter_pc_charset_mode", finalcut::fc::t_enter_pc_charset_mode },
|
||||||
{ "t_exit_pc_charset_mode", fc::t_exit_pc_charset_mode },
|
{ "t_exit_pc_charset_mode", finalcut::fc::t_exit_pc_charset_mode },
|
||||||
{ "t_enter_insert_mode", fc::t_enter_insert_mode },
|
{ "t_enter_insert_mode", finalcut::fc::t_enter_insert_mode },
|
||||||
{ "t_exit_insert_mode", fc::t_exit_insert_mode },
|
{ "t_exit_insert_mode", finalcut::fc::t_exit_insert_mode },
|
||||||
{ "t_enter_am_mode", fc::t_enter_am_mode },
|
{ "t_enter_am_mode", finalcut::fc::t_enter_am_mode },
|
||||||
{ "t_exit_am_mode", fc::t_exit_am_mode },
|
{ "t_exit_am_mode", finalcut::fc::t_exit_am_mode },
|
||||||
{ "t_acs_chars", fc::t_acs_chars },
|
{ "t_acs_chars", finalcut::fc::t_acs_chars },
|
||||||
{ "t_keypad_xmit", fc::t_keypad_xmit },
|
{ "t_keypad_xmit", finalcut::fc::t_keypad_xmit },
|
||||||
{ "t_keypad_local", fc::t_keypad_local },
|
{ "t_keypad_local", finalcut::fc::t_keypad_local },
|
||||||
{ "t_key_mouse", fc::t_key_mouse }
|
{ "t_key_mouse", finalcut::fc::t_key_mouse }
|
||||||
};
|
};
|
||||||
|
|
||||||
const int last_item = int ( sizeof(strings) / sizeof(strings[0]) ) - 1;
|
const int last_item = int ( sizeof(strings) / sizeof(strings[0]) ) - 1;
|
||||||
|
@ -204,10 +204,10 @@ void tcapString (const std::string& name, const char cap_str[])
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
void debug (FApplication& TermApp)
|
void debug (finalcut::FApplication& TermApp)
|
||||||
{
|
{
|
||||||
const FString& ab_s = TermApp.getAnswerbackString();
|
const finalcut::FString& ab_s = TermApp.getAnswerbackString();
|
||||||
const FString& sec_da = TermApp.getSecDAString();
|
const finalcut::FString& sec_da = TermApp.getSecDAString();
|
||||||
std::cout << "\n.------------------- debug -------------------\r\n";
|
std::cout << "\n.------------------- debug -------------------\r\n";
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
std::cout << "| Framebuffer bpp: "
|
std::cout << "| Framebuffer bpp: "
|
||||||
|
@ -231,7 +231,7 @@ void debug (FApplication& TermApp)
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void debug (FApplication&)
|
void debug (finalcut::FApplication&)
|
||||||
{ }
|
{ }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -240,19 +240,19 @@ void booleans()
|
||||||
{
|
{
|
||||||
std::cout << "\r\n[Booleans]\r\n";
|
std::cout << "\r\n[Booleans]\r\n";
|
||||||
tcapBoolean ( "background_color_erase"
|
tcapBoolean ( "background_color_erase"
|
||||||
, FTermcap::background_color_erase );
|
, finalcut::FTermcap::background_color_erase );
|
||||||
tcapBoolean ( "automatic_left_margin"
|
tcapBoolean ( "automatic_left_margin"
|
||||||
, FTermcap::automatic_left_margin );
|
, finalcut::FTermcap::automatic_left_margin );
|
||||||
tcapBoolean ( "automatic_right_margin"
|
tcapBoolean ( "automatic_right_margin"
|
||||||
, FTermcap::automatic_right_margin );
|
, finalcut::FTermcap::automatic_right_margin );
|
||||||
tcapBoolean ( "eat_nl_glitch"
|
tcapBoolean ( "eat_nl_glitch"
|
||||||
, FTermcap::eat_nl_glitch );
|
, finalcut::FTermcap::eat_nl_glitch );
|
||||||
tcapBoolean ( "ansi_default_color"
|
tcapBoolean ( "ansi_default_color"
|
||||||
, FTermcap::ansi_default_color );
|
, finalcut::FTermcap::ansi_default_color );
|
||||||
tcapBoolean ( "osc_support"
|
tcapBoolean ( "osc_support"
|
||||||
, FTermcap::osc_support );
|
, finalcut::FTermcap::osc_support );
|
||||||
tcapBoolean ( "no_utf8_acs_chars"
|
tcapBoolean ( "no_utf8_acs_chars"
|
||||||
, FTermcap::no_utf8_acs_chars );
|
, finalcut::FTermcap::no_utf8_acs_chars );
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -260,22 +260,22 @@ void numeric()
|
||||||
{
|
{
|
||||||
std::cout << "\r\n[Numeric]\r\n";
|
std::cout << "\r\n[Numeric]\r\n";
|
||||||
tcapNumeric ("max_color"
|
tcapNumeric ("max_color"
|
||||||
, FTermcap::max_color);
|
, finalcut::FTermcap::max_color);
|
||||||
tcapNumeric ("tabstop"
|
tcapNumeric ("tabstop"
|
||||||
, FTermcap::tabstop);
|
, finalcut::FTermcap::tabstop);
|
||||||
tcapNumeric ("attr_without_color"
|
tcapNumeric ("attr_without_color"
|
||||||
, FTermcap::attr_without_color);
|
, finalcut::FTermcap::attr_without_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void string(FTermcap::tcap_map*& tcap)
|
void string(finalcut::FTermcap::tcap_map*& tcap)
|
||||||
{
|
{
|
||||||
std::cout << "\r\n[String]\r\n";
|
std::cout << "\r\n[String]\r\n";
|
||||||
|
|
||||||
for (int n = 0; n <= last_item; n++ )
|
for (int n = 0; n <= last_item; n++ )
|
||||||
{
|
{
|
||||||
const std::string name = strings[n].name;
|
const std::string name = strings[n].name;
|
||||||
const fc::termcaps cap = strings[n].cap;
|
const finalcut::fc::termcaps cap = strings[n].cap;
|
||||||
tcapString (name, tcap[cap].string);
|
tcapString (name, tcap[cap].string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,13 +286,13 @@ void string(FTermcap::tcap_map*& tcap)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
bool disable_alt_screen = true;
|
bool disable_alt_screen = true;
|
||||||
FApplication TermApp (argc, argv, disable_alt_screen);
|
finalcut::FApplication TermApp (argc, argv, disable_alt_screen);
|
||||||
|
|
||||||
// Pointer to the global virtual terminal object
|
// Pointer to the global virtual terminal object
|
||||||
terminal = static_cast<FVTerm*>(&TermApp);
|
terminal = static_cast<finalcut::FVTerm*>(&TermApp);
|
||||||
|
|
||||||
FTermcap::tcap_map* tcap = 0;
|
finalcut::FTermcap::tcap_map* tcap = 0;
|
||||||
tcap = FTermcap::getTermcapMap();
|
tcap = finalcut::FTermcap::getTermcapMap();
|
||||||
|
|
||||||
std::cout << "--------\r\nFTermcap\r\n--------\r\n\n";
|
std::cout << "--------\r\nFTermcap\r\n--------\r\n\n";
|
||||||
std::cout << "Terminal: " << TermApp.getTermType() << "\r\n";
|
std::cout << "Terminal: " << TermApp.getTermType() << "\r\n";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2014-2017 Markus Gans *
|
* Copyright 2014-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -27,24 +27,24 @@
|
||||||
// class Timer
|
// class Timer
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
class Timer : public FWidget
|
class Timer : public finalcut::FWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Timer (FWidget* = 0);
|
explicit Timer (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (finalcut::FTimerEvent*);
|
||||||
void onAccel (FAccelEvent*);
|
void onAccel (finalcut::FAccelEvent*);
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Timer::Timer (FWidget* parent)
|
Timer::Timer (finalcut::FWidget* parent)
|
||||||
: FWidget(parent)
|
: finalcut::FWidget(parent)
|
||||||
{
|
{
|
||||||
addTimer (60000); // 1-minute timer
|
addTimer (60000); // 1-minute timer
|
||||||
int id = addTimer (50); // 50-millisecond timer
|
int id = addTimer (50); // 50-millisecond timer
|
||||||
|
@ -52,8 +52,8 @@ Timer::Timer (FWidget* parent)
|
||||||
delTimer (id);
|
delTimer (id);
|
||||||
addTimer (250); // 250-millisecond timer
|
addTimer (250); // 250-millisecond timer
|
||||||
|
|
||||||
wc.term_fg = fc::Default;
|
wc.term_fg = finalcut::fc::Default;
|
||||||
wc.term_bg = fc::Default;
|
wc.term_bg = finalcut::fc::Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -67,7 +67,7 @@ void Timer::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Timer::onTimer (FTimerEvent* ev)
|
void Timer::onTimer (finalcut::FTimerEvent* ev)
|
||||||
{
|
{
|
||||||
bool is_last_line = false;
|
bool is_last_line = false;
|
||||||
int timer_id = ev->timerId();
|
int timer_id = ev->timerId();
|
||||||
|
@ -75,7 +75,7 @@ void Timer::onTimer (FTimerEvent* ev)
|
||||||
if ( getPrintPos().getY() == getDesktopHeight() )
|
if ( getPrintPos().getY() == getDesktopHeight() )
|
||||||
is_last_line = true;
|
is_last_line = true;
|
||||||
|
|
||||||
setColor (short(1 + timer_id), fc::Default);
|
setColor (short(1 + timer_id), finalcut::fc::Default);
|
||||||
print() << "Timer event, id " << timer_id << '\n';
|
print() << "Timer event, id " << timer_id << '\n';
|
||||||
|
|
||||||
if ( is_last_line )
|
if ( is_last_line )
|
||||||
|
@ -85,7 +85,7 @@ void Timer::onTimer (FTimerEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Timer::onAccel (FAccelEvent* ev)
|
void Timer::onAccel (finalcut::FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
quit();
|
quit();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
|
@ -98,9 +98,9 @@ void Timer::onAccel (FAccelEvent* ev)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
app.setForegroundColor(fc::Default);
|
app.setForegroundColor(finalcut::fc::Default);
|
||||||
app.setBackgroundColor(fc::Default);
|
app.setBackgroundColor(finalcut::fc::Default);
|
||||||
|
|
||||||
// Create a timer object t
|
// Create a timer object t
|
||||||
Timer t(&app);
|
Timer t(&app);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Transparent : public FDialog
|
class Transparent : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Typedef and Enumeration
|
// Typedef and Enumeration
|
||||||
|
@ -43,7 +43,7 @@ class Transparent : public FDialog
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Transparent (FWidget* = 0, trans_type = transparent);
|
explicit Transparent (finalcut::FWidget* = 0, trans_type = transparent);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Transparent();
|
~Transparent();
|
||||||
|
@ -59,7 +59,7 @@ class Transparent : public FDialog
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onKeyPress (FKeyEvent* ev);
|
void onKeyPress (finalcut::FKeyEvent* ev);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
trans_type type;
|
trans_type type;
|
||||||
|
@ -67,8 +67,9 @@ class Transparent : public FDialog
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Transparent::Transparent (FWidget* parent, Transparent::trans_type tt)
|
Transparent::Transparent ( finalcut::FWidget* parent
|
||||||
: FDialog(parent)
|
, Transparent::trans_type tt )
|
||||||
|
: finalcut::FDialog(parent)
|
||||||
, type(tt)
|
, type(tt)
|
||||||
{
|
{
|
||||||
setStatusbarMessage("Press Q to quit");
|
setStatusbarMessage("Press Q to quit");
|
||||||
|
@ -81,7 +82,7 @@ Transparent::~Transparent()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Transparent::draw()
|
void Transparent::draw()
|
||||||
{
|
{
|
||||||
FDialog::draw();
|
finalcut::FDialog::draw();
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(true);
|
setReverse(true);
|
||||||
|
@ -94,16 +95,16 @@ void Transparent::draw()
|
||||||
else if ( type == inherit_background )
|
else if ( type == inherit_background )
|
||||||
{
|
{
|
||||||
if ( getMaxColor() > 8 )
|
if ( getMaxColor() > 8 )
|
||||||
setColor(fc::Blue, fc::Black);
|
setColor(finalcut::fc::Blue, finalcut::fc::Black);
|
||||||
else
|
else
|
||||||
setColor(fc::Green, fc::Black);
|
setColor(finalcut::fc::Green, finalcut::fc::Black);
|
||||||
|
|
||||||
setInheritBackground();
|
setInheritBackground();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setTransparent();
|
setTransparent();
|
||||||
|
|
||||||
FString line(getClientWidth(), wchar_t('.'));
|
finalcut::FString line(getClientWidth(), wchar_t('.'));
|
||||||
|
|
||||||
for (int n = 1; n <= getClientHeight(); n++)
|
for (int n = 1; n <= getClientHeight(); n++)
|
||||||
{
|
{
|
||||||
|
@ -123,7 +124,7 @@ void Transparent::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Transparent::onKeyPress (FKeyEvent* ev)
|
void Transparent::onKeyPress (finalcut::FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
if ( ! ev )
|
if ( ! ev )
|
||||||
return;
|
return;
|
||||||
|
@ -136,7 +137,7 @@ void Transparent::onKeyPress (FKeyEvent* ev)
|
||||||
ev->ignore();
|
ev->ignore();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
FDialog::onKeyPress(ev);
|
finalcut::FDialog::onKeyPress(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,11 +148,11 @@ void Transparent::onKeyPress (FKeyEvent* ev)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class MainWindow : public FDialog
|
class MainWindow : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
FString line1;
|
finalcut::FString line1;
|
||||||
FString line2;
|
finalcut::FString line2;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
|
@ -162,10 +163,10 @@ class MainWindow : public FDialog
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
void onShow (FShowEvent*);
|
void onShow (finalcut::FShowEvent*);
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (finalcut::FTimerEvent*);
|
||||||
void onKeyPress (FKeyEvent* ev)
|
void onKeyPress (finalcut::FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
if ( ! ev )
|
if ( ! ev )
|
||||||
return;
|
return;
|
||||||
|
@ -176,19 +177,19 @@ class MainWindow : public FDialog
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
FDialog::onKeyPress(ev);
|
finalcut::FDialog::onKeyPress(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit MainWindow (FWidget* = 0);
|
explicit MainWindow (finalcut::FWidget* = 0);
|
||||||
// Destructor
|
// Destructor
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
MainWindow::MainWindow (FWidget* parent)
|
MainWindow::MainWindow (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: FDialog(parent)
|
||||||
, line1()
|
, line1()
|
||||||
, line2()
|
, line2()
|
||||||
|
@ -212,7 +213,7 @@ MainWindow::MainWindow (FWidget* parent)
|
||||||
ibg->unsetTransparentShadow();
|
ibg->unsetTransparentShadow();
|
||||||
|
|
||||||
// Statusbar at the bottom
|
// Statusbar at the bottom
|
||||||
FStatusBar* status_bar = new FStatusBar (this);
|
finalcut::FStatusBar* status_bar = new finalcut::FStatusBar (this);
|
||||||
status_bar->setMessage("Press Q to quit");
|
status_bar->setMessage("Press Q to quit");
|
||||||
|
|
||||||
addAccelerator('q');
|
addAccelerator('q');
|
||||||
|
@ -227,7 +228,7 @@ MainWindow::~MainWindow()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MainWindow::draw()
|
void MainWindow::draw()
|
||||||
{
|
{
|
||||||
FDialog::draw();
|
finalcut::FDialog::draw();
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(true);
|
setReverse(true);
|
||||||
|
@ -245,19 +246,19 @@ void MainWindow::draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MainWindow::onClose (FCloseEvent* ev)
|
void MainWindow::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MainWindow::onShow (FShowEvent*)
|
void MainWindow::onShow (finalcut::FShowEvent*)
|
||||||
{
|
{
|
||||||
addTimer(100);
|
addTimer(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MainWindow::onTimer (FTimerEvent*)
|
void MainWindow::onTimer (finalcut::FTimerEvent*)
|
||||||
{
|
{
|
||||||
wchar_t first_Char[2];
|
wchar_t first_Char[2];
|
||||||
uInt length = line1.getLength();
|
uInt length = line1.getLength();
|
||||||
|
@ -276,7 +277,7 @@ void MainWindow::onTimer (FTimerEvent*)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app (argc, argv);
|
finalcut::FApplication app (argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
MainWindow main_dlg (&app);
|
MainWindow main_dlg (&app);
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Treeview : public FDialog
|
class Treeview : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Treeview (FWidget* = 0);
|
explicit Treeview (finalcut::FWidget* = 0);
|
||||||
// Destructor
|
// Destructor
|
||||||
~Treeview();
|
~Treeview();
|
||||||
|
|
||||||
|
@ -62,11 +62,11 @@ class Treeview : public FDialog
|
||||||
TreeItem* getOceania();
|
TreeItem* getOceania();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FListView* listView;
|
finalcut::FListView* listView;
|
||||||
FButton* Quit;
|
finalcut::FButton* Quit;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
@ -251,13 +251,13 @@ Treeview::TreeItem* Treeview::getOceania()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Treeview::Treeview (FWidget* parent)
|
Treeview::Treeview (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, listView()
|
, listView()
|
||||||
, Quit()
|
, Quit()
|
||||||
{
|
{
|
||||||
// Create FListView object
|
// Create FListView object
|
||||||
listView = new FListView (this);
|
listView = new finalcut::FListView (this);
|
||||||
listView->setGeometry(2, 1, 53, 14);
|
listView->setGeometry(2, 1, 53, 14);
|
||||||
|
|
||||||
// Add columns to the view
|
// Add columns to the view
|
||||||
|
@ -266,8 +266,8 @@ Treeview::Treeview (FWidget* parent)
|
||||||
listView->addColumn ("Density/km²");
|
listView->addColumn ("Density/km²");
|
||||||
|
|
||||||
// Set right alignment for the second and third column
|
// Set right alignment for the second and third column
|
||||||
listView->setColumnAlignment (2, fc::alignRight);
|
listView->setColumnAlignment (2, finalcut::fc::alignRight);
|
||||||
listView->setColumnAlignment (3, fc::alignRight);
|
listView->setColumnAlignment (3, finalcut::fc::alignRight);
|
||||||
|
|
||||||
// Activate tree view
|
// Activate tree view
|
||||||
listView->setTreeView();
|
listView->setTreeView();
|
||||||
|
@ -297,12 +297,15 @@ Treeview::Treeview (FWidget* parent)
|
||||||
while ( continent_list->name )
|
while ( continent_list->name )
|
||||||
{
|
{
|
||||||
TreeItem* country_list = continent_list->child_element;
|
TreeItem* country_list = continent_list->child_element;
|
||||||
FStringList continent_line (continent_list->begin(), continent_list->end());
|
finalcut::FStringList continent_line ( continent_list->begin()
|
||||||
FObjectIterator iter = listView->insert (continent_line);
|
, continent_list->end() );
|
||||||
|
finalcut::FListViewIterator::FObjectIterator iter = \
|
||||||
|
listView->insert (continent_line);
|
||||||
|
|
||||||
while ( country_list && country_list->name )
|
while ( country_list && country_list->name )
|
||||||
{
|
{
|
||||||
FStringList country_line (country_list->begin(), country_list->end());
|
finalcut::FStringList country_line ( country_list->begin()
|
||||||
|
, country_list->end() );
|
||||||
listView->insert (country_line, iter);
|
listView->insert (country_line, iter);
|
||||||
country_list++;
|
country_list++;
|
||||||
}
|
}
|
||||||
|
@ -311,7 +314,7 @@ Treeview::Treeview (FWidget* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quit button
|
// Quit button
|
||||||
Quit = new FButton (this);
|
Quit = new finalcut::FButton (this);
|
||||||
Quit->setGeometry(24, 16, 10, 1);
|
Quit->setGeometry(24, 16, 10, 1);
|
||||||
Quit->setText (L"&Quit");
|
Quit->setText (L"&Quit");
|
||||||
|
|
||||||
|
@ -319,7 +322,7 @@ Treeview::Treeview (FWidget* parent)
|
||||||
Quit->addCallback
|
Quit->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,13 +348,13 @@ void Treeview::adjustSize()
|
||||||
if ( Quit )
|
if ( Quit )
|
||||||
Quit->setY(getHeight() - 4);
|
Quit->setY(getHeight() - 4);
|
||||||
|
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Treeview::onClose (FCloseEvent* ev)
|
void Treeview::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -362,7 +365,7 @@ void Treeview::onClose (FCloseEvent* ev)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
Treeview d(&app);
|
Treeview d(&app);
|
||||||
|
|
420
examples/ui.cpp
420
examples/ui.cpp
|
@ -34,11 +34,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class ProgressDialog : public FDialog
|
class ProgressDialog : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit ProgressDialog (FWidget* = 0);
|
explicit ProgressDialog (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~ProgressDialog();
|
~ProgressDialog();
|
||||||
|
@ -50,25 +50,25 @@ class ProgressDialog : public FDialog
|
||||||
ProgressDialog& operator = (const ProgressDialog&);
|
ProgressDialog& operator = (const ProgressDialog&);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onShow (FShowEvent*);
|
void onShow (finalcut::FShowEvent*);
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (finalcut::FTimerEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_reset_bar (FWidget*, data_ptr);
|
void cb_reset_bar (finalcut::FWidget*, data_ptr);
|
||||||
void cb_more_bar (FWidget*, data_ptr);
|
void cb_more_bar (finalcut::FWidget*, data_ptr);
|
||||||
void cb_exit_bar (FWidget*, data_ptr);
|
void cb_exit_bar (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FProgressbar* progressBar;
|
finalcut::FProgressbar* progressBar;
|
||||||
FButton* reset;
|
finalcut::FButton* reset;
|
||||||
FButton* more;
|
finalcut::FButton* more;
|
||||||
FButton* quit;
|
finalcut::FButton* quit;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
ProgressDialog::ProgressDialog (FWidget* parent)
|
ProgressDialog::ProgressDialog (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, progressBar()
|
, progressBar()
|
||||||
, reset()
|
, reset()
|
||||||
, more()
|
, more()
|
||||||
|
@ -78,24 +78,24 @@ ProgressDialog::ProgressDialog (FWidget* parent)
|
||||||
setText("Progress bar");
|
setText("Progress bar");
|
||||||
//setModal();
|
//setModal();
|
||||||
|
|
||||||
reset = new FButton(this);
|
reset = new finalcut::FButton(this);
|
||||||
reset->setText("&Reset");
|
reset->setText("&Reset");
|
||||||
reset->setStatusbarMessage ("Reset the progress bar");
|
reset->setStatusbarMessage ("Reset the progress bar");
|
||||||
reset->setGeometry(2, 6, 8, 1, false);
|
reset->setGeometry(2, 6, 8, 1, false);
|
||||||
reset->setDisable();
|
reset->setDisable();
|
||||||
|
|
||||||
more = new FButton(this);
|
more = new finalcut::FButton(this);
|
||||||
more->setText("&More");
|
more->setText("&More");
|
||||||
more->setStatusbarMessage ("Increases the progress bar position");
|
more->setStatusbarMessage ("Increases the progress bar position");
|
||||||
more->setGeometry(15, 6, 8, 1, false);
|
more->setGeometry(15, 6, 8, 1, false);
|
||||||
more->setDisable();
|
more->setDisable();
|
||||||
|
|
||||||
quit = new FButton(this);
|
quit = new finalcut::FButton(this);
|
||||||
quit->setText("E&xit");
|
quit->setText("E&xit");
|
||||||
quit->setGeometry(28, 6, 8, 1, false);
|
quit->setGeometry(28, 6, 8, 1, false);
|
||||||
quit->setDisable();
|
quit->setDisable();
|
||||||
|
|
||||||
progressBar = new FProgressbar(this);
|
progressBar = new finalcut::FProgressbar(this);
|
||||||
progressBar->setGeometry(2, 3, 34, 1, false);
|
progressBar->setGeometry(2, 3, 34, 1, false);
|
||||||
//progressBar->setPercentage(78);
|
//progressBar->setPercentage(78);
|
||||||
|
|
||||||
|
@ -132,13 +132,13 @@ ProgressDialog::~ProgressDialog() // destructor
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ProgressDialog::onShow (FShowEvent*)
|
void ProgressDialog::onShow (finalcut::FShowEvent*)
|
||||||
{
|
{
|
||||||
addTimer(15);
|
addTimer(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ProgressDialog::onTimer (FTimerEvent*)
|
void ProgressDialog::onTimer (finalcut::FTimerEvent*)
|
||||||
{
|
{
|
||||||
int p = progressBar->getPercentage();
|
int p = progressBar->getPercentage();
|
||||||
progressBar->setPercentage(++p);
|
progressBar->setPercentage(++p);
|
||||||
|
@ -164,20 +164,20 @@ void ProgressDialog::onTimer (FTimerEvent*)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ProgressDialog::cb_reset_bar (FWidget*, data_ptr)
|
void ProgressDialog::cb_reset_bar (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
progressBar->reset();
|
progressBar->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ProgressDialog::cb_more_bar (FWidget*, data_ptr)
|
void ProgressDialog::cb_more_bar (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
int p = progressBar->getPercentage();
|
int p = progressBar->getPercentage();
|
||||||
progressBar->setPercentage(++p);
|
progressBar->setPercentage(++p);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ProgressDialog::cb_exit_bar (FWidget*, data_ptr)
|
void ProgressDialog::cb_exit_bar (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -190,16 +190,16 @@ void ProgressDialog::cb_exit_bar (FWidget*, data_ptr)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class TextWindow : public FDialog
|
class TextWindow : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit TextWindow (FWidget* = 0);
|
explicit TextWindow (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~TextWindow();
|
~TextWindow();
|
||||||
|
|
||||||
void append (const FString&);
|
void append (const finalcut::FString&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
|
@ -211,16 +211,16 @@ class TextWindow : public FDialog
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FTextView* scrollText;
|
finalcut::FTextView* scrollText;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
TextWindow::TextWindow (FWidget* parent)
|
TextWindow::TextWindow (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, scrollText()
|
, scrollText()
|
||||||
{
|
{
|
||||||
scrollText = new FTextView(this);
|
scrollText = new finalcut::FTextView(this);
|
||||||
scrollText->ignorePadding();
|
scrollText->ignorePadding();
|
||||||
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
|
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
|
||||||
setMinimumSize (51, 6);
|
setMinimumSize (51, 6);
|
||||||
|
@ -240,7 +240,7 @@ TextWindow::~TextWindow() // destructor
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void TextWindow::append (const FString& str)
|
void TextWindow::append (const finalcut::FString& str)
|
||||||
{
|
{
|
||||||
scrollText->append(str);
|
scrollText->append(str);
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ void TextWindow::append (const FString& str)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void TextWindow::adjustSize()
|
void TextWindow::adjustSize()
|
||||||
{
|
{
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
|
scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,11 +260,11 @@ void TextWindow::adjustSize()
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class MyDialog : public FDialog
|
class MyDialog : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit MyDialog (FWidget* = 0);
|
explicit MyDialog (finalcut::FWidget* = 0);
|
||||||
// Destructor
|
// Destructor
|
||||||
~MyDialog();
|
~MyDialog();
|
||||||
|
|
||||||
|
@ -292,58 +292,58 @@ class MyDialog : public FDialog
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_noFunctionMsg (FWidget*, data_ptr);
|
void cb_noFunctionMsg (finalcut::FWidget*, data_ptr);
|
||||||
void cb_about (FWidget*, data_ptr);
|
void cb_about (finalcut::FWidget*, data_ptr);
|
||||||
void cb_terminfo (FWidget*, data_ptr);
|
void cb_terminfo (finalcut::FWidget*, data_ptr);
|
||||||
void cb_drives (FWidget*, data_ptr);
|
void cb_drives (finalcut::FWidget*, data_ptr);
|
||||||
void cb_cutClipboard (FWidget*, data_ptr);
|
void cb_cutClipboard (finalcut::FWidget*, data_ptr);
|
||||||
void cb_copyClipboard (FWidget*, data_ptr);
|
void cb_copyClipboard (finalcut::FWidget*, data_ptr);
|
||||||
void cb_pasteClipboard (FWidget*, data_ptr);
|
void cb_pasteClipboard (finalcut::FWidget*, data_ptr);
|
||||||
void cb_clearInput (FWidget*, data_ptr);
|
void cb_clearInput (finalcut::FWidget*, data_ptr);
|
||||||
void cb_input2buttonText (FWidget*, data_ptr);
|
void cb_input2buttonText (finalcut::FWidget*, data_ptr);
|
||||||
void cb_setTitlebar (FWidget*, data_ptr);
|
void cb_setTitlebar (finalcut::FWidget*, data_ptr);
|
||||||
void cb_ProgressBar (FWidget*, data_ptr);
|
void cb_ProgressBar (finalcut::FWidget*, data_ptr);
|
||||||
void cb_updateNumber (FWidget*, data_ptr);
|
void cb_updateNumber (finalcut::FWidget*, data_ptr);
|
||||||
void cb_activateButton (FWidget*, data_ptr);
|
void cb_activateButton (finalcut::FWidget*, data_ptr);
|
||||||
void cb_view (FWidget*, data_ptr);
|
void cb_view (finalcut::FWidget*, data_ptr);
|
||||||
void cb_setInput (FWidget*, data_ptr);
|
void cb_setInput (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FMenuItem* Open;
|
finalcut::FMenuItem* Open;
|
||||||
FMenuItem* Quit;
|
finalcut::FMenuItem* Quit;
|
||||||
FMenuItem* File1;
|
finalcut::FMenuItem* File1;
|
||||||
FMenuItem* File2;
|
finalcut::FMenuItem* File2;
|
||||||
FMenuItem* File3;
|
finalcut::FMenuItem* File3;
|
||||||
FMenuItem* Cut;
|
finalcut::FMenuItem* Cut;
|
||||||
FMenuItem* Copy;
|
finalcut::FMenuItem* Copy;
|
||||||
FMenuItem* Paste;
|
finalcut::FMenuItem* Paste;
|
||||||
FMenuItem* Clear;
|
finalcut::FMenuItem* Clear;
|
||||||
FMenuItem* Env;
|
finalcut::FMenuItem* Env;
|
||||||
FMenuItem* Drive;
|
finalcut::FMenuItem* Drive;
|
||||||
FMenuItem* Help;
|
finalcut::FMenuItem* Help;
|
||||||
FStatusKey* key_F1;
|
finalcut::FStatusKey* key_F1;
|
||||||
FStatusKey* key_F2;
|
finalcut::FStatusKey* key_F2;
|
||||||
FStatusKey* key_F3;
|
finalcut::FStatusKey* key_F3;
|
||||||
FButton* MyButton1;
|
finalcut::FButton* MyButton1;
|
||||||
FButton* MyButton2;
|
finalcut::FButton* MyButton2;
|
||||||
FButton* MyButton3;
|
finalcut::FButton* MyButton3;
|
||||||
FButton* MyButton4;
|
finalcut::FButton* MyButton4;
|
||||||
FButton* MyButton5;
|
finalcut::FButton* MyButton5;
|
||||||
FButton* MyButton6;
|
finalcut::FButton* MyButton6;
|
||||||
FRadioButton* radio1;
|
finalcut::FRadioButton* radio1;
|
||||||
FLabel* tagged_count;
|
finalcut::FLabel* tagged_count;
|
||||||
FLineEdit* myLineEdit;
|
finalcut::FLineEdit* myLineEdit;
|
||||||
FListBox* myList;
|
finalcut::FListBox* myList;
|
||||||
FString clipboard;
|
finalcut::FString clipboard;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
MyDialog::MyDialog (FWidget* parent)
|
MyDialog::MyDialog (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, Open()
|
, Open()
|
||||||
, Quit()
|
, Quit()
|
||||||
, File1()
|
, File1()
|
||||||
|
@ -387,62 +387,67 @@ MyDialog::~MyDialog() // destructor
|
||||||
void MyDialog::initMenu()
|
void MyDialog::initMenu()
|
||||||
{
|
{
|
||||||
// Menu bar
|
// Menu bar
|
||||||
FMenuBar* Menubar = new FMenuBar (this);
|
finalcut::FMenuBar* Menubar = new finalcut::FMenuBar (this);
|
||||||
|
|
||||||
// Menu bar items
|
// Menu bar items
|
||||||
FMenu* File = new FMenu ("&File", Menubar);
|
finalcut::FMenu* File = new finalcut::FMenu ("&File", Menubar);
|
||||||
File->setStatusbarMessage ("File management commands");
|
File->setStatusbarMessage ("File management commands");
|
||||||
FMenu* Edit = new FMenu ("&Edit", Menubar);
|
finalcut::FMenu* Edit = new finalcut::FMenu ("&Edit", Menubar);
|
||||||
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
|
Edit->setStatusbarMessage ("Cut-and-paste editing commands");
|
||||||
FMenu* View = new FMenu ("&View", Menubar);
|
finalcut::FMenu* View = new finalcut::FMenu ("&View", Menubar);
|
||||||
View->setStatusbarMessage ("Show internal informations");
|
View->setStatusbarMessage ("Show internal informations");
|
||||||
FMenuItem* Options = new FMenuItem ("&Options", Menubar);
|
finalcut::FMenuItem* Options = \
|
||||||
|
new finalcut::FMenuItem ("&Options", Menubar);
|
||||||
Options->setStatusbarMessage ("Set program defaults");
|
Options->setStatusbarMessage ("Set program defaults");
|
||||||
Options->setDisable();
|
Options->setDisable();
|
||||||
FDialogListMenu* Window = new FDialogListMenu ("&Window", Menubar);
|
finalcut::FDialogListMenu* Window = \
|
||||||
|
new finalcut::FDialogListMenu ("&Window", Menubar);
|
||||||
Window->setStatusbarMessage ("List of all the active dialogs");
|
Window->setStatusbarMessage ("List of all the active dialogs");
|
||||||
Help = new FMenuItem ("&Help", Menubar);
|
Help = new finalcut::FMenuItem ("&Help", Menubar);
|
||||||
Help->setStatusbarMessage ("Show version and copyright information");
|
Help->setStatusbarMessage ("Show version and copyright information");
|
||||||
|
|
||||||
// "File" menu items
|
// "File" menu items
|
||||||
Open = new FMenuItem ("&Open...", File);
|
Open = new finalcut::FMenuItem ("&Open...", File);
|
||||||
Open->addAccelerator (fc::Fckey_o); // Ctrl + O
|
Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
|
||||||
Open->setStatusbarMessage ("Locate and open a text file");
|
Open->setStatusbarMessage ("Locate and open a text file");
|
||||||
FMenu* Recent = new FMenu ("&System files", File);
|
finalcut::FMenu* Recent = new finalcut::FMenu ("&System files", File);
|
||||||
Recent->setStatusbarMessage ("View text file");
|
Recent->setStatusbarMessage ("View text file");
|
||||||
|
|
||||||
FMenuItem* Line1 = new FMenuItem (File);
|
finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File);
|
||||||
Line1->setSeparator();
|
Line1->setSeparator();
|
||||||
Quit = new FMenuItem ("&Quit", File);
|
Quit = new finalcut::FMenuItem ("&Quit", File);
|
||||||
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
|
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
|
||||||
Quit->setStatusbarMessage ("Exit the program");
|
Quit->setStatusbarMessage ("Exit the program");
|
||||||
|
|
||||||
// "Recent" menu items
|
// "Recent" menu items
|
||||||
File1 = new FMenuItem ("/etc/services", Recent);
|
File1 = new finalcut::FMenuItem ("/etc/services", Recent);
|
||||||
File2 = new FMenuItem ("/etc/fstab", Recent);
|
File2 = new finalcut::FMenuItem ("/etc/fstab", Recent);
|
||||||
File3 = new FMenuItem ("/etc/passwd", Recent);
|
File3 = new finalcut::FMenuItem ("/etc/passwd", Recent);
|
||||||
|
|
||||||
// "Edit" menu items
|
// "Edit" menu items
|
||||||
FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "Undo", Edit);
|
finalcut::FMenuItem* Undo = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_z, "Undo", Edit);
|
||||||
Undo->setDisable();
|
Undo->setDisable();
|
||||||
FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "Redo", Edit);
|
finalcut::FMenuItem* Redo = \
|
||||||
|
new finalcut::FMenuItem (finalcut::fc::Fckey_y, "Redo", Edit);
|
||||||
Redo->setDisable();
|
Redo->setDisable();
|
||||||
FMenuItem* Line2 = new FMenuItem (Edit);
|
finalcut::FMenuItem* Line2 = \
|
||||||
|
new finalcut::FMenuItem (Edit);
|
||||||
Line2->setSeparator();
|
Line2->setSeparator();
|
||||||
Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit);
|
Cut = new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit);
|
||||||
Cut->setStatusbarMessage ( "Remove the input text"
|
Cut->setStatusbarMessage ( "Remove the input text"
|
||||||
" and put it in the clipboard" );
|
" and put it in the clipboard" );
|
||||||
Copy= new FMenuItem (fc::Fckey_c, "&Copy", Edit);
|
Copy= new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit);
|
||||||
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
|
Copy->setStatusbarMessage ("Copy the input text into the clipboad");
|
||||||
Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit);
|
Paste = new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit);
|
||||||
Paste->setStatusbarMessage ("Insert text form clipboard");
|
Paste->setStatusbarMessage ("Insert text form clipboard");
|
||||||
Clear = new FMenuItem (fc::Fkey_dc, "C&lear", Edit);
|
Clear = new finalcut::FMenuItem (finalcut::fc::Fkey_dc, "C&lear", Edit);
|
||||||
Clear->setStatusbarMessage ("Delete input text");
|
Clear->setStatusbarMessage ("Delete input text");
|
||||||
|
|
||||||
// "View" menu items
|
// "View" menu items
|
||||||
Env = new FMenuItem ("&Terminal...", View);
|
Env = new finalcut::FMenuItem ("&Terminal...", View);
|
||||||
Env->setStatusbarMessage ("Informations about this terminal");
|
Env->setStatusbarMessage ("Informations about this terminal");
|
||||||
Drive = new FMenuItem ("&Drive symbols...", View);
|
Drive = new finalcut::FMenuItem ("&Drive symbols...", View);
|
||||||
Drive->setStatusbarMessage ("Show drive symbols");
|
Drive->setStatusbarMessage ("Show drive symbols");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +474,7 @@ void MyDialog::initFileMenuCallbacks()
|
||||||
Quit->addCallback
|
Quit->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
|
|
||||||
// System files submenu
|
// System files submenu
|
||||||
|
@ -477,21 +482,21 @@ void MyDialog::initFileMenuCallbacks()
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
||||||
static_cast<FWidget::data_ptr>(File1)
|
static_cast<finalcut::FWidget::data_ptr>(File1)
|
||||||
);
|
);
|
||||||
|
|
||||||
File2->addCallback
|
File2->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
||||||
static_cast<FWidget::data_ptr>(File2)
|
static_cast<finalcut::FWidget::data_ptr>(File2)
|
||||||
);
|
);
|
||||||
|
|
||||||
File3->addCallback
|
File3->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_view),
|
||||||
static_cast<FWidget::data_ptr>(File3)
|
static_cast<finalcut::FWidget::data_ptr>(File3)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,12 +560,12 @@ void MyDialog::initHelpMenuCallback()
|
||||||
void MyDialog::initStatusBar()
|
void MyDialog::initStatusBar()
|
||||||
{
|
{
|
||||||
// Statusbar at the bottom
|
// Statusbar at the bottom
|
||||||
FStatusBar* Statusbar = new FStatusBar (this);
|
finalcut::FStatusBar* Statusbar = new finalcut::FStatusBar (this);
|
||||||
|
|
||||||
// Statusbar keys
|
// Statusbar keys
|
||||||
key_F1 = new FStatusKey (fc::Fkey_f1, "About", Statusbar);
|
key_F1 = new finalcut::FStatusKey (finalcut::fc::Fkey_f1, "About", Statusbar);
|
||||||
key_F2 = new FStatusKey (fc::Fkey_f2, "View", Statusbar);
|
key_F2 = new finalcut::FStatusKey (finalcut::fc::Fkey_f2, "View", Statusbar);
|
||||||
key_F3 = new FStatusKey (fc::Fkey_f3, "Quit", Statusbar);
|
key_F3 = new finalcut::FStatusKey (finalcut::fc::Fkey_f3, "Quit", Statusbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -583,7 +588,7 @@ void MyDialog::initStatusBarCallbacks()
|
||||||
key_F3->addCallback
|
key_F3->addCallback
|
||||||
(
|
(
|
||||||
"activate",
|
"activate",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,24 +602,24 @@ void MyDialog::initWidgets()
|
||||||
initToggleButtons();
|
initToggleButtons();
|
||||||
|
|
||||||
// A text input field
|
// A text input field
|
||||||
myLineEdit = new FLineEdit (this);
|
myLineEdit = new finalcut::FLineEdit (this);
|
||||||
myLineEdit->setGeometry(22, 1, 10, 1);
|
myLineEdit->setGeometry(22, 1, 10, 1);
|
||||||
myLineEdit->setLabelText (L"&Input");
|
myLineEdit->setLabelText (L"&Input");
|
||||||
myLineEdit->setStatusbarMessage ("Press Enter to set the title");
|
myLineEdit->setStatusbarMessage ("Press Enter to set the title");
|
||||||
*myLineEdit << FString("EnTry").toLower();
|
*myLineEdit << finalcut::FString("EnTry").toLower();
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
initButtons();
|
initButtons();
|
||||||
|
|
||||||
// A multiple selection listbox
|
// A multiple selection listbox
|
||||||
myList = new FListBox (this);
|
myList = new finalcut::FListBox (this);
|
||||||
myList->setGeometry(38, 1, 14, 17);
|
myList->setGeometry(38, 1, 14, 17);
|
||||||
myList->setText ("Items");
|
myList->setText ("Items");
|
||||||
myList->setStatusbarMessage ("99 items in a list");
|
myList->setStatusbarMessage ("99 items in a list");
|
||||||
myList->setMultiSelection();
|
myList->setMultiSelection();
|
||||||
|
|
||||||
for (int z = 1; z < 100; z++)
|
for (int z = 1; z < 100; z++)
|
||||||
myList->insert (FString() << z << L" placeholder");
|
myList->insert (finalcut::FString() << z << L" placeholder");
|
||||||
|
|
||||||
// Text labels
|
// Text labels
|
||||||
initLabels();
|
initLabels();
|
||||||
|
@ -624,23 +629,23 @@ void MyDialog::initWidgets()
|
||||||
void MyDialog::initFlatButtons()
|
void MyDialog::initFlatButtons()
|
||||||
{
|
{
|
||||||
// Flat buttons
|
// Flat buttons
|
||||||
MyButton1 = new FButton (this);
|
MyButton1 = new finalcut::FButton (this);
|
||||||
MyButton1->setGeometry(3, 3, 5, 1);
|
MyButton1->setGeometry(3, 3, 5, 1);
|
||||||
MyButton1->setText (L"&SIN");
|
MyButton1->setText (L"&SIN");
|
||||||
MyButton1->setStatusbarMessage ("Sine function");
|
MyButton1->setStatusbarMessage ("Sine function");
|
||||||
MyButton1->setNoUnderline();
|
MyButton1->setNoUnderline();
|
||||||
MyButton1->setFlat();
|
MyButton1->setFlat();
|
||||||
MyButton1->setDoubleFlatLine (fc::bottom);
|
MyButton1->setDoubleFlatLine (finalcut::fc::bottom);
|
||||||
|
|
||||||
MyButton2 = new FButton (this);
|
MyButton2 = new finalcut::FButton (this);
|
||||||
MyButton2->setGeometry(3, 5, 5, 1);
|
MyButton2->setGeometry(3, 5, 5, 1);
|
||||||
MyButton2->setText (L"&COS");
|
MyButton2->setText (L"&COS");
|
||||||
MyButton2->setStatusbarMessage ("Cosine function");
|
MyButton2->setStatusbarMessage ("Cosine function");
|
||||||
MyButton2->setNoUnderline();
|
MyButton2->setNoUnderline();
|
||||||
MyButton2->setFlat();
|
MyButton2->setFlat();
|
||||||
MyButton2->setDoubleFlatLine (fc::top);
|
MyButton2->setDoubleFlatLine (finalcut::fc::top);
|
||||||
|
|
||||||
MyButton3 = new FButton (this);
|
MyButton3 = new finalcut::FButton (this);
|
||||||
MyButton3->setGeometry(10, 3, 5, 3);
|
MyButton3->setGeometry(10, 3, 5, 3);
|
||||||
MyButton3->setText (L"&=");
|
MyButton3->setText (L"&=");
|
||||||
MyButton3->setStatusbarMessage ("Equal");
|
MyButton3->setStatusbarMessage ("Equal");
|
||||||
|
@ -671,15 +676,17 @@ void MyDialog::initFlatButtons()
|
||||||
void MyDialog::initToggleButtons()
|
void MyDialog::initToggleButtons()
|
||||||
{
|
{
|
||||||
// Radio buttons in a group
|
// Radio buttons in a group
|
||||||
FButtonGroup* radioButtonGroup = new FButtonGroup ("Button", this);
|
finalcut::FButtonGroup* radioButtonGroup = \
|
||||||
|
new finalcut::FButtonGroup ("Button", this);
|
||||||
radioButtonGroup->setGeometry(3, 8, 14, 4);
|
radioButtonGroup->setGeometry(3, 8, 14, 4);
|
||||||
//radioButtonGroup->unsetBorder();
|
//radioButtonGroup->unsetBorder();
|
||||||
|
|
||||||
radio1 = new FRadioButton ("E&nable", radioButtonGroup);
|
radio1 = new finalcut::FRadioButton ("E&nable", radioButtonGroup);
|
||||||
radio1->setGeometry(1, 1, 10, 1);
|
radio1->setGeometry(1, 1, 10, 1);
|
||||||
radio1->setStatusbarMessage ("Enable button Test");
|
radio1->setStatusbarMessage ("Enable button Test");
|
||||||
|
|
||||||
FRadioButton* radio2 = new FRadioButton (radioButtonGroup);
|
finalcut::FRadioButton* radio2 = \
|
||||||
|
new finalcut::FRadioButton (radioButtonGroup);
|
||||||
radio2->setGeometry(1, 2, 11, 1);
|
radio2->setGeometry(1, 2, 11, 1);
|
||||||
radio2->setText ("&Disable");
|
radio2->setText ("&Disable");
|
||||||
radio2->setStatusbarMessage ("Disable button Test");
|
radio2->setStatusbarMessage ("Disable button Test");
|
||||||
|
@ -687,14 +694,17 @@ void MyDialog::initToggleButtons()
|
||||||
//radio2->setDisable();
|
//radio2->setDisable();
|
||||||
|
|
||||||
// Checkboxes in a group
|
// Checkboxes in a group
|
||||||
FButtonGroup* checkButtonGroup = new FButtonGroup ("Options", this);
|
finalcut::FButtonGroup* checkButtonGroup = \
|
||||||
|
new finalcut::FButtonGroup ("Options", this);
|
||||||
checkButtonGroup->setGeometry(3, 12, 14, 4);
|
checkButtonGroup->setGeometry(3, 12, 14, 4);
|
||||||
|
|
||||||
FCheckBox* check1 = new FCheckBox ("&Bitmode", checkButtonGroup);
|
finalcut::FCheckBox* check1 = \
|
||||||
|
new finalcut::FCheckBox ("&Bitmode", checkButtonGroup);
|
||||||
check1->setGeometry(1, 1, 11, 1);
|
check1->setGeometry(1, 1, 11, 1);
|
||||||
check1->setNoUnderline();
|
check1->setNoUnderline();
|
||||||
|
|
||||||
FCheckBox* check2 = new FCheckBox ("&8-Bit", checkButtonGroup);
|
finalcut::FCheckBox* check2 = \
|
||||||
|
new finalcut::FCheckBox ("&8-Bit", checkButtonGroup);
|
||||||
check2->setGeometry(1, 2, 9, 1);
|
check2->setGeometry(1, 2, 9, 1);
|
||||||
check2->setChecked();
|
check2->setChecked();
|
||||||
check2->setNoUnderline();
|
check2->setNoUnderline();
|
||||||
|
@ -704,19 +714,19 @@ void MyDialog::initToggleButtons()
|
||||||
void MyDialog::initButtons()
|
void MyDialog::initButtons()
|
||||||
{
|
{
|
||||||
// Buttons
|
// Buttons
|
||||||
MyButton4 = new FButton (this);
|
MyButton4 = new finalcut::FButton (this);
|
||||||
MyButton4->setGeometry(20, 8, 12, 1);
|
MyButton4->setGeometry(20, 8, 12, 1);
|
||||||
MyButton4->setText (L"&Get input");
|
MyButton4->setText (L"&Get input");
|
||||||
MyButton4->setStatusbarMessage ("Take text from input field");
|
MyButton4->setStatusbarMessage ("Take text from input field");
|
||||||
MyButton4->setFocus();
|
MyButton4->setFocus();
|
||||||
|
|
||||||
MyButton5 = new FButton (this);
|
MyButton5 = new finalcut::FButton (this);
|
||||||
MyButton5->setGeometry(20, 11, 12, 1);
|
MyButton5->setGeometry(20, 11, 12, 1);
|
||||||
MyButton5->setText (L"&Test");
|
MyButton5->setText (L"&Test");
|
||||||
MyButton5->setStatusbarMessage ("Progressbar testing dialog");
|
MyButton5->setStatusbarMessage ("Progressbar testing dialog");
|
||||||
MyButton5->setDisable();
|
MyButton5->setDisable();
|
||||||
|
|
||||||
MyButton6 = new FButton (this);
|
MyButton6 = new finalcut::FButton (this);
|
||||||
MyButton6->setGeometry(20, 14, 12, 1);
|
MyButton6->setGeometry(20, 14, 12, 1);
|
||||||
MyButton6->setText (L"&Quit");
|
MyButton6->setText (L"&Quit");
|
||||||
MyButton6->setStatusbarMessage ("Exit the program");
|
MyButton6->setStatusbarMessage ("Exit the program");
|
||||||
|
@ -727,7 +737,7 @@ void MyDialog::initButtons()
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText),
|
||||||
static_cast<FWidget::data_ptr>(myLineEdit)
|
static_cast<finalcut::FWidget::data_ptr>(myLineEdit)
|
||||||
);
|
);
|
||||||
|
|
||||||
MyButton5->addCallback
|
MyButton5->addCallback
|
||||||
|
@ -739,7 +749,7 @@ void MyDialog::initButtons()
|
||||||
MyButton6->addCallback
|
MyButton6->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,24 +757,24 @@ void MyDialog::initButtons()
|
||||||
void MyDialog::initLabels()
|
void MyDialog::initLabels()
|
||||||
{
|
{
|
||||||
// Text labels
|
// Text labels
|
||||||
FLabel* headline = new FLabel (this);
|
finalcut::FLabel* headline = new finalcut::FLabel (this);
|
||||||
headline->setGeometry(21, 3, 10, 1);
|
headline->setGeometry(21, 3, 10, 1);
|
||||||
headline->setEmphasis();
|
headline->setEmphasis();
|
||||||
headline->setAlignment (fc::alignCenter);
|
headline->setAlignment (finalcut::fc::alignCenter);
|
||||||
*headline = L"List items";
|
*headline = L"List items";
|
||||||
|
|
||||||
FLabel* tagged = new FLabel (L"Tagged:", this);
|
finalcut::FLabel* tagged = new finalcut::FLabel (L"Tagged:", this);
|
||||||
tagged->setGeometry(21, 4, 7, 1);
|
tagged->setGeometry(21, 4, 7, 1);
|
||||||
|
|
||||||
tagged_count = new FLabel(this);
|
tagged_count = new finalcut::FLabel(this);
|
||||||
tagged_count->setGeometry(29, 4, 5, 1);
|
tagged_count->setGeometry(29, 4, 5, 1);
|
||||||
*tagged_count << 0;
|
*tagged_count << 0;
|
||||||
|
|
||||||
FLabel* sum = new FLabel (L"Sum:", this);
|
finalcut::FLabel* sum = new finalcut::FLabel (L"Sum:", this);
|
||||||
sum->setGeometry(21, 5, 7, 3);
|
sum->setGeometry(21, 5, 7, 3);
|
||||||
sum->setAlignment (fc::alignRight);
|
sum->setAlignment (finalcut::fc::alignRight);
|
||||||
|
|
||||||
FLabel* sum_count = new FLabel (this);
|
finalcut::FLabel* sum_count = new finalcut::FLabel (this);
|
||||||
sum_count->setGeometry(29, 5, 5, 3);
|
sum_count->setGeometry(29, 5, 5, 3);
|
||||||
*sum_count << myList->getCount();
|
*sum_count << myList->getCount();
|
||||||
}
|
}
|
||||||
|
@ -784,21 +794,21 @@ void MyDialog::initWidgetsCallbacks()
|
||||||
(
|
(
|
||||||
"toggled",
|
"toggled",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton),
|
||||||
static_cast<FWidget::data_ptr>(MyButton5)
|
static_cast<finalcut::FWidget::data_ptr>(MyButton5)
|
||||||
);
|
);
|
||||||
|
|
||||||
myList->addCallback
|
myList->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_setInput),
|
||||||
static_cast<FWidget::data_ptr>(myLineEdit)
|
static_cast<finalcut::FWidget::data_ptr>(myLineEdit)
|
||||||
);
|
);
|
||||||
|
|
||||||
myList->addCallback
|
myList->addCallback
|
||||||
(
|
(
|
||||||
"row-selected",
|
"row-selected",
|
||||||
F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
|
F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber),
|
||||||
static_cast<FWidget::data_ptr>(tagged_count)
|
static_cast<finalcut::FWidget::data_ptr>(tagged_count)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,83 +827,91 @@ void MyDialog::adjustSize()
|
||||||
if ( myList )
|
if ( myList )
|
||||||
myList->setHeight (getHeight() - 3, false);
|
myList->setHeight (getHeight() - 3, false);
|
||||||
|
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::onClose (FCloseEvent* ev)
|
void MyDialog::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_noFunctionMsg (FWidget* widget, data_ptr)
|
void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, data_ptr)
|
||||||
{
|
{
|
||||||
FButton* button = static_cast<FButton*>(widget);
|
finalcut::FButton* button = static_cast<finalcut::FButton*>(widget);
|
||||||
FString text = button->getText();
|
finalcut::FString text = button->getText();
|
||||||
text = text.replace('&', "");
|
text = text.replace('&', "");
|
||||||
FMessageBox::error (this, "The \"" + text + "\" button has\n"
|
finalcut::FMessageBox::error ( this
|
||||||
|
, "The \"" + text + "\" button has\n"
|
||||||
"no function");
|
"no function");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_about (FWidget*, data_ptr)
|
void MyDialog::cb_about (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
const char libver[] = F_VERSION;
|
const char libver[] = F_VERSION;
|
||||||
FString line(2, wchar_t(fc::BoxDrawingsHorizontal));
|
finalcut::FString line(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal));
|
||||||
|
|
||||||
FMessageBox info ( "About"
|
finalcut::FMessageBox info ( "About"
|
||||||
, line + L" The Final Cut " + line + "\n\n"
|
, line + L" The Final Cut " + line + "\n\n"
|
||||||
L"Version " + libver + "\n\n"
|
L"Version " + libver + "\n\n"
|
||||||
L"(c) 2018 by Markus Gans"
|
L"(c) 2018 by Markus Gans"
|
||||||
, FMessageBox::Ok, 0, 0, this );
|
, finalcut::FMessageBox::Ok, 0, 0, this );
|
||||||
info.setCenterText();
|
info.setCenterText();
|
||||||
info.show();
|
info.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_terminfo (FWidget*, data_ptr)
|
void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
int x = getDesktopWidth();
|
int x = getDesktopWidth();
|
||||||
int y = getDesktopHeight();
|
int y = getDesktopHeight();
|
||||||
FMessageBox info1 ( "Environment"
|
finalcut::FMessageBox info1 \
|
||||||
, FString()
|
(
|
||||||
|
"Environment"
|
||||||
|
, finalcut::FString()
|
||||||
<< " Type: " << getTermType() << "\n"
|
<< " Type: " << getTermType() << "\n"
|
||||||
<< " Name: " << getTermFileName() << "\n"
|
<< " Name: " << getTermFileName() << "\n"
|
||||||
<< " Mode: " << getEncodingString() << "\n"
|
<< " Mode: " << getEncodingString() << "\n"
|
||||||
<< " Size: " << x << wchar_t(fc::Times)
|
<< " Size: " << x << wchar_t(finalcut::fc::Times)
|
||||||
<< y << "\n"
|
<< y << "\n"
|
||||||
<< "Colors: " << getMaxColor()
|
<< "Colors: " << getMaxColor()
|
||||||
, FMessageBox::Ok, 0, 0, this );
|
, finalcut::FMessageBox::Ok, 0, 0, this
|
||||||
|
);
|
||||||
info1.setHeadline("Terminal:");
|
info1.setHeadline("Terminal:");
|
||||||
info1.exec();
|
info1.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_drives (FWidget*, data_ptr)
|
void MyDialog::cb_drives (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
FMessageBox info2 ( "Drive symbols"
|
finalcut::FMessageBox info2 \
|
||||||
|
(
|
||||||
|
"Drive symbols"
|
||||||
, "Generic: \n\n"
|
, "Generic: \n\n"
|
||||||
"Network: \n\n"
|
"Network: \n\n"
|
||||||
" CD:"
|
" CD:"
|
||||||
, FMessageBox::Ok, 0, 0, this );
|
, finalcut::FMessageBox::Ok, 0, 0, this
|
||||||
|
);
|
||||||
|
|
||||||
if ( isNewFont() )
|
if ( isNewFont() )
|
||||||
{
|
{
|
||||||
FLabel drive (NF_Drive, &info2);
|
finalcut::FLabel drive (finalcut::NF_Drive, &info2);
|
||||||
drive.setGeometry (11, 2, 4, 1);
|
drive.setGeometry (11, 2, 4, 1);
|
||||||
FLabel net (NF_Net_Drive, &info2);
|
finalcut::FLabel net (finalcut::NF_Net_Drive, &info2);
|
||||||
net.setGeometry (11, 4, 4, 1);
|
net.setGeometry (11, 4, 4, 1);
|
||||||
FLabel cd (NF_CD_ROM, &info2);
|
finalcut::FLabel cd (finalcut::NF_CD_ROM, &info2);
|
||||||
cd.setGeometry (11, 6, 4, 1);
|
cd.setGeometry (11, 6, 4, 1);
|
||||||
info2.exec();
|
info2.exec();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FLabel drive (" - ", &info2);
|
finalcut::FLabel drive (" - ", &info2);
|
||||||
drive.setGeometry (11, 2, 4, 1);
|
drive.setGeometry (11, 2, 4, 1);
|
||||||
FLabel net (" N ", &info2);
|
finalcut::FLabel net (" N ", &info2);
|
||||||
net.setGeometry (11, 4, 4, 1);
|
net.setGeometry (11, 4, 4, 1);
|
||||||
FLabel cd (" CD ", &info2);
|
finalcut::FLabel cd (" CD ", &info2);
|
||||||
cd.setGeometry (11, 6, 4, 1);
|
cd.setGeometry (11, 6, 4, 1);
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
|
@ -904,12 +922,12 @@ void MyDialog::cb_drives (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
net.setForegroundColor (fc::White);
|
net.setForegroundColor (finalcut::fc::White);
|
||||||
net.setBackgroundColor (fc::DarkGray);
|
net.setBackgroundColor (finalcut::fc::DarkGray);
|
||||||
drive.setForegroundColor (fc::White);
|
drive.setForegroundColor (finalcut::fc::White);
|
||||||
drive.setBackgroundColor (fc::DarkGray);
|
drive.setBackgroundColor (finalcut::fc::DarkGray);
|
||||||
cd.setForegroundColor (fc::White);
|
cd.setForegroundColor (finalcut::fc::White);
|
||||||
cd.setBackgroundColor (fc::DarkGray);
|
cd.setBackgroundColor (finalcut::fc::DarkGray);
|
||||||
}
|
}
|
||||||
|
|
||||||
info2.exec();
|
info2.exec();
|
||||||
|
@ -917,7 +935,7 @@ void MyDialog::cb_drives (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_cutClipboard (FWidget*, data_ptr)
|
void MyDialog::cb_cutClipboard (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! myLineEdit )
|
if ( ! myLineEdit )
|
||||||
return;
|
return;
|
||||||
|
@ -928,7 +946,7 @@ void MyDialog::cb_cutClipboard (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_copyClipboard (FWidget*, data_ptr)
|
void MyDialog::cb_copyClipboard (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! myLineEdit )
|
if ( ! myLineEdit )
|
||||||
return;
|
return;
|
||||||
|
@ -937,7 +955,7 @@ void MyDialog::cb_copyClipboard (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_pasteClipboard (FWidget*, data_ptr)
|
void MyDialog::cb_pasteClipboard (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! myLineEdit )
|
if ( ! myLineEdit )
|
||||||
return;
|
return;
|
||||||
|
@ -947,7 +965,7 @@ void MyDialog::cb_pasteClipboard (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_clearInput (FWidget*, data_ptr)
|
void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! myLineEdit )
|
if ( ! myLineEdit )
|
||||||
return;
|
return;
|
||||||
|
@ -958,19 +976,19 @@ void MyDialog::cb_clearInput (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_input2buttonText (FWidget* widget, data_ptr data)
|
void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, data_ptr data)
|
||||||
{
|
{
|
||||||
FButton* button = static_cast<FButton*>(widget);
|
finalcut::FButton* button = static_cast<finalcut::FButton*>(widget);
|
||||||
FLineEdit* lineedit = static_cast<FLineEdit*>(data);
|
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(data);
|
||||||
button->setText( lineedit->getText() );
|
button->setText( lineedit->getText() );
|
||||||
button->redraw();
|
button->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr)
|
void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr)
|
||||||
{
|
{
|
||||||
FLineEdit* lineedit = static_cast<FLineEdit*>(widget);
|
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(widget);
|
||||||
FString title;
|
finalcut::FString title;
|
||||||
*lineedit >> title;
|
*lineedit >> title;
|
||||||
setTermTitle (title);
|
setTermTitle (title);
|
||||||
setText (title);
|
setText (title);
|
||||||
|
@ -978,17 +996,17 @@ void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_ProgressBar (FWidget*, data_ptr)
|
void MyDialog::cb_ProgressBar (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
ProgressDialog* p_dgl = new ProgressDialog(this);
|
ProgressDialog* p_dgl = new ProgressDialog(this);
|
||||||
p_dgl->show();
|
p_dgl->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data)
|
void MyDialog::cb_updateNumber (finalcut::FWidget* widget, data_ptr data)
|
||||||
{
|
{
|
||||||
FListBox* list = static_cast<FListBox*>(widget);
|
finalcut::FListBox* list = static_cast<finalcut::FListBox*>(widget);
|
||||||
FLabel* num = static_cast<FLabel*>(data);
|
finalcut::FLabel* num = static_cast<finalcut::FLabel*>(data);
|
||||||
int select_num = 0;
|
int select_num = 0;
|
||||||
uInt count = list->getCount();
|
uInt count = list->getCount();
|
||||||
|
|
||||||
|
@ -1002,10 +1020,10 @@ void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_activateButton (FWidget* widget, data_ptr data)
|
void MyDialog::cb_activateButton (finalcut::FWidget* widget, data_ptr data)
|
||||||
{
|
{
|
||||||
FRadioButton* rb = static_cast<FRadioButton*>(widget);
|
finalcut::FRadioButton* rb = static_cast<finalcut::FRadioButton*>(widget);
|
||||||
FButton* button = static_cast<FButton*>(data);
|
finalcut::FButton* button = static_cast<finalcut::FButton*>(data);
|
||||||
|
|
||||||
if ( rb->isChecked() )
|
if ( rb->isChecked() )
|
||||||
button->setEnable();
|
button->setEnable();
|
||||||
|
@ -1016,21 +1034,21 @@ void MyDialog::cb_activateButton (FWidget* widget, data_ptr data)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_view (FWidget*, data_ptr data)
|
void MyDialog::cb_view (finalcut::FWidget*, data_ptr data)
|
||||||
{
|
{
|
||||||
FString file;
|
finalcut::FString file;
|
||||||
FMenuItem* item = static_cast<FMenuItem*>(data);
|
finalcut::FMenuItem* item = static_cast<finalcut::FMenuItem*>(data);
|
||||||
|
|
||||||
if ( item && ! item->getText().isEmpty() )
|
if ( item && ! item->getText().isEmpty() )
|
||||||
file = item->getText();
|
file = item->getText();
|
||||||
else
|
else
|
||||||
file = FFileDialog::fileOpenChooser (this);
|
file = finalcut::FFileDialog::fileOpenChooser (this);
|
||||||
|
|
||||||
if ( file.isNull() )
|
if ( file.isNull() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TextWindow* view = new TextWindow(this);
|
TextWindow* view = new TextWindow(this);
|
||||||
FString filename(basename(const_cast<char*>(file.c_str())));
|
finalcut::FString filename(basename(const_cast<char*>(file.c_str())));
|
||||||
view->setText ("Viewer: " + filename);
|
view->setText ("Viewer: " + filename);
|
||||||
view->setGeometry ( 1 + int((getRootWidget()->getWidth() - 60) / 2),
|
view->setGeometry ( 1 + int((getRootWidget()->getWidth() - 60) / 2),
|
||||||
int(getRootWidget()->getHeight() / 6),
|
int(getRootWidget()->getHeight() / 6),
|
||||||
|
@ -1055,10 +1073,10 @@ void MyDialog::cb_view (FWidget*, data_ptr data)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_setInput (FWidget* widget, data_ptr data)
|
void MyDialog::cb_setInput (finalcut::FWidget* widget, data_ptr data)
|
||||||
{
|
{
|
||||||
FListBox* ListBox = static_cast<FListBox*>(widget);
|
finalcut::FListBox* ListBox = static_cast<finalcut::FListBox*>(widget);
|
||||||
FLineEdit* lineedit = static_cast<FLineEdit*>(data);
|
finalcut::FLineEdit* lineedit = static_cast<finalcut::FLineEdit*>(data);
|
||||||
*lineedit = ListBox->getItem(ListBox->currentItem()).getText();
|
*lineedit = ListBox->getItem(ListBox->currentItem()).getText();
|
||||||
lineedit->redraw();
|
lineedit->redraw();
|
||||||
}
|
}
|
||||||
|
@ -1070,11 +1088,13 @@ void MyDialog::cb_setInput (FWidget* widget, data_ptr data)
|
||||||
|
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
FString ver = F_VERSION; // Library version
|
finalcut::FString ver = F_VERSION; // Library version
|
||||||
FString title = "The FINAL CUT " + ver + " (C) 2018 by Markus Gans";
|
finalcut::FString title = "The FINAL CUT "
|
||||||
|
+ ver
|
||||||
|
+ " (C) 2018 by Markus Gans";
|
||||||
|
|
||||||
// Create the application object app
|
// Create the application object app
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
app.redefineDefaultColors(true);
|
app.redefineDefaultColors(true);
|
||||||
app.setTermTitle (title);
|
app.setTermTitle (title);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -31,11 +31,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Watch : public FDialog
|
class Watch : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Watch (FWidget* = 0);
|
explicit Watch (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Watch();
|
~Watch();
|
||||||
|
@ -44,12 +44,12 @@ class Watch : public FDialog
|
||||||
void printTime();
|
void printTime();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (finalcut::FTimerEvent*);
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_clock (FWidget*, data_ptr);
|
void cb_clock (finalcut::FWidget*, data_ptr);
|
||||||
void cb_seconds (FWidget*, data_ptr);
|
void cb_seconds (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
|
@ -64,16 +64,16 @@ class Watch : public FDialog
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
bool sec;
|
bool sec;
|
||||||
FLabel* time_label;
|
finalcut::FLabel* time_label;
|
||||||
FLabel* time_str;
|
finalcut::FLabel* time_str;
|
||||||
FSwitch* clock_sw;
|
finalcut::FSwitch* clock_sw;
|
||||||
FSwitch* seconds_sw;
|
finalcut::FSwitch* seconds_sw;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Watch::Watch (FWidget* parent)
|
Watch::Watch (FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, sec(true)
|
, sec(true)
|
||||||
, time_label(0)
|
, time_label(0)
|
||||||
, time_str(0)
|
, time_str(0)
|
||||||
|
@ -85,21 +85,21 @@ Watch::Watch (FWidget* parent)
|
||||||
setGeometry (1 + (pw - 22) / 2, 3, 22, 13);
|
setGeometry (1 + (pw - 22) / 2, 3, 22, 13);
|
||||||
|
|
||||||
// Create labels
|
// Create labels
|
||||||
time_label = new FLabel(L"Time", this);
|
time_label = new finalcut::FLabel(L"Time", this);
|
||||||
time_label->setGeometry(5, 2, 5, 1);
|
time_label->setGeometry(5, 2, 5, 1);
|
||||||
time_label->setEmphasis();
|
time_label->setEmphasis();
|
||||||
time_str = new FLabel(L"--:--:--", this);
|
time_str = new finalcut::FLabel(L"--:--:--", this);
|
||||||
time_str->setGeometry(10, 2, 8, 1);
|
time_str->setGeometry(10, 2, 8, 1);
|
||||||
|
|
||||||
// Create checkbox buttons
|
// Create checkbox buttons
|
||||||
clock_sw = new FSwitch(L"Clock", this);
|
clock_sw = new finalcut::FSwitch(L"Clock", this);
|
||||||
seconds_sw = new FSwitch(L"Seconds", this);
|
seconds_sw = new finalcut::FSwitch(L"Seconds", this);
|
||||||
clock_sw->setGeometry(4, 4, 9, 1);
|
clock_sw->setGeometry(4, 4, 9, 1);
|
||||||
seconds_sw->setGeometry(2, 6, 11, 1);
|
seconds_sw->setGeometry(2, 6, 11, 1);
|
||||||
sec = seconds_sw->setChecked();
|
sec = seconds_sw->setChecked();
|
||||||
|
|
||||||
// Create button
|
// Create button
|
||||||
FButton* quit_btn = new FButton(L"&Quit", this);
|
finalcut::FButton* quit_btn = new finalcut::FButton(L"&Quit", this);
|
||||||
quit_btn->setGeometry(6, 9, 9, 1);
|
quit_btn->setGeometry(6, 9, 9, 1);
|
||||||
|
|
||||||
// Connect switch signal "toggled" with a callback member function
|
// Connect switch signal "toggled" with a callback member function
|
||||||
|
@ -120,7 +120,7 @@ Watch::Watch (FWidget* parent)
|
||||||
quit_btn->addCallback
|
quit_btn->addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
F_METHOD_CALLBACK (this, &FApplication::cb_exitApp)
|
F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ Watch::~Watch()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Watch::printTime()
|
void Watch::printTime()
|
||||||
{
|
{
|
||||||
FString str;
|
finalcut::FString str;
|
||||||
std::tm now;
|
std::tm now;
|
||||||
std::time_t t;
|
std::time_t t;
|
||||||
|
|
||||||
|
@ -150,19 +150,19 @@ void Watch::printTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Watch::onTimer (FTimerEvent*)
|
void Watch::onTimer (finalcut::FTimerEvent*)
|
||||||
{
|
{
|
||||||
printTime();
|
printTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Watch::onClose (FCloseEvent* ev)
|
void Watch::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Watch::cb_clock (FWidget*, data_ptr)
|
void Watch::cb_clock (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( clock_sw->isChecked() )
|
if ( clock_sw->isChecked() )
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ void Watch::cb_clock (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Watch::cb_seconds (FWidget*, data_ptr)
|
void Watch::cb_seconds (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( seconds_sw->isChecked() )
|
if ( seconds_sw->isChecked() )
|
||||||
sec = true;
|
sec = true;
|
||||||
|
@ -203,7 +203,7 @@ void Watch::adjustSize()
|
||||||
{
|
{
|
||||||
int pw = getParentWidget()->getWidth();
|
int pw = getParentWidget()->getWidth();
|
||||||
setX (1 + (pw - 22) / 2, false);
|
setX (1 + (pw - 22) / 2, false);
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -212,7 +212,7 @@ void Watch::adjustSize()
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app(argc, argv);
|
finalcut::FApplication app(argc, argv);
|
||||||
|
|
||||||
// Create a simple dialog box
|
// Create a simple dialog box
|
||||||
Watch w(&app);
|
Watch w(&app);
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class SmallWindow : public FDialog
|
class SmallWindow : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit SmallWindow (FWidget* = 0);
|
explicit SmallWindow (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~SmallWindow();
|
~SmallWindow();
|
||||||
|
@ -51,21 +51,21 @@ class SmallWindow : public FDialog
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onShow (FShowEvent*);
|
void onShow (finalcut::FShowEvent*);
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (finalcut::FTimerEvent*);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FLabel* left_arrow;
|
finalcut::FLabel* left_arrow;
|
||||||
FLabel* right_arrow;
|
finalcut::FLabel* right_arrow;
|
||||||
FLabel* top_left_label;
|
finalcut::FLabel* top_left_label;
|
||||||
FLabel* top_right_label;
|
finalcut::FLabel* top_right_label;
|
||||||
FLabel* bottom_label;
|
finalcut::FLabel* bottom_label;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
SmallWindow::SmallWindow (FWidget* parent)
|
SmallWindow::SmallWindow (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, left_arrow()
|
, left_arrow()
|
||||||
, right_arrow()
|
, right_arrow()
|
||||||
, top_left_label()
|
, top_left_label()
|
||||||
|
@ -74,39 +74,39 @@ SmallWindow::SmallWindow (FWidget* parent)
|
||||||
{
|
{
|
||||||
wchar_t arrow_up, arrow_down;
|
wchar_t arrow_up, arrow_down;
|
||||||
|
|
||||||
arrow_up = fc::BlackUpPointingTriangle;
|
arrow_up = finalcut::fc::BlackUpPointingTriangle;
|
||||||
arrow_down = fc::BlackDownPointingTriangle;
|
arrow_down = finalcut::fc::BlackDownPointingTriangle;
|
||||||
|
|
||||||
left_arrow = new FLabel (arrow_up, this);
|
left_arrow = new finalcut::FLabel (arrow_up, this);
|
||||||
left_arrow->setForegroundColor (wc.label_inactive_fg);
|
left_arrow->setForegroundColor (wc.label_inactive_fg);
|
||||||
left_arrow->setEmphasis();
|
left_arrow->setEmphasis();
|
||||||
left_arrow->ignorePadding();
|
left_arrow->ignorePadding();
|
||||||
left_arrow->setGeometry (2, 2, 1, 1);
|
left_arrow->setGeometry (2, 2, 1, 1);
|
||||||
|
|
||||||
right_arrow = new FLabel (arrow_up, this);
|
right_arrow = new finalcut::FLabel (arrow_up, this);
|
||||||
right_arrow->setForegroundColor (wc.label_inactive_fg);
|
right_arrow->setForegroundColor (wc.label_inactive_fg);
|
||||||
right_arrow->setEmphasis();
|
right_arrow->setEmphasis();
|
||||||
right_arrow->ignorePadding();
|
right_arrow->ignorePadding();
|
||||||
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
|
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
|
||||||
|
|
||||||
const FString& top_left_label_text = "menu";
|
const finalcut::FString& top_left_label_text = "menu";
|
||||||
top_left_label = new FLabel (top_left_label_text, this);
|
top_left_label = new finalcut::FLabel (top_left_label_text, this);
|
||||||
top_left_label->setForegroundColor (wc.label_inactive_fg);
|
top_left_label->setForegroundColor (wc.label_inactive_fg);
|
||||||
top_left_label->setEmphasis();
|
top_left_label->setEmphasis();
|
||||||
top_left_label->setGeometry (1, 1, 6, 1);
|
top_left_label->setGeometry (1, 1, 6, 1);
|
||||||
|
|
||||||
const FString& top_right_label_text = "zoom";
|
const finalcut::FString& top_right_label_text = "zoom";
|
||||||
top_right_label = new FLabel (top_right_label_text, this);
|
top_right_label = new finalcut::FLabel (top_right_label_text, this);
|
||||||
top_right_label->setAlignment (fc::alignRight);
|
top_right_label->setAlignment (finalcut::fc::alignRight);
|
||||||
top_right_label->setForegroundColor (wc.label_inactive_fg);
|
top_right_label->setForegroundColor (wc.label_inactive_fg);
|
||||||
top_right_label->setEmphasis();
|
top_right_label->setEmphasis();
|
||||||
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
|
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
|
||||||
|
|
||||||
FString bottom_label_text = "resize\n"
|
finalcut::FString bottom_label_text = "resize\n"
|
||||||
"corner\n";
|
"corner\n";
|
||||||
bottom_label_text += arrow_down;
|
bottom_label_text += arrow_down;
|
||||||
bottom_label = new FLabel (bottom_label_text, this);
|
bottom_label = new finalcut::FLabel (bottom_label_text, this);
|
||||||
bottom_label->setAlignment (fc::alignRight);
|
bottom_label->setAlignment (finalcut::fc::alignRight);
|
||||||
bottom_label->setForegroundColor (wc.label_inactive_fg);
|
bottom_label->setForegroundColor (wc.label_inactive_fg);
|
||||||
bottom_label->setEmphasis();
|
bottom_label->setEmphasis();
|
||||||
bottom_label->setGeometry (13, 3, 6, 3);
|
bottom_label->setGeometry (13, 3, 6, 3);
|
||||||
|
@ -133,20 +133,20 @@ void SmallWindow::adjustSize()
|
||||||
bottom_label->setVisible();
|
bottom_label->setVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
|
right_arrow->setGeometry (getWidth() - 1, 2, 1, 1);
|
||||||
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
|
top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1);
|
||||||
bottom_label->setGeometry (1, getClientHeight() - 2, getClientWidth(), 3);
|
bottom_label->setGeometry (1, getClientHeight() - 2, getClientWidth(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void SmallWindow::onShow (FShowEvent*)
|
void SmallWindow::onShow (finalcut::FShowEvent*)
|
||||||
{
|
{
|
||||||
addTimer(1000);
|
addTimer(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void SmallWindow::onTimer (FTimerEvent*)
|
void SmallWindow::onTimer (finalcut::FTimerEvent*)
|
||||||
{
|
{
|
||||||
left_arrow->unsetEmphasis();
|
left_arrow->unsetEmphasis();
|
||||||
left_arrow->redraw();
|
left_arrow->redraw();
|
||||||
|
@ -170,23 +170,23 @@ void SmallWindow::onTimer (FTimerEvent*)
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
class Window : public FDialog
|
class Window : public finalcut::FDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit Window (FWidget* = 0);
|
explicit Window (finalcut::FWidget* = 0);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Window();
|
~Window();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedefs
|
// Typedefs
|
||||||
typedef void (Window::*WindowCallback)(FWidget*, data_ptr);
|
typedef void (Window::*WindowCallback)(finalcut::FWidget*, data_ptr);
|
||||||
typedef void (FApplication::*FAppCallback)(FWidget*, data_ptr);
|
typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, data_ptr);
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
bool is_open;
|
bool is_open;
|
||||||
FString* title;
|
finalcut::FString* title;
|
||||||
SmallWindow* dgl;
|
SmallWindow* dgl;
|
||||||
}
|
}
|
||||||
win_data;
|
win_data;
|
||||||
|
@ -198,22 +198,22 @@ class Window : public FDialog
|
||||||
Window& operator = (const Window&);
|
Window& operator = (const Window&);
|
||||||
|
|
||||||
// Method
|
// Method
|
||||||
void createFileMenuItems (FMenu*);
|
void createFileMenuItems (finalcut::FMenu*);
|
||||||
void createDialogButtons();
|
void createDialogButtons();
|
||||||
void activateWindow (FDialog*);
|
void activateWindow (finalcut::FDialog*);
|
||||||
void adjustSize();
|
void adjustSize();
|
||||||
void addClickedCallback (FWidget*, WindowCallback);
|
void addClickedCallback (finalcut::FWidget*, WindowCallback);
|
||||||
void addClickedCallback (FWidget*, FAppCallback);
|
void addClickedCallback (finalcut::FWidget*, FAppCallback);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*);
|
void onClose (finalcut::FCloseEvent*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_createWindows (FWidget*, data_ptr);
|
void cb_createWindows (finalcut::FWidget*, data_ptr);
|
||||||
void cb_closeWindows (FWidget*, data_ptr);
|
void cb_closeWindows (finalcut::FWidget*, data_ptr);
|
||||||
void cb_next (FWidget*, data_ptr);
|
void cb_next (finalcut::FWidget*, data_ptr);
|
||||||
void cb_previous (FWidget*, data_ptr);
|
void cb_previous (finalcut::FWidget*, data_ptr);
|
||||||
void cb_destroyWindow (FWidget*, data_ptr);
|
void cb_destroyWindow (finalcut::FWidget*, data_ptr);
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
std::vector<win_data*> windows;
|
std::vector<win_data*> windows;
|
||||||
|
@ -221,26 +221,26 @@ class Window : public FDialog
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
Window::Window (FWidget* parent)
|
Window::Window (finalcut::FWidget* parent)
|
||||||
: FDialog(parent)
|
: finalcut::FDialog(parent)
|
||||||
, windows()
|
, windows()
|
||||||
{
|
{
|
||||||
FMenu* File;
|
finalcut::FMenu* File;
|
||||||
FDialogListMenu* DglList;
|
finalcut::FDialogListMenu* DglList;
|
||||||
FString drop_down_symbol;
|
finalcut::FString drop_down_symbol;
|
||||||
FMenuBar* Menubar;
|
finalcut::FMenuBar* Menubar;
|
||||||
FStatusBar* Statusbar;
|
finalcut::FStatusBar* Statusbar;
|
||||||
|
|
||||||
// Menu bar
|
// Menu bar
|
||||||
Menubar = new FMenuBar (this);
|
Menubar = new finalcut::FMenuBar (this);
|
||||||
|
|
||||||
// Menu bar item
|
// Menu bar item
|
||||||
File = new FMenu ("&File", Menubar);
|
File = new finalcut::FMenu ("&File", Menubar);
|
||||||
File->setStatusbarMessage ("File management commands");
|
File->setStatusbarMessage ("File management commands");
|
||||||
|
|
||||||
// Dialog list menu item
|
// Dialog list menu item
|
||||||
drop_down_symbol = wchar_t(fc::BlackDownPointingTriangle);
|
drop_down_symbol = wchar_t(finalcut::fc::BlackDownPointingTriangle);
|
||||||
DglList = new FDialogListMenu (drop_down_symbol, Menubar);
|
DglList = new finalcut::FDialogListMenu (drop_down_symbol, Menubar);
|
||||||
DglList->setStatusbarMessage ("List of all the active dialogs");
|
DglList->setStatusbarMessage ("List of all the active dialogs");
|
||||||
|
|
||||||
// File menu items
|
// File menu items
|
||||||
|
@ -250,7 +250,7 @@ Window::Window (FWidget* parent)
|
||||||
createDialogButtons();
|
createDialogButtons();
|
||||||
|
|
||||||
// Statusbar at the bottom
|
// Statusbar at the bottom
|
||||||
Statusbar = new FStatusBar (this);
|
Statusbar = new finalcut::FStatusBar (this);
|
||||||
Statusbar->setMessage("Status bar message");
|
Statusbar->setMessage("Status bar message");
|
||||||
|
|
||||||
// Generate data vector for the windows
|
// Generate data vector for the windows
|
||||||
|
@ -258,7 +258,7 @@ Window::Window (FWidget* parent)
|
||||||
{
|
{
|
||||||
win_data* win_dat = new win_data;
|
win_data* win_dat = new win_data;
|
||||||
win_dat->is_open = false;
|
win_dat->is_open = false;
|
||||||
win_dat->title = new FString();
|
win_dat->title = new finalcut::FString();
|
||||||
win_dat->title->sprintf("Window %d", n);
|
win_dat->title->sprintf("Window %d", n);
|
||||||
windows.push_back(win_dat);
|
windows.push_back(win_dat);
|
||||||
}
|
}
|
||||||
|
@ -285,31 +285,31 @@ Window::~Window()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::createFileMenuItems (FMenu* File)
|
void Window::createFileMenuItems (finalcut::FMenu* File)
|
||||||
{
|
{
|
||||||
// "File" menu item
|
// "File" menu item
|
||||||
FMenuItem* New = new FMenuItem ("&New", File);
|
finalcut::FMenuItem* New = new finalcut::FMenuItem ("&New", File);
|
||||||
New->setStatusbarMessage ("Create the windows");
|
New->setStatusbarMessage ("Create the windows");
|
||||||
|
|
||||||
FMenuItem* Close = new FMenuItem ("&Close", File);
|
finalcut::FMenuItem* Close = new finalcut::FMenuItem ("&Close", File);
|
||||||
Close->setStatusbarMessage ("Close the windows");
|
Close->setStatusbarMessage ("Close the windows");
|
||||||
|
|
||||||
FMenuItem* Line1 = new FMenuItem (File);
|
finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File);
|
||||||
Line1->setSeparator();
|
Line1->setSeparator();
|
||||||
|
|
||||||
FMenuItem* Next = new FMenuItem ("Ne&xt window", File);
|
finalcut::FMenuItem* Next = new finalcut::FMenuItem ("Ne&xt window", File);
|
||||||
Next->addAccelerator (fc::Fmkey_npage); // Meta/Alt + PgDn
|
Next->addAccelerator (finalcut::fc::Fmkey_npage); // Meta/Alt + PgDn
|
||||||
Next->setStatusbarMessage ("Switch to the next window");
|
Next->setStatusbarMessage ("Switch to the next window");
|
||||||
|
|
||||||
FMenuItem* Previous = new FMenuItem ("&Previous window", File);
|
finalcut::FMenuItem* Previous = new finalcut::FMenuItem ("&Previous window", File);
|
||||||
Previous->addAccelerator (fc::Fmkey_ppage); // Meta/Alt + PgUp
|
Previous->addAccelerator (finalcut::fc::Fmkey_ppage); // Meta/Alt + PgUp
|
||||||
Previous->setStatusbarMessage ("Switch to the previous window");
|
Previous->setStatusbarMessage ("Switch to the previous window");
|
||||||
|
|
||||||
FMenuItem* Line2 = new FMenuItem (File);
|
finalcut::FMenuItem* Line2 = new finalcut::FMenuItem (File);
|
||||||
Line2->setSeparator();
|
Line2->setSeparator();
|
||||||
|
|
||||||
FMenuItem* Quit = new FMenuItem ("&Quit", File);
|
finalcut::FMenuItem* Quit = new finalcut::FMenuItem ("&Quit", File);
|
||||||
Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X
|
Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
|
||||||
Quit->setStatusbarMessage ("Exit the program");
|
Quit->setStatusbarMessage ("Exit the program");
|
||||||
|
|
||||||
// Add menu item callback
|
// Add menu item callback
|
||||||
|
@ -317,38 +317,38 @@ void Window::createFileMenuItems (FMenu* File)
|
||||||
addClickedCallback (Close, &Window::cb_closeWindows);
|
addClickedCallback (Close, &Window::cb_closeWindows);
|
||||||
addClickedCallback (Next, &Window::cb_next);
|
addClickedCallback (Next, &Window::cb_next);
|
||||||
addClickedCallback (Previous, &Window::cb_previous);
|
addClickedCallback (Previous, &Window::cb_previous);
|
||||||
addClickedCallback (Quit, &FApplication::cb_exitApp);
|
addClickedCallback (Quit, &finalcut::FApplication::cb_exitApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::createDialogButtons()
|
void Window::createDialogButtons()
|
||||||
{
|
{
|
||||||
// Dialog buttons
|
// Dialog buttons
|
||||||
FButton* CreateButton = new FButton (this);
|
finalcut::FButton* CreateButton = new finalcut::FButton (this);
|
||||||
CreateButton->setGeometry(2, 2, 9, 1);
|
CreateButton->setGeometry(2, 2, 9, 1);
|
||||||
CreateButton->setText (L"&Create");
|
CreateButton->setText (L"&Create");
|
||||||
|
|
||||||
FButton* CloseButton = new FButton (this);
|
finalcut::FButton* CloseButton = new finalcut::FButton (this);
|
||||||
CloseButton->setGeometry(15, 2, 9, 1);
|
CloseButton->setGeometry(15, 2, 9, 1);
|
||||||
CloseButton->setText (L"C&lose");
|
CloseButton->setText (L"C&lose");
|
||||||
|
|
||||||
FButton* QuitButton = new FButton (this);
|
finalcut::FButton* QuitButton = new finalcut::FButton (this);
|
||||||
QuitButton->setGeometry(28, 2, 9, 1);
|
QuitButton->setGeometry(28, 2, 9, 1);
|
||||||
QuitButton->setText (L"&Quit");
|
QuitButton->setText (L"&Quit");
|
||||||
|
|
||||||
// Add button callback
|
// Add button callback
|
||||||
addClickedCallback (CreateButton, &Window::cb_createWindows);
|
addClickedCallback (CreateButton, &Window::cb_createWindows);
|
||||||
addClickedCallback (CloseButton, &Window::cb_closeWindows);
|
addClickedCallback (CloseButton, &Window::cb_closeWindows);
|
||||||
addClickedCallback (QuitButton, &FApplication::cb_exitApp);
|
addClickedCallback (QuitButton, &finalcut::FApplication::cb_exitApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::activateWindow (FDialog* win)
|
void Window::activateWindow (finalcut::FDialog* win)
|
||||||
{
|
{
|
||||||
if ( ! win || win->isWindowHidden() || win->isWindowActive() )
|
if ( ! win || win->isWindowHidden() || win->isWindowActive() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool has_raised = FWindow::raiseWindow(win);
|
bool has_raised = finalcut::FWindow::raiseWindow(win);
|
||||||
win->activateDialog();
|
win->activateDialog();
|
||||||
|
|
||||||
if ( has_raised )
|
if ( has_raised )
|
||||||
|
@ -387,14 +387,15 @@ void Window::adjustSize()
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDialog::adjustSize();
|
finalcut::FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::addClickedCallback (FWidget* widget, WindowCallback call)
|
void Window::addClickedCallback ( finalcut::FWidget* widget
|
||||||
|
, WindowCallback call )
|
||||||
{
|
{
|
||||||
FMemberCallback callback
|
FMemberCallback callback
|
||||||
= reinterpret_cast<FWidget::FMemberCallback>(call);
|
= reinterpret_cast<finalcut::FWidget::FMemberCallback>(call);
|
||||||
|
|
||||||
widget->addCallback
|
widget->addCallback
|
||||||
(
|
(
|
||||||
|
@ -404,10 +405,11 @@ void Window::addClickedCallback (FWidget* widget, WindowCallback call)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::addClickedCallback (FWidget* widget, FAppCallback call)
|
void Window::addClickedCallback ( finalcut::FWidget* widget
|
||||||
|
, FAppCallback call )
|
||||||
{
|
{
|
||||||
FMemberCallback callback
|
FMemberCallback callback
|
||||||
= reinterpret_cast<FWidget::FMemberCallback>(call);
|
= reinterpret_cast<finalcut::FWidget::FMemberCallback>(call);
|
||||||
|
|
||||||
widget->addCallback
|
widget->addCallback
|
||||||
(
|
(
|
||||||
|
@ -417,13 +419,13 @@ void Window::addClickedCallback (FWidget* widget, FAppCallback call)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::onClose (FCloseEvent* ev)
|
void Window::onClose (finalcut::FCloseEvent* ev)
|
||||||
{
|
{
|
||||||
FApplication::closeConfirmationDialog (this, ev);
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::cb_createWindows (FWidget*, data_ptr)
|
void Window::cb_createWindows (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
std::vector<win_data*>::const_iterator iter, first;
|
std::vector<win_data*>::const_iterator iter, first;
|
||||||
iter = first = windows.begin();
|
iter = first = windows.begin();
|
||||||
|
@ -453,7 +455,7 @@ void Window::cb_createWindows (FWidget*, data_ptr)
|
||||||
(
|
(
|
||||||
"destroy",
|
"destroy",
|
||||||
F_METHOD_CALLBACK (this, &Window::cb_destroyWindow),
|
F_METHOD_CALLBACK (this, &Window::cb_destroyWindow),
|
||||||
static_cast<FWidget::data_ptr>(win_dat)
|
static_cast<finalcut::FWidget::data_ptr>(win_dat)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,12 +466,12 @@ void Window::cb_createWindows (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::cb_closeWindows (FWidget*, data_ptr)
|
void Window::cb_closeWindows (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! dialog_list || dialog_list->empty() )
|
if ( ! dialog_list || dialog_list->empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widgetList::const_iterator iter, first;
|
finalcut::FWidget::widgetList::const_iterator iter, first;
|
||||||
iter = dialog_list->end();
|
iter = dialog_list->end();
|
||||||
first = dialog_list->begin();
|
first = dialog_list->begin();
|
||||||
activateWindow(this);
|
activateWindow(this);
|
||||||
|
@ -485,20 +487,20 @@ void Window::cb_closeWindows (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::cb_next (FWidget*, data_ptr)
|
void Window::cb_next (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! dialog_list || dialog_list->empty() )
|
if ( ! dialog_list || dialog_list->empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widgetList::const_iterator iter;
|
finalcut::FWidget::widgetList::const_iterator iter;
|
||||||
iter = dialog_list->begin();
|
iter = dialog_list->begin();
|
||||||
|
|
||||||
while ( iter != dialog_list->end() )
|
while ( iter != dialog_list->end() )
|
||||||
{
|
{
|
||||||
if ( static_cast<FWindow*>(*iter)->isWindowActive() )
|
if ( static_cast<finalcut::FWindow*>(*iter)->isWindowActive() )
|
||||||
{
|
{
|
||||||
FDialog* next;
|
finalcut::FDialog* next;
|
||||||
widgetList::const_iterator next_element;
|
finalcut::FWidget::widgetList::const_iterator next_element;
|
||||||
next_element = iter;
|
next_element = iter;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -508,7 +510,7 @@ void Window::cb_next (FWidget*, data_ptr)
|
||||||
if ( next_element == dialog_list->end() )
|
if ( next_element == dialog_list->end() )
|
||||||
next_element = dialog_list->begin();
|
next_element = dialog_list->begin();
|
||||||
|
|
||||||
next = static_cast<FDialog*>(*next_element);
|
next = static_cast<finalcut::FDialog*>(*next_element);
|
||||||
} while ( ! next->isEnabled()
|
} while ( ! next->isEnabled()
|
||||||
|| ! next->acceptFocus()
|
|| ! next->acceptFocus()
|
||||||
|| ! next->isVisible()
|
|| ! next->isVisible()
|
||||||
|
@ -523,12 +525,12 @@ void Window::cb_next (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::cb_previous (FWidget*, data_ptr)
|
void Window::cb_previous (finalcut::FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
if ( ! dialog_list || dialog_list->empty() )
|
if ( ! dialog_list || dialog_list->empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widgetList::const_iterator iter;
|
finalcut::FWidget::widgetList::const_iterator iter;
|
||||||
iter = dialog_list->end();
|
iter = dialog_list->end();
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -536,10 +538,10 @@ void Window::cb_previous (FWidget*, data_ptr)
|
||||||
--iter;
|
--iter;
|
||||||
|
|
||||||
if ( (*iter)->isDialogWidget()
|
if ( (*iter)->isDialogWidget()
|
||||||
&& static_cast<FWindow*>(*iter)->isWindowActive() )
|
&& static_cast<finalcut::FWindow*>(*iter)->isWindowActive() )
|
||||||
{
|
{
|
||||||
FDialog* prev;
|
finalcut::FDialog* prev;
|
||||||
widgetList::const_iterator prev_element;
|
finalcut::FWidget::widgetList::const_iterator prev_element;
|
||||||
prev_element = iter;
|
prev_element = iter;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -548,7 +550,7 @@ void Window::cb_previous (FWidget*, data_ptr)
|
||||||
prev_element = dialog_list->end();
|
prev_element = dialog_list->end();
|
||||||
|
|
||||||
--prev_element;
|
--prev_element;
|
||||||
prev = static_cast<FDialog*>(*prev_element);
|
prev = static_cast<finalcut::FDialog*>(*prev_element);
|
||||||
} while ( ! prev->isEnabled()
|
} while ( ! prev->isEnabled()
|
||||||
|| ! prev->acceptFocus()
|
|| ! prev->acceptFocus()
|
||||||
|| ! prev->isVisible()
|
|| ! prev->isVisible()
|
||||||
|
@ -562,7 +564,7 @@ void Window::cb_previous (FWidget*, data_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Window::cb_destroyWindow (FWidget*, data_ptr data)
|
void Window::cb_destroyWindow (finalcut::FWidget*, data_ptr data)
|
||||||
{
|
{
|
||||||
win_data* win_dat = static_cast<win_data*>(data);
|
win_data* win_dat = static_cast<win_data*>(data);
|
||||||
|
|
||||||
|
@ -581,7 +583,7 @@ void Window::cb_destroyWindow (FWidget*, data_ptr data)
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Create the application object
|
// Create the application object
|
||||||
FApplication app (argc, argv);
|
finalcut::FApplication app (argc, argv);
|
||||||
|
|
||||||
// Create main dialog object
|
// Create main dialog object
|
||||||
Window main_dlg (&app);
|
Window main_dlg (&app);
|
||||||
|
|
|
@ -8,8 +8,9 @@ FONTFILE="8x16graph.bdf"
|
||||||
echo -e "// newfont.h\\n"
|
echo -e "// newfont.h\\n"
|
||||||
echo -e "#ifndef FNEWFONT_H"
|
echo -e "#ifndef FNEWFONT_H"
|
||||||
echo -e "#define FNEWFONT_H\\n"
|
echo -e "#define FNEWFONT_H\\n"
|
||||||
echo -e "namespace fc\\n{"
|
echo -e "namespace finalcut\\n{\\n"
|
||||||
echo -e "\\nstatic unsigned char __8x16graph[] =\\n{"
|
echo -e "namespace fc\\n{\\n"
|
||||||
|
echo -e "static unsigned char __8x16graph[] =\\n{"
|
||||||
|
|
||||||
grep -A${HEIGHT} ^BITMAP "$FONTFILE" \
|
grep -A${HEIGHT} ^BITMAP "$FONTFILE" \
|
||||||
| tr '\n' ',' \
|
| tr '\n' ',' \
|
||||||
|
@ -28,6 +29,7 @@ FONTFILE="8x16graph.bdf"
|
||||||
|
|
||||||
echo -e "};"
|
echo -e "};"
|
||||||
echo -e "\\n} // namespace fc"
|
echo -e "\\n} // namespace fc"
|
||||||
|
echo -e "\\n} // namespace finalcut"
|
||||||
echo -e "\\n#endif // FNEWFONT_H"
|
echo -e "\\n#endif // FNEWFONT_H"
|
||||||
) > newfont.h
|
) > newfont.h
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ FONTFILE="8x16std"
|
||||||
echo -e "// vgafont.h\\n"
|
echo -e "// vgafont.h\\n"
|
||||||
echo -e "#ifndef FVGAFONT_H"
|
echo -e "#ifndef FVGAFONT_H"
|
||||||
echo -e "#define FVGAFONT_H\\n"
|
echo -e "#define FVGAFONT_H\\n"
|
||||||
|
echo -e "namespace finalcut\\n{\\n"
|
||||||
echo -e "namespace fc\\n{\\n"
|
echo -e "namespace fc\\n{\\n"
|
||||||
|
|
||||||
xxd -g 1 -i -c $HEIGHT $FONTFILE \
|
xxd -g 1 -i -c $HEIGHT $FONTFILE \
|
||||||
|
@ -26,5 +27,6 @@ FONTFILE="8x16std"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "\\n} // namespace fc"
|
echo -e "\\n} // namespace fc"
|
||||||
|
echo -e "\\n} // namespace finalcut"
|
||||||
echo -e "\\n#endif // FVGAFONT_H"
|
echo -e "\\n#endif // FVGAFONT_H"
|
||||||
) > vgafont.h
|
) > vgafont.h
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
#ifndef FNEWFONT_H
|
#ifndef FNEWFONT_H
|
||||||
#define FNEWFONT_H
|
#define FNEWFONT_H
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -268,4 +271,6 @@ static unsigned char __8x16graph[] =
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FNEWFONT_H
|
#endif // FNEWFONT_H
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
#ifndef FUNICODEMAP_H
|
#ifndef FUNICODEMAP_H
|
||||||
#define FUNICODEMAP_H
|
#define FUNICODEMAP_H
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -318,4 +321,6 @@ static struct unipair unicode_cp437_pairs[] =
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FUNICODEMAP_H
|
#endif // FUNICODEMAP_H
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
#ifndef FVGAFONT_H
|
#ifndef FVGAFONT_H
|
||||||
#define FVGAFONT_H
|
#define FVGAFONT_H
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -268,4 +271,6 @@ static unsigned char __8x16std[] =
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FVGAFONT_H
|
#endif // FVGAFONT_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -29,6 +29,9 @@
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -90,4 +93,6 @@ inline void emptyFString::clear()
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // EMPTYFSTRING_H
|
#endif // EMPTYFSTRING_H
|
||||||
|
|
|
@ -69,6 +69,8 @@
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FApplication
|
// class FApplication
|
||||||
|
@ -241,5 +243,6 @@ inline FWidget* FApplication::getFocusWidget() const
|
||||||
inline void FApplication::cb_exitApp (FWidget*, data_ptr)
|
inline void FApplication::cb_exitApp (FWidget*, data_ptr)
|
||||||
{ close(); }
|
{ close(); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FAPPLICATION_H
|
#endif // FAPPLICATION_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2012-2017 Markus Gans *
|
* Copyright 2012-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FButton
|
// class FButton
|
||||||
|
@ -274,4 +276,6 @@ inline bool FButton::hasShadow() const
|
||||||
inline bool FButton::hasClickAnimation()
|
inline bool FButton::hasClickAnimation()
|
||||||
{ return click_animation; }
|
{ return click_animation; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FBUTTON_H
|
#endif // FBUTTON_H
|
||||||
|
|
|
@ -55,6 +55,8 @@
|
||||||
|
|
||||||
#include "final/fscrollview.h"
|
#include "final/fscrollview.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FToggleButton;
|
class FToggleButton;
|
||||||
|
@ -170,4 +172,6 @@ inline uInt FButtonGroup::getCount() const
|
||||||
inline FString& FButtonGroup::getText()
|
inline FString& FButtonGroup::getText()
|
||||||
{ return text; }
|
{ return text; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FBUTTONGROUP_H
|
#endif // FBUTTONGROUP_H
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
#define OSC ESC "]" // Operating system command (7-bit)
|
#define OSC ESC "]" // Operating system command (7-bit)
|
||||||
#define SECDA ESC "[>c" // Secondary Device Attributes
|
#define SECDA ESC "[>c" // Secondary Device Attributes
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Global constants and enumerations
|
// Global constants and enumerations
|
||||||
|
@ -1135,4 +1137,6 @@ enum termcaps
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FC_H
|
#endif // FC_H
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -327,4 +330,6 @@ const uInt lastCP437Item = uInt ( sizeof(cp437_to_ucs)
|
||||||
/ sizeof(cp437_to_ucs[0]) ) - 1;
|
/ sizeof(cp437_to_ucs[0]) ) - 1;
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCHARMAP_H
|
#endif // FCHARMAP_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2014-2017 Markus Gans *
|
* Copyright 2014-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
#include "final/ftogglebutton.h"
|
#include "final/ftogglebutton.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FCheckBox
|
// class FCheckBox
|
||||||
|
@ -100,4 +102,6 @@ class FCheckBox : public FToggleButton
|
||||||
inline const char* FCheckBox::getClassName() const
|
inline const char* FCheckBox::getClassName() const
|
||||||
{ return "FCheckBox"; }
|
{ return "FCheckBox"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCHECKBOX_H
|
#endif // FCHECKBOX_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
#include "final/fmenuitem.h"
|
#include "final/fmenuitem.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FCheckMenuItem
|
// class FCheckMenuItem
|
||||||
|
@ -100,4 +102,6 @@ class FCheckMenuItem : public FMenuItem
|
||||||
inline const char* FCheckMenuItem::getClassName() const
|
inline const char* FCheckMenuItem::getClassName() const
|
||||||
{ return "FCheckMenuItem"; }
|
{ return "FCheckMenuItem"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCHECKMENUITEM_H
|
#endif // FCHECKMENUITEM_H
|
||||||
|
|
|
@ -31,8 +31,14 @@
|
||||||
#ifndef FCOLORPALETTE_H
|
#ifndef FCOLORPALETTE_H
|
||||||
#define FCOLORPALETTE_H
|
#define FCOLORPALETTE_H
|
||||||
|
|
||||||
|
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
|
||||||
|
#error "Only <final/final.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FColorPalette
|
// class FColorPalette
|
||||||
|
@ -69,4 +75,6 @@ class FColorPalette
|
||||||
inline const char* FColorPalette::getClassName() const
|
inline const char* FColorPalette::getClassName() const
|
||||||
{ return "FColorPalette"; }
|
{ return "FColorPalette"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCOLORPALETTE_H
|
#endif // FCOLORPALETTE_H
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
#include "final/ftooltip.h"
|
#include "final/ftooltip.h"
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FDialog
|
// class FDialog
|
||||||
|
@ -285,6 +287,6 @@ inline bool FDialog::isModal()
|
||||||
inline bool FDialog::isScrollable()
|
inline bool FDialog::isScrollable()
|
||||||
{ return ((flags & fc::scrollable) != 0); }
|
{ return ((flags & fc::scrollable) != 0); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FDIALOG_H
|
#endif // FDIALOG_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2016-2017 Markus Gans *
|
* Copyright 2016-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -65,6 +65,8 @@
|
||||||
|
|
||||||
#include "final/fmenu.h"
|
#include "final/fmenu.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FDialogListMenu
|
// class FDialogListMenu
|
||||||
|
@ -104,4 +106,6 @@ class FDialogListMenu : public FMenu
|
||||||
inline const char* FDialogListMenu::getClassName() const
|
inline const char* FDialogListMenu::getClassName() const
|
||||||
{ return "FDialogListMenu"; }
|
{ return "FDialogListMenu"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FDIALOGLISTMENU_H
|
#endif // FDIALOGLISTMENU_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2014-2017 Markus Gans *
|
* Copyright 2014-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -79,6 +79,8 @@
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/fpoint.h"
|
#include "final/fpoint.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FEvent
|
// class FEvent
|
||||||
|
@ -336,4 +338,6 @@ class FTimerEvent : public FEvent // timer event
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FEVENT_H
|
#endif // FEVENT_H
|
||||||
|
|
|
@ -81,6 +81,8 @@
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
#include "final/fterm.h"
|
#include "final/fterm.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FFileDialog
|
// class FFileDialog
|
||||||
|
@ -231,4 +233,6 @@ inline bool FFileDialog::unsetShowHiddenFiles()
|
||||||
inline bool FFileDialog::getShowHiddenFiles()
|
inline bool FFileDialog::getShowHiddenFiles()
|
||||||
{ return show_hidden; }
|
{ return show_hidden; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FFILEDIALOG_H
|
#endif // FFILEDIALOG_H
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -39,4 +42,6 @@ extern keyname FkeyName[];
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FKEYMAP_H
|
#endif // FKEYMAP_H
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
#include "final/ftermlinux.h"
|
#include "final/ftermlinux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FApplication;
|
class FApplication;
|
||||||
|
|
||||||
|
@ -252,4 +255,6 @@ inline bool FKeyboard::setNonBlockingInput()
|
||||||
inline bool FKeyboard::unsetNonBlockingInput()
|
inline bool FKeyboard::unsetNonBlockingInput()
|
||||||
{ return setNonBlockingInput(false); }
|
{ return setNonBlockingInput(false); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FKEYBOARD_H
|
#endif // FKEYBOARD_H
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FLabel
|
// class FLabel
|
||||||
|
@ -225,4 +227,6 @@ inline bool FLabel::hasReverseMode()
|
||||||
inline void FLabel::clear()
|
inline void FLabel::clear()
|
||||||
{ text.clear(); }
|
{ text.clear(); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FLABEL_H
|
#endif // FLABEL_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2012-2017 Markus Gans *
|
* Copyright 2012-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -55,6 +55,8 @@
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
#include "final/flabel.h"
|
#include "final/flabel.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FLineEdit
|
// class FLineEdit
|
||||||
|
@ -227,4 +229,6 @@ inline bool FLineEdit::unsetShadow()
|
||||||
inline bool FLineEdit::hasShadow()
|
inline bool FLineEdit::hasShadow()
|
||||||
{ return ((flags & fc::shadow) != 0); }
|
{ return ((flags & fc::shadow) != 0); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FLINEEDIT_H
|
#endif // FLINEEDIT_H
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FListBoxItem
|
// class FListBoxItem
|
||||||
|
@ -532,4 +534,6 @@ inline FListBox::listBoxItems::iterator FListBox::index2iterator (int index)
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FLISTBOX_H
|
#endif // FLISTBOX_H
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
#include "final/ftermbuffer.h"
|
#include "final/ftermbuffer.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FListView;
|
class FListView;
|
||||||
|
|
||||||
|
@ -473,4 +476,6 @@ inline FObject::FObjectIterator FListView::endOfList()
|
||||||
inline void FListView::scrollTo (const FPoint& pos)
|
inline void FListView::scrollTo (const FPoint& pos)
|
||||||
{ scrollTo(pos.getX(), pos.getY()); }
|
{ scrollTo(pos.getX(), pos.getY()); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FLISTVIEW_H
|
#endif // FLISTVIEW_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -64,6 +64,8 @@
|
||||||
#include "final/fmenulist.h"
|
#include "final/fmenulist.h"
|
||||||
#include "final/fmenuitem.h"
|
#include "final/fmenuitem.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FMenu
|
// class FMenu
|
||||||
|
@ -327,5 +329,6 @@ inline FMenu* FMenu::superMenuAt (const FPoint& p)
|
||||||
inline void FMenu::onAccel (FAccelEvent* ev)
|
inline void FMenu::onAccel (FAccelEvent* ev)
|
||||||
{ item->onAccel(ev); }
|
{ item->onAccel(ev); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMENU_H
|
#endif // FMENU_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -63,6 +63,8 @@
|
||||||
#include "final/fmenulist.h"
|
#include "final/fmenulist.h"
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FMenuBar
|
// class FMenuBar
|
||||||
|
@ -166,4 +168,6 @@ inline const char* FMenuBar::getClassName() const
|
||||||
inline bool FMenuBar::isMenu (FMenuItem* mi) const
|
inline bool FMenuBar::isMenu (FMenuItem* mi) const
|
||||||
{ return mi->hasMenu(); }
|
{ return mi->hasMenu(); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMENUBAR_H
|
#endif // FMENUBAR_H
|
||||||
|
|
|
@ -58,6 +58,9 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FDialog;
|
class FDialog;
|
||||||
class FMenu;
|
class FMenu;
|
||||||
|
@ -270,4 +273,6 @@ inline FWidget* FMenuItem::getSuperMenu() const
|
||||||
inline void FMenuItem::setSuperMenu (FWidget* smenu)
|
inline void FMenuItem::setSuperMenu (FWidget* smenu)
|
||||||
{ super_menu = smenu; }
|
{ super_menu = smenu; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMENUITEM_H
|
#endif // FMENUITEM_H
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2017 Markus Gans *
|
* Copyright 2015-2018 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -48,6 +48,8 @@
|
||||||
#include "final/fmenuitem.h"
|
#include "final/fmenuitem.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FMenuList
|
// class FMenuList
|
||||||
|
@ -139,4 +141,6 @@ inline bool FMenuList::isSelected(int index) const
|
||||||
inline bool FMenuList::hasSelectedItem() const
|
inline bool FMenuList::hasSelectedItem() const
|
||||||
{ return selected_item; }
|
{ return selected_item; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMENULIST_H
|
#endif // FMENULIST_H
|
||||||
|
|
|
@ -68,6 +68,8 @@
|
||||||
#include "final/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
#include "final/fterm.h"
|
#include "final/fterm.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FMessageBox
|
// class FMessageBox
|
||||||
|
@ -205,4 +207,6 @@ inline bool FMessageBox::setCenterText()
|
||||||
inline bool FMessageBox::unsetCenterText()
|
inline bool FMessageBox::unsetCenterText()
|
||||||
{ return setCenterText(false); }
|
{ return setCenterText(false); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMESSAGEBOX_H
|
#endif // FMESSAGEBOX_H
|
||||||
|
|
|
@ -76,6 +76,8 @@
|
||||||
#undef buttons // from term.h
|
#undef buttons // from term.h
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FMouse
|
// class FMouse
|
||||||
|
@ -249,7 +251,7 @@ inline bool FMouseGPM::disableGpmMouse()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FMouseGPM::isGpmMouseEnabled()
|
inline bool FMouseGPM::isGpmMouseEnabled()
|
||||||
{ return gpm_mouse_enabled; }
|
{ return gpm_mouse_enabled; }
|
||||||
#endif
|
#endif // F_HAVE_LIBGPM
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -528,4 +530,6 @@ inline void FMouseControl::enableXTermMouse()
|
||||||
inline void FMouseControl::disableXTermMouse()
|
inline void FMouseControl::disableXTermMouse()
|
||||||
{ xtermMouse(false); }
|
{ xtermMouse(false); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FMOUSE_H
|
#endif // FMOUSE_H
|
||||||
|
|
|
@ -46,7 +46,8 @@
|
||||||
#include "final/fevent.h"
|
#include "final/fevent.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FObject
|
// class FObject
|
||||||
|
@ -194,6 +195,8 @@ inline bool FObject::isInstanceOf (const char classname[]) const
|
||||||
inline bool FObject::isTimerInUpdating() const
|
inline bool FObject::isTimerInUpdating() const
|
||||||
{ return timer_modify_lock; }
|
{ return timer_modify_lock; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Operator functions for timeval
|
// Operator functions for timeval
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FOptiAttr
|
// class FOptiAttr
|
||||||
|
@ -413,4 +415,6 @@ inline void FOptiAttr::setDefaultColorSupport()
|
||||||
inline void FOptiAttr::unsetDefaultColorSupport()
|
inline void FOptiAttr::unsetDefaultColorSupport()
|
||||||
{ ansi_default_color = false; }
|
{ ansi_default_color = false; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FOPTIATTR_H
|
#endif // FOPTIATTR_H
|
||||||
|
|
|
@ -49,12 +49,12 @@
|
||||||
typedef unsigned int chtype;
|
typedef unsigned int chtype;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long chtype;
|
typedef unsigned long chtype;
|
||||||
#endif
|
#endif // _LP64
|
||||||
|
|
||||||
#include <term.h> // need for tparm
|
#include <term.h> // need for tparm
|
||||||
#else
|
#else
|
||||||
#include <term.h> // need for tparm
|
#include <term.h> // need for tparm
|
||||||
#endif
|
#endif // defined(__sun) && defined(__SVR4)
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
@ -65,6 +65,9 @@
|
||||||
|
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FOptiMove
|
// class FOptiMove
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -333,4 +336,6 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap)
|
||||||
inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
|
inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
|
||||||
{ eat_nl_glitch = bcap; }
|
{ eat_nl_glitch = bcap; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FOPTIMOVE_H
|
#endif // FOPTIMOVE_H
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FPoint
|
// class FPoint
|
||||||
|
@ -151,4 +153,6 @@ inline short& FPoint::x_ref()
|
||||||
inline short& FPoint::y_ref()
|
inline short& FPoint::y_ref()
|
||||||
{ return ypos; }
|
{ return ypos; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FPOINT_H
|
#endif // FPOINT_H
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FProgressbar
|
// class FProgressbar
|
||||||
|
@ -126,5 +128,6 @@ inline bool FProgressbar::unsetShadow()
|
||||||
inline bool FProgressbar::hasShadow()
|
inline bool FProgressbar::hasShadow()
|
||||||
{ return ((flags & fc::shadow) != 0); }
|
{ return ((flags & fc::shadow) != 0); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FPROGRESSBAR_H
|
#endif // FPROGRESSBAR_H
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
#include "final/ftogglebutton.h"
|
#include "final/ftogglebutton.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FRadioButton
|
// class FRadioButton
|
||||||
|
@ -100,4 +102,6 @@ class FRadioButton : public FToggleButton
|
||||||
inline const char* FRadioButton::getClassName() const
|
inline const char* FRadioButton::getClassName() const
|
||||||
{ return "FRadioButton"; }
|
{ return "FRadioButton"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FRADIOBUTTON_H
|
#endif // FRADIOBUTTON_H
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
#include "final/fmenuitem.h"
|
#include "final/fmenuitem.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FRadioMenuItem
|
// class FRadioMenuItem
|
||||||
|
@ -100,4 +102,6 @@ class FRadioMenuItem : public FMenuItem
|
||||||
inline const char* FRadioMenuItem::getClassName() const
|
inline const char* FRadioMenuItem::getClassName() const
|
||||||
{ return "FRadioMenuItem"; }
|
{ return "FRadioMenuItem"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FRADIOMENUITEM_H
|
#endif // FRADIOMENUITEM_H
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "final/fpoint.h"
|
#include "final/fpoint.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FRect
|
// class FRect
|
||||||
|
@ -227,4 +229,6 @@ inline short& FRect::x2_ref()
|
||||||
inline short& FRect::y2_ref()
|
inline short& FRect::y2_ref()
|
||||||
{ return Y2; }
|
{ return Y2; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FRECT_H
|
#endif // FRECT_H
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FScrollbar
|
// class FScrollbar
|
||||||
|
@ -174,4 +176,6 @@ inline int FScrollbar::getValue() const
|
||||||
inline FScrollbar::sType FScrollbar::getScrollType() const
|
inline FScrollbar::sType FScrollbar::getScrollType() const
|
||||||
{ return scroll_type; }
|
{ return scroll_type; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FSCROLLBAR_H
|
#endif // FSCROLLBAR_H
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
#include "final/fscrollbar.h"
|
#include "final/fscrollbar.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FScrollView
|
// class FScrollView
|
||||||
|
@ -248,5 +250,6 @@ inline bool FScrollView::isViewportPrint()
|
||||||
inline void FScrollView::scrollTo (const FPoint& pos)
|
inline void FScrollView::scrollTo (const FPoint& pos)
|
||||||
{ scrollTo(pos.getX(), pos.getY()); }
|
{ scrollTo(pos.getX(), pos.getY()); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FSCROLLVIEW_H
|
#endif // FSCROLLVIEW_H
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
|
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FStatusBar;
|
class FStatusBar;
|
||||||
|
@ -295,4 +297,6 @@ inline FString FStatusBar::getMessage() const
|
||||||
inline void FStatusBar::clearMessage()
|
inline void FStatusBar::clearMessage()
|
||||||
{ text.clear(); }
|
{ text.clear(); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FSTATUSBAR_H
|
#endif // FSTATUSBAR_H
|
||||||
|
|
|
@ -57,6 +57,9 @@
|
||||||
|
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FString;
|
class FString;
|
||||||
|
|
||||||
|
@ -496,5 +499,6 @@ inline FString& FString::setFormatedNumber (int num, char separator)
|
||||||
inline FString& FString::setFormatedNumber (uInt num, char separator)
|
inline FString& FString::setFormatedNumber (uInt num, char separator)
|
||||||
{ return setFormatedNumber (uLong(num), separator); }
|
{ return setFormatedNumber (uLong(num), separator); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FSTRING_H
|
#endif // FSTRING_H
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
#include "final/ftogglebutton.h"
|
#include "final/ftogglebutton.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FSwitch
|
// class FSwitch
|
||||||
|
@ -113,4 +115,6 @@ class FSwitch : public FToggleButton
|
||||||
inline const char* FSwitch::getClassName() const
|
inline const char* FSwitch::getClassName() const
|
||||||
{ return "FSwitch"; }
|
{ return "FSwitch"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FSWITCH_H
|
#endif // FSWITCH_H
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
|
|
||||||
#include "final/ftermcap.h"
|
#include "final/ftermcap.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -139,4 +142,6 @@ static FTermcap::tcap_map term_caps[] =
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTCAPMAP_H
|
#endif // FTCAPMAP_H
|
||||||
|
|
|
@ -112,12 +112,12 @@
|
||||||
typedef unsigned int chtype;
|
typedef unsigned int chtype;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long chtype;
|
typedef unsigned long chtype;
|
||||||
#endif
|
#endif // _LP64
|
||||||
|
|
||||||
#include <term.h> // termcap
|
#include <term.h> // termcap
|
||||||
#else
|
#else
|
||||||
#include <term.h> // termcap
|
#include <term.h> // termcap
|
||||||
#endif
|
#endif // defined(__sun) && defined(__SVR4)
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
#ifdef F_HAVE_LIBGPM
|
||||||
#undef buttons // from term.h
|
#undef buttons // from term.h
|
||||||
|
@ -164,6 +164,8 @@
|
||||||
#include "final/ftermios.h"
|
#include "final/ftermios.h"
|
||||||
#include "final/ftermxterminal.h"
|
#include "final/ftermxterminal.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTerm
|
// class FTerm
|
||||||
|
@ -205,7 +207,7 @@ class FTerm
|
||||||
static const char* getTermType_Answerback();
|
static const char* getTermType_Answerback();
|
||||||
static const char* getTermType_SecDA();
|
static const char* getTermType_SecDA();
|
||||||
static int getFramebufferBpp();
|
static int getFramebufferBpp();
|
||||||
#endif
|
#endif // DEBUG
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
static bool isCursorHidden();
|
static bool isCursorHidden();
|
||||||
|
@ -551,7 +553,7 @@ inline const char* FTerm::getTermType_SecDA()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline int FTerm::getFramebufferBpp()
|
inline int FTerm::getFramebufferBpp()
|
||||||
{ return framebuffer_bpp; }
|
{ return framebuffer_bpp; }
|
||||||
#endif
|
#endif // DEBUG
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FTerm::isCursorHidden()
|
inline bool FTerm::isCursorHidden()
|
||||||
|
@ -710,4 +712,6 @@ inline void FTerm::changeTermSizeFinished()
|
||||||
{ resize_term = false; }
|
{ resize_term = false; }
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERM_H
|
#endif // FTERM_H
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
#include "final/fvterm.h"
|
#include "final/fvterm.h"
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermBuffer
|
// class FTermBuffer
|
||||||
|
@ -135,4 +137,6 @@ inline FTermBuffer& FTermBuffer::write()
|
||||||
inline std::vector<FTermBuffer::charData> FTermBuffer::getBuffer()
|
inline std::vector<FTermBuffer::charData> FTermBuffer::getBuffer()
|
||||||
{ return data; }
|
{ return data; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMBUFFER_H
|
#endif // FTERMBUFFER_H
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermcap
|
// class FTermcap
|
||||||
|
@ -103,4 +105,6 @@ class FTermcap
|
||||||
inline const char* FTermcap::getClassName() const
|
inline const char* FTermcap::getClassName() const
|
||||||
{ return "FTermcap"; }
|
{ return "FTermcap"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMCAP_H
|
#endif // FTERMCAP_H
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#include "final/ftermcap.h"
|
#include "final/ftermcap.h"
|
||||||
#include "final/ftermdetection.h"
|
#include "final/ftermdetection.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermcapsQuirks
|
// class FTermcapsQuirks
|
||||||
|
@ -96,4 +98,6 @@ class FTermcapQuirks
|
||||||
inline const char* FTermcapQuirks::getClassName() const
|
inline const char* FTermcapQuirks::getClassName() const
|
||||||
{ return "FTermcapQuirks"; }
|
{ return "FTermcapQuirks"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMCAPQUIRKS_H
|
#endif // FTERMCAPQUIRKS_H
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
#include "final/ftermios.h"
|
#include "final/ftermios.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermDetection
|
// class FTermDetection
|
||||||
|
@ -456,4 +458,6 @@ inline void FTermDetection::setTmuxTerm (bool on)
|
||||||
inline void FTermDetection::setTerminalDetection (bool on)
|
inline void FTermDetection::setTerminalDetection (bool on)
|
||||||
{ terminal_detection = on; }
|
{ terminal_detection = on; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMDETECTION_H
|
#endif // FTERMDETECTION_H
|
||||||
|
|
|
@ -46,6 +46,9 @@
|
||||||
#include <sys/kbio.h>
|
#include <sys/kbio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermFreeBSD
|
// class FTermFreeBSD
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -129,4 +132,6 @@ inline void FTermFreeBSD::disableMetaSendsEscape()
|
||||||
{ meta_sends_escape = false; }
|
{ meta_sends_escape = false; }
|
||||||
#endif // defined(__FreeBSD__) || defined(__DragonFly__)
|
#endif // defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMFREEBSD_H
|
#endif // FTERMFREEBSD_H
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
|
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermios
|
// class FTermios
|
||||||
|
@ -125,5 +127,6 @@ inline bool FTermios::unsetRawMode()
|
||||||
inline bool FTermios::setCookedMode()
|
inline bool FTermios::setCookedMode()
|
||||||
{ return setRawMode(false); }
|
{ return setRawMode(false); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMIOS_H
|
#endif // FTERMIOS_H
|
||||||
|
|
|
@ -40,10 +40,10 @@
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
||||||
#include <sys/io.h> // <asm/io.h> is deprecated
|
#include <sys/io.h> // <asm/io.h> is deprecated
|
||||||
#endif
|
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
||||||
|
|
||||||
#include <sys/kd.h>
|
#include <sys/kd.h>
|
||||||
#endif
|
#endif // defined(__linux__)
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -56,6 +56,8 @@
|
||||||
#include "final/ftermdetection.h"
|
#include "final/ftermdetection.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermLinux
|
// class FTermLinux
|
||||||
|
@ -156,7 +158,7 @@ class FTermLinux
|
||||||
static bool setVGAPalette (short, int, int, int);
|
static bool setVGAPalette (short, int, int, int);
|
||||||
static bool saveVGAPalette();
|
static bool saveVGAPalette();
|
||||||
static bool resetVGAPalette();
|
static bool resetVGAPalette();
|
||||||
#endif
|
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
||||||
static int shiftKeyCorrection (const int&);
|
static int shiftKeyCorrection (const int&);
|
||||||
static int ctrlKeyCorrection (const int&);
|
static int ctrlKeyCorrection (const int&);
|
||||||
static int altKeyCorrection (const int&);
|
static int altKeyCorrection (const int&);
|
||||||
|
@ -215,4 +217,6 @@ inline bool FTermLinux::isNewFontUsed()
|
||||||
{ return NewFont; }
|
{ return NewFont; }
|
||||||
#endif // defined(__linux__)
|
#endif // defined(__linux__)
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMLINUX_H
|
#endif // FTERMLINUX_H
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
#include <dev/wscons/wsconsio.h>
|
#include <dev/wscons/wsconsio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermOpenBSD
|
// class FTermOpenBSD
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -89,7 +92,7 @@ class FTermOpenBSD
|
||||||
// Data Members
|
// Data Members
|
||||||
static kbd_t bsd_keyboard_encoding;
|
static kbd_t bsd_keyboard_encoding;
|
||||||
static bool meta_sends_escape;
|
static bool meta_sends_escape;
|
||||||
#endif
|
#endif // defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
@ -108,4 +111,6 @@ inline void FTermOpenBSD::disableMetaSendsEscape()
|
||||||
{ meta_sends_escape = false; }
|
{ meta_sends_escape = false; }
|
||||||
#endif // defined(__NetBSD__) || defined(__OpenBSD__)
|
#endif // defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMOPENBSD_H
|
#endif // FTERMOPENBSD_H
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#include "final/ftermcap.h"
|
#include "final/ftermcap.h"
|
||||||
#include "final/ftermdetection.h"
|
#include "final/ftermdetection.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTermXTerminal
|
// class FTermXTerminal
|
||||||
|
@ -219,5 +221,6 @@ inline void FTermXTerminal::setMouseSupport()
|
||||||
inline void FTermXTerminal::unsetMouseSupport()
|
inline void FTermXTerminal::unsetMouseSupport()
|
||||||
{ setMouseSupport (false); }
|
{ setMouseSupport (false); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTERMXTERMINAL_H
|
#endif // FTERMXTERMINAL_H
|
||||||
|
|
|
@ -60,6 +60,8 @@
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTextView
|
// class FTextView
|
||||||
|
@ -183,4 +185,6 @@ inline void FTextView::deleteRange (int from, int to)
|
||||||
inline void FTextView::deleteLine (int pos)
|
inline void FTextView::deleteLine (int pos)
|
||||||
{ deleteRange (pos, pos); }
|
{ deleteRange (pos, pos); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTEXTVIEW_H
|
#endif // FTEXTVIEW_H
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FButtonGroup;
|
class FButtonGroup;
|
||||||
|
@ -223,4 +225,6 @@ inline FButtonGroup* FToggleButton::getGroup() const
|
||||||
inline bool FToggleButton::hasGroup() const
|
inline bool FToggleButton::hasGroup() const
|
||||||
{ return button_group; }
|
{ return button_group; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTOGGLEBUTTON_H
|
#endif // FTOGGLEBUTTON_H
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
|
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FToolTip
|
// class FToolTip
|
||||||
|
@ -121,5 +123,6 @@ class FToolTip : public FWindow
|
||||||
inline const char* FToolTip::getClassName() const
|
inline const char* FToolTip::getClassName() const
|
||||||
{ return "FToolTip"; }
|
{ return "FToolTip"; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTOOLTIP_H
|
#endif // FTOOLTIP_H
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
|
|
||||||
#define null NULL
|
#define null NULL
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
typedef unsigned char uChar;
|
typedef unsigned char uChar;
|
||||||
typedef unsigned int uInt;
|
typedef unsigned int uInt;
|
||||||
typedef unsigned long uLong;
|
typedef unsigned long uLong;
|
||||||
|
@ -49,6 +52,12 @@ typedef int64_t sInt64;
|
||||||
|
|
||||||
typedef long double lDouble;
|
typedef long double lDouble;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
|
@ -75,7 +84,10 @@ typedef struct
|
||||||
}
|
}
|
||||||
keyname;
|
keyname;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FTYPES_H
|
#endif // FTYPES_H
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,9 @@
|
||||||
static_cast<FVTerm*>((i)) \
|
static_cast<FVTerm*>((i)) \
|
||||||
, reinterpret_cast<FVTerm::FPreprocessingHandler>((h))
|
, reinterpret_cast<FVTerm::FPreprocessingHandler>((h))
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FWidget;
|
class FWidget;
|
||||||
|
|
||||||
|
@ -858,4 +861,6 @@ inline bool FVTerm::isVirtualWindow() const
|
||||||
inline void FVTerm::setPrintArea (term_area* area)
|
inline void FVTerm::setPrintArea (term_area* area)
|
||||||
{ print_area = area; }
|
{ print_area = area; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FVTERM_H
|
#endif // FVTERM_H
|
||||||
|
|
|
@ -103,11 +103,14 @@
|
||||||
|
|
||||||
// Callback macros
|
// Callback macros
|
||||||
#define F_FUNCTION_CALLBACK(h) \
|
#define F_FUNCTION_CALLBACK(h) \
|
||||||
reinterpret_cast<FWidget::FCallback>((h))
|
reinterpret_cast<finalcut::FWidget::FCallback>((h))
|
||||||
|
|
||||||
#define F_METHOD_CALLBACK(i,h) \
|
#define F_METHOD_CALLBACK(i,h) \
|
||||||
reinterpret_cast<FWidget*>((i)) \
|
reinterpret_cast<finalcut::FWidget*>((i)) \
|
||||||
, reinterpret_cast<FWidget::FMemberCallback>((h))
|
, reinterpret_cast<finalcut::FWidget::FMemberCallback>((h))
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// class forward declaration
|
// class forward declaration
|
||||||
class FStatusBar;
|
class FStatusBar;
|
||||||
|
@ -929,4 +932,6 @@ const wchar_t CHECKED_RADIO_BUTTON[4] =
|
||||||
'\0'
|
'\0'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FWIDGET_H
|
#endif // FWIDGET_H
|
||||||
|
|
|
@ -31,8 +31,14 @@
|
||||||
#ifndef FWIDGETCOLORS_H
|
#ifndef FWIDGETCOLORS_H
|
||||||
#define FWIDGETCOLORS_H
|
#define FWIDGETCOLORS_H
|
||||||
|
|
||||||
|
#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
|
||||||
|
#error "Only <final/final.h> can be included directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FWidgetColors
|
// class FWidgetColors
|
||||||
|
@ -136,5 +142,6 @@ class FWidgetColors
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FWIDGETCOLORS_H
|
#endif // FWIDGETCOLORS_H
|
||||||
|
|
|
@ -62,6 +62,8 @@
|
||||||
|
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FWindow
|
// class FWindow
|
||||||
|
@ -273,4 +275,6 @@ inline bool FWindow::raiseWindow()
|
||||||
inline bool FWindow::lowerWindow()
|
inline bool FWindow::lowerWindow()
|
||||||
{ return lowerWindow(this); }
|
{ return lowerWindow(this); }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FWINDOW_H
|
#endif // FWINDOW_H
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// global application object
|
// global application object
|
||||||
static FApplication* rootObj = 0;
|
static FApplication* rootObj = 0;
|
||||||
|
|
||||||
|
@ -1229,3 +1232,5 @@ bool FApplication::processNextEvent()
|
||||||
|
|
||||||
return ( num_events > 0 );
|
return ( num_events > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include "final/fbutton.h"
|
#include "final/fbutton.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FButton
|
// class FButton
|
||||||
|
@ -855,3 +857,5 @@ void FButton::processClick()
|
||||||
{
|
{
|
||||||
emitCallback("clicked");
|
emitCallback("clicked");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
#include "final/ftogglebutton.h"
|
#include "final/ftogglebutton.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FButtonGroup
|
// class FButtonGroup
|
||||||
|
@ -692,3 +694,5 @@ void FButtonGroup::directFocus()
|
||||||
flush_out();
|
flush_out();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "final/fcheckbox.h"
|
#include "final/fcheckbox.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FCheckBox
|
// class FCheckBox
|
||||||
|
@ -107,3 +109,5 @@ void FCheckBox::drawCheckButton()
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#include "final/fcheckmenuitem.h"
|
#include "final/fcheckmenuitem.h"
|
||||||
#include "final/fmenu.h"
|
#include "final/fmenu.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FCheckMenuItem
|
// class FCheckMenuItem
|
||||||
|
@ -77,3 +79,5 @@ void FCheckMenuItem::processClicked()
|
||||||
processToggle();
|
processToggle();
|
||||||
emitCallback("clicked");
|
emitCallback("clicked");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "final/fcolorpalette.h"
|
#include "final/fcolorpalette.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FColorPalette
|
// class FColorPalette
|
||||||
|
@ -122,3 +124,5 @@ void FColorPalette::reset16ColorPalette (funcp setPalette)
|
||||||
setPalette (fc::Yellow, 0xff, 0xff, 0x55);
|
setPalette (fc::Yellow, 0xff, 0xff, 0x55);
|
||||||
setPalette (fc::White, 0xff, 0xff, 0xff);
|
setPalette (fc::White, 0xff, 0xff, 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include "final/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FDialog
|
// class FDialog
|
||||||
|
@ -1066,7 +1068,7 @@ void FDialog::drawTitleBar()
|
||||||
setPrintPos (getWidth() - 2, 1);
|
setPrintPos (getWidth() - 2, 1);
|
||||||
printf ("(%d)", getWindowLayer(this));
|
printf ("(%d)", getWindowLayer(this));
|
||||||
}
|
}
|
||||||
#endif
|
#endif // DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1765,3 +1767,5 @@ void FDialog::cb_close (FWidget*, data_ptr)
|
||||||
drawTitleBar();
|
drawTitleBar();
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "final/fdialoglistmenu.h"
|
#include "final/fdialoglistmenu.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FDialogListMenu
|
// class FDialogListMenu
|
||||||
|
@ -56,3 +58,5 @@ void FDialogListMenu::init()
|
||||||
if ( menuitem )
|
if ( menuitem )
|
||||||
menuitem->dialog_index = true;
|
menuitem->dialog_index = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "final/fevent.h"
|
#include "final/fevent.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FEvent
|
// class FEvent
|
||||||
|
@ -357,3 +359,5 @@ FTimerEvent::~FTimerEvent() // destructor
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int FTimerEvent::timerId() const
|
int FTimerEvent::timerId() const
|
||||||
{ return id; }
|
{ return id; }
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "final/ffiledialog.h"
|
#include "final/ffiledialog.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// non-member functions
|
// non-member functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -939,3 +941,5 @@ void FFileDialog::cb_processShowHidden (FWidget*, data_ptr)
|
||||||
{
|
{
|
||||||
setShowHiddenFiles(not show_hidden);
|
setShowHiddenFiles(not show_hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
#include <final/fc.h>
|
#include <final/fc.h>
|
||||||
#include <final/fkey_map.h>
|
#include <final/fkey_map.h>
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -826,3 +829,5 @@ keyname FkeyName[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#include "final/fkey_map.h"
|
#include "final/fkey_map.h"
|
||||||
#include "final/ftermios.h"
|
#include "final/ftermios.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
long FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress)
|
long FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress)
|
||||||
struct timeval FKeyboard::time_keypressed;
|
struct timeval FKeyboard::time_keypressed;
|
||||||
|
@ -567,3 +570,5 @@ void FKeyboard::escapeKeyPressed()
|
||||||
{
|
{
|
||||||
escape_key_cmd.execute();
|
escape_key_cmd.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include "final/flabel.h"
|
#include "final/flabel.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FLabel
|
// class FLabel
|
||||||
|
@ -666,3 +668,5 @@ void FLabel::printLine ( wchar_t line[]
|
||||||
if ( hasReverseMode() )
|
if ( hasReverseMode() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue