coding style
This commit is contained in:
parent
6a92b4a956
commit
eb05f1c1ed
|
@ -168,8 +168,8 @@ void FButton::draw()
|
|||
if ( is_Flat )
|
||||
clearFlatBorder();
|
||||
clearShadow();
|
||||
setColor ( parentWidget()->getForegroundColor(),
|
||||
parentWidget()->getBackgroundColor() );
|
||||
setColor ( parentWidget()->getForegroundColor()
|
||||
, parentWidget()->getBackgroundColor() );
|
||||
for (int y=1; y <= height; y++)
|
||||
{
|
||||
gotoxy (xpos+xmin-1, ypos+ymin-2+y);
|
||||
|
@ -252,8 +252,8 @@ void FButton::draw()
|
|||
&& (is_Flat || ! hasShadow() || isMonochron()) )
|
||||
{
|
||||
// clear the right █ from button down
|
||||
setColor ( parentWidget()->getForegroundColor(),
|
||||
parentWidget()->getBackgroundColor() );
|
||||
setColor ( parentWidget()->getForegroundColor()
|
||||
, parentWidget()->getBackgroundColor() );
|
||||
for (int y=1; y <= height; y++)
|
||||
{
|
||||
if ( isMonochron() )
|
||||
|
@ -283,11 +283,11 @@ void FButton::draw()
|
|||
print (space); // █
|
||||
|
||||
if ( hotkeypos == -1 )
|
||||
setCursorPos ( xpos+xmin-1+margin+i,
|
||||
ypos+ymin-1+j ); // first character
|
||||
setCursorPos ( xpos+xmin-1+margin+i
|
||||
, ypos+ymin-1+j ); // first character
|
||||
else
|
||||
setCursorPos ( xpos+xmin-1+margin+i+hotkeypos,
|
||||
ypos+ymin-1+j ); // hotkey
|
||||
setCursorPos ( xpos+xmin-1+margin+i+hotkeypos
|
||||
, ypos+ymin-1+j ); // hotkey
|
||||
|
||||
if ( isMonochron() && is_ActiveFocus )
|
||||
setBold();
|
||||
|
@ -337,8 +337,8 @@ void FButton::draw()
|
|||
|
||||
if ( is_NonFlatShadow && ! button_down )
|
||||
{
|
||||
setColor ( parentWidget()->getForegroundColor(),
|
||||
parentWidget()->getBackgroundColor() );
|
||||
setColor ( parentWidget()->getForegroundColor()
|
||||
, parentWidget()->getBackgroundColor() );
|
||||
print(' '); // restore background after button down
|
||||
drawShadow();
|
||||
}
|
||||
|
|
|
@ -71,8 +71,8 @@ void FButtonGroup::init()
|
|||
//----------------------------------------------------------------------
|
||||
bool FButtonGroup::isRadioButton(FToggleButton* button) const
|
||||
{
|
||||
return bool ( strcmp ( button->getClassName(),
|
||||
const_cast<char*>("FRadioButton") ) == 0 );
|
||||
return bool ( strcmp ( button->getClassName()
|
||||
, const_cast<char*>("FRadioButton") ) == 0 );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -10,14 +10,15 @@
|
|||
|
||||
// constructor and destructor
|
||||
//----------------------------------------------------------------------
|
||||
FCheckBox::FCheckBox(FWidget* parent) : FToggleButton(parent)
|
||||
FCheckBox::FCheckBox(FWidget* parent)
|
||||
: FToggleButton(parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FCheckBox::FCheckBox ( const FString& txt,
|
||||
FWidget* parent ) : FToggleButton(txt, parent)
|
||||
FCheckBox::FCheckBox (const FString& txt, FWidget* parent)
|
||||
: FToggleButton(txt, parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
|
|
@ -388,8 +388,8 @@ void FListBox::drawList()
|
|||
const wchar_t* element_str;
|
||||
uInt i, len;
|
||||
element = data[y+uInt(yoffset)].getText()
|
||||
.mid( uInt(1+xoffset),
|
||||
uInt(width-nf_offset-4) );
|
||||
.mid ( uInt(1+xoffset)
|
||||
, uInt(width-nf_offset-4) );
|
||||
element_str = element.wc_str();
|
||||
len = element.getLength();
|
||||
|
||||
|
|
|
@ -215,8 +215,7 @@ void FMenuBar::drawItems()
|
|||
|
||||
if ( x > screenWidth )
|
||||
{
|
||||
print ( vmenubar,
|
||||
txt.left(uInt(int(txt_length)+screenWidth-x-1)) );
|
||||
print (vmenubar, txt.left(uInt(int(txt_length)+screenWidth-x-1)));
|
||||
print (vmenubar, "..");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -532,8 +532,8 @@ inline bool FOptiMove::isTwoDirectionMove ( int xold, int yold
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FOptiMove::isWideMove ( int xold, int yold,
|
||||
int xnew, int ynew )
|
||||
inline bool FOptiMove::isWideMove ( int xold, int yold
|
||||
, int xnew, int ynew )
|
||||
{
|
||||
return bool ( (xnew > MOVE_LIMIT)
|
||||
&& (xnew < screen_width - 1 - MOVE_LIMIT)
|
||||
|
|
|
@ -54,8 +54,8 @@ void FProgressbar::drawBar()
|
|||
}
|
||||
else if ( getMaxColor() < 16 )
|
||||
{
|
||||
setColor ( wc.progressbar_bg,
|
||||
wc.progressbar_fg );
|
||||
setColor ( wc.progressbar_bg
|
||||
, wc.progressbar_fg );
|
||||
if ( round(length) >= 1)
|
||||
print (' ');
|
||||
else
|
||||
|
@ -63,11 +63,11 @@ void FProgressbar::drawBar()
|
|||
}
|
||||
|
||||
if ( round(length) >= 1)
|
||||
setColor( wc.progressbar_fg,
|
||||
parentWidget()->getBackgroundColor() );
|
||||
setColor ( wc.progressbar_fg
|
||||
, parentWidget()->getBackgroundColor() );
|
||||
else
|
||||
setColor( wc.progressbar_bg,
|
||||
parentWidget()->getBackgroundColor() );
|
||||
setColor ( wc.progressbar_bg
|
||||
, parentWidget()->getBackgroundColor() );
|
||||
|
||||
if ( ! isMonochron() && getMaxColor() >= 16 )
|
||||
{
|
||||
|
@ -80,8 +80,8 @@ void FProgressbar::drawBar()
|
|||
print (fc::RightHalfBlock); // ▐
|
||||
}
|
||||
|
||||
setColor ( wc.progressbar_bg,
|
||||
wc.progressbar_fg );
|
||||
setColor ( wc.progressbar_bg
|
||||
, wc.progressbar_fg );
|
||||
if ( isMonochron() )
|
||||
setReverse(true);
|
||||
for (; i < trunc(length); i++)
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
// constructor and destructor
|
||||
//----------------------------------------------------------------------
|
||||
FRadioButton::FRadioButton(FWidget* parent) : FToggleButton(parent)
|
||||
FRadioButton::FRadioButton(FWidget* parent)
|
||||
: FToggleButton(parent)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
|
|
@ -169,19 +169,19 @@ FRect FRect::intersect (const FRect& r) const
|
|||
//----------------------------------------------------------------------
|
||||
FRect operator + (const FRect& r, const FPoint& p)
|
||||
{
|
||||
return FRect( r.X1,
|
||||
r.Y1,
|
||||
r.X2 - r.X1 + 1 + p.getX(),
|
||||
r.Y2 - r.Y1 + 1 + p.getY() );
|
||||
return FRect ( r.X1
|
||||
, r.Y1
|
||||
, r.X2 - r.X1 + 1 + p.getX()
|
||||
, r.Y2 - r.Y1 + 1 + p.getY() );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FRect operator - (const FRect& r, const FPoint& p)
|
||||
{
|
||||
return FRect( r.X1,
|
||||
r.Y1,
|
||||
r.X2 - r.X1 + 1 - p.getX(),
|
||||
r.Y2 - r.Y1 + 1 - p.getY() );
|
||||
return FRect ( r.X1
|
||||
, r.Y1
|
||||
, r.X2 - r.X1 + 1 - p.getX()
|
||||
, r.Y2 - r.Y1 + 1 - p.getY() );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -261,8 +261,8 @@ void FStatusBar::drawKeys()
|
|||
}
|
||||
else
|
||||
{
|
||||
print ( vstatusbar,
|
||||
(*iter)->getText()
|
||||
print ( vstatusbar
|
||||
, (*iter)->getText()
|
||||
.left(uInt(txt_length+screenWidth-x-1)) );
|
||||
print (vstatusbar, "..");
|
||||
}
|
||||
|
@ -612,8 +612,8 @@ void FStatusBar::drawMessage()
|
|||
print (vstatusbar, getMessage());
|
||||
else
|
||||
{
|
||||
print ( vstatusbar,
|
||||
getMessage().left(uInt(msg_length+termWidth-x-1)) );
|
||||
print ( vstatusbar
|
||||
, getMessage().left(uInt(msg_length+termWidth-x-1)) );
|
||||
print (vstatusbar, "..");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -742,9 +742,9 @@ const FString FString::operator + (const char c)
|
|||
const FString operator + (const FString& s1, const FString& s2)
|
||||
{
|
||||
FString tmp(s1);
|
||||
tmp._insert ( uInt(wcslen(s1.wc_str())),
|
||||
uInt(wcslen(s2.wc_str())),
|
||||
s2.wc_str() );
|
||||
tmp._insert ( uInt(wcslen(s1.wc_str()))
|
||||
, uInt(wcslen(s2.wc_str()))
|
||||
, s2.wc_str() );
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,8 +78,8 @@ void FSwitch::drawCheckButton()
|
|||
print (on);
|
||||
setColor (wc.button_inactive_fg, wc.button_inactive_bg);
|
||||
print (off);
|
||||
setCursorPos ( xpos + xmin + 1 + switch_offset_pos,
|
||||
ypos + ymin - 1 );
|
||||
setCursorPos ( xpos + xmin + 1 + switch_offset_pos
|
||||
, ypos + ymin - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -101,8 +101,8 @@ void FSwitch::drawCheckButton()
|
|||
else
|
||||
setColor (wc.button_hotkey_fg, wc.button_active_bg);
|
||||
print (off);
|
||||
setCursorPos ( xpos + xmin + 5 + switch_offset_pos,
|
||||
ypos + ymin - 1 );
|
||||
setCursorPos ( xpos + xmin + 5 + switch_offset_pos
|
||||
, ypos + ymin - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -308,8 +308,9 @@ int FTerm::getScreenFont()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int FTerm::setScreenFont (uChar* fontdata, uInt count,
|
||||
uInt fontwidth, uInt fontheight, bool direct)
|
||||
int FTerm::setScreenFont ( uChar* fontdata, uInt count
|
||||
, uInt fontwidth, uInt fontheight
|
||||
, bool direct)
|
||||
{
|
||||
struct console_font_op font;
|
||||
int ret;
|
||||
|
@ -347,9 +348,9 @@ int FTerm::setScreenFont (uChar* fontdata, uInt count,
|
|||
memset(font.data, 0, data_size);
|
||||
|
||||
for (uInt i=0; i < count; i++)
|
||||
memcpy ( const_cast<uChar*>(font.data + bytes_per_line*32*i),
|
||||
&fontdata[i * font.height],
|
||||
font.height);
|
||||
memcpy ( const_cast<uChar*>(font.data + bytes_per_line*32*i)
|
||||
, &fontdata[i * font.height]
|
||||
, font.height);
|
||||
}
|
||||
// font operation
|
||||
ret = ioctl (fd_tty, KDFONTOP, &font);
|
||||
|
@ -2440,11 +2441,11 @@ bool FTerm::setOldFont()
|
|||
{
|
||||
if ( screenFont.data )
|
||||
{
|
||||
int ret = setScreenFont ( screenFont.data,
|
||||
screenFont.charcount,
|
||||
screenFont.width,
|
||||
screenFont.height,
|
||||
true );
|
||||
int ret = setScreenFont ( screenFont.data
|
||||
, screenFont.charcount
|
||||
, screenFont.width
|
||||
, screenFont.height
|
||||
, true );
|
||||
delete[] screenFont.data;
|
||||
if ( ret == 0 )
|
||||
retval = true;
|
||||
|
|
|
@ -28,7 +28,8 @@ class Mandelbrot : public FDialog
|
|||
#pragma pack(pop)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
Mandelbrot::Mandelbrot (FWidget* parent) : FDialog(parent)
|
||||
Mandelbrot::Mandelbrot (FWidget* parent)
|
||||
: FDialog(parent)
|
||||
{
|
||||
setText ("Mandelbrot set");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue