widget clearing updates now only non-covered characters

This commit is contained in:
Markus Gans 2016-08-06 21:43:39 +02:00
parent f81370f8cf
commit 5606d66404
28 changed files with 75 additions and 65 deletions

View File

@ -1,3 +1,9 @@
2016-07-31 Markus Gans <guru.mail@muenster.de>
* Rename setUpdateVTerm to updateVTerm
* Rename clrscr to clearArea
* The widget clearing method updates now only non-covered
characters on the virtual terminal.
2016-07-31 Markus Gans <guru.mail@muenster.de>
* Resetting the local window widget focus at
the end of the lifetime of a widget.

View File

@ -21,7 +21,7 @@ Missing Features
---------------------------------------
- Screen characters should get the options transparent
and transparent with color
and transparent shadow (transparent with color)
- FDialog title button [▲] and [▼] should maximized or restore
the window size on a resizeable dialog
- A possibility to change the window size dynamically with the mouse

View File

@ -161,7 +161,7 @@ void FButton::draw()
is_Flat = isFlat();
is_NonFlatShadow = ((flags & (fc::shadow+fc::flat)) == fc::shadow);
is_NoUnderline = ((flags & fc::no_underline) != 0);
setUpdateVTerm(false);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -374,7 +374,7 @@ void FButton::draw()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
delete[] ButtonText;
if ( is_Focus && statusBar() )

View File

@ -138,7 +138,7 @@ void FButtonGroup::directFocus()
//----------------------------------------------------------------------
void FButtonGroup::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -153,7 +153,7 @@ void FButtonGroup::draw()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -40,10 +40,10 @@ void FCheckBox::init()
//----------------------------------------------------------------------
void FCheckBox::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
drawCheckButton();
drawLabel();
setUpdateVTerm(true);
updateVTerm(true);
FToggleButton::draw();
}

View File

@ -466,14 +466,14 @@ void FDialog::draw()
height = ymax;
}
setUpdateVTerm(false);
updateVTerm(false);updateVTerm(true);
// fill the background
setColor (foregroundColor, backgroundColor);
if ( isMonochron() )
setReverse(true);
clrscr();
clearArea();
drawBorder();
drawTitleBar();
@ -526,7 +526,7 @@ void FDialog::draw()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -239,7 +239,7 @@ void FLabel::draw()
if ( text.isNull() || text.isEmpty() )
return;
setUpdateVTerm(false);
updateVTerm(false);
if ( isMonochron() )
{
@ -317,7 +317,7 @@ void FLabel::draw()
setBold(false);
}
setUpdateVTerm(true);
updateVTerm(true);
}

View File

@ -135,7 +135,7 @@ void FLineEdit::drawInputField()
isActive = ((flags & fc::active) != 0);
isShadow = ((flags & fc::shadow) != 0 );
setUpdateVTerm(false);
updateVTerm(false);
gotoxy (xpos+xmin-1, ypos+ymin-1);
if ( isMonochron() )
@ -220,7 +220,7 @@ void FLineEdit::drawInputField()
if ( isShadow )
drawShadow ();
setUpdateVTerm(true);
updateVTerm(true);
// set the cursor to the first pos.
setCursorPos (xpos+xmin+cursor_pos-offset, ypos+ymin-1);

View File

