2017-11-04 07:03:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* term-attributes.cpp - Test the video attributes of the terminal *
|
|
|
|
* *
|
|
|
|
* This file is part of the Final Cut widget toolkit *
|
|
|
|
* *
|
2018-09-20 23:59:01 +02:00
|
|
|
* Copyright 2015-2018 Markus Gans *
|
2017-11-04 07:03:53 +01:00
|
|
|
* *
|
|
|
|
* The Final Cut is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* The Final Cut is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this program. If not, see *
|
|
|
|
* <http://www.gnu.org/licenses/>. *
|
|
|
|
***********************************************************************/
|
2015-12-24 02:37:01 +01:00
|
|
|
|
2017-10-31 00:41:59 +01:00
|
|
|
#include <final/final.h>
|
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class AttribDlg
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
class AttribDlg : public finalcut::FDialog
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Constructor
|
2018-09-20 23:59:01 +02:00
|
|
|
explicit AttribDlg (finalcut::FWidget* = 0);
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Destructor
|
|
|
|
~AttribDlg();
|
2016-09-30 04:55:28 +02:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Event handlers
|
2018-09-24 04:02:35 +02:00
|
|
|
virtual void onAccel (finalcut::FAccelEvent*);
|
|
|
|
virtual void onWheel (finalcut::FWheelEvent*);
|
|
|
|
virtual void onClose (finalcut::FCloseEvent*);
|
2016-09-30 04:55:28 +02:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Callback methods
|
2018-09-20 23:59:01 +02:00
|
|
|
void cb_next (finalcut::FWidget* = 0, data_ptr = 0);
|
|
|
|
void cb_back (finalcut::FWidget* = 0, data_ptr = 0);
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Data Members
|
2018-11-07 22:06:58 +01:00
|
|
|
FColor bgcolor;
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
private:
|
|
|
|
// Disable copy constructor
|
|
|
|
AttribDlg (const AttribDlg&);
|
|
|
|
// Disable assignment operator (=)
|
|
|
|
AttribDlg& operator = (const AttribDlg&);
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Method
|
2018-09-24 04:02:35 +02:00
|
|
|
virtual void adjustSize();
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Data Members
|
2018-10-03 22:23:55 +02:00
|
|
|
finalcut::FButton next_button;
|
|
|
|
finalcut::FButton back_button;
|
2015-12-24 02:37:01 +01:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
AttribDlg::AttribDlg (finalcut::FWidget* parent)
|
|
|
|
: finalcut::FDialog(parent)
|
2016-11-02 00:37:58 +01:00
|
|
|
, bgcolor(wc.label_bg)
|
2018-10-03 22:23:55 +02:00
|
|
|
, next_button("&Next >", this)
|
|
|
|
, back_button("< &Back", this)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2016-01-08 01:00:05 +01:00
|
|
|
setText ( "A terminal attributes test ("
|
2018-10-30 01:13:32 +01:00
|
|
|
+ finalcut::FString(getTermType())
|
2016-01-08 01:00:05 +01:00
|
|
|
+ ")");
|
|
|
|
|
2018-10-14 06:25:33 +02:00
|
|
|
next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1);
|
2018-10-03 22:23:55 +02:00
|
|
|
next_button.addAccelerator(finalcut::fc::Fkey_right);
|
2018-10-14 06:25:33 +02:00
|
|
|
back_button.setGeometry(int(getWidth()) - 25, int(getHeight()) - 4, 10, 1);
|
2018-10-03 22:23:55 +02:00
|
|
|
back_button.addAccelerator(finalcut::fc::Fkey_left);
|
2016-01-08 01:00:05 +01:00
|
|
|
|
|
|
|
// Add function callbacks
|
2018-10-03 22:23:55 +02:00
|
|
|
next_button.addCallback
|
2016-01-08 01:00:05 +01:00
|
|
|
(
|
|
|
|
"clicked",
|
2017-04-09 20:08:53 +02:00
|
|
|
F_METHOD_CALLBACK (this, &AttribDlg::cb_next)
|
2016-01-08 01:00:05 +01:00
|
|
|
);
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2018-10-03 22:23:55 +02:00
|
|
|
back_button.addCallback
|
2016-01-08 01:00:05 +01:00
|
|
|
(
|
|
|
|
"clicked",
|
2017-04-09 20:08:53 +02:00
|
|
|
F_METHOD_CALLBACK (this, &AttribDlg::cb_back)
|
2016-01-08 01:00:05 +01:00
|
|
|
);
|
2015-12-24 02:37:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
AttribDlg::~AttribDlg()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void AttribDlg::onAccel (finalcut::FAccelEvent* ev)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
|
|
|
close();
|
|
|
|
ev->accept();
|
|
|
|
}
|
|
|
|
|
2016-01-10 00:56:52 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void AttribDlg::onWheel (finalcut::FWheelEvent* ev)
|
2016-01-10 00:56:52 +01:00
|
|
|
{
|
|
|
|
int wheel = ev->getWheel();
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
if ( wheel == finalcut::fc::WheelUp )
|
2016-01-10 00:56:52 +01:00
|
|
|
cb_next();
|
2018-09-20 23:59:01 +02:00
|
|
|
else if ( wheel == finalcut::fc::WheelDown )
|
2016-01-10 00:56:52 +01:00
|
|
|
cb_back();
|
|
|
|
}
|
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void AttribDlg::onClose (finalcut::FCloseEvent* ev)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
2015-12-24 02:37:01 +01:00
|
|
|
}
|
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void AttribDlg::cb_next (finalcut::FWidget*, data_ptr)
|
2016-01-08 01:00:05 +01:00
|
|
|
{
|
|
|
|
if ( isMonochron() )
|
|
|
|
return;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2018-11-07 22:06:58 +01:00
|
|
|
if ( bgcolor == FColor(getMaxColor() - 1) )
|
2018-09-20 23:59:01 +02:00
|
|
|
bgcolor = finalcut::fc::Default;
|
2018-11-07 22:06:58 +01:00
|
|
|
else if ( bgcolor == finalcut::fc::Default )
|
|
|
|
bgcolor = 0;
|
|
|
|
else
|
|
|
|
bgcolor++;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
redraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void AttribDlg::cb_back (finalcut::FWidget*, data_ptr)
|
2016-01-08 01:00:05 +01:00
|
|
|
{
|
|
|
|
if ( isMonochron() )
|
|
|
|
return;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2018-11-07 22:06:58 +01:00
|
|
|
if ( bgcolor == 0 )
|
|
|
|
bgcolor = finalcut::fc::Default;
|
|
|
|
else if ( bgcolor == finalcut::fc::Default )
|
|
|
|
bgcolor = FColor(getMaxColor() - 1);
|
|
|
|
else
|
|
|
|
bgcolor--;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
redraw();
|
|
|
|
}
|
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDlg::adjustSize()
|
|
|
|
{
|
2018-10-14 06:25:33 +02:00
|
|
|
int x = int((getParentWidget()->getWidth() - getWidth()) / 2);
|
|
|
|
int y = int((getParentWidget()->getHeight() - getHeight()) / 2) + 1;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-17 02:57:08 +01:00
|
|
|
if ( x < 1 )
|
|
|
|
x = 1;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-17 02:57:08 +01:00
|
|
|
if ( y < 1 )
|
|
|
|
y = 1;
|
2016-01-08 01:00:05 +01:00
|
|
|
|
|
|
|
setGeometry(x, y, 69, 21, false);
|
2018-10-14 06:25:33 +02:00
|
|
|
next_button.setGeometry(int(getWidth()) - 13, int(getHeight()) - 4, 10, 1, false);
|
|
|
|
back_button.setGeometry(int(getWidth()) - 25, int(getHeight()) - 4, 10, 1, false);
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FDialog::adjustSize();
|
2015-12-24 02:37:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class AttribDemo
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
class AttribDemo : public finalcut::FWidget
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Constructor
|
|
|
|
explicit AttribDemo (FWidget* = 0);
|
|
|
|
|
|
|
|
// Destructor
|
|
|
|
~AttribDemo()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
// Event handler
|
2018-09-24 04:02:35 +02:00
|
|
|
virtual void onWheel (finalcut::FWheelEvent* ev)
|
2017-09-11 03:06:02 +02:00
|
|
|
{
|
|
|
|
AttribDlg* p = static_cast<AttribDlg*>(getParentWidget());
|
|
|
|
|
|
|
|
if ( p )
|
|
|
|
p->onWheel(ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Methods
|
|
|
|
void printColorLine();
|
|
|
|
void printAltCharset();
|
2017-11-24 00:28:25 +01:00
|
|
|
void printDim();
|
|
|
|
void printNormal();
|
|
|
|
void printBold();
|
|
|
|
void printBoldDim();
|
|
|
|
void printItalic();
|
|
|
|
void printUnderline();
|
|
|
|
void printDblUnderline();
|
|
|
|
void printCrossesOut();
|
|
|
|
void printBlink();
|
|
|
|
void printReverse();
|
|
|
|
void printStandout();
|
|
|
|
void printInvisible();
|
|
|
|
void printProtected();
|
2018-09-24 04:02:35 +02:00
|
|
|
virtual void draw();
|
2017-09-11 03:06:02 +02:00
|
|
|
|
|
|
|
// Data Member
|
|
|
|
int colors;
|
2015-12-24 02:37:01 +01:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
AttribDemo::AttribDemo (finalcut::FWidget* parent)
|
|
|
|
: finalcut::FWidget(parent)
|
2017-09-11 03:06:02 +02:00
|
|
|
, colors(getMaxColor())
|
2016-01-08 01:00:05 +01:00
|
|
|
{
|
|
|
|
if ( isMonochron() )
|
|
|
|
colors = 1;
|
|
|
|
else if ( colors > 16 )
|
|
|
|
colors = 16;
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
unsetFocusable();
|
|
|
|
}
|
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printColorLine()
|
|
|
|
{
|
2016-01-08 01:00:05 +01:00
|
|
|
AttribDlg* parent = static_cast<AttribDlg*>(getParent());
|
|
|
|
|
2017-08-27 09:50:30 +02:00
|
|
|
for (short color = 0; color < colors; color++)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2016-01-08 01:00:05 +01:00
|
|
|
setColor (color, parent->bgcolor);
|
2015-12-24 02:37:01 +01:00
|
|
|
print (" # ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printAltCharset()
|
|
|
|
{
|
|
|
|
AttribDlg* parent = static_cast<AttribDlg*>(getParent());
|
|
|
|
|
|
|
|
if ( ! isMonochron() )
|
|
|
|
setColor (wc.label_fg, wc.label_bg);
|
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
setPrintPos (1,1);
|
2016-01-08 01:00:05 +01:00
|
|
|
print("alternate charset: ");
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
if ( parent->bgcolor == finalcut::fc::Default )
|
2016-01-08 01:00:05 +01:00
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
setColor (finalcut::fc::Default, finalcut::fc::Default);
|
2016-01-08 01:00:05 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( parent->bgcolor == 0 || parent->bgcolor == 16 )
|
2018-09-20 23:59:01 +02:00
|
|
|
setColor (finalcut::fc::White, parent->bgcolor);
|
2016-01-08 01:00:05 +01:00
|
|
|
else
|
2018-09-20 23:59:01 +02:00
|
|
|
setColor (finalcut::fc::Black, parent->bgcolor);
|
2016-01-08 01:00:05 +01:00
|
|
|
}
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
setAltCharset();
|
|
|
|
print("`abcdefghijklmnopqrstuvwxyz{|}~");
|
|
|
|
unsetAltCharset();
|
|
|
|
print(" ");
|
|
|
|
}
|
|
|
|
|
2017-11-24 00:28:25 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printDim()
|
|
|
|
{
|
|
|
|
print(" Dim: ");
|
|
|
|
setDim();
|
|
|
|
printColorLine();
|
|
|
|
unsetDim();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printNormal()
|
|
|
|
{
|
|
|
|
print(" Normal: ");
|
|
|
|
setNormal();
|
|
|
|
printColorLine();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printBold()
|
|
|
|
{
|
|
|
|
print(" Bold: ");
|
|
|
|
setBold();
|
|
|
|
printColorLine();
|
|
|
|
unsetBold();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printBoldDim()
|
|
|
|
{
|
|
|
|
print(" Bold+Dim: ");
|
|
|
|
setBold();
|
|
|
|
setDim();
|
|
|
|
printColorLine();
|
|
|
|
unsetDim();
|
|
|
|
unsetBold();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printItalic()
|
|
|
|
{
|
|
|
|
print(" Italic: ");
|
|
|
|
setItalic();
|
|
|
|
printColorLine();
|
|
|
|
unsetItalic();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printUnderline()
|
|
|
|
{
|
|
|
|
print(" Underline: ");
|
|
|
|
setUnderline();
|
|
|
|
printColorLine();
|
|
|
|
unsetUnderline();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printDblUnderline()
|
|
|
|
{
|
|
|
|
print(" Double underline: ");
|
|
|
|
setDoubleUnderline();
|
|
|
|
printColorLine();
|
|
|
|
unsetDoubleUnderline();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printCrossesOut()
|
|
|
|
{
|
|
|
|
print(" Crossed-out: ");
|
|
|
|
setCrossedOut();
|
|
|
|
printColorLine();
|
|
|
|
unsetCrossedOut();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printBlink()
|
|
|
|
{
|
|
|
|
print(" Blink: ");
|
|
|
|
setBlink();
|
|
|
|
printColorLine();
|
|
|
|
unsetBlink();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printReverse()
|
|
|
|
{
|
|
|
|
print(" Reverse: ");
|
|
|
|
setReverse();
|
|
|
|
printColorLine();
|
|
|
|
unsetReverse();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printStandout()
|
|
|
|
{
|
|
|
|
print(" Standout: ");
|
|
|
|
setStandout();
|
|
|
|
printColorLine();
|
|
|
|
unsetStandout();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printInvisible()
|
|
|
|
{
|
|
|
|
print(" Invisible: ");
|
|
|
|
setInvisible();
|
|
|
|
printColorLine();
|
|
|
|
unsetInvisible();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::printProtected()
|
|
|
|
{
|
|
|
|
print(" Protected: ");
|
|
|
|
setProtected();
|
|
|
|
printColorLine();
|
|
|
|
unsetProtected();
|
|
|
|
}
|
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void AttribDemo::draw()
|
|
|
|
{
|
2016-01-08 01:00:05 +01:00
|
|
|
// test alternate character set
|
|
|
|
printAltCharset();
|
|
|
|
|
2018-10-14 06:25:33 +02:00
|
|
|
for (int y = 0; y < int(getParentWidget()->getHeight()) - 7; y++)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2017-08-27 09:50:30 +02:00
|
|
|
setPrintPos (1, 2 + y);
|
2016-01-08 01:00:05 +01:00
|
|
|
|
|
|
|
if ( ! isMonochron() )
|
|
|
|
setColor (wc.label_fg, wc.label_bg);
|
|
|
|
|
|
|
|
switch (y)
|
2015-12-24 02:37:01 +01:00
|
|
|
{
|
2016-01-08 01:00:05 +01:00
|
|
|
case 0:
|
2017-11-24 00:28:25 +01:00
|
|
|
printDim();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
2017-11-24 00:28:25 +01:00
|
|
|
printNormal();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2017-11-24 00:28:25 +01:00
|
|
|
printBold();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
2017-11-24 00:28:25 +01:00
|
|
|
printBoldDim();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
2017-11-24 00:28:25 +01:00
|
|
|
printItalic();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
2017-11-24 00:28:25 +01:00
|
|
|
printUnderline();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
2017-11-24 00:28:25 +01:00
|
|
|
printDblUnderline();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
2017-11-24 00:28:25 +01:00
|
|
|
printCrossesOut();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
2017-11-24 00:28:25 +01:00
|
|
|
printBlink();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 9:
|
2017-11-24 00:28:25 +01:00
|
|
|
printReverse();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 10:
|
2017-11-24 00:28:25 +01:00
|
|
|
printStandout();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 11:
|
2017-11-24 00:28:25 +01:00
|
|
|
printInvisible();
|
2016-01-08 01:00:05 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 12:
|
2017-11-24 00:28:25 +01:00
|
|
|
printProtected();
|
2015-12-24 02:37:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-08 01:00:05 +01:00
|
|
|
if ( ! isMonochron() )
|
|
|
|
setColor(wc.label_fg, wc.label_bg);
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
setPrintPos (1, 15);
|
2018-11-07 22:06:58 +01:00
|
|
|
FColor bg = static_cast<AttribDlg*>(getParent())->bgcolor;
|
2016-01-17 02:57:08 +01:00
|
|
|
print (" Background color:");
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2018-09-20 23:59:01 +02:00
|
|
|
if ( bg == finalcut::fc::Default )
|
2016-01-17 23:37:52 +01:00
|
|
|
print (" default");
|
2016-01-17 02:57:08 +01:00
|
|
|
else
|
|
|
|
printf ( " %d", bg);
|
2016-07-09 00:01:59 +02:00
|
|
|
|
2016-10-11 04:57:36 +02:00
|
|
|
setPrintPos (16, 17);
|
2016-01-08 01:00:05 +01:00
|
|
|
print ("Change background color ->");
|
2015-12-24 02:37:01 +01:00
|
|
|
}
|
|
|
|
|
2016-01-10 00:56:52 +01:00
|
|
|
|
2015-12-24 02:37:01 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// main part
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
int main (int argc, char* argv[])
|
|
|
|
{
|
|
|
|
// Create the application object
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FApplication app (argc, argv);
|
2015-12-24 02:37:01 +01:00
|
|
|
|
|
|
|
// Create a dialog box object.
|
|
|
|
// This object will be automatically deleted by
|
|
|
|
// the parent object "app" (FObject destructor).
|
2018-10-03 22:23:55 +02:00
|
|
|
AttribDlg dialog(&app);
|
2015-12-24 02:37:01 +01:00
|
|
|
|
2018-10-03 22:23:55 +02:00
|
|
|
dialog.setGeometry (6, 2, 69, 21);
|
|
|
|
dialog.addAccelerator('q'); // press 'q' to quit
|
|
|
|
dialog.setShadow();
|
2015-12-24 02:37:01 +01:00
|
|
|
|
2017-09-19 06:18:03 +02:00
|
|
|
// Create the attribute demo widget as a child object from the dialog
|
2018-10-03 22:23:55 +02:00
|
|
|
AttribDemo demo(&dialog);
|
|
|
|
demo.setGeometry (1, 1, 67, 19);
|
2015-12-24 02:37:01 +01:00
|
|
|
|
2017-09-19 06:18:03 +02:00
|
|
|
// Set the dialog object as main widget
|
2018-10-03 22:23:55 +02:00
|
|
|
app.setMainWidget(&dialog);
|
2015-12-24 02:37:01 +01:00
|
|
|
|
2017-09-19 06:18:03 +02:00
|
|
|
// Show and start the application
|
2018-10-03 22:23:55 +02:00
|
|
|
dialog.show();
|
2015-12-24 02:37:01 +01:00
|
|
|
return app.exec();
|
|
|
|
}
|