From 298755a0fe37ddb7c1bd3b1ee0c423e40e30b121 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Tue, 1 Oct 2019 23:14:00 +0200 Subject: [PATCH] Replacing null-terminated wide strings with FString objects --- ChangeLog | 4 + README.md | 8 +- debian/libfinal0.docs | 6 + debian/libfinal0.install | 5 +- doc/readme.txt | 47 ++++++++ doc/virtual-terminal.txt | 7 ++ examples/calculator.cpp | 4 +- examples/scrollview.cpp | 2 +- examples/term-attributes.cpp | 4 +- examples/transparent.cpp | 2 +- examples/windows.cpp | 2 +- fonts/README.md | 4 + fonts/{README.txt => newfont.txt} | 6 + src/fbutton.cpp | 45 +------- src/fbuttongroup.cpp | 73 +++--------- src/flabel.cpp | 85 +++----------- src/flistbox.cpp | 42 +------ src/flistview.cpp | 78 +++++-------- src/fmenu.cpp | 22 +--- src/fmenubar.cpp | 41 ++----- src/fpoint.cpp | 2 +- src/frect.cpp | 2 +- src/fscrollbar.cpp | 2 +- src/fscrollview.cpp | 28 ----- src/fstatusbar.cpp | 13 +-- src/fstring.cpp | 12 +- src/fterm.cpp | 27 +++-- src/ftermxterminal.cpp | 174 +++++++---------------------- src/ftextview.cpp | 138 +++++++++++------------ src/ftogglebutton.cpp | 56 ++-------- src/fvterm.cpp | 2 +- src/fwidget.cpp | 90 +++++++-------- src/include/final/fbutton.h | 2 +- src/include/final/fbuttongroup.h | 2 +- src/include/final/flabel.h | 6 +- src/include/final/flistbox.h | 9 +- src/include/final/flistview.h | 111 +++++++++--------- src/include/final/fmenu.h | 3 +- src/include/final/fmenubar.h | 3 +- src/include/final/fmessagebox.h | 2 +- src/include/final/fobject.h | 22 ++-- src/include/final/fscrollbar.h | 37 ++++++ src/include/final/fscrollview.h | 18 ++- src/include/final/ftermxterminal.h | 56 +++++----- src/include/final/ftextview.h | 9 +- src/include/final/ftogglebutton.h | 2 +- src/include/final/fwidget.h | 5 +- test/fobject-test.cpp | 4 +- 48 files changed, 514 insertions(+), 810 deletions(-) create mode 100644 debian/libfinal0.docs rename fonts/{README.txt => newfont.txt} (83%) diff --git a/ChangeLog b/ChangeLog index 619a34eb..607f76e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-10-01 Markus Gans + * Replacing null-terminated wide strings with FString objects + * Fix for getColumnWidth() with newfont character + 2019-09-29 Markus Gans * Streaming into an FTextView() object * Fixes the streaming of empty FString objects into a stream with diff --git a/README.md b/README.md index 7251377c..780e27d7 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,7 @@ The calculator example in newfont mode: Virtual terminal ---------------- -It uses a virtual terminal to print the character via an update method on the screen. -The virtual windows are an overlying layer to realizing window movements. -The update method transmits only the changes to the virtual terminal or the screen. +FINAL CUT uses a virtual terminal to print character via an update method on the screen. It provides (as an overlying layer) virtual windows for the realization of window movements. The update methods only transfer differences to the virtual terminal or physical screen.
  print(...)
@@ -261,9 +259,7 @@ GNU Lesser General Public License Version 3
 
 Frequently Asked Questions
 --------------------------
-If you have any problems, please read the
-[FAQ](doc/faq.md#frequently-asked-questions)
-before you give up.
+For general questions about FINAL CUT, likely the answer is already included in the [FAQ](doc/faq.md#frequently-asked-questions).
 
 Please send bug reports to
 --------------------------
diff --git a/debian/libfinal0.docs b/debian/libfinal0.docs
new file mode 100644
index 00000000..cd2a01ef
--- /dev/null
+++ b/debian/libfinal0.docs
@@ -0,0 +1,6 @@
+AUTHORS
+COPYING
+COPYING.LESSER
+ChangeLog
+doc/readme.txt
+fonts/newfont.txt
diff --git a/debian/libfinal0.install b/debian/libfinal0.install
index eb577ae5..475e5232 100644
--- a/debian/libfinal0.install
+++ b/debian/libfinal0.install
@@ -1,3 +1,6 @@
 usr/lib/*/lib*.so
 usr/lib/*/lib*.so.*
-
+fonts/8x16graph.pcf.gz /usr/share/fonts/X11/misc/finalcut/
+fonts/fonts.alias /usr/share/fonts/X11/misc/finalcut/
+fonts/fonts.dir /usr/share/fonts/X11/misc/finalcut/
+fonts/newfont.txt /usr/share/fonts/X11/misc/finalcut/
diff --git a/doc/readme.txt b/doc/readme.txt
index 57f413bf..4016a9f0 100644
--- a/doc/readme.txt
+++ b/doc/readme.txt
@@ -12,3 +12,50 @@ the C++ class design of FINAL CUT. It provides common controls like
 dialog boxes, push buttons, check boxes, radio buttons, input lines,
 list boxes, status bars and so on.
 
+
+Installation
+------------
+> git clone git://github.com/gansm/finalcut.git
+> cd finalcut
+> autoreconf --install --force
+> ./configure --prefix=/usr
+> make
+> su -c "make install"
+
+
+Supported platforms
+-------------------
+* Linux
+* FreeBSD
+* NetBSD
+* OpenBSD
+* macOS
+* Cygwin
+* Solaris
+
+
+First steps
+-----------
+See the first-steps.md documentation for information on how to use
+the library.
+
+
+License
+-------
+GNU Lesser General Public License Version 3
+
+
+Frequently Asked Questions
+--------------------------
+For general questions about FINAL CUT, likely the answer is already included in the faq.md.
+
+
+Download
+--------
+You can find the latest version at https://github.com/gansm/finalcut
+
+
+Please send bug reports to
+--------------------------
+https://github.com/gansm/finalcut/issues
+
diff --git a/doc/virtual-terminal.txt b/doc/virtual-terminal.txt
index 006a41d0..b01bdc76 100644
--- a/doc/virtual-terminal.txt
+++ b/doc/virtual-terminal.txt
@@ -1,6 +1,13 @@
                         The virtual terminal (vterm)
                         ----------------------------
 
+FINAL CUT uses a virtual terminal to print character via an update
+method on the screen. It provides (as an overlying layer) virtual windows
+for the realization of window movements. The update methods only transfer
+differences to the virtual terminal or physical screen.
+
+
+
  print(...)
 printf(...)
   │
diff --git a/examples/calculator.cpp b/examples/calculator.cpp
index da963f05..0664412d 100644
--- a/examples/calculator.cpp
+++ b/examples/calculator.cpp
@@ -80,7 +80,7 @@ void Button::setChecked (bool enable)
   }
   else
   {
-    const finalcut::FWidgetColors& wc = getFWidgetColors();
+    const auto& wc = getFWidgetColors();
     setBackgroundColor(wc.button_active_bg);
     setFocusForegroundColor(wc.button_active_focus_fg);
     setFocusBackgroundColor(wc.button_active_focus_bg);
@@ -328,7 +328,7 @@ void Calc::drawDispay()
   if ( isMonochron() )
     setReverse(false);
 
-  const finalcut::FWidgetColors& wc = getFWidgetColors();
+  const auto& wc = getFWidgetColors();
   print() << FColorPair(fc::Black, fc::LightGray)
           << FPoint(3, 3) << display << ' '
           << FColorPair(wc.dialog_fg, wc.dialog_bg);
diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp
index 7480446a..88ea3a59 100644
--- a/examples/scrollview.cpp
+++ b/examples/scrollview.cpp
@@ -131,7 +131,7 @@ void Scrollview::draw()
   if ( isMonochron() )
     setReverse(true);
 
-  const finalcut::FWidgetColors& wc = getFWidgetColors();
+  const auto& wc = getFWidgetColors();
   setColor (wc.label_inactive_fg, wc.dialog_bg);
   clearArea();
 
diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp
index 68b1446f..37566b6d 100644
--- a/examples/term-attributes.cpp
+++ b/examples/term-attributes.cpp
@@ -262,7 +262,7 @@ void AttribDemo::printColorLine()
 //----------------------------------------------------------------------
 void AttribDemo::printAltCharset()
 {
-  const finalcut::FWidgetColors& wc = getFWidgetColors();
+  const auto& wc = getFWidgetColors();
   auto parent = static_cast(getParent());
 
   if ( ! isMonochron() )
@@ -413,7 +413,7 @@ void AttribDemo::printProtected()
 void AttribDemo::draw()
 {
   // test alternate character set
-  const finalcut::FWidgetColors& wc = getFWidgetColors();
+  const auto& wc = getFWidgetColors();
   printAltCharset();
 
   std::vector > effect
diff --git a/examples/transparent.cpp b/examples/transparent.cpp
index fd4c373f..cf5e9c25 100644
--- a/examples/transparent.cpp
+++ b/examples/transparent.cpp
@@ -89,7 +89,7 @@ void Transparent::draw()
 
   if ( type == shadow )
   {
-    const finalcut::FWidgetColors& wc = getFWidgetColors();
+    const auto& wc = getFWidgetColors();
     setColor(wc.shadow_bg, wc.shadow_fg);
     setTransShadow();
   }
diff --git a/examples/windows.cpp b/examples/windows.cpp
index 57dea275..d0514154 100644
--- a/examples/windows.cpp
+++ b/examples/windows.cpp
@@ -68,7 +68,7 @@ class SmallWindow : public finalcut::FDialog
 SmallWindow::SmallWindow (finalcut::FWidget* parent)
   : finalcut::FDialog(parent)
 {
-  const finalcut::FWidgetColors& wc = getFWidgetColors();
+  const auto& wc = getFWidgetColors();
   wchar_t arrow_up, arrow_down;
   arrow_up = fc::BlackUpPointingTriangle;
   arrow_down = fc::BlackDownPointingTriangle;
diff --git a/fonts/README.md b/fonts/README.md
index 386a3723..a6efcb4e 100644
--- a/fonts/README.md
+++ b/fonts/README.md
@@ -1,3 +1,7 @@
+# The FINAL CUT newfont
+## *A graphical text font for X11 and the Linux console*
+
+
 ### How can I use the new graphical font under the Linux text console?
 
 Simply start your program with the parameter `--newfont`.
diff --git a/fonts/README.txt b/fonts/newfont.txt
similarity index 83%
rename from fonts/README.txt
rename to fonts/newfont.txt
index 98fd789d..cbb18147 100644
--- a/fonts/README.txt
+++ b/fonts/newfont.txt
@@ -1,3 +1,9 @@
+----------------------------------------------------------------------
+                        The FINAL CUT newfont
+          A graphical text font for X11 and the Linux console
+----------------------------------------------------------------------
+
+
 How can I use the new graphical font under the Linux text console?
 ------------------------------------------------------------------
 
diff --git a/src/fbutton.cpp b/src/fbutton.cpp
index 782f29f6..8e68776f 100644
--- a/src/fbutton.cpp
+++ b/src/fbutton.cpp
@@ -251,14 +251,11 @@ void FButton::hide()
   if ( size == 0 )
     return;
 
-  char* blank = createBlankArray(size + 1);
-
   for (std::size_t y{0}; y < getHeight() + s + (f << 1); y++)
   {
-    print() << FPoint(1 - int(f), 1 + int(y - f)) << blank;
+    print() << FPoint(1 - int(f), 1 + int(y - f))
+            << FString(size, L' ');
   }
-
-  destroyBlankArray (blank);
 }
 
 //----------------------------------------------------------------------
@@ -422,25 +419,7 @@ void FButton::init()
 //----------------------------------------------------------------------
 void FButton::setHotkeyAccelerator()
 {
-  FKey hotkey = getHotkey(text);
-
-  if ( hotkey > 0xff00 && hotkey < 0xff5f )  // full-width character
-    hotkey -= 0xfee0;
-
-  if ( hotkey )
-  {
-    if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
-    {
-      addAccelerator (FKey(std::tolower(int(hotkey))));
-      addAccelerator (FKey(std::toupper(int(hotkey))));
-      // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
-    }
-    else
-      addAccelerator (hotkey);
-  }
-  else
-    delAccelerator();
+  setHotkeyViaString (this, text);
 }
 
 //----------------------------------------------------------------------
@@ -560,7 +539,7 @@ inline void FButton::drawTopBottomBackground()
 }
 
 //----------------------------------------------------------------------
-inline void FButton::drawButtonTextLine (wchar_t button_text[])
+inline void FButton::drawButtonTextLine (const FString& button_text)
 {
   std::size_t pos{};
   print() << FPoint(2 + int(indent), 1 + int(vcenter_offset))
@@ -638,23 +617,12 @@ inline void FButton::drawButtonTextLine (wchar_t button_text[])
 //----------------------------------------------------------------------
 void FButton::draw()
 {
-  wchar_t* button_text{};
+  FString button_text{};
   auto parent_widget = getParentWidget();
-  auto txtlength = text.getLength();
   column_width = getColumnWidth(text);
   space_char = int(' ');
   active_focus = getFlags().active && getFlags().focus;
 
-  try
-  {
-    button_text = new wchar_t[txtlength + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
   if ( isMonochron() )
     setReverse(true);  // Light background
 
@@ -673,7 +641,7 @@ void FButton::draw()
   if ( getFlags().flat && ! button_down )
     drawFlatBorder();
 
-  hotkeypos = finalcut::getHotkeyPos(text.wc_str(), button_text, uInt(txtlength));
+  hotkeypos = finalcut::getHotkeyPos(text, button_text);
 
   if ( hotkeypos != NOT_SET )
     column_width--;
@@ -702,7 +670,6 @@ void FButton::draw()
   if ( isMonochron() )
     setReverse(false);  // Dark background
 
-  delete[] button_text;
   updateStatusBar();
 }
 
diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp
index 575dfc0e..b79b1057 100644
--- a/src/fbuttongroup.cpp
+++ b/src/fbuttongroup.cpp
@@ -182,6 +182,7 @@ void FButtonGroup::hide()
   {
     for (auto&& item : buttonlist)
     {
+      // Hide items
       auto toggle_button = static_cast(item);
       toggle_button->hide();
     }
@@ -205,15 +206,13 @@ void FButtonGroup::hide()
   if ( size == 0 )
     return;
 
-  char* blank = createBlankArray(size + 1);
+  // Hide border
+  unsetViewportPrint();
 
   for (int y{0}; y < int(getHeight()); y++)
-  {
-    FWidget::setPrintPos (FPoint(1, 1 + y));
-    print (blank);
-  }
+    print() << FPoint(1, 1 + y) << FString(size, L' ');
 
-  destroyBlankArray (blank);
+  setViewportPrint();
 }
 
 //----------------------------------------------------------------------
@@ -308,10 +307,10 @@ void FButtonGroup::onAccel (FAccelEvent*)
 //----------------------------------------------------------------------
 void FButtonGroup::onFocusIn (FFocusEvent* in_ev)
 {
+  in_ev->ignore();  // Change default value to ignore
+
   if ( hasCheckedButton() && ! buttonlist.empty() )
   {
-    in_ev->ignore();
-
     for (auto&& item : buttonlist)
     {
       auto toggle_button = static_cast(item);
@@ -374,25 +373,7 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev)
 //----------------------------------------------------------------------
 void FButtonGroup::setHotkeyAccelerator()
 {
-  FKey hotkey = getHotkey(text);
-
-  if ( hotkey > 0xff00 && hotkey < 0xff5f )  // full-width character
-    hotkey -= 0xfee0;
-
-  if ( hotkey )
-  {
-    if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
-    {
-      addAccelerator (FKey(std::tolower(int(hotkey))));
-      addAccelerator (FKey(std::toupper(int(hotkey))));
-      // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
-    }
-    else
-      addAccelerator (hotkey);
-  }
-  else
-    delAccelerator();
+  setHotkeyViaString (this, text);
 }
 
 //----------------------------------------------------------------------
@@ -417,36 +398,18 @@ void FButtonGroup::drawLabel()
   if ( text.isNull() || text.isEmpty() )
     return;
 
-  wchar_t* LabelText{};
+  FString label_text{};
   FString txt{" " + text + " "};
-  std::size_t length = txt.getLength();
-
-  try
-  {
-    LabelText = new wchar_t[length + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  wchar_t* src = const_cast(txt.wc_str());
-  wchar_t* dest = const_cast(LabelText);
   unsetViewportPrint();
-  auto hotkeypos = finalcut::getHotkeyPos(src, dest, length);
-
-  if ( hotkeypos != NOT_SET )
-    length--;
+  auto hotkeypos = finalcut::getHotkeyPos(txt, label_text);
 
   if ( hasBorder() )
     FWidget::setPrintPos (FPoint(2, 1));
   else
     FWidget::setPrintPos (FPoint(0, 1));
 
-  drawText (LabelText, hotkeypos, length);
+  drawText (label_text, hotkeypos);
   setViewportPrint();
-  delete[] LabelText;
 }
 
 
@@ -472,18 +435,18 @@ void FButtonGroup::init()
 }
 
 //----------------------------------------------------------------------
-void FButtonGroup::drawText ( wchar_t LabelText[]
-                            , std::size_t hotkeypos
-                            , std::size_t length )
+void FButtonGroup::drawText ( const FString& label_text
+                            , std::size_t hotkeypos )
 {
   const auto& wc = getFWidgetColors();
-  std::size_t column_width = getColumnWidth(LabelText);
+  std::size_t column_width = getColumnWidth(label_text);
+  std::size_t length = label_text.getLength();
   bool ellipsis{false};
 
   if ( column_width > getClientWidth() )
   {
     std::size_t len = getClientWidth() - 3;
-    FString s = finalcut::getColumnSubString (LabelText, 1, len);
+    FString s = finalcut::getColumnSubString (label_text, 1, len);
     length = s.getLength();
     ellipsis = true;
   }
@@ -505,7 +468,7 @@ void FButtonGroup::drawText ( wchar_t LabelText[]
       if ( ! getFlags().no_underline )
         setUnderline();
 
-      print (LabelText[z]);
+      print (label_text[z]);
 
       if ( ! getFlags().no_underline )
         unsetUnderline();
@@ -513,7 +476,7 @@ void FButtonGroup::drawText ( wchar_t LabelText[]
       setColor (wc.label_emphasis_fg, wc.label_bg);
     }
     else
-      print (LabelText[z]);
+      print (label_text[z]);
   }
 
   if ( ellipsis )  // Print ellipsis
diff --git a/src/flabel.cpp b/src/flabel.cpp
index 89cfc522..1d0b24d8 100644
--- a/src/flabel.cpp
+++ b/src/flabel.cpp
@@ -333,25 +333,7 @@ void FLabel::init()
 //----------------------------------------------------------------------
 void FLabel::setHotkeyAccelerator()
 {
-  FKey hotkey = getHotkey(text);
-
-  if ( hotkey > 0xff00 && hotkey < 0xff5f )  // full-width character
-    hotkey -= 0xfee0;
-
-  if ( hotkey )
-  {
-    if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
-    {
-      addAccelerator (FKey(std::tolower(int(hotkey))));
-      addAccelerator (FKey(std::toupper(int(hotkey))));
-      // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
-    }
-    else
-      addAccelerator (hotkey);
-  }
-  else
-    delAccelerator();
+  setHotkeyViaString (this, text);
 }
 
 //----------------------------------------------------------------------
@@ -423,87 +405,48 @@ void FLabel::drawMultiLine()
 
   while ( y < text_lines && y < std::size_t(getHeight()) )
   {
-    wchar_t* label_text{};
-    std::size_t hotkeypos{NOT_SET};
-    std::size_t align_offset{};
+    FString label_text{};
+    hotkeypos = NOT_SET;
     auto length = multiline_text[y].getLength();
-    auto column_width = getColumnWidth(multiline_text[y]);
-
-    try
-    {
-      label_text = new wchar_t[length + 1]();
-    }
-    catch (const std::bad_alloc& ex)
-    {
-      std::cerr << bad_alloc_str << ex.what() << std::endl;
-      return;
-    }
-
-    auto src  = const_cast(multiline_text[y].wc_str());
-    auto dest = const_cast(label_text);
+    column_width = getColumnWidth(multiline_text[y]);
 
     if ( ! hotkey_printed )
-      hotkeypos = finalcut::getHotkeyPos(src, dest, length);
+      hotkeypos = finalcut::getHotkeyPos (multiline_text[y], label_text);
     else
-      std::wcsncpy(dest, src, length);
+      label_text = multiline_text[y];
 
     print() << FPoint(1, 1 + int(y));
 
     if ( hotkeypos != NOT_SET )
     {
       align_offset = getAlignOffset(length - 1);
-      printLine (label_text, length - 1, column_width, hotkeypos, align_offset);
       hotkey_printed = true;
     }
     else
-    {
       align_offset = getAlignOffset(length);
-      printLine (label_text, length, column_width, NOT_SET, align_offset);
-    }
 
+    printLine (std::move(label_text));
     y++;
-    delete[] label_text;
   }
 }
 
 //----------------------------------------------------------------------
 void FLabel::drawSingleLine()
 {
-  wchar_t* label_text{};
-  std::size_t hotkeypos{NOT_SET};
-  auto length = text.getLength();
-  auto column_width = getColumnWidth(text);
-
-  try
-  {
-    label_text = new wchar_t[length + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  hotkeypos = finalcut::getHotkeyPos (text.wc_str(), label_text, length);
+  FString label_text{};
+  column_width = getColumnWidth(text);
+  hotkeypos = finalcut::getHotkeyPos (text, label_text);
 
   if ( hotkeypos != NOT_SET )
-  {
-    length--;
     column_width--;
-  }
 
   print() << FPoint(1, 1);
-  auto align_offset = getAlignOffset(column_width);
-  printLine (label_text, length, column_width, hotkeypos, align_offset);
-  delete[] label_text;
+  align_offset = getAlignOffset(column_width);
+  printLine (std::move(label_text));
 }
 
 //----------------------------------------------------------------------
-void FLabel::printLine ( wchar_t line[]
-                       , std::size_t length
-                       , std::size_t column_width
-                       , std::size_t hotkeypos
-                       , std::size_t align_offset )
+void FLabel::printLine (FString&& line)
 {
   std::size_t to_char{};
   std::size_t to_column{};
@@ -514,7 +457,7 @@ void FLabel::printLine ( wchar_t line[]
 
   if ( column_width <= width )
   {
-    to_char = length;
+    to_char = line.getLength();
     to_column = column_width;
   }
   else
diff --git a/src/flistbox.cpp b/src/flistbox.cpp
index baba5fc9..98295680 100644
--- a/src/flistbox.cpp
+++ b/src/flistbox.cpp
@@ -27,7 +27,6 @@
 #include "final/fcolorpair.h"
 #include "final/fevent.h"
 #include "final/flistbox.h"
-#include "final/fscrollbar.h"
 #include "final/fstring.h"
 #include "final/fstatusbar.h"
 #include "final/fwidgetcolors.h"
@@ -305,21 +304,16 @@ void FListBox::clear()
   const auto& wc = getFWidgetColors();
   setColor (wc.list_fg, wc.list_bg);
   std::size_t size = getWidth() - 2;
+  drawBorder();
+  drawHeadline();
 
   if ( size == 0 )
     return;
 
-  char* blank = createBlankArray(size + 1);
-
-  std::memset (blank, ' ', size);
-  blank[size] = '\0';
-
   for (int y{0}; y < int(getHeight()) - 2; y++)
   {
-    print() << FPoint(2, 2 + y) << blank;
+    print() << FPoint(2, 2 + y) << FString(size, L' ');
   }
-
-  destroyBlankArray (blank);
 }
 
 //----------------------------------------------------------------------
@@ -754,8 +748,8 @@ inline FString& FListBox::getString (listBoxItems::iterator iter)
 //----------------------------------------------------------------------
 void FListBox::init()
 {
-  initScrollbar (vbar, fc::vertical, &FListBox::cb_VBarChange);
-  initScrollbar (hbar, fc::horizontal, &FListBox::cb_HBarChange);
+  initScrollbar (vbar, fc::vertical, this, &FListBox::cb_VBarChange);
+  initScrollbar (hbar, fc::horizontal, this, &FListBox::cb_HBarChange);
   setGeometry (FPoint(1, 1), FSize(5, 4), false);  // initialize geometry values
   const auto& wc = getFWidgetColors();
   setForegroundColor (wc.dialog_fg);
@@ -767,32 +761,6 @@ void FListBox::init()
   setRightPadding(1 + int(nf_offset));
 }
 
-//----------------------------------------------------------------------
-void FListBox::initScrollbar ( FScrollbarPtr& bar
-                             , fc::orientation o
-                             , FListBoxCallback callback )
-{
-  try
-  {
-    bar = std::make_shared(o, this);
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  bar->setMinimum(0);
-  bar->setValue(0);
-  bar->hide();
-
-  bar->addCallback
-  (
-    "change-value",
-    F_METHOD_CALLBACK (this, callback)
-  );
-}
-
 //----------------------------------------------------------------------
 void FListBox::draw()
 {
diff --git a/src/flistview.cpp b/src/flistview.cpp
index 84441213..3f90dd8a 100644
--- a/src/flistview.cpp
+++ b/src/flistview.cpp
@@ -32,7 +32,6 @@
 #include "final/fcolorpair.h"
 #include "final/fevent.h"
 #include "final/flistview.h"
-#include "final/fscrollbar.h"
 #include "final/fstatusbar.h"
 #include "final/fstring.h"
 #include "final/ftermbuffer.h"
@@ -42,7 +41,7 @@ namespace finalcut
 {
 
 // Static class attribute
-FObject::FObjectIterator FListView::null_iter;
+FObject::iterator FListView::null_iter;
 
 // Function prototypes
 uInt64 firstNumberFromString (const FString&);
@@ -55,14 +54,13 @@ bool sortDescendingByNumber (const FObject*, const FObject*);
 //----------------------------------------------------------------------
 uInt64 firstNumberFromString (const FString& str)
 {
-  auto last = str.end();
   auto iter = str.begin();
 
-  while ( iter != last )
+  while ( iter != str.end() )
   {
     if ( wchar_t(*iter) >= L'0' && wchar_t(*iter) <= L'9' )
     {
-      if ( wchar_t(*(iter - 1)) == L'-' )
+      if ( iter != str.begin() && wchar_t(*(iter - 1)) == L'-' )
         --iter;
 
       break;
@@ -73,10 +71,10 @@ uInt64 firstNumberFromString (const FString& str)
 
   auto first_pos = iter;
 
-  if ( first_pos == last )
+  if ( first_pos == str.end() )
     return 0;
 
-  while ( iter != last )
+  while ( iter != str.end() )
   {
     if ( wchar_t(*iter) < L'0' || wchar_t(*iter) > L'9' )
       break;
@@ -86,7 +84,7 @@ uInt64 firstNumberFromString (const FString& str)
 
   auto last_pos = iter;
 
-  if ( last_pos == last )
+  if ( last_pos == str.end() )
     return 0;
 
   uInt64 number;
@@ -186,7 +184,7 @@ FListViewItem::FListViewItem (const FListViewItem& item)
 }
 
 //----------------------------------------------------------------------
-FListViewItem::FListViewItem (FObjectIterator parent_iter)
+FListViewItem::FListViewItem (iterator parent_iter)
   : FObject((*parent_iter)->getParent())
 {
   insert (this, parent_iter);
@@ -195,7 +193,7 @@ FListViewItem::FListViewItem (FObjectIterator parent_iter)
 //----------------------------------------------------------------------
 FListViewItem::FListViewItem ( const FStringList& cols
                              , FDataPtr data
-                             , FObjectIterator parent_iter )
+                             , iterator parent_iter )
   : FObject(nullptr)
   , column_list(cols)
   , data_pointer(data)
@@ -279,7 +277,7 @@ void FListViewItem::setText (int column, const FString& text)
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListViewItem::insert (FListViewItem* child)
+FObject::iterator FListViewItem::insert (FListViewItem* child)
 {
   // Add a FListViewItem as child element
   if ( ! child )
@@ -289,8 +287,8 @@ FObject::FObjectIterator FListViewItem::insert (FListViewItem* child)
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListViewItem::insert ( FListViewItem* child
-                                               , FObjectIterator parent_iter )
+FObject::iterator FListViewItem::insert ( FListViewItem* child
+                                        , iterator parent_iter )
 {
   if ( parent_iter == FListView::null_iter )
     return FListView::null_iter;
@@ -353,7 +351,7 @@ void FListViewItem::sort (Compare cmp)
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListViewItem::appendItem (FListViewItem* child)
+FObject::iterator FListViewItem::appendItem (FListViewItem* child)
 {
   expandable = true;
   resetVisibleLineCounter();
@@ -434,7 +432,7 @@ void FListViewItem::resetVisibleLineCounter()
 
 // constructor and destructor
 //----------------------------------------------------------------------
-FListViewIterator::FListViewIterator (FObjectIterator iter)
+FListViewIterator::FListViewIterator (iterator iter)
   : node(iter)
 { }
 
@@ -496,7 +494,7 @@ FListViewIterator& FListViewIterator::operator -= (volatile int n)
 
 // private methods of FListViewIterator
 //----------------------------------------------------------------------
-void FListViewIterator::nextElement (FObjectIterator& iter)
+void FListViewIterator::nextElement (iterator& iter)
 {
   auto item = static_cast(*iter);
 
@@ -526,7 +524,7 @@ void FListViewIterator::nextElement (FObjectIterator& iter)
 }
 
 //----------------------------------------------------------------------
-void FListViewIterator::prevElement (FObjectIterator& iter)
+void FListViewIterator::prevElement (iterator& iter)
 {
   auto start_iter = iter;
 
@@ -713,7 +711,7 @@ void FListView::setColumnSortType (int column, fc::sorting_type type)
   if ( column < 1 || header.empty() || column > int(header.size()) )
     return;
 
-  std::size_t size = std::size_t(column + 1);
+  std::size_t size = std::size_t(column) + 1;
 
   if ( sort_type.empty() || sort_type.size() < size )
     sort_type.resize(size);
@@ -760,10 +758,10 @@ void FListView::hide()
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListView::insert ( FListViewItem* item
-                                           , FObjectIterator parent_iter )
+FObject::iterator FListView::insert ( FListViewItem* item
+                                    , iterator parent_iter )
 {
-  FObjectIterator item_iter;
+  iterator item_iter;
 
   if ( parent_iter == FListView::null_iter )
     return FListView::null_iter;
@@ -799,9 +797,9 @@ FObject::FObjectIterator FListView::insert ( FListViewItem* item
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListView::insert ( const FStringList& cols
-                                           , FDataPtr d
-                                           , FObjectIterator parent_iter )
+FObject::iterator FListView::insert ( const FStringList& cols
+                                    , FDataPtr d
+                                    , iterator parent_iter )
 {
   FListViewItem* item;
 
@@ -1379,8 +1377,8 @@ void FListView::adjustSize()
 //----------------------------------------------------------------------
 void FListView::init()
 {
-  initScrollbar (vbar, fc::vertical, &FListView::cb_VBarChange);
-  initScrollbar (hbar, fc::horizontal, &FListView::cb_HBarChange);
+  initScrollbar (vbar, fc::vertical, this, &FListView::cb_VBarChange);
+  initScrollbar (hbar, fc::horizontal, this, &FListView::cb_HBarChange);
   selflist.push_back(this);
   root = selflist.begin();
   null_iter = selflist.end();
@@ -1395,32 +1393,6 @@ void FListView::init()
   setRightPadding(1 + int(nf_offset));
 }
 
-//----------------------------------------------------------------------
-void FListView::initScrollbar ( FScrollbarPtr& bar
-                              , fc::orientation o
-                              , FListViewCallback callback )
-{
-  try
-  {
-    bar = std::make_shared(o, this);
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  bar->setMinimum(0);
-  bar->setValue(0);
-  bar->hide();
-
-  bar->addCallback
-  (
-    "change-value",
-    F_METHOD_CALLBACK (this, callback)
-  );
-}
-
 //----------------------------------------------------------------------
 template 
 void FListView::sort (Compare cmp)
@@ -2283,7 +2255,7 @@ void FListView::stopDragScroll()
 }
 
 //----------------------------------------------------------------------
-FObject::FObjectIterator FListView::appendItem (FListViewItem* item)
+FObject::iterator FListView::appendItem (FListViewItem* item)
 {
   item->root = root;
   addChild (item);
diff --git a/src/fmenu.cpp b/src/fmenu.cpp
index 2a855e80..58790b1b 100644
--- a/src/fmenu.cpp
+++ b/src/fmenu.cpp
@@ -1236,8 +1236,6 @@ inline void FMenu::drawMenuLine (FMenuItem* m_item, int y)
 {
   FString txt(m_item->getText());
   menuText txtdata{};
-  std::size_t txt_length = txt.getLength();
-  std::size_t to_char = txt_length;
   std::size_t column_width = getColumnWidth(txt);
   FKey accel_key   = m_item->accel_key;
   bool is_enabled  = m_item->isEnabled();
@@ -1252,25 +1250,11 @@ inline void FMenu::drawMenuLine (FMenuItem* m_item, int y)
   // Print leading blank space
   print (' ');
 
-  try
-  {
-    txtdata.text = new wchar_t[txt_length + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  hotkeypos = finalcut::getHotkeyPos(txt.wc_str(), txtdata.text, txt_length);
+  hotkeypos = finalcut::getHotkeyPos(txt, txtdata.text);
 
   if ( hotkeypos != NOT_SET )
-  {
-    to_char--;
     column_width--;
-  }
 
-  txtdata.length = to_char;
   txtdata.no_underline = m_item->getFlags().no_underline;
   setCursorToHotkeyPosition (m_item);
 
@@ -1292,8 +1276,6 @@ inline void FMenu::drawMenuLine (FMenuItem* m_item, int y)
 
   if ( isMonochron() && is_enabled && is_selected )
     setReverse(true);
-
-  delete[] txtdata.text;
 }
 
 //----------------------------------------------------------------------
@@ -1347,7 +1329,7 @@ inline void FMenu::drawMenuText (menuText& data)
 {
   // Print menu text
 
-  for (std::size_t z{0}; z < data.length; z++)
+  for (std::size_t z{0}; z < data.text.getLength(); z++)
   {
     if ( ! std::iswprint(std::wint_t(data.text[z])) )
     {
diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp
index cd7d46f1..da3c965d 100644
--- a/src/fmenubar.cpp
+++ b/src/fmenubar.cpp
@@ -64,15 +64,13 @@ void FMenuBar::resetMenu()
 //----------------------------------------------------------------------
 void FMenuBar::hide()
 {
-  FWindow::hide();
   const auto& wc = getFWidgetColors();
   FColor fg = wc.term_fg;
   FColor bg = wc.term_bg;
   setColor (fg, bg);
-  screenWidth = getDesktopWidth();
-  char* blank = createBlankArray (screenWidth + 1);
-  print() << FPoint(1, 1) << blank;
-  destroyBlankArray (blank);
+  print() << FPoint(1, 1) << FString(getDesktopWidth(), L' ');
+  updateTerminal();
+  FWindow::hide();
 }
 
 //----------------------------------------------------------------------
@@ -482,14 +480,13 @@ void FMenuBar::drawItems()
   if ( isMonochron() )
     setReverse(true);
 
-  screenWidth = getDesktopWidth();
   std::size_t x{1};
 
   for (auto&& item : list)
     drawItem (item, x);
 
   // Print spaces to end of line
-  for (; x <= screenWidth; x++)
+  for (; x <= getDesktopWidth(); x++)
     print (' ');
 
   if ( isMonochron() )
@@ -503,8 +500,6 @@ inline void FMenuBar::drawItem (FMenuItem* menuitem, std::size_t& x)
   txtdata.startpos = x + 1;
   txtdata.no_underline = menuitem->getFlags().no_underline;
   FString txt(menuitem->getText());
-  std::size_t to_char{};
-  std::size_t txt_length = txt.getLength();
   std::size_t column_width = getColumnWidth(txt);
   bool is_enabled  = menuitem->isEnabled();
   bool is_selected = menuitem->isSelected();
@@ -513,32 +508,14 @@ inline void FMenuBar::drawItem (FMenuItem* menuitem, std::size_t& x)
   setLineAttributes (menuitem);
   drawLeadingSpace (x);
 
-  try
-  {
-    txtdata.text = new wchar_t[txt_length + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
+  if ( x - 1 > screenWidth )
+    txt = txt.left(getColumnWidth(txt) - screenWidth - x - 1);
 
-  if ( x - 1 <= screenWidth )
-    to_char = txt_length;
-  else
-    to_char = txt_length - screenWidth - x - 1;
-
-  std::size_t hotkeypos = finalcut::getHotkeyPos ( txt.wc_str()
-                                                 , txtdata.text
-                                                 , txt_length );
+  std::size_t hotkeypos = finalcut::getHotkeyPos(txt, txtdata.text);
 
   if ( hotkeypos != NOT_SET )
-  {
     column_width--;
-    to_char--;
-  }
 
-  txtdata.length = to_char;
   x += column_width;
 
   if ( ! is_enabled || is_selected )
@@ -556,8 +533,6 @@ inline void FMenuBar::drawItem (FMenuItem* menuitem, std::size_t& x)
 
   if ( isMonochron() && is_enabled && is_selected )
     setReverse(true);
-
-  delete[] txtdata.text;
 }
 
 //----------------------------------------------------------------------
@@ -616,7 +591,7 @@ inline void FMenuBar::drawMenuText (menuText& data)
 {
   // Print menu text
 
-  for (std::size_t z{0}; z < data.length; z++)
+  for (std::size_t z{0}; z < data.text.getLength(); z++)
   {
     if ( data.startpos > screenWidth - z )
       break;
diff --git a/src/fpoint.cpp b/src/fpoint.cpp
index a861fcc5..f9af58ae 100644
--- a/src/fpoint.cpp
+++ b/src/fpoint.cpp
@@ -101,7 +101,7 @@ std::ostream& operator << (std::ostream& outstr, const FPoint& p)
 //----------------------------------------------------------------------
 std::istream& operator >> (std::istream& instr, FPoint& p)
 {
-  int x, y;
+  int x{}, y{};
   instr >> x;
   instr >> y;
   p.setPoint (x, y);
diff --git a/src/frect.cpp b/src/frect.cpp
index a183e049..24b1d9b1 100644
--- a/src/frect.cpp
+++ b/src/frect.cpp
@@ -381,7 +381,7 @@ std::ostream& operator << (std::ostream& outstr, const FRect& r)
 //----------------------------------------------------------------------
 std::istream& operator >> (std::istream& instr, FRect& r)
 {
-  int x1, y1, x2, y2;
+  int x1{}, y1{}, x2{}, y2{};
   instr >> x1;
   instr >> y1;
   instr >> x2;
diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp
index 42afa9b1..304fc062 100644
--- a/src/fscrollbar.cpp
+++ b/src/fscrollbar.cpp
@@ -346,7 +346,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev)
 
   if ( scroll_type == FScrollbar::scrollJump )
   {
-    int new_val;
+    int new_val{};
 
     if ( bar_orientation == fc::vertical )
     {
diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp
index 7e482e8d..bd34c062 100644
--- a/src/fscrollview.cpp
+++ b/src/fscrollview.cpp
@@ -797,34 +797,6 @@ void FScrollView::init (FWidget* parent)
     setChildPrintArea (viewport);
 }
 
-//----------------------------------------------------------------------
-void FScrollView::initScrollbar ( FScrollbarPtr& bar
-                                , fc::orientation o
-                                , FScrollViewCallback callback )
-{
-  try
-  {
-    bar = std::make_shared(o, this);
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  term_area* area = getPrintArea();
-  bar->setPrintArea(area);
-  bar->setMinimum(0);
-  bar->setValue(0);
-  bar->hide();
-
-  bar->addCallback
-  (
-    "change-value",
-    F_METHOD_CALLBACK (this, callback)
-  );
-}
-
 //----------------------------------------------------------------------
 void FScrollView::calculateScrollbarPos()
 {
diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp
index 5a3a8918..f2012b46 100644
--- a/src/fstatusbar.cpp
+++ b/src/fstatusbar.cpp
@@ -174,15 +174,13 @@ bool FStatusBar::hasActivatedKey()
 //----------------------------------------------------------------------
 void FStatusBar::hide()
 {
-  FWindow::hide();
   const auto& wc = getFWidgetColors();
   FColor fg = wc.term_fg;
   FColor bg = wc.term_bg;
   setColor (fg, bg);
-  screenWidth = getDesktopWidth();
-  char* blank = createBlankArray(screenWidth + 1);
-  print() << FPoint(1, 1) << blank;
-  destroyBlankArray (blank);
+  print() << FPoint(1, 1) << FString(getDesktopWidth(), L' ');
+  updateTerminal();
+  FWindow::hide();
 }
 
 //----------------------------------------------------------------------
@@ -408,10 +406,9 @@ void FStatusBar::onMouseUp (FMouseEvent* ev)
 
         if ( (*iter)->hasMouseFocus() )
         {
-          int mouse_x, mouse_y;
           (*iter)->unsetMouseFocus();
-          mouse_x = ev->getX();
-          mouse_y = ev->getY();
+          int mouse_x = ev->getX();
+          int mouse_y = ev->getY();
 
           if ( mouse_x >= x1 && mouse_x <= x2 && mouse_y == 1 )
             (*iter)->setActive();
diff --git a/src/fstring.cpp b/src/fstring.cpp
index 836487df..13410f7c 100644
--- a/src/fstring.cpp
+++ b/src/fstring.cpp
@@ -847,7 +847,7 @@ FString& FString::setString (const FString& s)
 FString& FString::setNumber (sInt64 num)
 {
   bool neg{false};
-  wchar_t buf[30];
+  wchar_t buf[30]{};
   wchar_t* s = &buf[29];
 
   if ( num < 0 )
@@ -879,7 +879,7 @@ FString& FString::setNumber (sInt64 num)
 //----------------------------------------------------------------------
 FString& FString::setNumber (uInt64 num)
 {
-  wchar_t buf[30];
+  wchar_t buf[30]{};
   wchar_t* s = &buf[29];
   *s = '\0';
 
@@ -897,7 +897,7 @@ FString& FString::setNumber (uInt64 num)
 //----------------------------------------------------------------------
 FString& FString::setNumber (lDouble f_num, int precision)
 {
-  wchar_t format[20];  // = "%.Lg"
+  wchar_t format[20]{};  // = "%.Lg"
   wchar_t* s = &format[0];
   *s++ = L'%';
   *s++ = L'.';
@@ -930,7 +930,7 @@ FString& FString::setFormatedNumber (sInt64 num, char separator)
 {
   bool neg{false};
   int n{0};
-  wchar_t buf[30];
+  wchar_t buf[30]{};
   wchar_t* s = &buf[29];
 
   if ( separator == 0 )
@@ -969,7 +969,7 @@ FString& FString::setFormatedNumber (sInt64 num, char separator)
 FString& FString::setFormatedNumber (uInt64 num, char separator)
 {
   int n{0};
-  wchar_t buf[30];
+  wchar_t buf[30]{};
   wchar_t* s = &buf[29];
   *s = L'\0';
 
@@ -1328,7 +1328,7 @@ void FString::_assign (const wchar_t s[])
   if ( string && std::wcscmp(string, s) == 0 )
     return;  // string == s
 
-  uInt new_length= uInt(std::wcslen(s));
+  uInt new_length = uInt(std::wcslen(s));
 
   if ( ! string || new_length > capacity() )
   {
diff --git a/src/fterm.cpp b/src/fterm.cpp
index a6217394..10f4cb44 100644
--- a/src/fterm.cpp
+++ b/src/fterm.cpp
@@ -759,7 +759,7 @@ bool FTerm::setOldFont()
     if ( font.getLength() > 2 )
     {
       // restore saved xterm font
-      xterm->setFont (font);
+      xterm->setFont(font);
     }
     else
     {
@@ -1855,14 +1855,14 @@ void FTerm::init_captureFontAndTitle()
   // Save the used xterm font and window title
 
   xterm->captureFontAndTitle();
-  const auto font = xterm->getFont();
-  const auto title = xterm->getTitle();
+  const auto& font = xterm->getFont();
+  const auto& title = xterm->getTitle();
 
-  if ( font )
-    data->setXtermFont(*font);
+  if ( ! font.isEmpty() )
+    data->setXtermFont(font);
 
-  if ( title )
-    data->setXtermTitle(*title);
+  if ( ! title.isEmpty() )
+    data->setXtermTitle(title);
 }
 
 //----------------------------------------------------------------------
@@ -2549,7 +2549,7 @@ wchar_t cp437_to_unicode (uChar c)
 {
   constexpr std::size_t CP437 = 0;
   constexpr std::size_t UNICODE = 1;
-  wchar_t ucs(c);
+  wchar_t ucs = c;
 
   for (std::size_t i{0}; i <= fc::lastCP437Item; i++)
   {
@@ -2740,15 +2740,20 @@ std::size_t getColumnWidth (const FString& s)
 //----------------------------------------------------------------------
 std::size_t getColumnWidth (const wchar_t wchar)
 {
-  int column_width = wcwidth (wchar);
+  int column_width{};
+
+  if ( wchar >= fc::NF_rev_left_arrow2 && wchar <= fc::NF_check_mark )
+    column_width = 1;
+  else
+    column_width = wcwidth(wchar);
+
   return ( column_width == -1 ) ? 0 : std::size_t(column_width);
 }
 
 //----------------------------------------------------------------------
 std::size_t getColumnWidth (charData& term_char)
 {
-  int column_width = wcwidth (term_char.code);
-  std::size_t char_width = ( column_width == -1 ) ? 0 : std::size_t(column_width);
+  std::size_t char_width = getColumnWidth(term_char.code);
 
   if ( char_width == 2 && FTerm::getEncoding() != fc::UTF8 )
   {
diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp
index d31a3eee..118bb1bc 100644
--- a/src/ftermxterminal.cpp
+++ b/src/ftermxterminal.cpp
@@ -43,14 +43,14 @@ bool                 FTermXTerminal::meta_sends_esc{false};
 bool                 FTermXTerminal::xterm_default_colors{false};
 std::size_t          FTermXTerminal::term_width{80};
 std::size_t          FTermXTerminal::term_height{24};
-const FString*       FTermXTerminal::xterm_font{nullptr};
-const FString*       FTermXTerminal::xterm_title{nullptr};
-const FString*       FTermXTerminal::foreground_color{nullptr};
-const FString*       FTermXTerminal::background_color{nullptr};
-const FString*       FTermXTerminal::cursor_color{nullptr};
-const FString*       FTermXTerminal::mouse_foreground_color{nullptr};
-const FString*       FTermXTerminal::mouse_background_color{nullptr};
-const FString*       FTermXTerminal::highlight_background_color{nullptr};
+FString              FTermXTerminal::xterm_font{};
+FString              FTermXTerminal::xterm_title{};
+FString              FTermXTerminal::foreground_color{};
+FString              FTermXTerminal::background_color{};
+FString              FTermXTerminal::cursor_color{};
+FString              FTermXTerminal::mouse_foreground_color{};
+FString              FTermXTerminal::mouse_background_color{};
+FString              FTermXTerminal::highlight_background_color{};
 FSystem*             FTermXTerminal::fsystem{nullptr};
 FTermDetection*      FTermXTerminal::term_detection{nullptr};
 fc::xtermCursorStyle FTermXTerminal::cursor_style{fc::unknown_cursor_style};
@@ -70,31 +70,7 @@ FTermXTerminal::FTermXTerminal()
 
 //----------------------------------------------------------------------
 FTermXTerminal::~FTermXTerminal()  // destructor
-{
-  if ( highlight_background_color )
-    delete highlight_background_color;
-
-  if ( mouse_background_color )
-    delete mouse_background_color;
-
-  if ( mouse_foreground_color )
-    delete mouse_foreground_color;
-
-  if ( cursor_color )
-    delete cursor_color;
-
-  if ( background_color )
-    delete background_color;
-
-  if ( foreground_color )
-    delete foreground_color;
-
-  if ( xterm_title )
-    delete xterm_title;
-
-  if ( xterm_font )
-    delete xterm_font;
-}
+{ }
 
 
 // public methods of FTermXTerminal
@@ -112,10 +88,7 @@ void FTermXTerminal::setFont (const FString& fontname)
 {
   // Change the XTerm font (needs the allowFontOps resource)
 
-  if ( xterm_font )
-    delete xterm_font;
-
-  xterm_font = new FString(fontname);
+  xterm_font = fontname;
   setXTermFont();
 }
 
@@ -124,10 +97,7 @@ void FTermXTerminal::setTitle (const FString& title)
 {
   // Set the xterm title
 
-  if ( xterm_title )
-    delete xterm_title;
-
-  xterm_title = new FString(title);
+  xterm_title = title;
   setXTermTitle();
 }
 
@@ -146,10 +116,7 @@ void FTermXTerminal::setForeground (const FString& fg)
 {
   // Set the XTerm text foreground color
 
-  if ( foreground_color )
-    delete foreground_color;
-
-  foreground_color = new FString(fg);
+  foreground_color = fg;
   setXTermForeground();
 }
 
@@ -158,10 +125,7 @@ void FTermXTerminal::setBackground (const FString& bg)
 {
   // Set the XTerm text background color
 
-  if ( background_color )
-    delete background_color;
-
-  background_color = new FString(bg);
+  background_color = bg;
   setXTermBackground();
 }
 
@@ -170,10 +134,7 @@ void FTermXTerminal::setCursorColor (const FString& cc)
 {
   // Set the text cursor color
 
-  if ( cursor_color )
-    delete cursor_color;
-
-  cursor_color = new FString(cc);
+  cursor_color = cc;
   setXTermCursorColor();
 }
 
@@ -182,10 +143,7 @@ void FTermXTerminal::setMouseForeground (const FString& mfg)
 {
   // Set the mouse foreground color
 
-  if ( mouse_foreground_color )
-    delete mouse_foreground_color;
-
-  mouse_foreground_color = new FString(mfg);
+  mouse_foreground_color = mfg;
   setXTermMouseForeground();
 }
 
@@ -194,10 +152,7 @@ void FTermXTerminal::setMouseBackground (const FString& mbg)
 {
   // Set the mouse background color
 
-  if ( mouse_background_color )
-    delete mouse_background_color;
-
-  mouse_background_color = new FString(mbg);
+  mouse_background_color = mbg;
   setXTermMouseBackground();
 }
 
@@ -206,10 +161,7 @@ void FTermXTerminal::setHighlightBackground (const FString& hbg)
 {
   // Set the highlight background color
 
-  if ( highlight_background_color )
-    delete highlight_background_color;
-
-  highlight_background_color = new FString(hbg);
+  highlight_background_color = hbg;
   setXTermHighlightBackground();
 }
 
@@ -266,10 +218,7 @@ void FTermXTerminal::resetForeground()
 {
   // Reset the XTerm text foreground color
 
-  if ( foreground_color )
-    delete foreground_color;
-
-  foreground_color = nullptr;
+  foreground_color.clear();
   resetXTermForeground();
 }
 
@@ -278,10 +227,7 @@ void FTermXTerminal::resetBackground()
 {
   // Reset the XTerm text background color
 
-  if ( background_color )
-    delete background_color;
-
-  background_color = nullptr;
+  background_color.clear();
   resetXTermBackground();
 }
 
@@ -290,10 +236,7 @@ void FTermXTerminal::resetCursorColor()
 {
   // Reset the text cursor color
 
-  if ( cursor_color )
-    delete cursor_color;
-
-  cursor_color = nullptr;
+  cursor_color.clear();
   resetXTermCursorColor();
 }
 
@@ -302,10 +245,7 @@ void FTermXTerminal::resetMouseForeground()
 {
   // Reset the mouse foreground color
 
-  if ( mouse_foreground_color )
-    delete mouse_foreground_color;
-
-  mouse_foreground_color = nullptr;
+  mouse_foreground_color.clear();
   resetXTermMouseForeground();
 }
 
@@ -314,10 +254,7 @@ void FTermXTerminal::resetMouseBackground()
 {
   // Reset the mouse background color
 
-  if ( mouse_background_color )
-    delete mouse_background_color;
-
-  mouse_background_color = nullptr;
+  mouse_background_color.clear();
   resetXTermMouseBackground();
 }
 
@@ -326,10 +263,7 @@ void FTermXTerminal::resetHighlightBackground()
 {
   // Reset the highlight background color
 
-  if ( highlight_background_color )
-    delete highlight_background_color;
-
-  highlight_background_color = nullptr;
+  highlight_background_color.clear();
   resetXTermHighlightBackground();
 }
 
@@ -364,12 +298,6 @@ void FTermXTerminal::captureFontAndTitle()
     || term_detection->isUrxvtTerminal() )
     && ! term_detection->isRxvtTerminal() )
   {
-    if ( xterm_font )
-      delete xterm_font;
-
-    if ( xterm_title )
-      delete xterm_title;
-
     FTermios::setCaptureSendCharacters();
     xterm_font  = captureXTermFont();
     xterm_title = captureXTermTitle();
@@ -420,7 +348,7 @@ void FTermXTerminal::setXTermTitle()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "0;%s" BEL, xterm_title->c_str());
+    FTerm::putstringf (OSC "0;%s" BEL, xterm_title.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -449,7 +377,7 @@ void FTermXTerminal::setXTermFont()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "50;%s" BEL, xterm_font->c_str() );
+    FTerm::putstringf (OSC "50;%s" BEL, xterm_font.c_str() );
     oscPostfix();
   }
 }
@@ -466,7 +394,7 @@ void FTermXTerminal::setXTermForeground()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "10;%s" BEL, foreground_color->c_str());
+    FTerm::putstringf (OSC "10;%s" BEL, foreground_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -484,7 +412,7 @@ void FTermXTerminal::setXTermBackground()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "11;%s" BEL, background_color->c_str());
+    FTerm::putstringf (OSC "11;%s" BEL, background_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -502,7 +430,7 @@ void FTermXTerminal::setXTermCursorColor()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "12;%s" BEL, cursor_color->c_str());
+    FTerm::putstringf (OSC "12;%s" BEL, cursor_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -519,7 +447,7 @@ void FTermXTerminal::setXTermMouseForeground()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "13;%s" BEL, mouse_foreground_color->c_str());
+    FTerm::putstringf (OSC "13;%s" BEL, mouse_foreground_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -535,7 +463,7 @@ void FTermXTerminal::setXTermMouseBackground()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "14;%s" BEL, mouse_background_color->c_str());
+    FTerm::putstringf (OSC "14;%s" BEL, mouse_background_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -552,7 +480,7 @@ void FTermXTerminal::setXTermHighlightBackground()
     || FTermcap::osc_support )
   {
     oscPrefix();
-    FTerm::putstringf (OSC "17;%s" BEL, highlight_background_color->c_str());
+    FTerm::putstringf (OSC "17;%s" BEL, highlight_background_color.c_str());
     oscPostfix();
     std::fflush(stdout);
   }
@@ -769,7 +697,7 @@ void FTermXTerminal::oscPostfix()
 }
 
 //----------------------------------------------------------------------
-const FString* FTermXTerminal::captureXTermFont()
+const FString FTermXTerminal::captureXTermFont()
 {
   if ( term_detection->isXTerminal()
     || term_detection->isScreenTerm()
@@ -796,36 +724,25 @@ const FString* FTermXTerminal::captureXTermFont()
 
       if ( std::scanf("\033]50;%148[^\n]s", temp) == 1 )
       {
-        FString* xtermfont;
         std::size_t n = std::strlen(temp);
 
         // BEL + '\0' = string terminator
         if ( n >= 5 && temp[n - 1] == BEL[0] && temp[n] == '\0' )
           temp[n - 1] = '\0';
 
-        try
-        {
-          xtermfont = new FString(temp);
-        }
-        catch (const std::bad_alloc& ex)
-        {
-          std::cerr << bad_alloc_str << ex.what() << std::endl;
-          return 0;
-        }
-
-        return xtermfont;
+        return FString(temp);
       }
     }
   }
 
-  return 0;
+  return FString{};
 }
 
 //----------------------------------------------------------------------
-const FString* FTermXTerminal::captureXTermTitle()
+const FString FTermXTerminal::captureXTermTitle()
 {
   if ( term_detection->isKdeTerminal() )
-    return 0;
+    return FString{};
 
   fd_set ifds{};
   struct timeval tv{};
@@ -851,29 +768,16 @@ const FString* FTermXTerminal::captureXTermTitle()
       // Esc + \ = OSC string terminator
       if ( n >= 2 && temp[n - 2] == ESC[0] && temp[n - 1] == '\\' )
       {
-        FString* xtermtitle;
-
         if ( n < 4 )
-          return 0;
+          return FString{};
 
         temp[n - 2] = '\0';
-
-        try
-        {
-          xtermtitle = new FString(temp);
-        }
-        catch (const std::bad_alloc& ex)
-        {
-          std::cerr << bad_alloc_str << ex.what() << std::endl;
-          return 0;
-        }
-
-        return xtermtitle;
+        return FString{temp};
       }
     }
   }
 
-  return 0;
+  return FString{};
 }
 
 //----------------------------------------------------------------------
diff --git a/src/ftextview.cpp b/src/ftextview.cpp
index 08e0ce3b..cad4943a 100644
--- a/src/ftextview.cpp
+++ b/src/ftextview.cpp
@@ -65,30 +65,28 @@ const FString FTextView::getText() const
     return FString("");
 
   std::size_t len{0};
-  std::size_t rows = getRows();
 
-  for (std::size_t i{0} ; i < rows; i++)
-    len += data[i].getLength() + 1;
+  for (auto&& line : data)
+    len += line.getLength() + 1;  // String length + '\n'
 
-  FString s(len + 1);
-  std::size_t idx{0};
+  FString s(len);  // Reserves storage
+  auto iter = s.begin();
 
-  for (std::size_t i{0}; i < rows; i++)
+  for (auto&& line : data)
   {
-    const wchar_t* p = data[i].wc_str();
+    if ( ! line.isEmpty() )
+    {
+      if ( iter != s.begin() )
+      {
+        *iter = '\n';
+        ++iter;
+      }
 
-    if ( p )
-    {
-      while ( (s[idx++] = *p++) != 0 );
-      s[idx - 1] = '\n';
-    }
-    else
-    {
-      s[idx++] = '\n';
+      std::copy (line.begin(), line.end(), iter);
+      iter += std::distance(line.begin(), line.end());
     }
   }
 
-  s[idx - 1] = 0;
   return s;
 }
 
@@ -297,19 +295,28 @@ void FTextView::clear()
 
   // clear list from screen
   setColor();
+
+
+  if ( useFDialogBorder() )
+  {
+    auto parent = getParentWidget();
+    static_cast(parent)->redraw();
+  }
+  else
+    drawBorder();
+
   std::size_t size = getWidth() - 2;
 
   if ( size == 0 )
     return;
 
-  char* blank = createBlankArray(size + 1);
-
   for (int y{0}; y < int(getTextHeight()); y++)
   {
-    print() << FPoint(2, 2 - nf_offset + y) << blank;
+    print() << FPoint(2, 2 - nf_offset + y)
+            << FString(size, L' ');
   }
 
-  destroyBlankArray (blank);
+  updateTerminal();
   processChanged();
 }
 
@@ -595,8 +602,8 @@ std::size_t FTextView::getTextWidth()
 //----------------------------------------------------------------------
 void FTextView::init()
 {
-  initScrollbar (vbar, fc::vertical, &FTextView::cb_VBarChange);
-  initScrollbar (hbar, fc::horizontal, &FTextView::cb_HBarChange);
+  initScrollbar (vbar, fc::vertical, this, &FTextView::cb_VBarChange);
+  initScrollbar (hbar, fc::horizontal, this, &FTextView::cb_HBarChange);
   const auto& wc = getFWidgetColors();
   setForegroundColor (wc.dialog_fg);
   setBackgroundColor (wc.dialog_bg);
@@ -607,61 +614,11 @@ void FTextView::init()
   setRightPadding(1 + nf_offset);
 }
 
-//----------------------------------------------------------------------
-void FTextView::initScrollbar ( FScrollbarPtr& bar
-                              , fc::orientation o
-                              , FTextViewCallback callback )
-{
-  try
-  {
-    bar = std::make_shared(o, this);
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
-  bar->setMinimum(0);
-  bar->setValue(0);
-  bar->hide();
-
-  bar->addCallback
-  (
-    "change-value",
-    F_METHOD_CALLBACK (this, callback)
-  );
-}
-
 //----------------------------------------------------------------------
 void FTextView::draw()
 {
-  auto parent = getParentWidget();
-  bool is_text_dialog;
   setColor();
-
-  if ( isMonochron() )
-    setReverse(true);
-
-  if ( parent
-    && parent->isDialogWidget()
-    && isPaddingIgnored()
-    && getGeometry() == FRect ( 1
-                              , 2
-                              , parent->getWidth()
-                              , parent->getHeight() - 1) )
-  {
-    is_text_dialog = true;
-  }
-  else
-    is_text_dialog = false;
-
-  if ( ! (is_text_dialog || isNewFont()) )
-    drawBorder();
-
-  if ( isMonochron() )
-    setReverse(false);
-
+  drawBorder();
   drawScrollbars();
   drawText();
 
@@ -682,6 +639,21 @@ void FTextView::draw()
   flush_out();
 }
 
+//----------------------------------------------------------------------
+void FTextView::drawBorder()
+{
+  if ( ! useFDialogBorder() )
+  {
+    if ( isMonochron() )
+      setReverse(true);
+
+    FWidget::drawBorder();
+
+    if ( isMonochron() )
+      setReverse(false);
+  }
+}
+
 //----------------------------------------------------------------------
 void FTextView::drawScrollbars()
 {
@@ -740,6 +712,26 @@ void FTextView::drawText()
     setReverse(false);
 }
 
+//----------------------------------------------------------------------
+inline bool FTextView::useFDialogBorder()
+{
+  auto parent = getParentWidget();
+  bool use_fdialog_border{false};
+
+  if ( parent
+    && parent->isDialogWidget()
+    && isPaddingIgnored()
+    && getGeometry() == FRect ( 1
+                              , 2
+                              , parent->getWidth()
+                              , parent->getHeight() - 1) )
+  {
+    use_fdialog_border = true;
+  }
+
+  return use_fdialog_border;
+}
+
 //----------------------------------------------------------------------
 inline bool FTextView::isPrintable (wchar_t ch)
 {
diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp
index 11993501..c8d65eb3 100644
--- a/src/ftogglebutton.cpp
+++ b/src/ftogglebutton.cpp
@@ -370,25 +370,7 @@ void FToggleButton::onFocusOut (FFocusEvent* out_ev)
 //----------------------------------------------------------------------
 void FToggleButton::setHotkeyAccelerator()
 {
-  FKey hotkey = getHotkey(text);
-
-  if ( hotkey > 0xff00 && hotkey < 0xff5f )  // full-width character
-    hotkey -= 0xfee0;
-
-  if ( hotkey )
-  {
-    if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
-    {
-      addAccelerator (FKey(std::tolower(int(hotkey))));
-      addAccelerator (FKey(std::toupper(int(hotkey))));
-      // Meta + hotkey
-      addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
-    }
-    else
-      addAccelerator (hotkey);
-  }
-  else
-    delAccelerator();
+  setHotkeyViaString (this, text);
 }
 
 //----------------------------------------------------------------------
@@ -429,34 +411,14 @@ void FToggleButton::draw()
 //----------------------------------------------------------------------
 void FToggleButton::drawLabel()
 {
-  wchar_t* LabelText;
-
   if ( text.isNull() || text.isEmpty() )
     return;
 
-  std::size_t length = text.getLength();
-
-  try
-  {
-    LabelText = new wchar_t[length + 1]();
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return;
-  }
-
   FString txt(text);
-  wchar_t* src = const_cast(txt.wc_str());
-  wchar_t* dest = const_cast(LabelText);
-  auto hotkeypos = finalcut::getHotkeyPos(src, dest, length);
-
-  if ( hotkeypos != NOT_SET )
-    length--;
-
+  FString label_text{};
+  auto hotkeypos = finalcut::getHotkeyPos(txt, label_text);
   print() << FPoint(1 + int(label_offset_pos), 1);
-  drawText (LabelText, hotkeypos, length);
-  delete[] LabelText;
+  drawText (std::move(label_text), hotkeypos);
 }
 
 //----------------------------------------------------------------------
@@ -561,9 +523,7 @@ void FToggleButton::init()
 }
 
 //----------------------------------------------------------------------
-void FToggleButton::drawText ( wchar_t LabelText[]
-                             , std::size_t hotkeypos
-                             , std::size_t length )
+void FToggleButton::drawText (FString&& label_text, std::size_t hotkeypos)
 {
   if ( isMonochron() )
     setReverse(true);
@@ -575,7 +535,7 @@ void FToggleButton::drawText ( wchar_t LabelText[]
   else
     setColor (wc.label_inactive_fg, wc.label_inactive_bg);
 
-  for (std::size_t z{0}; z < length; z++)
+  for (std::size_t z{0}; z < label_text.getLength(); z++)
   {
     if ( (z == hotkeypos) && flags.active )
     {
@@ -584,7 +544,7 @@ void FToggleButton::drawText ( wchar_t LabelText[]
       if ( ! flags.no_underline )
         setUnderline();
 
-      print ( LabelText[z] );
+      print ( label_text[z] );
 
       if ( ! flags.no_underline )
         unsetUnderline();
@@ -592,7 +552,7 @@ void FToggleButton::drawText ( wchar_t LabelText[]
       setColor (wc.label_fg, wc.label_bg);
     }
     else
-      print (LabelText[z]);
+      print (label_text[z]);
   }
 
   if ( isMonochron() )
diff --git a/src/fvterm.cpp b/src/fvterm.cpp
index 342a8f77..ab13d769 100644
--- a/src/fvterm.cpp
+++ b/src/fvterm.cpp
@@ -1746,7 +1746,7 @@ charData FVTerm::getCharacter ( character_type char_type
 
   for (auto&& win_obj : *FWidget::getWindowList())
   {
-    bool significant_char;
+    bool significant_char{false};
 
     // char_type can be "overlapped_character"
     // or "covered_character"
diff --git a/src/fwidget.cpp b/src/fwidget.cpp
index b03da4e1..001bb6f0 100644
--- a/src/fwidget.cpp
+++ b/src/fwidget.cpp
@@ -1626,17 +1626,15 @@ void FWidget::hideArea (const FSize& size)
   }
 
   setColor (fg, bg);
-  char* blank = createBlankArray(size.getWidth());
 
-  if ( blank == 0 )
+  if ( size.getWidth() == 0 )
     return;
 
   for (int y{0}; y < int(size.getHeight()); y++)
   {
-    print() << FPoint(1, 1 + y) << blank;
+    print() << FPoint(1, 1 + y) << FString(size.getWidth(), L' ');
   }
 
-  destroyBlankArray (blank);
   flush_out();
 }
 
@@ -2258,7 +2256,6 @@ void FWidget::drawTransparentShadow (int x1, int y1, int x2, int y2)
 void FWidget::drawBlockShadow (int x1, int y1, int x2, int y2)
 {
   // non-transparent shadow
-  wchar_t block;
 
   if ( ! hasShadowCharacter() )
     return;
@@ -2273,7 +2270,6 @@ void FWidget::drawBlockShadow (int x1, int y1, int x2, int y2)
   else if ( auto p = getParentWidget() )
     setColor (wcolors.shadow_fg, p->getBackgroundColor());
 
-  block = fc::FullBlock;  // █
   print (fc::LowerHalfBlock);  // ▄
 
   if ( isWindowWidget() )
@@ -2281,7 +2277,7 @@ void FWidget::drawBlockShadow (int x1, int y1, int x2, int y2)
 
   for (std::size_t y{1}; y < getHeight(); y++)
   {
-    print() << FPoint(x2 + 1, y1 + int(y)) << block;  // █
+    print() << FPoint(x2 + 1, y1 + int(y)) << fc::FullBlock;  // █
   }
 
   print() << FPoint(x1 + 1, y2 + 1);
@@ -2309,38 +2305,12 @@ void FWidget::setColorTheme()
 
 
 // non-member functions
-//----------------------------------------------------------------------
-char* createBlankArray (std::size_t size)
-{
-  char* blank;
-
-  if ( size == 0 )
-    return 0;
-
-  try
-  {
-    blank = new char[size + 1];
-  }
-  catch (const std::bad_alloc& ex)
-  {
-    std::cerr << bad_alloc_str << ex.what() << std::endl;
-    return 0;
-  }
-
-  std::memset(blank, ' ', size);
-  blank[size] = '\0';
-  return blank;
-}
-
-//----------------------------------------------------------------------
-void destroyBlankArray (char blank[])
-{
-  delete[] blank;
-}
-
 //----------------------------------------------------------------------
 FKey getHotkey (const FString& text)
 {
+  // Returns the hotkey character from a string
+  // e.g. "E&xit" returns 'x'
+
   if ( text.isEmpty() )
     return 0;
 
@@ -2362,34 +2332,64 @@ FKey getHotkey (const FString& text)
 }
 
 //----------------------------------------------------------------------
-std::size_t getHotkeyPos (wchar_t src[], wchar_t dest[], std::size_t length)
+std::size_t getHotkeyPos (const FString& src, FString& dest)
 {
   // Find hotkey position in string
   // + generate a new string without the '&'-sign
-  const wchar_t* txt = src;
+
   constexpr std::size_t NOT_SET = static_cast(-1);
   std::size_t hotkeypos{NOT_SET};
+  std::size_t i{0};
 
-  for (std::size_t i{0}; i < length; i++)
+  for (auto&& ch : src)
   {
-    if ( txt[i] == L'&' && hotkeypos == NOT_SET )
-    {
+    if ( ch == L'&' && hotkeypos == NOT_SET && src.getLength() != i + 1 )
       hotkeypos = i;
-      i++;
-      src++;
-    }
+    else
+      dest += ch;
 
-    *dest++ = *src++;
+    i++;
   }
 
   return hotkeypos;
 }
+//----------------------------------------------------------------------
+void setHotkeyViaString (FWidget* w, const FString& text)
+{
+  // Set hotkey accelerator via string
+
+  if ( ! w )
+    return;
+
+  FKey hotkey = getHotkey(text);
+
+  if ( hotkey > 0xff00 && hotkey < 0xff5f )  // full-width character
+    hotkey -= 0xfee0;
+
+  if ( hotkey )
+  {
+    if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
+    {
+      w->addAccelerator (FKey(std::tolower(int(hotkey))));
+      w->addAccelerator (FKey(std::toupper(int(hotkey))));
+      // Meta + hotkey
+      w->addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
+    }
+    else
+      w->addAccelerator (hotkey);
+  }
+  else
+    w->delAccelerator();
+}
 
 //----------------------------------------------------------------------
 inline void drawBox (FWidget* w, const FRect& r)
 {
   // Use box-drawing characters to draw a border
 
+  if ( ! w )
+    return;
+
   w->print() << r.getUpperLeftPos() << fc::BoxDrawingsDownAndRight;  // ┌
 
   for (int x = r.getX1() + 1; x < r.getX2(); x++)
diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h
index 33ad6340..e56ea804 100644
--- a/src/include/final/fbutton.h
+++ b/src/include/final/fbutton.h
@@ -149,7 +149,7 @@ class FButton : public FWidget
     void                drawMarginLeft();
     void                drawMarginRight();
     void                drawTopBottomBackground();
-    void                drawButtonTextLine (wchar_t[]);
+    void                drawButtonTextLine (const FString&);
     void                draw() override;
     void                updateStatusBar();
     void                updateButtonColor();
diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h
index 1be167f3..b5f540eb 100644
--- a/src/include/final/fbuttongroup.h
+++ b/src/include/final/fbuttongroup.h
@@ -131,7 +131,7 @@ class FButtonGroup : public FScrollView
 
     // Methods
     void                init();
-    void                drawText (wchar_t[], std::size_t, std::size_t);
+    void                drawText (const FString&, std::size_t);
     void                directFocus();
 
     // Callback method
diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h
index 473c7a34..eb29a3d4 100644
--- a/src/include/final/flabel.h
+++ b/src/include/final/flabel.h
@@ -146,14 +146,16 @@ class FLabel : public FWidget
     void                draw() override;
     void                drawMultiLine();
     void                drawSingleLine();
-    void                printLine ( wchar_t[], std::size_t, std::size_t
-                                  , std::size_t, std::size_t = 0 );
+    void                printLine (FString&&);
 
     // Data members
     FStringList         multiline_text{};
     FString             text{};
     FWidget*            accel_widget{nullptr};
     fc::text_alignment  alignment{fc::alignLeft};
+    std::size_t         align_offset{0};
+    std::size_t         hotkeypos{NOT_SET};
+    std::size_t         column_width{0};
     FColor              emphasis_color{getFWidgetColors().label_emphasis_fg};
     FColor              ellipsis_color{getFWidgetColors().label_ellipsis_fg};
     bool                multiline{false};
diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h
index 52efa51c..df22c908 100644
--- a/src/include/final/flistbox.h
+++ b/src/include/final/flistbox.h
@@ -56,8 +56,10 @@ e Copyright 2014-2019 Markus Gans                                      *
 #include 
 #include 
 
+#include "final/fscrollbar.h"
 #include "final/fwidget.h"
 
+
 namespace finalcut
 {
 
@@ -236,10 +238,6 @@ class FListBox : public FWidget
     void                adjustSize() override;
 
   private:
-    // Typedef
-    typedef std::shared_ptr FScrollbarPtr;
-    typedef void (FListBox::*FListBoxCallback)(FWidget*, FDataPtr);
-
     // Enumeration
     enum convert_type
     {
@@ -257,9 +255,6 @@ class FListBox : public FWidget
 
     // Methods
     void                init();
-    void                initScrollbar ( FScrollbarPtr&
-                                      , fc::orientation
-                                      , FListBoxCallback );
     void                draw() override;
     void                drawBorder() override;
     void                drawScrollbars();
diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h
index 5997e3bc..def85c81 100644
--- a/src/include/final/flistview.h
+++ b/src/include/final/flistview.h
@@ -57,6 +57,7 @@
 #include 
 #include 
 
+#include "final/fscrollbar.h"
 #include "final/ftermbuffer.h"
 #include "final/fwidget.h"
 
@@ -77,10 +78,10 @@ class FListViewItem : public FObject
   public:
     // Constructor
     FListViewItem (const FListViewItem&);  // copy constructor
-    explicit FListViewItem (FObjectIterator);
+    explicit FListViewItem (iterator);
     FListViewItem ( const FStringList&
                   , FDataPtr
-                  , FObjectIterator );
+                  , iterator );
 
     // Destructor
     virtual ~FListViewItem();
@@ -107,8 +108,8 @@ class FListViewItem : public FObject
     bool                isExpand() const;
 
     // Methods
-    FObjectIterator     insert (FListViewItem*);
-    FObjectIterator     insert (FListViewItem*, FObjectIterator);
+    iterator            insert (FListViewItem*);
+    iterator            insert (FListViewItem*, iterator);
     void                expand();
     void                collapse();
 
@@ -120,7 +121,7 @@ class FListViewItem : public FObject
     // Methods
     template 
     void                sort (Compare);
-    FObjectIterator     appendItem (FListViewItem*);
+    iterator            appendItem (FListViewItem*);
     void                replaceControlCodes();
     std::size_t         getVisibleLines();
     void                resetVisibleLineCounter();
@@ -128,7 +129,7 @@ class FListViewItem : public FObject
     // Data members
     FStringList      column_list{};
     FDataPtr         data_pointer{nullptr};
-    FObjectIterator  root{};
+    iterator         root{};
     std::size_t      visible_lines{1};
     bool             expandable{false};
     bool             is_expand{false};
@@ -187,13 +188,13 @@ class FListViewIterator
 {
   public:
     // Typedefs
-    typedef std::list         FObjectList;
-    typedef FObjectList::iterator       FObjectIterator;
-    typedef std::stack FObjectIteratorStack;
+    typedef std::list   FObjectList;
+    typedef FObjectList::iterator iterator;
+    typedef std::stack  iterator_stack;
 
     // Constructor
     FListViewIterator () = default;
-    FListViewIterator (FObjectIterator);
+    FListViewIterator (iterator);
 
     // Overloaded operators
     FListViewIterator& operator ++ ();     // prefix
@@ -216,12 +217,12 @@ class FListViewIterator
 
   private:
     // Methods
-    void                nextElement (FObjectIterator&);
-    void                prevElement (FObjectIterator&);
+    void                nextElement (iterator&);
+    void                prevElement (iterator&);
 
     // Data members
-    FObjectIteratorStack iter_path{};
-    FObjectIterator      node{};
+    iterator_stack       iter_path{};
+    iterator             node{};
     int                  position{0};
 };
 
@@ -251,6 +252,7 @@ inline const char* FListViewIterator::getClassName() const
 inline int FListViewIterator::getPosition() const
 { return position; }
 
+
 //----------------------------------------------------------------------
 // class FListView
 //----------------------------------------------------------------------
@@ -304,38 +306,38 @@ class FListView : public FWidget
     // Methods
     virtual int          addColumn (const FString&, int = USE_MAX_SIZE);
     void                 hide() override;
-    FObjectIterator      insert (FListViewItem*);
-    FObjectIterator      insert (FListViewItem*, FObjectIterator);
-    FObjectIterator      insert ( const FStringList&
+    iterator             insert (FListViewItem*);
+    iterator             insert (FListViewItem*, iterator);
+    iterator             insert ( const FStringList&
                                 , FDataPtr = nullptr );
-    FObjectIterator      insert ( const FStringList&
-                                , FObjectIterator );
-    FObjectIterator      insert ( const FStringList&
+    iterator             insert ( const FStringList&
+                                , iterator );
+    iterator             insert ( const FStringList&
                                 , FDataPtr
-                                , FObjectIterator );
+                                , iterator );
     template 
-    FObjectIterator      insert ( const std::initializer_list&
+    iterator             insert ( const std::initializer_list&
                                 , FDataPtr = nullptr );
     template 
-    FObjectIterator      insert ( const std::initializer_list&
-                                , FObjectIterator );
+    iterator             insert ( const std::initializer_list&
+                                , iterator );
     template 
-    FObjectIterator      insert ( const std::initializer_list&
+    iterator             insert ( const std::initializer_list&
                                 , FDataPtr
-                                , FObjectIterator );
+                                , iterator );
     template 
-    FObjectIterator      insert ( const std::vector&
+    iterator             insert ( const std::vector&
                                 , FDataPtr = nullptr );
     template 
-    FObjectIterator      insert ( const std::vector&
-                                , FObjectIterator );
+    iterator             insert ( const std::vector&
+                                , iterator );
     template 
-    FObjectIterator      insert ( const std::vector&
+    iterator             insert ( const std::vector&
                                 , FDataPtr
-                                , FObjectIterator );
+                                , iterator );
 
-    FObjectIterator      beginOfList();
-    FObjectIterator      endOfList();
+    iterator             beginOfList();
+    iterator             endOfList();
     virtual void         sort();
 
     // Event handlers
@@ -350,7 +352,7 @@ class FListView : public FWidget
     void                 onFocusOut (FFocusEvent*) override;
 
     // Data members
-    static FObjectIterator null_iter;
+    static iterator      null_iter;
 
   protected:
     // Methods
@@ -365,8 +367,6 @@ class FListView : public FWidget
     struct Header;  // forward declaration
     typedef std::vector
headerItems; typedef std::vector sortTypes; - typedef std::shared_ptr FScrollbarPtr; - typedef void (FListView::*FListViewCallback)(FWidget*, FDataPtr); // Constants static constexpr int USE_MAX_SIZE = -1; @@ -377,9 +377,6 @@ class FListView : public FWidget // Methods void init(); - void initScrollbar ( FScrollbarPtr& - , fc::orientation - , FListViewCallback ); template void sort (Compare); std::size_t getAlignOffset ( fc::text_alignment @@ -414,7 +411,7 @@ class FListView : public FWidget void dragUp (int); void dragDown (int); void stopDragScroll(); - FObjectIterator appendItem (FListViewItem*); + iterator appendItem (FListViewItem*); void processClick(); void processChanged(); void toggleCheckbox(); @@ -441,7 +438,7 @@ class FListView : public FWidget void cb_HBarChange (FWidget*, FDataPtr); // Data members - FObjectIterator root{}; + iterator root{}; FObjectList selflist{}; FObjectList itemlist{}; FListViewIterator current_iter{}; @@ -537,39 +534,39 @@ inline bool FListView::unsetTreeView() { return setTreeView(false); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator FListView::insert (FListViewItem* item) +inline FObject::iterator FListView::insert (FListViewItem* item) { return insert (item, root); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert (const FStringList& cols, FDataPtr d) { return insert (cols, d, root); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert ( const FStringList& cols - , FObjectIterator parent_iter ) + , iterator parent_iter ) { return insert (cols, 0, parent_iter); } //---------------------------------------------------------------------- template -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert (const std::initializer_list& list, FDataPtr d) { return insert (list, d, root); } //---------------------------------------------------------------------- template -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert ( const std::initializer_list& list - , FObjectIterator parent_iter ) + , iterator parent_iter ) { return insert (list, 0, parent_iter); } //---------------------------------------------------------------------- template -FObject::FObjectIterator +FObject::iterator FListView::insert ( const std::initializer_list& list , FDataPtr d - , FObjectIterator parent_iter ) + , iterator parent_iter ) { FStringList str_cols; @@ -589,23 +586,23 @@ FObject::FObjectIterator //---------------------------------------------------------------------- template -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert (const std::vector& cols, FDataPtr d) { return insert (cols, d, root); } //---------------------------------------------------------------------- template -inline FObject::FObjectIterator +inline FObject::iterator FListView::insert ( const std::vector& cols - , FObjectIterator parent_iter ) + , iterator parent_iter ) { return insert (cols, 0, parent_iter); } //---------------------------------------------------------------------- template -FObject::FObjectIterator +FObject::iterator FListView::insert ( const std::vector& cols , FDataPtr d - , FObjectIterator parent_iter ) + , iterator parent_iter ) { FStringList str_cols; @@ -624,11 +621,11 @@ FObject::FObjectIterator } //---------------------------------------------------------------------- -inline FObject::FObjectIterator FListView::beginOfList() +inline FObject::iterator FListView::beginOfList() { return itemlist.begin(); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator FListView::endOfList() +inline FObject::iterator FListView::endOfList() { return itemlist.end(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 13666787..a7d1ba64 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -147,8 +147,7 @@ class FMenu : public FWindow, public FMenuList typedef struct { - wchar_t* text; - std::size_t length; + FString text; std::size_t hotkeypos; bool no_underline; } menuText; diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 6578f82a..9df004eb 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -112,8 +112,7 @@ class FMenuBar : public FWindow, public FMenuList // Typedef typedef struct { - wchar_t* text; - std::size_t length; + FString text; std::size_t startpos; std::size_t hotkeypos; bool no_underline; diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index fb3748b9..ccac9d06 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -233,7 +233,7 @@ int FMessageBox::error ( FWidget* parent mbox.beep(); mbox.setHeadline("Warning:"); mbox.setCenterText(); - const FWidgetColors& wc = mbox.getFWidgetColors(); + const auto& wc = mbox.getFWidgetColors(); mbox.setForegroundColor(wc.error_box_fg); mbox.setBackgroundColor(wc.error_box_bg); mbox.emphasis_color = wc.error_box_emphasis_fg; diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index d3476031..7016da7d 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -72,9 +72,9 @@ class FObject { public: // Typedef - typedef std::list FObjectList; - typedef FObjectList::iterator FObjectIterator; - typedef FObjectList::const_iterator constFObjectIterator; + typedef std::list FObjectList; + typedef FObjectList::iterator iterator; + typedef FObjectList::const_iterator const_iterator; // Constructor explicit FObject (FObject* = nullptr); @@ -95,10 +95,10 @@ class FObject FObjectList& getChildren(); const FObjectList& getChildren() const; int numOfChildren() const; - FObjectIterator begin(); - FObjectIterator end(); - constFObjectIterator begin() const; - constFObjectIterator end() const; + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; // Inquiries bool hasParent() const; @@ -185,19 +185,19 @@ inline int FObject::numOfChildren() const { return int(children_list.size()); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator FObject::begin() +inline FObject::iterator FObject::begin() { return children_list.begin(); } //---------------------------------------------------------------------- -inline FObject::FObjectIterator FObject::end() +inline FObject::iterator FObject::end() { return children_list.end(); } //---------------------------------------------------------------------- -inline FObject::constFObjectIterator FObject::begin() const +inline FObject::const_iterator FObject::begin() const { return children_list.begin(); } //---------------------------------------------------------------------- -inline FObject::constFObjectIterator FObject::end() const +inline FObject::const_iterator FObject::end() const { return children_list.end(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 246b46b1..ee77fc4f 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -57,6 +57,12 @@ namespace finalcut { +// class forward declaration +class FScrollbar; + +// Global typedef +typedef std::shared_ptr FScrollbarPtr; + //---------------------------------------------------------------------- // class FScrollbar //---------------------------------------------------------------------- @@ -161,6 +167,37 @@ class FScrollbar : public FWidget int max_color{getMaxColor()}; }; + +// non-member function forward declarations +//---------------------------------------------------------------------- +template +void initScrollbar ( FScrollbarPtr& bar + , fc::orientation o + , FWidget* cb_instance + , Callback cb_handler ) +{ + try + { + bar = std::make_shared(o, cb_instance); + } + catch (const std::bad_alloc& ex) + { + std::cerr << bad_alloc_str << ex.what() << std::endl; + return; + } + + bar->setMinimum(0); + bar->setValue(0); + bar->hide(); + + bar->addCallback + ( + "change-value", + F_METHOD_CALLBACK (cb_instance, cb_handler) + ); +} + + // FScrollbar inline functions //---------------------------------------------------------------------- inline const char* FScrollbar::getClassName() const diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 9a07c54b..223abbb1 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -153,10 +153,6 @@ class FScrollView : public FWidget void copy2area(); private: - // Typedef - typedef std::shared_ptr FScrollbarPtr; - typedef void (FScrollView::*FScrollViewCallback)(FWidget*, FDataPtr); - // Constants static constexpr int vertical_border_spacing = 2; static constexpr int horizontal_border_spacing = 2; @@ -166,9 +162,10 @@ class FScrollView : public FWidget // Methods void init (FWidget*); + template void initScrollbar ( FScrollbarPtr& , fc::orientation - , FScrollViewCallback ); + , Callback ); void calculateScrollbarPos(); void setHorizontalScrollBarVisibility(); void setVerticalScrollBarVisibility(); @@ -270,6 +267,17 @@ inline void FScrollView::print (const FPoint& pos) setPrintPos(pos); } +//---------------------------------------------------------------------- +template +inline void FScrollView::initScrollbar ( FScrollbarPtr& bar + , fc::orientation o + , Callback cb_handler ) +{ + finalcut::initScrollbar (bar, o, this, cb_handler); + term_area* area = getPrintArea(); + bar->setPrintArea(area); +} + } // namespace finalcut #endif // FSCROLLVIEW_H diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index 1c1f58c0..27efcfab 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -76,14 +76,14 @@ class FTermXTerminal final // Accessors const char* getClassName() const; static fc::xtermCursorStyle getCursorStyle(); - static const FString* getFont(); - static const FString* getTitle(); - static const FString* getForeground(); - static const FString* getBackground(); - static const FString* getCursorColor(); - static const FString* getMouseForeground(); - static const FString* getMouseBackground(); - static const FString* getHighlightBackground(); + static const FString getFont(); + static const FString getTitle(); + static const FString getForeground(); + static const FString getBackground(); + static const FString getCursorColor(); + static const FString getMouseForeground(); + static const FString getMouseBackground(); + static const FString getHighlightBackground(); // Inquiries static bool hasFont(); @@ -128,8 +128,8 @@ class FTermXTerminal final static bool canResetColor(); static void oscPrefix(); static void oscPostfix(); - static const FString* captureXTermFont(); - static const FString* captureXTermTitle(); + static const FString captureXTermFont(); + static const FString captureXTermTitle(); static void enableXTermMouse(); static void disableXTermMouse(); static void enableXTermMetaSendsESC(); @@ -141,14 +141,14 @@ class FTermXTerminal final static bool xterm_default_colors; static std::size_t term_width; static std::size_t term_height; - static const FString* xterm_font; - static const FString* xterm_title; - static const FString* foreground_color; - static const FString* background_color; - static const FString* cursor_color; - static const FString* mouse_foreground_color; - static const FString* mouse_background_color; - static const FString* highlight_background_color; + static FString xterm_font; + static FString xterm_title; + static FString foreground_color; + static FString background_color; + static FString cursor_color; + static FString mouse_foreground_color; + static FString mouse_background_color; + static FString highlight_background_color; static FSystem* fsystem; static FTermDetection* term_detection; static fc::xtermCursorStyle cursor_style; @@ -169,44 +169,44 @@ inline fc::xtermCursorStyle FTermXTerminal::getCursorStyle() { return cursor_style; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getFont() +inline const FString FTermXTerminal::getFont() { return xterm_font; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getTitle() +inline const FString FTermXTerminal::getTitle() { return xterm_title; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getForeground() +inline const FString FTermXTerminal::getForeground() { return foreground_color; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getBackground() +inline const FString FTermXTerminal::getBackground() { return background_color; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getCursorColor() +inline const FString FTermXTerminal::getCursorColor() { return cursor_color; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getMouseForeground() +inline const FString FTermXTerminal::getMouseForeground() { return mouse_foreground_color; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getMouseBackground() +inline const FString FTermXTerminal::getMouseBackground() { return mouse_background_color; } //---------------------------------------------------------------------- -inline const FString* FTermXTerminal::getHighlightBackground() +inline const FString FTermXTerminal::getHighlightBackground() { return highlight_background_color; } //---------------------------------------------------------------------- inline bool FTermXTerminal::hasFont() -{ return bool(xterm_font && xterm_font->getLength() > 2); } +{ return bool(xterm_font.getLength() > 2); } //---------------------------------------------------------------------- inline bool FTermXTerminal::hasTitle() -{ return bool(xterm_title && xterm_title->getLength() > 0); } +{ return bool(xterm_title.getLength() > 0); } //---------------------------------------------------------------------- inline void FTermXTerminal::setMouseSupport() diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index 1b3fc90b..805ab135 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -136,10 +136,6 @@ class FTextView : public FWidget void adjustSize() override; private: - // Typedef - typedef std::shared_ptr FScrollbarPtr; - typedef void (FTextView::*FTextViewCallback)(FWidget*, FDataPtr); - // Accessors std::size_t getTextHeight(); std::size_t getTextWidth(); @@ -150,12 +146,11 @@ class FTextView : public FWidget // Methods void init(); - void initScrollbar ( FScrollbarPtr& - , fc::orientation - , FTextViewCallback ); void draw() override; + void drawBorder() override; void drawScrollbars(); void drawText(); + bool useFDialogBorder(); bool isPrintable (wchar_t); void processChanged(); diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index 4764fa58..3fac8512 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -151,7 +151,7 @@ class FToggleButton : public FWidget // Methods void init(); - void drawText (wchar_t[], std::size_t , std::size_t); + void drawText (FString&&, std::size_t); // Friend classes friend class FButtonGroup; diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 018e4dc0..ba27a34c 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -525,10 +525,9 @@ class FWidget : public FVTerm, public FObject // non-member function forward declarations //---------------------------------------------------------------------- -char* createBlankArray (std::size_t); -void destroyBlankArray (char[]); FKey getHotkey (const FString&); -std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t); +std::size_t getHotkeyPos (const FString& src, FString& dest); +void setHotkeyViaString (FWidget*, const FString&); void drawBorder (FWidget*, FRect); // FWidget inline functions diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index 521dba2c..e6bf3d85 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -388,7 +388,7 @@ void FObjectTest::iteratorTest() CPPUNIT_ASSERT ( child2->getParent() == obj ); CPPUNIT_ASSERT ( child3->getParent() == obj ); - finalcut::FObject::constFObjectIterator c_iter, c_last; + finalcut::FObject::const_iterator c_iter, c_last; c_iter = obj->begin(); c_last = obj->end(); int i = 0; @@ -402,7 +402,7 @@ void FObjectTest::iteratorTest() CPPUNIT_ASSERT ( obj->numOfChildren() == i ); CPPUNIT_ASSERT ( i == 3 ); - finalcut::FObject::FObjectIterator iter, last; + finalcut::FObject::iterator iter, last; iter = obj->begin(); last = obj->end(); i = 0;