Fixed: build with gcc < 5.5
This commit is contained in:
parent
226663889b
commit
c4b799d98f
|
@ -85,7 +85,7 @@ SegmentView::SegmentView (finalcut::FWidget* parent)
|
|||
input.setGeometry (FPoint(2, 2), FSize{12, 1});
|
||||
input.setLabelText (L"&Hex value");
|
||||
input.setLabelText (L"&Hex-digits or (.) (:) (H) (L) (P) (U)");
|
||||
input.setLabelOrientation(finalcut::FLineEdit::label_above);
|
||||
input.setLabelOrientation(finalcut::FLineEdit::LabelOrientation::above);
|
||||
input.setMaxLength(9);
|
||||
input.setInputFilter("[:.hHlLpPuU[:xdigit:]]");
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ Background::Background (finalcut::FWidget* parent)
|
|||
|
||||
// Combobox
|
||||
color_choice.setGeometry (FPoint{2, 2}, FSize{18, 1});
|
||||
color_choice.setLabelOrientation (finalcut::FLineEdit::label_above);
|
||||
color_choice.setLabelOrientation (finalcut::FLineEdit::LabelOrientation::above);
|
||||
color_choice.setLabelText ("Color choice");
|
||||
color_choice.unsetEditable();
|
||||
|
||||
|
@ -111,19 +111,19 @@ Background::Background (finalcut::FWidget* parent)
|
|||
|
||||
// Spin boxes
|
||||
red.setGeometry (FPoint{2, 5}, FSize{7, 1});
|
||||
red.setLabelOrientation (finalcut::FLineEdit::label_above);
|
||||
red.setLabelOrientation (finalcut::FLineEdit::LabelOrientation::above);
|
||||
red.setLabelText ("Red");
|
||||
red.setRange (0, 255);
|
||||
red.setValue (0x80);
|
||||
|
||||
green.setGeometry (FPoint{12, 5}, FSize{7, 1});
|
||||
green.setLabelOrientation (finalcut::FLineEdit::label_above);
|
||||
green.setLabelOrientation (finalcut::FLineEdit::LabelOrientation::above);
|
||||
green.setLabelText ("Green");
|
||||
green.setRange (0, 255);
|
||||
green.setValue (0xa4);
|
||||
|
||||
blue.setGeometry (FPoint{22, 5}, FSize{7, 1});
|
||||
blue.setLabelOrientation (finalcut::FLineEdit::label_above);
|
||||
blue.setLabelOrientation (finalcut::FLineEdit::LabelOrientation::above);
|
||||
blue.setLabelText ("Blue");
|
||||
blue.setRange (0, 255);
|
||||
blue.setValue (0xec);
|
||||
|
|
|
@ -76,7 +76,7 @@ int main (int argc, char* argv[])
|
|||
finalcut::FLineEdit c_field {&dgl};
|
||||
|
||||
// Set input type to password
|
||||
pw_field.setInputType (finalcut::FLineEdit::password);
|
||||
pw_field.setInputType (finalcut::FLineEdit::InputType::password);
|
||||
|
||||
name_field.setLabelText (L"&Name");
|
||||
pw_field.setLabelText (L"&Password");
|
||||
|
|
|
@ -194,9 +194,9 @@ void Listview::cb_showInMessagebox()
|
|||
"Temperature: " + item->getText(3) + "\n"
|
||||
" Humidity: " + item->getText(4) + "\n"
|
||||
" Pressure: " + item->getText(5)
|
||||
, finalcut::FMessageBox::Ok
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Ok
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, this );
|
||||
info.show();
|
||||
}
|
||||
|
|
|
@ -809,9 +809,9 @@ void MyDialog::cb_about()
|
|||
, line + L" FINAL CUT " + line + L"\n\n"
|
||||
L"Version " + libver + L"\n\n"
|
||||
L"(c) 2020 by Markus Gans"
|
||||
, finalcut::FMessageBox::Ok
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Ok
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, this );
|
||||
info.setCenterText();
|
||||
info.show();
|
||||
|
@ -832,9 +832,9 @@ void MyDialog::cb_terminfo()
|
|||
<< " Size: " << x << fc::Times
|
||||
<< y << "\n"
|
||||
<< "Colors: " << finalcut::FTerm::getMaxColor()
|
||||
, finalcut::FMessageBox::Ok
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Ok
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, this
|
||||
);
|
||||
info1.setHeadline("Terminal:");
|
||||
|
@ -850,9 +850,9 @@ void MyDialog::cb_drives()
|
|||
, "Generic: \n\n"
|
||||
"Network: \n\n"
|
||||
" CD:"
|
||||
, finalcut::FMessageBox::Ok
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Ok
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, finalcut::FMessageBox::ButtonType::Reject
|
||||
, this
|
||||
);
|
||||
|
||||
|
|
|
@ -365,12 +365,14 @@ void FApplication::setKeyboardWidget (FWidget* widget)
|
|||
void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev)
|
||||
{
|
||||
internal::var::app_object->unsetMoveSizeMode();
|
||||
const int ret = FMessageBox::info ( w, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
const FMessageBox::ButtonType ret = \
|
||||
FMessageBox::info ( w, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::ButtonType::Yes
|
||||
, FMessageBox::ButtonType::No );
|
||||
|
||||
if ( ret == FMessageBox::ButtonType::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
{
|
||||
|
@ -1265,7 +1267,7 @@ void FApplication::processCloseWidget()
|
|||
if ( ! getWidgetCloseList() || getWidgetCloseList()->empty() )
|
||||
return;
|
||||
|
||||
setTerminalUpdates (FVTerm::stop_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Stop);
|
||||
auto iter = getWidgetCloseList()->begin();
|
||||
|
||||
while ( iter != getWidgetCloseList()->end() && *iter )
|
||||
|
@ -1275,7 +1277,7 @@ void FApplication::processCloseWidget()
|
|||
}
|
||||
|
||||
getWidgetCloseList()->clear();
|
||||
setTerminalUpdates (FVTerm::start_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Start);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -189,9 +189,9 @@ void FDialog::hide()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int FDialog::exec()
|
||||
FDialog::ResultCode FDialog::exec()
|
||||
{
|
||||
result_code = FDialog::Reject;
|
||||
result_code = ResultCode::Reject;
|
||||
show();
|
||||
return result_code;
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ void FDialog::onKeyPress (FKeyEvent* ev)
|
|||
ev->accept();
|
||||
|
||||
if ( isModal() )
|
||||
done (FDialog::Reject);
|
||||
done (ResultCode::Reject);
|
||||
else
|
||||
close();
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev)
|
|||
setClickedWidget(nullptr);
|
||||
|
||||
if ( isModal() )
|
||||
done (FDialog::Reject);
|
||||
done (ResultCode::Reject);
|
||||
else
|
||||
close();
|
||||
}
|
||||
|
@ -761,7 +761,7 @@ void FDialog::onWindowLowered (FEvent*)
|
|||
|
||||
// protected methods of FDialog
|
||||
//----------------------------------------------------------------------
|
||||
void FDialog::done(int result)
|
||||
void FDialog::done (ResultCode result)
|
||||
{
|
||||
hide();
|
||||
result_code = result;
|
||||
|
@ -807,7 +807,7 @@ void FDialog::drawDialogShadow()
|
|||
void FDialog::onClose (FCloseEvent* ev)
|
||||
{
|
||||
ev->accept();
|
||||
result_code = FDialog::Reject;
|
||||
result_code = ResultCode::Reject;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ FString fileChooser ( FWidget* parent
|
|||
, type
|
||||
, parent );
|
||||
|
||||
if ( fileopen.exec() == FDialog::Accept )
|
||||
if ( fileopen.exec() == FDialog::ResultCode::Accept )
|
||||
ret = fileopen.getPath() + fileopen.getSelectedFile();
|
||||
else
|
||||
ret = FString{};
|
||||
|
@ -261,7 +261,7 @@ FString FFileDialog::fileOpenChooser ( FWidget* parent
|
|||
, const FString& dirname
|
||||
, const FString& filter )
|
||||
{
|
||||
return fileChooser (parent, dirname, filter, FFileDialog::Open);
|
||||
return fileChooser (parent, dirname, filter, DialogType::Open);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -269,7 +269,7 @@ FString FFileDialog::fileSaveChooser ( FWidget* parent
|
|||
, const FString& dirname
|
||||
, const FString& filter )
|
||||
{
|
||||
return fileChooser (parent, dirname, filter, FFileDialog::Save);
|
||||
return fileChooser (parent, dirname, filter, DialogType::Save);
|
||||
}
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ void FFileDialog::init()
|
|||
else
|
||||
x = y = 1;
|
||||
|
||||
if ( dlg_type == FFileDialog::Save )
|
||||
if ( dlg_type == DialogType::Save )
|
||||
FDialog::setText("Save file");
|
||||
else
|
||||
FDialog::setText("Open file");
|
||||
|
@ -362,7 +362,7 @@ inline void FFileDialog::widgetSettings (const FPoint& pos)
|
|||
cancel_btn.setText ("&Cancel");
|
||||
cancel_btn.setGeometry(FPoint{19, 10}, FSize{9, 1});
|
||||
|
||||
if ( dlg_type == FFileDialog::Save )
|
||||
if ( dlg_type == DialogType::Save )
|
||||
open_btn.setText ("&Save");
|
||||
else
|
||||
open_btn.setText ("&Open");
|
||||
|
@ -788,7 +788,7 @@ void FFileDialog::cb_processActivate()
|
|||
if ( found )
|
||||
changeDir(input);
|
||||
else
|
||||
done (FDialog::Accept);
|
||||
done (ResultCode::Accept);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -818,19 +818,19 @@ void FFileDialog::cb_processClicked()
|
|||
if ( dir_entries[n].directory )
|
||||
changeDir(dir_entries[n].name);
|
||||
else
|
||||
done (FDialog::Accept);
|
||||
done (ResultCode::Accept);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FFileDialog::cb_processCancel()
|
||||
{
|
||||
done (FDialog::Reject);
|
||||
done (ResultCode::Reject);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FFileDialog::cb_processOpen()
|
||||
{
|
||||
done (FDialog::Accept);
|
||||
done (ResultCode::Accept);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -214,7 +214,7 @@ void FLineEdit::setLabelText (const FString& ltxt)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FLineEdit::setLabelOrientation (const label_o o)
|
||||
void FLineEdit::setLabelOrientation (const LabelOrientation o)
|
||||
{
|
||||
label_orientation = o;
|
||||
adjustLabel();
|
||||
|
@ -610,15 +610,15 @@ void FLineEdit::adjustLabel()
|
|||
if ( hasHotkey() )
|
||||
label_width--;
|
||||
|
||||
assert ( label_orientation == label_above
|
||||
|| label_orientation == label_left );
|
||||
assert ( label_orientation == LabelOrientation::above
|
||||
|| label_orientation == LabelOrientation::left );
|
||||
|
||||
if ( label_orientation == label_above )
|
||||
if ( label_orientation == LabelOrientation::above )
|
||||
{
|
||||
label->setGeometry ( FPoint{w->getX(), w->getY() - 1}
|
||||
, FSize{label_width, 1} );
|
||||
}
|
||||
else if ( label_orientation == label_left )
|
||||
else if ( label_orientation == LabelOrientation::left )
|
||||
{
|
||||
label->setGeometry ( FPoint{w->getX() - int(label_width) - 1, w->getY()}
|
||||
, FSize{label_width, 1} );
|
||||
|
@ -710,15 +710,15 @@ void FLineEdit::drawInputField()
|
|||
|
||||
const std::size_t text_offset_column = [this] ()
|
||||
{
|
||||
assert ( input_type == FLineEdit::textfield
|
||||
|| input_type == FLineEdit::password );
|
||||
assert ( input_type == InputType::textfield
|
||||
|| input_type == InputType::password );
|
||||
|
||||
switch ( input_type )
|
||||
{
|
||||
case FLineEdit::textfield:
|
||||
case InputType::textfield:
|
||||
return printTextField();
|
||||
|
||||
case FLineEdit::password:
|
||||
case InputType::password:
|
||||
return printPassword();
|
||||
}
|
||||
|
||||
|
@ -782,11 +782,11 @@ inline std::size_t FLineEdit::printPassword()
|
|||
//----------------------------------------------------------------------
|
||||
inline std::size_t FLineEdit::getCursorColumnPos() const
|
||||
{
|
||||
if ( input_type == FLineEdit::textfield )
|
||||
if ( input_type == InputType::textfield )
|
||||
{
|
||||
return getColumnWidth (print_text, cursor_pos);
|
||||
}
|
||||
else if ( input_type == FLineEdit::password )
|
||||
else if ( input_type == InputType::password )
|
||||
{
|
||||
return cursor_pos;
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ inline FString FLineEdit::getPasswordText() const
|
|||
//----------------------------------------------------------------------
|
||||
inline bool FLineEdit::isPasswordField() const
|
||||
{
|
||||
return bool( input_type == FLineEdit::password );
|
||||
return bool( input_type == InputType::password );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -312,7 +312,7 @@ bool FMenuBar::selectNextItem()
|
|||
if ( next == *iter )
|
||||
return false;
|
||||
|
||||
setTerminalUpdates (FVTerm::stop_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Stop);
|
||||
unselectItem();
|
||||
next->setSelected();
|
||||
setSelectedItem(next);
|
||||
|
@ -335,7 +335,7 @@ bool FMenuBar::selectNextItem()
|
|||
getStatusBar()->drawMessage();
|
||||
|
||||
redraw();
|
||||
setTerminalUpdates (FVTerm::start_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Start);
|
||||
forceTerminalUpdate();
|
||||
break;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ bool FMenuBar::selectPrevItem()
|
|||
if ( prev == *iter )
|
||||
return false;
|
||||
|
||||
setTerminalUpdates (FVTerm::stop_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Stop);
|
||||
unselectItem();
|
||||
prev->setSelected();
|
||||
prev->setFocus();
|
||||
|
@ -400,7 +400,7 @@ bool FMenuBar::selectPrevItem()
|
|||
|
||||
setSelectedItem(prev);
|
||||
redraw();
|
||||
setTerminalUpdates (FVTerm::start_terminal_updates);
|
||||
setTerminalUpdates (FVTerm::TerminalUpdate::Start);
|
||||
forceTerminalUpdate();
|
||||
break;
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent& ev)
|
|||
else
|
||||
{
|
||||
// Event handover to the menu
|
||||
passEventToMenu(std::move(ev));
|
||||
passEventToMenu(ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent& ev)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenuBar::passEventToMenu (const FMouseEvent&& ev) const
|
||||
void FMenuBar::passEventToMenu (const FMouseEvent& ev) const
|
||||
{
|
||||
if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() )
|
||||
return;
|
||||
|
|
|
@ -51,31 +51,12 @@ constexpr std::array<const char* const, 8> button_text =
|
|||
//----------------------------------------------------------------------
|
||||
FMessageBox::FMessageBox (FWidget* parent)
|
||||
: FDialog{parent}
|
||||
, button_digit{FMessageBox::Ok, FMessageBox::Reject, FMessageBox::Reject}
|
||||
, button_digit{ButtonType::Ok, ButtonType::Reject, ButtonType::Reject}
|
||||
{
|
||||
setTitlebarText("Message for you");
|
||||
init();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FMessageBox::FMessageBox (const FMessageBox& mbox)
|
||||
: FDialog{mbox.getParentWidget()}
|
||||
, headline_text{mbox.headline_text}
|
||||
, text{mbox.text}
|
||||
, text_components{mbox.text_components}
|
||||
, max_line_width{mbox.max_line_width}
|
||||
, emphasis_color{mbox.emphasis_color}
|
||||
, button_digit{mbox.button_digit[0],
|
||||
mbox.button_digit[1],
|
||||
mbox.button_digit[2]}
|
||||
, num_buttons{mbox.num_buttons}
|
||||
, text_num_lines{mbox.text_num_lines}
|
||||
, center_text{mbox.center_text}
|
||||
{
|
||||
setTitlebarText (mbox.getTitlebarText());
|
||||
init();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FMessageBox::FMessageBox ( const FString& caption
|
||||
, const FString& message
|
||||
|
@ -151,15 +132,22 @@ void FMessageBox::setText (const FString& txt)
|
|||
if ( button[0] )
|
||||
button[0]->setY (int(getHeight()) - 4, false);
|
||||
|
||||
if ( button[1] && button_digit[1] != FMessageBox::Reject )
|
||||
if ( button[1] && button_digit[1] != ButtonType::Reject )
|
||||
button[1]->setY (int(getHeight()) - 4, false);
|
||||
|
||||
if ( button[2] && button_digit[2] != FMessageBox::Reject )
|
||||
if ( button[2] && button_digit[2] != ButtonType::Reject )
|
||||
button[2]->setY (int(getHeight()) - 4, false);
|
||||
|
||||
adjustButtons();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FMessageBox::ButtonType FMessageBox::exec()
|
||||
{
|
||||
result_code = ButtonType::Reject;
|
||||
show();
|
||||
return result_code;
|
||||
}
|
||||
|
||||
// protected methods of FMessageBox
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -187,10 +175,17 @@ void FMessageBox::adjustSize()
|
|||
FDialog::adjustSize();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMessageBox::done (ButtonType result)
|
||||
{
|
||||
hide();
|
||||
result_code = result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMessageBox::cb_processClick (ButtonType reply)
|
||||
{
|
||||
done(int(reply));
|
||||
done(reply);
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,21 +195,21 @@ void FMessageBox::init()
|
|||
{
|
||||
calculateDimensions();
|
||||
|
||||
if ( (button_digit[2] != Reject && button_digit[1] == Reject)
|
||||
|| (button_digit[1] != Reject && button_digit[0] == Reject) )
|
||||
if ( (button_digit[2] != ButtonType::Reject && button_digit[1] == ButtonType::Reject)
|
||||
|| (button_digit[1] != ButtonType::Reject && button_digit[0] == ButtonType::Reject) )
|
||||
{
|
||||
button_digit[0] = button_digit[1] \
|
||||
= button_digit[2] \
|
||||
= FMessageBox::Reject;
|
||||
= ButtonType::Reject;
|
||||
}
|
||||
|
||||
if ( button_digit[0] == FMessageBox::Reject )
|
||||
button_digit[0] = FMessageBox::Ok;
|
||||
if ( button_digit[0] == ButtonType::Reject )
|
||||
button_digit[0] = ButtonType::Ok;
|
||||
|
||||
if ( button_digit[1] == FMessageBox::Reject
|
||||
&& button_digit[2] == FMessageBox::Reject )
|
||||
if ( button_digit[1] == ButtonType::Reject
|
||||
&& button_digit[2] == ButtonType::Reject )
|
||||
num_buttons = 1;
|
||||
else if ( button_digit[2] == FMessageBox::Reject )
|
||||
else if ( button_digit[2] == ButtonType::Reject )
|
||||
num_buttons = 2;
|
||||
else
|
||||
num_buttons = 3;
|
||||
|
@ -232,25 +227,25 @@ inline void FMessageBox::allocation()
|
|||
try
|
||||
{
|
||||
button[0].reset(new FButton (this));
|
||||
button[0]->setText(button_text[button_digit[0]]);
|
||||
button[0]->setText(button_text[std::size_t(button_digit[0])]);
|
||||
button[0]->setPos(FPoint{3, int(getHeight()) - 4}, false);
|
||||
button[0]->setWidth(1, false);
|
||||
button[0]->setHeight(1, false);
|
||||
button[0]->setFocus();
|
||||
|
||||
if ( button_digit[1] > FMessageBox::Reject )
|
||||
if ( button_digit[1] > ButtonType::Reject )
|
||||
{
|
||||
button[1].reset(new FButton(this));
|
||||
button[1]->setText(button_text[button_digit[1]]);
|
||||
button[1]->setText(button_text[std::size_t(button_digit[1])]);
|
||||
button[1]->setPos(FPoint{17, int(getHeight()) - 4}, false);
|
||||
button[1]->setWidth(0, false);
|
||||
button[1]->setHeight(1, false);
|
||||
}
|
||||
|
||||
if ( button_digit[2] > FMessageBox::Reject )
|
||||
if ( button_digit[2] > ButtonType::Reject )
|
||||
{
|
||||
button[2].reset(new FButton(this));
|
||||
button[2]->setText(button_text[button_digit[2]]);
|
||||
button[2]->setText(button_text[std::size_t(button_digit[2])]);
|
||||
button[2]->setPos(FPoint{32, int(getHeight()) - 4}, false);
|
||||
button[2]->setWidth(0, false);
|
||||
button[2]->setHeight(1, false);
|
||||
|
@ -266,7 +261,7 @@ inline void FMessageBox::allocation()
|
|||
//----------------------------------------------------------------------
|
||||
inline void FMessageBox::initCallbacks()
|
||||
{
|
||||
if ( button[0] && button_digit[0] != FMessageBox::Reject )
|
||||
if ( button[0] && button_digit[0] != ButtonType::Reject )
|
||||
{
|
||||
button[0]->addCallback
|
||||
(
|
||||
|
@ -276,7 +271,7 @@ inline void FMessageBox::initCallbacks()
|
|||
);
|
||||
}
|
||||
|
||||
if ( button[1] && button_digit[1] != FMessageBox::Reject )
|
||||
if ( button[1] && button_digit[1] != ButtonType::Reject )
|
||||
{
|
||||
button[1]->addCallback
|
||||
(
|
||||
|
@ -286,7 +281,7 @@ inline void FMessageBox::initCallbacks()
|
|||
);
|
||||
}
|
||||
|
||||
if ( button[2] && button_digit[2] != FMessageBox::Reject )
|
||||
if ( button[2] && button_digit[2] != ButtonType::Reject )
|
||||
{
|
||||
button[2]->addCallback
|
||||
(
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace finalcut
|
|||
|
||||
// constructor and destructor
|
||||
//----------------------------------------------------------------------
|
||||
FRect::FRect (const FPoint& p, const FSize& s)
|
||||
FRect::FRect (const FPoint& p, const FSize& s) noexcept
|
||||
: X1{p.getX()}
|
||||
, Y1{p.getY()}
|
||||
, X2{p.getX() + int(s.getWidth()) - 1}
|
||||
|
@ -44,7 +44,7 @@ FRect::FRect (const FPoint& p, const FSize& s)
|
|||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FRect::FRect (const FPoint& p1, const FPoint& p2)
|
||||
FRect::FRect (const FPoint& p1, const FPoint& p2) noexcept
|
||||
: X1{p1.getX()}
|
||||
, Y1{p1.getY()}
|
||||
, X2{p2.getX()}
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
namespace finalcut
|
||||
{
|
||||
|
||||
// static class attribute
|
||||
FStartOptions* FStartOptions::start_options{};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// class FStartOptions
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -198,7 +198,7 @@ void FTermLinux::init()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FTermLinux::initCharMap()
|
||||
void FTermLinux::initCharMap() const
|
||||
{
|
||||
constexpr sInt16 NOT_FOUND = -1;
|
||||
|
||||
|
@ -767,7 +767,7 @@ inline uInt16 FTermLinux::getInputStatusRegisterOne() const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
uChar FTermLinux::readAttributeController (uChar index)
|
||||
uChar FTermLinux::readAttributeController (uChar index) const
|
||||
{
|
||||
// Reads a byte from the attribute controller from a given index
|
||||
|
||||
|
@ -793,7 +793,7 @@ uChar FTermLinux::readAttributeController (uChar index)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FTermLinux::writeAttributeController (uChar index, uChar data)
|
||||
void FTermLinux::writeAttributeController (uChar index, uChar data) const
|
||||
{
|
||||
// Writes a byte from the attribute controller from a given index
|
||||
|
||||
|
|
|
@ -153,19 +153,19 @@ void FVTerm::setTermXY (int x, int y) const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FVTerm::setTerminalUpdates (terminal_update refresh_state) const
|
||||
void FVTerm::setTerminalUpdates (TerminalUpdate refresh_state) const
|
||||
{
|
||||
if ( refresh_state == stop_terminal_updates )
|
||||
if ( refresh_state == TerminalUpdate::Stop )
|
||||
{
|
||||
no_terminal_updates = true;
|
||||
}
|
||||
else if ( refresh_state == continue_terminal_updates
|
||||
|| refresh_state == start_terminal_updates )
|
||||
else if ( refresh_state == TerminalUpdate::Continue
|
||||
|| refresh_state == TerminalUpdate::Start )
|
||||
{
|
||||
no_terminal_updates = false;
|
||||
}
|
||||
|
||||
if ( refresh_state == start_terminal_updates )
|
||||
if ( refresh_state == TerminalUpdate::Start )
|
||||
updateTerminal();
|
||||
}
|
||||
|
||||
|
@ -305,8 +305,9 @@ void FVTerm::addPreprocessingHandler ( const FVTerm* instance
|
|||
|
||||
if ( print_area )
|
||||
{
|
||||
FVTermPreprocessing obj{ instance, std::move(function) };
|
||||
delPreprocessingHandler (instance);
|
||||
auto obj = make_unique<FVTermPreprocessing> \
|
||||
(instance, std::forward<FPreprocessingFunction>(function));
|
||||
print_area->preproc_list.emplace_back(std::move(obj));
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +325,7 @@ void FVTerm::delPreprocessingHandler (const FVTerm* instance)
|
|||
|
||||
while ( iter != print_area->preproc_list.end() )
|
||||
{
|
||||
if ( iter->instance.get() == instance )
|
||||
if ( iter->get()->instance.get() == instance )
|
||||
iter = print_area->preproc_list.erase(iter);
|
||||
else
|
||||
++iter;
|
||||
|
@ -803,7 +804,7 @@ bool FVTerm::updateVTermCursor (const FTermArea* area) const
|
|||
|
||||
if ( isInsideArea (FPoint{cx, cy}, area)
|
||||
&& isInsideTerminal (FPoint{x, y})
|
||||
&& isCovered (FPoint{x, y}, area) == non_covered )
|
||||
&& isCovered (FPoint{x, y}, area) == CoveredState::non_covered )
|
||||
{
|
||||
vterm->input_cursor_x = x;
|
||||
vterm->input_cursor_y = y;
|
||||
|
@ -1362,15 +1363,15 @@ inline bool FVTerm::reallocateTextArea (FTermArea* area, std::size_t size)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FVTerm::covered_state FVTerm::isCovered ( const FPoint& pos
|
||||
, const FTermArea* area )
|
||||
FVTerm::CoveredState FVTerm::isCovered ( const FPoint& pos
|
||||
, const FTermArea* area )
|
||||
{
|
||||
// Determines the covered state for the given position
|
||||
|
||||
if ( ! area )
|
||||
return non_covered;
|
||||
return CoveredState::non_covered;
|
||||
|
||||
auto is_covered = non_covered;
|
||||
auto is_covered = CoveredState::non_covered;
|
||||
|
||||
if ( FWidget::getWindowList() && ! FWidget::getWindowList()->empty() )
|
||||
{
|
||||
|
@ -1398,11 +1399,11 @@ FVTerm::covered_state FVTerm::isCovered ( const FPoint& pos
|
|||
|
||||
if ( tmp->attr.bit.color_overlay )
|
||||
{
|
||||
is_covered = half_covered;
|
||||
is_covered = CoveredState::half_covered;
|
||||
}
|
||||
else if ( ! tmp->attr.bit.transparent )
|
||||
{
|
||||
is_covered = fully_covered;
|
||||
is_covered = CoveredState::fully_covered;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1524,10 +1525,10 @@ bool FVTerm::updateVTermCharacter ( const FTermArea* area
|
|||
// Get covered state
|
||||
const auto is_covered = isCovered(terminal_pos, area);
|
||||
|
||||
if ( is_covered == fully_covered )
|
||||
if ( is_covered == CoveredState::fully_covered )
|
||||
return false;
|
||||
|
||||
if ( is_covered == half_covered )
|
||||
if ( is_covered == CoveredState::half_covered )
|
||||
{
|
||||
// Overlapped character
|
||||
auto oc = getOverlappedCharacter (terminal_pos, area);
|
||||
|
@ -1610,7 +1611,7 @@ void FVTerm::callPreprocessingHandler (const FTermArea* area)
|
|||
for (auto&& pcall : area->preproc_list)
|
||||
{
|
||||
// call the preprocessing handler
|
||||
auto preprocessingHandler = pcall.function;
|
||||
auto preprocessingHandler = pcall->function;
|
||||
preprocessingHandler();
|
||||
}
|
||||
}
|
||||
|
@ -1623,11 +1624,11 @@ bool FVTerm::hasChildAreaChanges (FTermArea* area) const
|
|||
|
||||
return std::any_of ( area->preproc_list.begin()
|
||||
, area->preproc_list.end()
|
||||
, [] (const FVTermPreprocessing& pcall)
|
||||
, [] (const std::unique_ptr<FVTermPreprocessing>& pcall)
|
||||
{
|
||||
return pcall.instance
|
||||
&& pcall.instance->child_print_area
|
||||
&& pcall.instance->child_print_area->has_changes;
|
||||
return pcall->instance
|
||||
&& pcall->instance->child_print_area
|
||||
&& pcall->instance->child_print_area->has_changes;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -1640,8 +1641,8 @@ void FVTerm::clearChildAreaChanges (const FTermArea* area) const
|
|||
|
||||
for (auto&& pcall : area->preproc_list)
|
||||
{
|
||||
if ( pcall.instance && pcall.instance->child_print_area )
|
||||
pcall.instance->child_print_area->has_changes = false;
|
||||
if ( pcall->instance && pcall->instance->child_print_area )
|
||||
pcall->instance->child_print_area->has_changes = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1830,7 +1831,7 @@ void FVTerm::init()
|
|||
output_buffer->reserve(TERMINAL_OUTPUT_BUFFER_SIZE + 256);
|
||||
|
||||
// term_attribute stores the current state of the terminal
|
||||
term_attribute.ch = { L'\0' };
|
||||
term_attribute.ch = {{ L'\0' }};
|
||||
term_attribute.fg_color = fc::Default;
|
||||
term_attribute.bg_color = fc::Default;
|
||||
term_attribute.attr.byte[0] = 0;
|
||||
|
@ -2718,7 +2719,7 @@ void FVTerm::printPaddingCharacter (FTermArea* area, const FChar& term_char)
|
|||
|
||||
if ( FTerm::getEncoding() == fc::UTF8 )
|
||||
{
|
||||
pc.ch = { L'\0' };
|
||||
pc.ch = {{ L'\0' }};
|
||||
pc.attr.bit.fullwidth_padding = true;
|
||||
pc.attr.bit.char_width = 0;
|
||||
}
|
||||
|
|
|
@ -681,7 +681,7 @@ void FWindow::switchToPrevWindow (const FWidget* widget)
|
|||
// Disable terminal updates to avoid flickering
|
||||
// when redrawing the focused widget
|
||||
if ( widget )
|
||||
widget->setTerminalUpdates (FVTerm::stop_terminal_updates);
|
||||
widget->setTerminalUpdates (FVTerm::TerminalUpdate::Stop);
|
||||
|
||||
const bool is_activated = activatePrevWindow();
|
||||
auto active_win = static_cast<FWindow*>(getActiveWindow());
|
||||
|
@ -729,7 +729,7 @@ void FWindow::switchToPrevWindow (const FWidget* widget)
|
|||
|
||||
// Enable terminal updates again
|
||||
if ( widget )
|
||||
widget->setTerminalUpdates (FVTerm::continue_terminal_updates);
|
||||
widget->setTerminalUpdates (FVTerm::TerminalUpdate::Continue);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -134,6 +134,7 @@ class FComboBox : public FWidget
|
|||
public:
|
||||
// Using-declaration
|
||||
using FWidget::setGeometry;
|
||||
using LabelOrientation = FLineEdit::LabelOrientation;
|
||||
|
||||
// Constructors
|
||||
explicit FComboBox (FWidget* = nullptr);
|
||||
|
@ -155,7 +156,7 @@ class FComboBox : public FWidget
|
|||
FString getText() const;
|
||||
template <typename DT>
|
||||
clean_fdata_t<DT>& getItemData();
|
||||
FLineEdit::label_o getLabelOrientation() const;
|
||||
LabelOrientation getLabelOrientation() const;
|
||||
|
||||
// Mutators
|
||||
void setSize (const FSize&, bool = true) override;
|
||||
|
@ -179,7 +180,7 @@ class FComboBox : public FWidget
|
|||
void setText (const FString&);
|
||||
void clearText();
|
||||
void setLabelText (const FString&);
|
||||
void setLabelOrientation (const FLineEdit::label_o);
|
||||
void setLabelOrientation (const LabelOrientation);
|
||||
|
||||
// Inquiries
|
||||
bool hasShadow() const;
|
||||
|
@ -261,7 +262,7 @@ inline clean_fdata_t<DT>& FComboBox::getItemData()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FLineEdit::label_o FComboBox::getLabelOrientation() const
|
||||
inline FLineEdit::LabelOrientation FComboBox::getLabelOrientation() const
|
||||
{ return input_field.getLabelOrientation(); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -342,7 +343,7 @@ inline void FComboBox::setLabelText (const FString& s)
|
|||
{ input_field.setLabelText(s); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FComboBox::setLabelOrientation (const FLineEdit::label_o o)
|
||||
inline void FComboBox::setLabelOrientation (const LabelOrientation o)
|
||||
{ input_field.setLabelOrientation(o); }
|
||||
|
||||
} // namespace finalcut
|
||||
|
|
|
@ -65,7 +65,7 @@ template <typename T>
|
|||
struct cleanCondition<T, false, false>
|
||||
{
|
||||
// Leave the type untouched
|
||||
typedef T type;
|
||||
using type = T;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -73,7 +73,7 @@ template <typename T>
|
|||
struct cleanCondition<T, true, false>
|
||||
{
|
||||
// Array to pointer
|
||||
typedef typename std::remove_extent<T>::type* type;
|
||||
using type = typename std::remove_extent<T>::type*;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -81,7 +81,7 @@ template <typename T>
|
|||
struct cleanCondition<T, false, true>
|
||||
{
|
||||
// Add pointer to function
|
||||
typedef typename std::add_pointer<T>::type type;
|
||||
using type = typename std::add_pointer<T>::type;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -91,11 +91,11 @@ template <typename T>
|
|||
class cleanFData
|
||||
{
|
||||
private:
|
||||
typedef typename std::remove_reference<T>::type remove_ref;
|
||||
using remove_ref = typename std::remove_reference<T>::type;
|
||||
|
||||
public:
|
||||
// Similar to std::decay, but keeps const and volatile
|
||||
typedef typename internal::cleanCondition<remove_ref>::type type;
|
||||
using type = typename internal::cleanCondition<remove_ref>::type;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -153,7 +153,7 @@ template <typename T>
|
|||
class FData : public FDataAccess
|
||||
{
|
||||
public:
|
||||
typedef typename std::remove_cv<T>::type T_nocv;
|
||||
using T_nocv = typename std::remove_cv<T>::type;
|
||||
|
||||
// Constructors
|
||||
explicit FData (T& v) // constructor
|
||||
|
|
|
@ -71,7 +71,7 @@ class FDialog : public FWindow
|
|||
using FWindow::setResizeable;
|
||||
|
||||
// Enumeration
|
||||
enum DialogCode
|
||||
enum class ResultCode : int
|
||||
{
|
||||
Reject = 0,
|
||||
Accept = 1
|
||||
|
@ -119,7 +119,7 @@ class FDialog : public FWindow
|
|||
// Methods
|
||||
void show() override;
|
||||
void hide() override;
|
||||
int exec();
|
||||
ResultCode exec();
|
||||
void setPos (const FPoint&, bool = true) override;
|
||||
void move (const FPoint&) override;
|
||||
bool moveUp (int);
|
||||
|
@ -147,7 +147,7 @@ class FDialog : public FWindow
|
|||
|
||||
protected:
|
||||
// Methods
|
||||
virtual void done (int);
|
||||
void done (ResultCode);
|
||||
void draw() override;
|
||||
void drawDialogShadow();
|
||||
|
||||
|
@ -217,7 +217,7 @@ class FDialog : public FWindow
|
|||
|
||||
// Data members
|
||||
FString tb_text{}; // title bar text
|
||||
int result_code{FDialog::Reject};
|
||||
ResultCode result_code{ResultCode::Reject};
|
||||
bool zoom_button_pressed{false};
|
||||
bool zoom_button_active{false};
|
||||
bool setPos_error{false};
|
||||
|
|
|
@ -88,7 +88,7 @@ class FFileDialog : public FDialog
|
|||
{
|
||||
public:
|
||||
// Enumeration
|
||||
enum DialogType
|
||||
enum class DialogType
|
||||
{
|
||||
Open = 0,
|
||||
Save = 1
|
||||
|
@ -99,7 +99,7 @@ class FFileDialog : public FDialog
|
|||
FFileDialog (const FFileDialog&); // copy constructor
|
||||
FFileDialog ( const FString&
|
||||
, const FString&
|
||||
, DialogType = FFileDialog::Open
|
||||
, DialogType = DialogType::Open
|
||||
, FWidget* = nullptr );
|
||||
|
||||
// Destructor
|
||||
|
@ -219,7 +219,7 @@ class FFileDialog : public FDialog
|
|||
FCheckBox hidden_check{this};
|
||||
FButton cancel_btn{this};
|
||||
FButton open_btn{this};
|
||||
DialogType dlg_type{FFileDialog::Open};
|
||||
DialogType dlg_type{DialogType::Open};
|
||||
bool show_hidden{false};
|
||||
|
||||
// Friend functions
|
||||
|
|
|
@ -69,13 +69,13 @@ class FLineEdit : public FWidget
|
|||
using FWidget::setGeometry;
|
||||
|
||||
// Enumerations
|
||||
enum label_o
|
||||
enum class LabelOrientation
|
||||
{
|
||||
label_above = 0,
|
||||
label_left = 1
|
||||
above = 0,
|
||||
left = 1
|
||||
};
|
||||
|
||||
enum inputType
|
||||
enum class InputType
|
||||
{
|
||||
textfield = 0,
|
||||
password = 1
|
||||
|
@ -108,7 +108,7 @@ class FLineEdit : public FWidget
|
|||
std::size_t getMaxLength() const;
|
||||
std::size_t getCursorPosition() const;
|
||||
FLabel* getLabelObject() const;
|
||||
label_o getLabelOrientation() const;
|
||||
LabelOrientation getLabelOrientation() const;
|
||||
|
||||
// Mutators
|
||||
void setText (const FString&);
|
||||
|
@ -117,8 +117,8 @@ class FLineEdit : public FWidget
|
|||
void setMaxLength (std::size_t);
|
||||
void setCursorPosition (std::size_t);
|
||||
void setLabelText (const FString&);
|
||||
void setInputType (const inputType);
|
||||
void setLabelOrientation (const label_o);
|
||||
void setInputType (const InputType);
|
||||
void setLabelOrientation (const LabelOrientation);
|
||||
void setLabelAssociatedWidget (FWidget*);
|
||||
void resetColors() override;
|
||||
void setSize (const FSize&, bool = true) override;
|
||||
|
@ -204,24 +204,24 @@ class FLineEdit : public FWidget
|
|||
void processChanged() const;
|
||||
|
||||
// Data members
|
||||
FString text{""};
|
||||
FString print_text{""};
|
||||
FString label_text{""};
|
||||
FLabel* label{};
|
||||
FWidget* label_associated_widget{this};
|
||||
std::wstring input_filter{};
|
||||
dragScroll drag_scroll{FLineEdit::noScroll};
|
||||
label_o label_orientation{FLineEdit::label_left};
|
||||
inputType input_type{FLineEdit::textfield};
|
||||
int scroll_repeat{100};
|
||||
bool scroll_timer{false};
|
||||
bool insert_mode{true};
|
||||
bool read_only{false};
|
||||
std::size_t cursor_pos{NOT_SET};
|
||||
std::size_t text_offset{0};
|
||||
std::size_t char_width_offset{0};
|
||||
std::size_t x_pos{0};
|
||||
std::size_t max_length{std::numeric_limits<std::size_t>::max()};
|
||||
FString text{""};
|
||||
FString print_text{""};
|
||||
FString label_text{""};
|
||||
FLabel* label{};
|
||||
FWidget* label_associated_widget{this};
|
||||
std::wstring input_filter{};
|
||||
dragScroll drag_scroll{FLineEdit::noScroll};
|
||||
LabelOrientation label_orientation{LabelOrientation::left};
|
||||
InputType input_type{InputType::textfield};
|
||||
int scroll_repeat{100};
|
||||
bool scroll_timer{false};
|
||||
bool insert_mode{true};
|
||||
bool read_only{false};
|
||||
std::size_t cursor_pos{NOT_SET};
|
||||
std::size_t text_offset{0};
|
||||
std::size_t char_width_offset{0};
|
||||
std::size_t x_pos{0};
|
||||
std::size_t max_length{std::numeric_limits<std::size_t>::max()};
|
||||
};
|
||||
|
||||
|
||||
|
@ -257,7 +257,7 @@ inline FLabel* FLineEdit::getLabelObject() const
|
|||
{ return label; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FLineEdit::label_o FLineEdit::getLabelOrientation() const
|
||||
inline FLineEdit::LabelOrientation FLineEdit::getLabelOrientation() const
|
||||
{ return label_orientation; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -269,7 +269,7 @@ inline void FLineEdit::clearInputFilter()
|
|||
{ input_filter.clear(); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FLineEdit::setInputType (const inputType type)
|
||||
inline void FLineEdit::setInputType (const InputType type)
|
||||
{ input_type = type; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -221,6 +221,7 @@ class FListViewIterator
|
|||
|
||||
// Constructor
|
||||
FListViewIterator () = default;
|
||||
~FListViewIterator () = default;
|
||||
FListViewIterator (Iterator);
|
||||
FListViewIterator (const FListViewIterator&) = default;
|
||||
FListViewIterator (FListViewIterator&& i) noexcept
|
||||
|
|
|
@ -139,7 +139,7 @@ class FMenuBar : public FWindow, public FMenuList
|
|||
void mouseDownOverList (const FMouseEvent*);
|
||||
void mouseUpOverList (const FMouseEvent*);
|
||||
void mouseMoveOverList (const FMouseEvent&);
|
||||
void passEventToMenu (const FMouseEvent&&) const;
|
||||
void passEventToMenu (const FMouseEvent&) const;
|
||||
void leaveMenuBar();
|
||||
|
||||
// Data members
|
||||
|
|
|
@ -80,7 +80,7 @@ class FMessageBox : public FDialog
|
|||
{
|
||||
public:
|
||||
// Enumeration
|
||||
enum ButtonType
|
||||
enum class ButtonType : std::size_t
|
||||
{
|
||||
Reject = 0,
|
||||
Ok = 1,
|
||||
|
@ -94,10 +94,13 @@ class FMessageBox : public FDialog
|
|||
|
||||
// Constructors
|
||||
explicit FMessageBox (FWidget* = nullptr);
|
||||
FMessageBox (const FMessageBox&); // copy constructor
|
||||
|
||||
FMessageBox (const FMessageBox&) = default; // copy constructor
|
||||
|
||||
FMessageBox ( const FString&, const FString&
|
||||
, ButtonType, ButtonType, ButtonType
|
||||
, FWidget* = nullptr );
|
||||
|
||||
// Destructor
|
||||
~FMessageBox() noexcept override;
|
||||
|
||||
|
@ -119,23 +122,25 @@ class FMessageBox : public FDialog
|
|||
void setText (const FString&) override;
|
||||
|
||||
// Methods
|
||||
ButtonType exec();
|
||||
template <typename messageType>
|
||||
static int info ( FWidget*
|
||||
static ButtonType info ( FWidget*
|
||||
, const FString&
|
||||
, const messageType&
|
||||
, ButtonType = FMessageBox::Ok
|
||||
, ButtonType = FMessageBox::Reject
|
||||
, ButtonType = FMessageBox::Reject );
|
||||
, ButtonType = ButtonType::Ok
|
||||
, ButtonType = ButtonType::Reject
|
||||
, ButtonType = ButtonType::Reject );
|
||||
|
||||
template <typename messageType>
|
||||
static int error ( FWidget*
|
||||
static ButtonType error ( FWidget*
|
||||
, const messageType&
|
||||
, ButtonType = FMessageBox::Ok
|
||||
, ButtonType = FMessageBox::Reject
|
||||
, ButtonType = FMessageBox::Reject );
|
||||
, ButtonType = ButtonType::Ok
|
||||
, ButtonType = ButtonType::Reject
|
||||
, ButtonType = ButtonType::Reject );
|
||||
protected:
|
||||
// Method
|
||||
void adjustSize() override;
|
||||
void done (ButtonType);
|
||||
|
||||
// Callback method
|
||||
void cb_processClick (ButtonType);
|
||||
|
@ -161,10 +166,11 @@ class FMessageBox : public FDialog
|
|||
FString text{};
|
||||
FStringList text_components{};
|
||||
|
||||
FButtons button;
|
||||
FButtons button{};
|
||||
std::size_t max_line_width{0};
|
||||
FColor emphasis_color{getColorTheme()->dialog_emphasis_fg};
|
||||
ButtonType button_digit[MAX_BUTTONS]{FMessageBox::Reject};
|
||||
ButtonType result_code{ButtonType::Reject};
|
||||
ButtonType button_digit[MAX_BUTTONS]{ButtonType::Reject};
|
||||
std::size_t num_buttons{0};
|
||||
std::size_t text_num_lines{0};
|
||||
bool center_text{false};
|
||||
|
@ -209,28 +215,28 @@ inline bool FMessageBox::unsetCenterText()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
template <typename messageType>
|
||||
int FMessageBox::info ( FWidget* parent
|
||||
, const FString& caption
|
||||
, const messageType& message
|
||||
, ButtonType button0
|
||||
, ButtonType button1
|
||||
, ButtonType button2 )
|
||||
FMessageBox::ButtonType FMessageBox::info ( FWidget* parent
|
||||
, const FString& caption
|
||||
, const messageType& message
|
||||
, ButtonType button0
|
||||
, ButtonType button1
|
||||
, ButtonType button2 )
|
||||
{
|
||||
FMessageBox mbox ( caption
|
||||
, FString() << message
|
||||
, button0, button1, button2
|
||||
, parent );
|
||||
const int reply = mbox.exec();
|
||||
const ButtonType reply = mbox.exec();
|
||||
return reply;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
template <typename messageType>
|
||||
int FMessageBox::error ( FWidget* parent
|
||||
, const messageType& message
|
||||
, ButtonType button0
|
||||
, ButtonType button1
|
||||
, ButtonType button2 )
|
||||
FMessageBox::ButtonType FMessageBox::error ( FWidget* parent
|
||||
, const messageType& message
|
||||
, ButtonType button0
|
||||
, ButtonType button1
|
||||
, ButtonType button2 )
|
||||
{
|
||||
const FString caption{"Error message"};
|
||||
|
||||
|
@ -245,7 +251,7 @@ int FMessageBox::error ( FWidget* parent
|
|||
mbox.setForegroundColor(wc->error_box_fg);
|
||||
mbox.setBackgroundColor(wc->error_box_bg);
|
||||
mbox.emphasis_color = wc->error_box_emphasis_fg;
|
||||
const int reply = mbox.exec();
|
||||
const ButtonType reply = mbox.exec();
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ class FPoint
|
|||
{
|
||||
public:
|
||||
// Constructors
|
||||
FPoint () = default;
|
||||
FPoint (int, int);
|
||||
FPoint () noexcept = default;
|
||||
FPoint (int, int) noexcept;
|
||||
|
||||
// Overloaded operators
|
||||
FPoint& operator += (const FPoint&);
|
||||
|
@ -96,7 +96,7 @@ class FPoint
|
|||
|
||||
// FPoint inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline FPoint::FPoint (int x, int y)
|
||||
inline FPoint::FPoint (int x, int y) noexcept
|
||||
: xpos{x}
|
||||
, ypos{y}
|
||||
{ }
|
||||
|
|
|
@ -59,10 +59,10 @@ class FRect
|
|||
{
|
||||
public:
|
||||
// Constructors
|
||||
FRect () = default;
|
||||
FRect (int, int, std::size_t, std::size_t);
|
||||
FRect (const FPoint&, const FSize&);
|
||||
FRect (const FPoint&, const FPoint&);
|
||||
FRect () noexcept = default;
|
||||
FRect (int, int, std::size_t, std::size_t) noexcept;
|
||||
FRect (const FPoint&, const FSize&) noexcept;
|
||||
FRect (const FPoint&, const FPoint&) noexcept;
|
||||
|
||||
// Accessors
|
||||
FString getClassName() const;
|
||||
|
@ -139,7 +139,7 @@ class FRect
|
|||
|
||||
// FRect inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline FRect::FRect (int x, int y, std::size_t width, std::size_t height)
|
||||
inline FRect::FRect (int x, int y, std::size_t width, std::size_t height) noexcept
|
||||
: X1{x}
|
||||
, Y1{y}
|
||||
, X2{x + int(width) - 1}
|
||||
|
|
|
@ -56,8 +56,8 @@ class FSize
|
|||
{
|
||||
public:
|
||||
// Constructors
|
||||
FSize () = default;
|
||||
FSize (std::size_t, std::size_t);
|
||||
FSize () noexcept = default;
|
||||
FSize (std::size_t, std::size_t) noexcept;
|
||||
|
||||
// Overloaded operators
|
||||
FSize& operator += (const FSize&);
|
||||
|
@ -105,7 +105,7 @@ class FSize
|
|||
|
||||
// FSize inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline FSize::FSize (std::size_t w, std::size_t h)
|
||||
inline FSize::FSize (std::size_t w, std::size_t h) noexcept
|
||||
: width{w}
|
||||
, height{h}
|
||||
{ }
|
||||
|
|
|
@ -66,6 +66,7 @@ class FSpinBox : public FWidget
|
|||
public:
|
||||
// Using-declaration
|
||||
using FWidget::setGeometry;
|
||||
using LabelOrientation = FLineEdit::LabelOrientation;
|
||||
|
||||
// Constructors
|
||||
explicit FSpinBox (FWidget* = nullptr);
|
||||
|
@ -84,7 +85,7 @@ class FSpinBox : public FWidget
|
|||
sInt64 getValue() const;
|
||||
FString getPrefix() const;
|
||||
FString getSuffix() const;
|
||||
FLineEdit::label_o getLabelOrientation() const;
|
||||
LabelOrientation getLabelOrientation() const;
|
||||
|
||||
// Mutators
|
||||
void setSize (const FSize&, bool = true) override;
|
||||
|
@ -107,7 +108,7 @@ class FSpinBox : public FWidget
|
|||
void setPrefix (const FString&);
|
||||
void setSuffix (const FString&);
|
||||
void setLabelText (const FString&);
|
||||
void setLabelOrientation (const FLineEdit::label_o);
|
||||
void setLabelOrientation (const LabelOrientation);
|
||||
|
||||
// Inquiries
|
||||
bool hasShadow() const;
|
||||
|
@ -177,7 +178,7 @@ inline FString FSpinBox::getSuffix() const
|
|||
{ return sfix; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FLineEdit::label_o FSpinBox::getLabelOrientation() const
|
||||
inline FLineEdit::LabelOrientation FSpinBox::getLabelOrientation() const
|
||||
{ return input_field.getLabelOrientation(); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -217,7 +218,7 @@ inline void FSpinBox::setLabelText (const FString& s)
|
|||
{ input_field.setLabelText(s); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FSpinBox::setLabelOrientation (const FLineEdit::label_o o)
|
||||
inline void FSpinBox::setLabelOrientation (const LabelOrientation o)
|
||||
{ input_field.setLabelOrientation(o); }
|
||||
|
||||
} // namespace finalcut
|
||||
|
|
|
@ -95,7 +95,6 @@ class FStartOptions final
|
|||
|
||||
fc::encoding encoding{fc::UNKNOWN};
|
||||
std::ofstream logfile_stream{};
|
||||
static FStartOptions* start_options;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -105,7 +105,7 @@ class FTermLinux final
|
|||
|
||||
// Methods
|
||||
void init();
|
||||
void initCharMap();
|
||||
void initCharMap() const;
|
||||
void finish();
|
||||
bool loadVGAFont();
|
||||
bool loadNewFont();
|
||||
|
@ -154,8 +154,8 @@ class FTermLinux final
|
|||
// Methods
|
||||
#if defined(ISA_SYSCTL_SUPPORT)
|
||||
uInt16 getInputStatusRegisterOne() const;
|
||||
uChar readAttributeController (uChar);
|
||||
void writeAttributeController (uChar, uChar);
|
||||
uChar readAttributeController (uChar) const;
|
||||
void writeAttributeController (uChar, uChar) const;
|
||||
uChar getAttributeMode();
|
||||
void setAttributeMode (uChar);
|
||||
int setBlinkAsIntensity (bool);
|
||||
|
|
|
@ -98,21 +98,21 @@ class FVTerm
|
|||
// Using-declarations
|
||||
using FPreprocessingHandler = void (FVTerm::*)();
|
||||
using FPreprocessingFunction = std::function<void()>;
|
||||
using FPreprocessing = std::vector<FVTermPreprocessing>;
|
||||
using FPreprocessing = std::vector<std::unique_ptr<FVTermPreprocessing>>;
|
||||
|
||||
// Enumerations
|
||||
enum covered_state
|
||||
enum class CoveredState
|
||||
{
|
||||
non_covered,
|
||||
half_covered,
|
||||
fully_covered
|
||||
};
|
||||
|
||||
enum terminal_update
|
||||
enum class TerminalUpdate
|
||||
{
|
||||
stop_terminal_updates, // No terminal refresh
|
||||
continue_terminal_updates, // Resuming terminal refresh
|
||||
start_terminal_updates // Allowing terminal refresh
|
||||
Stop, // No terminal refresh
|
||||
Continue, // Resuming terminal refresh
|
||||
Start // Allowing terminal refresh
|
||||
};
|
||||
|
||||
// Constructor
|
||||
|
@ -150,7 +150,7 @@ class FVTerm
|
|||
|
||||
// Mutators
|
||||
void setTermXY (int, int) const;
|
||||
void setTerminalUpdates (terminal_update) const;
|
||||
void setTerminalUpdates (TerminalUpdate) const;
|
||||
void hideCursor (bool) const;
|
||||
void hideCursor() const;
|
||||
void showCursor() const;
|
||||
|
@ -347,7 +347,7 @@ class FVTerm
|
|||
, std::size_t );
|
||||
static bool reallocateTextArea ( FTermArea*
|
||||
, std::size_t );
|
||||
static covered_state isCovered (const FPoint&, const FTermArea*);
|
||||
static CoveredState isCovered (const FPoint&, const FTermArea*);
|
||||
static void updateOverlappedColor (const FChar&, const FChar&, FChar&);
|
||||
static void updateOverlappedCharacter (FChar&, FChar&);
|
||||
static void updateShadedCharacter (const FChar&, FChar&, FChar&);
|
||||
|
@ -509,7 +509,7 @@ struct FVTerm::FVTermPreprocessing
|
|||
{ }
|
||||
|
||||
FVTermPreprocessing (const FVTermPreprocessing&) = delete;
|
||||
FVTermPreprocessing (FVTermPreprocessing&&) = default;
|
||||
FVTermPreprocessing (FVTermPreprocessing&&) noexcept = default;
|
||||
FVTermPreprocessing& operator = (const FVTermPreprocessing&) = delete;
|
||||
FVTermPreprocessing& operator = (FVTermPreprocessing&&) noexcept = default;
|
||||
|
||||
|
|
Loading…
Reference in New Issue