@ -134,7 +134,7 @@ void FListBox::draw()
if ( current < 1 )
current = 1;
setUpdateVTerm(false);
updateVTerm(false);
setColor (foregroundColor, backgroundColor);
if ( isMonochron() )
@ -166,7 +166,7 @@ void FListBox::draw()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
if ( VBar->isVisible() )
VBar->redraw();
@ -247,7 +247,7 @@ void FListBox::drawList()
end = std::max(last_pos, current_pos)+1;
}
setUpdateVTerm(false);
updateVTerm(false);
for (uInt y=start; y < end; y++)
{
@ -473,7 +473,7 @@ void FListBox::drawList()
setReverse(false);
unsetBold();
setUpdateVTerm(true);
updateVTerm(true);
updateTerminal();
flush_out();

View File

@ -598,12 +598,12 @@ void FMenu::draw()
{
// fill the background
setColor (wc.menu_active_fg, wc.menu_active_bg);
setUpdateVTerm(false);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
clrscr();
clearArea();
drawBorder();
drawItems();
@ -611,9 +611,13 @@ void FMenu::draw()
setReverse(false);
if ( (flags & fc::shadow) != 0 )
{
drawMenuShadow();
setUpdateVTerm(true);
term_area* area = getWindowWidget(this)->getVWin();
putArea (xpos+xmin-1, ypos+ymin-1, area);
}
else
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -329,7 +329,7 @@ void FMenuBar::drawItems()
if ( itemlist.empty() )
return;
setUpdateVTerm(false);
updateVTerm(false);
gotoxy (1,1);
if ( isMonochron() )
@ -470,7 +470,7 @@ void FMenuBar::drawItems()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -229,7 +229,7 @@ void FMessageBox::draw()
int head_offset = 0;
int center_x = 0;
int msg_x = int((width - int(maxLineWidth)) / 2); // center the whole block
setUpdateVTerm(false);
updateVTerm(false);
if ( isMonochron() )
setReverse(true);
@ -263,7 +263,7 @@ void FMessageBox::draw()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -150,14 +150,14 @@ void FProgressbar::drawBar()
//----------------------------------------------------------------------
void FProgressbar::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
drawPercentage();
drawBar();
if ( (flags & fc::shadow) != 0 )
drawShadow ();
setUpdateVTerm(true);
updateVTerm(true);
flush_out();
}
@ -204,7 +204,7 @@ void FProgressbar::setPercentage (int percentage_value)
else
percentage = percentage_value;
setUpdateVTerm(false);
updateVTerm(false);
if ( isVisible() )
{
@ -212,14 +212,14 @@ void FProgressbar::setPercentage (int percentage_value)
drawBar();
}
setUpdateVTerm(true);
updateVTerm(true);
updateTerminal();
}
//----------------------------------------------------------------------
void FProgressbar::reset()
{
setUpdateVTerm(false);
updateVTerm(false);
percentage = -1;
if ( isVisible() )
@ -228,7 +228,7 @@ void FProgressbar::reset()
drawBar();
}
setUpdateVTerm(true);
updateVTerm(true);
updateTerminal();
}

View File

@ -41,10 +41,10 @@ void FRadioButton::init()
//----------------------------------------------------------------------
void FRadioButton::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
drawRadioButton();
drawLabel();
setUpdateVTerm(true);
updateVTerm(true);
FToggleButton::draw();
}

View File

@ -80,11 +80,11 @@ void FScrollbar::init()
//----------------------------------------------------------------------
void FScrollbar::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
drawButtons();
currentSliderPos = -1;
drawBar();
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------
@ -563,7 +563,7 @@ void FScrollbar::drawBar()
if (SliderPos != currentSliderPos)
{
int z;
setUpdateVTerm(false);
updateVTerm(false);
if ( bar_orientation == fc::vertical )
{
@ -665,7 +665,7 @@ void FScrollbar::drawBar()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
}

View File

@ -230,7 +230,7 @@ void FStatusBar::drawKeys()
return;
}
setUpdateVTerm(false);
updateVTerm(false);
gotoxy (1, lastLine);
if ( isMonochron() )
@ -343,7 +343,7 @@ void FStatusBar::drawKeys()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
x_msg = x;
}
@ -602,7 +602,7 @@ void FStatusBar::drawMessage()
if ( isLastActiveFocus )
space_offset = 0;
setUpdateVTerm(false);
updateVTerm(false);
setColor (wc.statusbar_fg, wc.statusbar_bg);
gotoxy (x, lastLine);
@ -646,7 +646,7 @@ void FStatusBar::drawMessage()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -37,10 +37,10 @@ FSwitch::~FSwitch() // destructor
//----------------------------------------------------------------------
void FSwitch::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
drawLabel();
drawCheckButton();
setUpdateVTerm(true);
updateVTerm(true);
FToggleButton::draw();
updateTerminal();
flush_out();

View File

