diff --git a/doc/first-steps.md b/doc/first-steps.md index b7558cac..2e7c5648 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -472,7 +472,7 @@ use `delCallbacks()` to remove all existing callbacks from an object.
"clicked"
"toggled"
FWidget
-
"destroy"
"focus-in"
"focus-out"
"mouse-press"
"mouse-release"
"mouse-move"
"mouse-wheel-down"
"mouse-wheel-up"
+
"destroy"
"enable"
"disable"
"focus-in"
"focus-out"
"mouse-press"
"mouse-release"
"mouse-move"
"mouse-wheel-down"
"mouse-wheel-up"
  diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 478b16aa..eb3d2c5a 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -745,7 +745,7 @@ void FLineEdit::drawInputField() if ( isActiveFocus && getMaxColor() < 16 ) setBold(); - const std::size_t text_offset_column = [&] () -> std::size_t + const std::size_t text_offset_column = [this] () -> std::size_t { switch ( input_type ) { diff --git a/src/flistview.cpp b/src/flistview.cpp index 64e0c55b..69265035 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1534,12 +1534,12 @@ inline void FListView::mapKeyFunctions() key_map[fc::Fkey_return] = std::bind(&FListView::processClick, this); key_map[fc::Fkey_enter] = std::bind(&FListView::processClick, this); key_map[fc::Fkey_space] = std::bind(&FListView::toggleCheckbox, this); - key_map[fc::Fkey_up] = [&] { stepBackward(); }; - key_map[fc::Fkey_down] = [&] { stepForward(); }; + key_map[fc::Fkey_up] = [this] { stepBackward(); }; + key_map[fc::Fkey_down] = [this] { stepForward(); }; key_map[fc::Fkey_left] = std::bind(&FListView::collapseAndScrollLeft, this); key_map[fc::Fkey_right] = std::bind(&FListView::expandAndScrollRight, this); - key_map[fc::Fkey_ppage] = [&] { stepBackward(int(getClientHeight()) - 1); }; - key_map[fc::Fkey_npage] = [&] { stepForward(int(getClientHeight()) - 1); }; + key_map[fc::Fkey_ppage] = [this] { stepBackward(int(getClientHeight()) - 1); }; + key_map[fc::Fkey_npage] = [this] { stepForward(int(getClientHeight()) - 1); }; key_map[fc::Fkey_home] = std::bind(&FListView::firstPos, this); key_map[fc::Fkey_end] = std::bind(&FListView::lastPos, this); key_map_result[FKey('+')] = std::bind(&FListView::expandSubtree, this); diff --git a/src/fmenu.cpp b/src/fmenu.cpp index f6655ff9..898e8190 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -316,6 +316,18 @@ void FMenu::onMouseMove (FMouseEvent* ev) } } +//---------------------------------------------------------------------- +void FMenu::cb_menuitemEnabled (FWidget*, const FDataPtr) +{ + setEnable(); +} + +//---------------------------------------------------------------------- +void FMenu::cb_menuitemDisabled (FWidget*, const FDataPtr) +{ + setDisable(); +} + //---------------------------------------------------------------------- void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr) { @@ -467,9 +479,26 @@ void FMenu::init(FWidget* parent) setSuperMenu(parent); } + initCallbacks(); calculateDimensions(); } +//---------------------------------------------------------------------- +void FMenu::initCallbacks() +{ + menuitem.addCallback + ( + "enable", + F_METHOD_CALLBACK (this, &FMenu::cb_menuitemEnabled) + ); + + menuitem.addCallback + ( + "disable", + F_METHOD_CALLBACK (this, &FMenu::cb_menuitemEnabled) + ); +} + //---------------------------------------------------------------------- void FMenu::calculateDimensions() { @@ -686,7 +715,7 @@ void FMenu::mouseDownSubmenu (const FMenuItem* m_item) if ( ! sel_item || ! sel_item->hasMenu() || sel_item->getMenu() != opened_sub_menu ) - return; + return; if ( sel_item != m_item ) hideSubMenus(); diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 4a52917a..f65e8fa2 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -564,6 +564,18 @@ void FMenuItem::updateSuperMenuDimensions() menu_ptr->calculateDimensions(); } +//---------------------------------------------------------------------- +void FMenuItem::processEnable() +{ + emitCallback("enable"); +} + +//---------------------------------------------------------------------- +void FMenuItem::processDisable() +{ + emitCallback("disable"); +} + //---------------------------------------------------------------------- void FMenuItem::processActivate() { diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index 519e5826..f4dde428 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -277,10 +277,10 @@ void FScrollView::setGeometry ( const FPoint& pos, const FSize& size } //---------------------------------------------------------------------- -void FScrollView::setCursorPos (const FPoint& p) +bool FScrollView::setCursorPos (const FPoint& p) { - FWidget::setCursorPos (FPoint ( p.getX() + getLeftPadding() - , p.getY() + getTopPadding() )); + return FWidget::setCursorPos (FPoint ( p.getX() + getLeftPadding() + , p.getY() + getTopPadding() )); } //---------------------------------------------------------------------- @@ -751,15 +751,15 @@ void FScrollView::init (const FWidget* parent) //---------------------------------------------------------------------- inline void FScrollView::mapKeyFunctions() { - key_map[fc::Fkey_up] = [&] { scrollBy (0, -1); }; - key_map[fc::Fkey_down] = [&] { scrollBy (0, 1); }; - key_map[fc::Fkey_left] = [&] { scrollBy (-1, 0); }; - key_map[fc::Fkey_right] = [&] { scrollBy (1, 0); }; - key_map[fc::Fkey_ppage] = [&] { scrollBy (0, -int(getViewportHeight())); }; - key_map[fc::Fkey_npage] = [&] { scrollBy (0, int(getViewportHeight())); }; - key_map[fc::Fkey_home] = [&] { scrollToY (1); }; + key_map[fc::Fkey_up] = [this] { scrollBy (0, -1); }; + key_map[fc::Fkey_down] = [this] { scrollBy (0, 1); }; + key_map[fc::Fkey_left] = [this] { scrollBy (-1, 0); }; + key_map[fc::Fkey_right] = [this] { scrollBy (1, 0); }; + key_map[fc::Fkey_ppage] = [this] { scrollBy (0, -int(getViewportHeight())); }; + key_map[fc::Fkey_npage] = [this] { scrollBy (0, int(getViewportHeight())); }; + key_map[fc::Fkey_home] = [this] { scrollToY (1); }; key_map[fc::Fkey_end] = \ - [&] () + [this] () { int yoffset_end = int(getScrollHeight() - getViewportHeight()); scrollToY (1 + yoffset_end); diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index 25e2ca61..db83c281 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -325,7 +325,7 @@ void FSpinBox::draw() { const auto& wc = getFWidgetColors(); - const FColorPair inc_button_color = [&] () + const FColorPair inc_button_color = [this, &wc] () { if ( value == max ) return FColorPair ( wc.scrollbar_button_inactive_fg @@ -335,7 +335,7 @@ void FSpinBox::draw() , wc.scrollbar_button_bg ); }(); - const FColorPair dec_button_color = [&] () + const FColorPair dec_button_color = [this, &wc] () { if ( value == min ) return FColorPair ( wc.scrollbar_button_inactive_fg diff --git a/src/fterm.cpp b/src/fterm.cpp index 50f81648..83ee8311 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -598,7 +598,7 @@ bool FTerm::canChangeColorPalette() || isOpenBSDTerm() || isSunTerminal() || isAnsiTerminal() ) - return false; + return false; return FTermcap::can_change_color_palette; } diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp index 41d0677f..d0117a1b 100644 --- a/src/ftermcapquirks.cpp +++ b/src/ftermcapquirks.cpp @@ -559,7 +559,7 @@ void FTermcapQuirks::ecma48() // Test for standard ECMA-48 (ANSI X3.64) terminal if ( ! TCAP(fc::t_exit_underline_mode) || std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) != 0 ) - return; + return; // Seems to be a ECMA-48 (ANSI X3.64) compatible terminal TCAP(fc::t_enter_dbl_underline_mode) = \ diff --git a/src/ftextview.cpp b/src/ftextview.cpp index d04adfc3..ad924e89 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -571,14 +571,14 @@ void FTextView::init() //---------------------------------------------------------------------- inline void FTextView::mapKeyFunctions() { - key_map[fc::Fkey_up] = [&] { scrollBy (0, -1); }; - key_map[fc::Fkey_down] = [&] { scrollBy (0, 1); }; - key_map[fc::Fkey_left] = [&] { scrollBy (-1, 0); }; - key_map[fc::Fkey_right] = [&] { scrollBy (1, 0); }; - key_map[fc::Fkey_ppage] = [&] { scrollBy (0, -int(getTextHeight())); }; - key_map[fc::Fkey_npage] = [&] { scrollBy (0, int(getTextHeight())); }; - key_map[fc::Fkey_home] = [&] { scrollToY (0); }; - key_map[fc::Fkey_end] = [&] { scrollToY (int(getRows() - getTextHeight())); }; + key_map[fc::Fkey_up] = [this] { scrollBy (0, -1); }; + key_map[fc::Fkey_down] = [this] { scrollBy (0, 1); }; + key_map[fc::Fkey_left] = [this] { scrollBy (-1, 0); }; + key_map[fc::Fkey_right] = [this] { scrollBy (1, 0); }; + key_map[fc::Fkey_ppage] = [this] { scrollBy (0, -int(getTextHeight())); }; + key_map[fc::Fkey_npage] = [this] { scrollBy (0, int(getTextHeight())); }; + key_map[fc::Fkey_home] = [this] { scrollToY (0); }; + key_map[fc::Fkey_end] = [this] { scrollToY (int(getRows() - getTextHeight())); }; } //---------------------------------------------------------------------- diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 9c5aa835..0aaa7d73 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -269,6 +269,11 @@ bool FWidget::setVisible (bool enable) //---------------------------------------------------------------------- bool FWidget::setEnable (bool enable) { + if ( enable ) + emitCallback("enable"); + else + emitCallback("disable"); + return (flags.active = enable); } @@ -1814,7 +1819,7 @@ void FWidget::KeyPressEvent (FKeyEvent* kev) { const FKey key = kev->key(); - if ( [&] () + if ( [this, &key] () { if ( isFocusNextKey(key) ) return focusNextChild(); diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 07e485fe..7d58849f 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -81,8 +81,8 @@ class FButton : public FWidget FString& getText(); // Mutators - void setForegroundColor (FColor); - void setBackgroundColor (FColor); + void setForegroundColor (FColor) override; + void setBackgroundColor (FColor) override; void setHotkeyForegroundColor (FColor); void setFocusForegroundColor (FColor); void setFocusBackgroundColor (FColor); diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 1863056f..d0656410 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -91,67 +91,67 @@ class FDialog : public FWindow FDialog& operator = (const FDialog&) = delete; // Accessors - const FString getClassName() const override; - FString getText() const; + const FString getClassName() const override; + virtual const FString getText() const; // Mutators - bool setDialogWidget (bool); - bool setDialogWidget(); - bool unsetDialogWidget(); - bool setModal (bool); - bool setModal(); - bool unsetModal(); - bool setResizeable (bool) override; - bool setScrollable (bool); - bool setScrollable(); - bool unsetScrollable(); - bool setBorder (bool); - bool setBorder(); - bool unsetBorder(); - void setText (const FString&); + bool setDialogWidget (bool); + bool setDialogWidget(); + bool unsetDialogWidget(); + bool setModal (bool); + bool setModal(); + bool unsetModal(); + bool setResizeable (bool) override; + bool setScrollable (bool); + bool setScrollable(); + bool unsetScrollable(); + bool setBorder (bool); + bool setBorder(); + bool unsetBorder(); + virtual void setText (const FString&); // Inquiries - bool isModal() const; - bool isScrollable() const; - bool hasBorder() const; + bool isModal() const; + bool isScrollable() const; + bool hasBorder() const; // Methods - void show() override; - void hide() override; - int exec(); - void setPos (const FPoint&, bool = true) override; - void move (const FPoint&) override; - bool moveUp (int); - bool moveDown (int); - bool moveLeft (int); - bool moveRight (int); - void setSize (const FSize&, bool = true) override; - bool reduceHeight (int); - bool expandHeight (int); - bool reduceWidth (int); - bool expandWidth (int); - void activateDialog(); + void show() override; + void hide() override; + int exec(); + void setPos (const FPoint&, bool = true) override; + void move (const FPoint&) override; + bool moveUp (int); + bool moveDown (int); + bool moveLeft (int); + bool moveRight (int); + void setSize (const FSize&, bool = true) override; + bool reduceHeight (int); + bool expandHeight (int); + bool reduceWidth (int); + bool expandWidth (int); + void activateDialog(); // Event handlers - void onKeyPress (FKeyEvent*) override; - void onMouseDown (FMouseEvent*) override; - void onMouseUp (FMouseEvent*) override; - void onMouseMove (FMouseEvent*) override; - void onMouseDoubleClick (FMouseEvent*) override; - void onAccel (FAccelEvent*) override; - void onWindowActive (FEvent*) override; - void onWindowInactive (FEvent*) override; - void onWindowRaised (FEvent*) override; - void onWindowLowered (FEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onMouseDoubleClick (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; + void onWindowActive (FEvent*) override; + void onWindowInactive (FEvent*) override; + void onWindowRaised (FEvent*) override; + void onWindowLowered (FEvent*) override; protected: // Methods - virtual void done (int); - void draw() override; - void drawDialogShadow(); + virtual void done (int); + void draw() override; + void drawDialogShadow(); // Event handlers - void onClose (FCloseEvent*) override; + void onClose (FCloseEvent*) override; private: // Typedef @@ -169,65 +169,65 @@ class FDialog : public FWindow static constexpr bool PRINT_WIN_NUMBER = false; // Only for debug // Methods - void init(); - void initDialogMenu(); - void initMoveSizeMenuItem (FMenu*); - void initZoomMenuItem (FMenu*); - void initCloseMenuItem (FMenu*); - void drawBorder() override; - void drawTitleBar(); - void drawBarButton(); - void drawZoomButton(); - void drawRestoreSizeButton(); - void drawZoomedButton(); - void drawTextBar(); - void restoreOverlaidWindows(); - void setCursorToFocusWidget(); - void leaveMenu(); - void openMenu(); - void selectFirstMenuItem(); - void setZoomItem(); - std::size_t getZoomButtonWidth(); - void activateZoomButton (const mouseStates&); - void deactivateZoomButton(); - void leaveZoomButton (const mouseStates&); - void pressZoomButton (const mouseStates&); - bool isMouseOverMenu (const FPoint&); - void passEventToSubMenu (const mouseStates&, const FMouseEvent*); - void moveSizeKey (FKeyEvent*); - void raiseActivateDialog(); - void lowerActivateDialog(); - bool isOutsideTerminal (const FPoint&); - bool isLowerRightResizeCorner (const mouseStates&); - void resizeMouseDown (const mouseStates&); - void resizeMouseUpMove (const mouseStates&, bool = false); - void cancelMouseResize(); - void acceptMoveSize(); - void cancelMoveSize(); - static void addDialog (FWidget*); - static void delDialog (const FWidget*); + void init(); + void initDialogMenu(); + void initMoveSizeMenuItem (FMenu*); + void initZoomMenuItem (FMenu*); + void initCloseMenuItem (FMenu*); + void drawBorder() override; + void drawTitleBar(); + void drawBarButton(); + void drawZoomButton(); + void drawRestoreSizeButton(); + void drawZoomedButton(); + void drawTextBar(); + void restoreOverlaidWindows(); + void setCursorToFocusWidget(); + void leaveMenu(); + void openMenu(); + void selectFirstMenuItem(); + void setZoomItem(); + std::size_t getZoomButtonWidth(); + void activateZoomButton (const mouseStates&); + void deactivateZoomButton(); + void leaveZoomButton (const mouseStates&); + void pressZoomButton (const mouseStates&); + bool isMouseOverMenu (const FPoint&); + void passEventToSubMenu (const mouseStates&, const FMouseEvent*); + void moveSizeKey (FKeyEvent*); + void raiseActivateDialog(); + void lowerActivateDialog(); + bool isOutsideTerminal (const FPoint&); + bool isLowerRightResizeCorner (const mouseStates&); + void resizeMouseDown (const mouseStates&); + void resizeMouseUpMove (const mouseStates&, bool = false); + void cancelMouseResize(); + void acceptMoveSize(); + void cancelMoveSize(); + static void addDialog (FWidget*); + static void delDialog (const FWidget*); // Callback methods - void cb_move (const FWidget*, const FDataPtr); - void cb_zoom (const FWidget*, const FDataPtr); - void cb_close (const FWidget*, const FDataPtr); + void cb_move (const FWidget*, const FDataPtr); + void cb_zoom (const FWidget*, const FDataPtr); + void cb_close (const FWidget*, const FDataPtr); // Data members - FString tb_text{}; // title bar text - int result_code{FDialog::Reject}; - bool zoom_button_pressed{false}; - bool zoom_button_active{false}; - bool setPos_error{false}; - bool setSize_error{false}; - FPoint titlebar_click_pos{}; - FPoint resize_click_pos{}; - FRect save_geometry{}; // required by keyboard move/size - FMenu* dialog_menu{nullptr}; - FMenuItem* dgl_menuitem{nullptr}; - FMenuItem* move_size_item{nullptr}; - FMenuItem* zoom_item{nullptr}; - FMenuItem* close_item{nullptr}; - FToolTip* tooltip{nullptr}; + FString tb_text{}; // title bar text + int result_code{FDialog::Reject}; + bool zoom_button_pressed{false}; + bool zoom_button_active{false}; + bool setPos_error{false}; + bool setSize_error{false}; + FPoint titlebar_click_pos{}; + FPoint resize_click_pos{}; + FRect save_geometry{}; // required by keyboard move/size + FMenu* dialog_menu{nullptr}; + FMenuItem* dgl_menuitem{nullptr}; + FMenuItem* move_size_item{nullptr}; + FMenuItem* zoom_item{nullptr}; + FMenuItem* close_item{nullptr}; + FToolTip* tooltip{nullptr}; // Friend function from FMenu friend void FMenu::hideSuperMenus(); @@ -239,7 +239,7 @@ inline const FString FDialog::getClassName() const { return "FDialog"; } //---------------------------------------------------------------------- -inline FString FDialog::getText() const +inline const FString FDialog::getText() const { return tb_text; } //---------------------------------------------------------------------- diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 5ccef631..a7d0dc54 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -71,6 +71,9 @@ class FMenuItem; class FMenu : public FWindow, public FMenuList { public: + // Using-declaration + using FMenuList::getItem; + // Constructor explicit FMenu (FWidget* = nullptr); explicit FMenu (const FString&, FWidget* = nullptr); @@ -104,7 +107,6 @@ class FMenu : public FWindow, public FMenuList void setText (const FString&); // Inquiries - bool isEnabled() const; bool isSelected() const; bool hasHotkey() const; bool hasMenu() const; @@ -121,6 +123,8 @@ class FMenu : public FWindow, public FMenuList void onAccel (FAccelEvent*) override; // Callback method + void cb_menuitemEnabled (FWidget*, const FDataPtr); + void cb_menuitemDisabled (FWidget*, const FDataPtr); void cb_menuitemToggled (FWidget*, const FDataPtr); private: @@ -167,6 +171,7 @@ class FMenu : public FWindow, public FMenuList // Methods void init(FWidget*); + void initCallbacks(); void calculateDimensions(); void adjustItems(); int adjustX(int); @@ -290,10 +295,6 @@ inline void FMenu::setMenu (FMenu* m) inline void FMenu::setText (const FString& txt) { menuitem.setText(txt); } -//---------------------------------------------------------------------- -inline bool FMenu::isEnabled() const -{ return menuitem.isEnabled(); } - //---------------------------------------------------------------------- inline bool FMenu::isSelected() const { return menuitem.isSelected(); } diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 68619a5e..b2888e47 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -156,6 +156,8 @@ class FMenuItem : public FWidget // Methods void init (FWidget*); void updateSuperMenuDimensions(); + void processEnable(); + void processDisable(); void processActivate(); void processDeactivate(); void createDialogList (FMenu*); diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index da0ae501..e7c7cd82 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -104,7 +104,7 @@ class FMessageBox : public FDialog const FString getClassName() const override; const FString getTitlebarText() const; const FString getHeadline() const; - const FString getText() const; + const FString getText() const override; // Mutator void setTitlebarText (const FString&); @@ -112,7 +112,7 @@ class FMessageBox : public FDialog bool setCenterText(bool); bool setCenterText(); bool unsetCenterText(); - void setText (const FString&); + void setText (const FString&) override; // Methods template diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index bbe2d764..d022401a 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -103,8 +103,8 @@ class FScrollView : public FWidget void setSize (const FSize&, bool = true) override; void setGeometry ( const FPoint&, const FSize& , bool = true ) override; - void setCursorPos (const FPoint&); - void setPrintPos (const FPoint&); + bool setCursorPos (const FPoint&) override; + void setPrintPos (const FPoint&) override; bool setViewportPrint (bool); bool setViewportPrint(); bool unsetViewportPrint(); diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index a546ca4e..e3789558 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -259,8 +259,8 @@ class FWidget : public FVTerm, public FObject bool ignorePadding (bool); // ignore padding from bool ignorePadding(); // the parent widget bool acceptPadding(); - void setForegroundColor (FColor); - void setBackgroundColor (FColor); + virtual void setForegroundColor (FColor); + virtual void setBackgroundColor (FColor); void setColor(); FWidgetFlags& setFlags(); // Positioning and sizes mutators... @@ -285,9 +285,9 @@ class FWidget : public FVTerm, public FObject void setMaximumHeight (std::size_t); void setMaximumSize (const FSize&); void setFixedSize (const FSize&); - bool setCursorPos (const FPoint&); + virtual bool setCursorPos (const FPoint&); void unsetCursorPos(); - void setPrintPos (const FPoint&); + virtual void setPrintPos (const FPoint&); void setDoubleFlatLine (fc::sides, bool = true); void unsetDoubleFlatLine (fc::sides); void setDoubleFlatLine (fc::sides, int, bool = true);