@ -2573,7 +2573,7 @@ void FTerm::updateVTerm (FTerm::term_area* area)
}
//----------------------------------------------------------------------
void FTerm::setUpdateVTerm (bool on)
void FTerm::updateVTerm (bool on)
{
vterm_updates = on;

View File

@ -278,7 +278,7 @@ class FTerm
bool isCovered (const FPoint&, FTerm::term_area*) const;
bool isCovered (int, int, FTerm::term_area*) const;
void updateVTerm (FTerm::term_area*);
void setUpdateVTerm (bool);
void updateVTerm (bool);
void getArea (const FPoint&, FTerm::term_area*);
void getArea (int, int, FTerm::term_area*);
void getArea (const FRect&, FTerm::term_area*);

View File

@ -65,7 +65,7 @@ void FTextView::init()
//----------------------------------------------------------------------
void FTextView::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
setColor (foregroundColor, backgroundColor);
if ( isMonochron() )
@ -83,7 +83,7 @@ void FTextView::draw()
if ( HBar->isVisible() )
HBar->redraw();
setUpdateVTerm(true);
updateVTerm(true);
drawText();
if ( hasFocus() && statusBar() )
@ -93,10 +93,10 @@ void FTextView::draw()
if ( curMsg != msg )
{
setUpdateVTerm(false);
updateVTerm(false);
statusBar()->setMessage(msg);
statusBar()->drawMessage();
setUpdateVTerm(true);
updateVTerm(true);
}
}
@ -119,7 +119,7 @@ void FTextView::drawText()
if ( end > getRows() )
end = getRows();
setUpdateVTerm(false);
updateVTerm(false);
setColor (foregroundColor, backgroundColor);
if ( isMonochron() )
@ -159,7 +159,7 @@ void FTextView::drawText()
if ( isMonochron() )
setReverse(false);
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -174,7 +174,7 @@ void FWidget::init()
foregroundColor = wc.term_fg;
backgroundColor = wc.term_bg;
setColor (foregroundColor, backgroundColor);
clrscr();
clearArea();
accelerator_list = new Accelerators();
}
@ -1232,7 +1232,7 @@ void FWidget::redraw()
{
terminal_updates = false;
setColor (wc.term_fg, wc.term_bg);
clrscr();
clearArea();
}
else if ( ! visible )
return;
@ -1926,7 +1926,7 @@ bool FWidget::setCursorPos (register int x, register int y)
}
//----------------------------------------------------------------------
void FWidget::clrscr()
void FWidget::clearArea()
{
term_area* area;
FWindow* area_widget;
@ -1979,7 +1979,7 @@ void FWidget::clrscr()
area->changes[i].xmax = uInt(area->width + area->right_shadow - 1);
}
putArea (xpos+xmin-1, ypos+ymin-1, area);
updateVTerm (area);
}
//----------------------------------------------------------------------

View File

@ -444,7 +444,7 @@ class FWidget : public FObject, public FTerm
static void gotoxy (const FPoint&);
static void gotoxy (register int, register int);
void clrscr();
void clearArea();
static void setNormal();

View File

@ -154,7 +154,7 @@ void FWindow::delWindow (FWidget* obj)
{
if ( (*iter) == obj )
{
window_list->erase(iter);
window_list->erase (iter);
return;
}

View File

@ -290,7 +290,7 @@ Calc::~Calc()
void Calc::drawDispay()
{
FString display = input;
setUpdateVTerm(false);
updateVTerm(false);
if ( display.isNull() || display.isEmpty() )
display = L'0';
@ -353,7 +353,7 @@ void Calc::drawDispay()
print(separator);
}
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -45,7 +45,7 @@ void keyboard::draw()
{
setNormal();
setColor(fc::Default, fc::Default);
clrscr();
clearArea();
gotoxy (1,1);
print ("---------------\n");
print ("Press Q to quit\n");

View File

@ -90,7 +90,7 @@ void Mandelbrot::draw()
current_line++;
}
setUpdateVTerm(true);
updateVTerm(true);
}
//----------------------------------------------------------------------

View File

@ -244,7 +244,7 @@ void AttribDemo::printAltCharset()
//----------------------------------------------------------------------
void AttribDemo::draw()
{
setUpdateVTerm(false);
updateVTerm(false);
// test alternate character set
printAltCharset();
@ -367,7 +367,7 @@ void AttribDemo::draw()
gotoxy (xpos + xmin + 14, ypos + ymin + 15);
print ("Change background color ->");
setUpdateVTerm(true);
updateVTerm(true);
}

View File

@ -50,7 +50,7 @@ void timer::draw()
{
setNormal();
setColor (fc::Default, fc::Default);
clrscr();
clearArea();
gotoxy (1,1);
print ("---------------\n");
print ("Press Q to quit\n");