FButton, FDialog, FLineEdit and FProgressbar has now shadow as default

This commit is contained in:
Markus Gans 2016-09-04 18:31:31 +02:00
parent 3d0f046de9
commit 6749164aca
17 changed files with 28 additions and 69 deletions

View File

@ -1,3 +1,8 @@
2016-09-04 Markus Gans <guru.mail@muenster.de>
* FButton, FLineEdit and FProgressbar has shadow now enabled
by default
* FDialog has now transparent shadow as default
2016-09-03 Markus Gans <guru.mail@muenster.de>
* The method clearFlatBorder() replace now a double flatline
with a single flatline

View File

@ -62,6 +62,7 @@ void FButton::init()
{
setForegroundColor (wc.button_active_fg);
setBackgroundColor (wc.button_active_bg);
setShadow();
if ( hasFocus() )
flags = fc::focus;

View File

@ -105,6 +105,7 @@ void FDialog::init()
addDialog(this);
addWindow(this);
setActiveWindow(this);
setTransparentShadow();
foregroundColor = wc.dialog_fg;
backgroundColor = wc.dialog_bg;
@ -460,7 +461,12 @@ void FDialog::draw()
gotoxy (xpos+xmin+width-4, ypos+ymin-1);
setColor (wc.titlebar_button_fg, wc.titlebar_button_bg);
print (' ');
print (fc::BlackDownPointingTriangle); // ▼
if ( isCygwinTerminal() )
print ('v');
else
print (fc::BlackDownPointingTriangle); // ▼
print (' ');
}
}
@ -478,7 +484,12 @@ void FDialog::draw()
gotoxy (xpos+xmin+width-4, ypos+ymin-1);
setColor (wc.titlebar_button_fg, wc.titlebar_button_bg);
print (' ');
print (fc::BlackUpPointingTriangle); // ▲
if ( isCygwinTerminal() )
print ('^');
else
print (fc::BlackUpPointingTriangle); // ▲
print (' ');
}
}

View File

@ -135,7 +135,6 @@ void FFileDialog::init()
filename->setLabelText("File&name:");
filename->setText(filter_pattern);
filename->setGeometry(11, 1, 28, 1);
filename->setShadow();
filename->setFocus();
filebrowser = new FListBox(this);
@ -147,7 +146,6 @@ void FFileDialog::init()
cancel = new FButton("&Cancel", this);
cancel->setGeometry(19, 10, 9, 1);
cancel->setShadow();
if ( dlg_type == FFileDialog::Save )
open = new FButton("&Save",this);
@ -155,7 +153,6 @@ void FFileDialog::init()
open = new FButton("&Open",this);
open->setGeometry(30, 10, 9, 1);
open->setShadow();
setGeometry (x, y, width, height);
filename->addCallback
@ -195,7 +192,6 @@ void FFileDialog::init()
);
setModal();
setTransparentShadow();
readDir();
}

View File

@ -69,6 +69,7 @@ void FLineEdit::init()
{
label->setAccelWidget(this);
setVisibleCursor();
setShadow();
if ( hasFocus() )
flags |= fc::focus;

View File

@ -702,17 +702,6 @@ bool FListBox::setFocus (bool on)
return on;
}
//----------------------------------------------------------------------
bool FListBox::setShadow (bool on)
{
if ( on )
flags |= fc::shadow;
else
flags &= ~fc::shadow;
return on;
}
//----------------------------------------------------------------------
void FListBox::onKeyPress (FKeyEvent* ev)
{

View File

@ -174,10 +174,6 @@ class FListBox : public FWidget
bool setFocus(bool);
bool setFocus();
bool unsetFocus();
bool setShadow(bool);
bool setShadow();
bool unsetShadow();
bool hasShadow();
void insert ( FString
, fc::brackets_type = fc::NoBrackets
@ -267,18 +263,6 @@ inline bool FListBox::setFocus()
inline bool FListBox::unsetFocus()
{ return setFocus(false); }
//----------------------------------------------------------------------
inline bool FListBox::setShadow()
{ return setShadow(true); }
//----------------------------------------------------------------------
inline bool FListBox::unsetShadow()
{ return setShadow(false); }
//----------------------------------------------------------------------
inline bool FListBox::hasShadow()
{ return ((flags & fc::shadow) != 0); }
//----------------------------------------------------------------------
inline FString& FListBox::getText()
{ return text; }

View File

@ -130,7 +130,6 @@ void FMessageBox::init(int button0, int button1, int button2)
button[0]->setWidth(1, false);
button[0]->setHeight(1, false);
button[0]->setFocus();
button[0]->setShadow();
if ( button1 > 0 )
{
@ -139,7 +138,6 @@ void FMessageBox::init(int button0, int button1, int button2)
button[1]->setPos(17, height-4, false);
button[1]->setWidth(0, false);
button[1]->setHeight(1, false);
button[1]->setShadow();
}
if ( button2 > 0 )
@ -149,7 +147,6 @@ void FMessageBox::init(int button0, int button1, int button2)
button[2]->setPos(32, height-4, false);
button[2]->setWidth(0, false);
button[2]->setHeight(1, false);
button[2]->setShadow();
}
resizeButtons();
@ -186,7 +183,6 @@ void FMessageBox::init(int button0, int button1, int button2)
}
setModal();
setTransparentShadow();
}
//----------------------------------------------------------------------

View File

@ -15,6 +15,7 @@ FProgressbar::FProgressbar(FWidget* parent)
, BarLength(width)
{
unsetFocusable();
setShadow();
}
//----------------------------------------------------------------------

View File

@ -265,7 +265,7 @@ void FWidget::setColorTheme()
wc.titlebar_active_bg = fc::Blue;
wc.titlebar_inactive_fg = fc::LightGray;
wc.titlebar_inactive_bg = fc::DarkGray;
wc.titlebar_button_fg = fc::Black;
wc.titlebar_button_fg = fc::DarkGray;
wc.titlebar_button_bg = fc::LightGray;
wc.menu_active_focus_fg = fc::White;
wc.menu_active_focus_bg = fc::Blue;

View File

@ -29,7 +29,6 @@ int main (int argc, char* argv[])
FDialog dgl(&app);
dgl.setText ("FDialog");
dgl.setGeometry (4, 3, 41, 11);
dgl.setShadow();
// Create text labels
FLabel label_1(&dgl),
@ -50,7 +49,6 @@ int main (int argc, char* argv[])
// Create the quit button
FButton btn("&Quit", &dgl);
btn.setGeometry (16, 7, 9, 1);
btn.setShadow();
// Connect the button signal "clicked" with the callback function
btn.addCallback

View File

@ -72,13 +72,6 @@ int main (int argc, char* argv[])
st_field->setGeometry(15, 9, 19, 1);
c_field->setGeometry(15, 11, 4, 1);
name_field->setShadow();
email_field->setShadow();
org_field->setShadow();
city_field->setShadow();
st_field->setShadow();
c_field->setShadow();
// Create the button group
FButtonGroup* radioButtonGroup = new FButtonGroup("Sex", &dgl);
radioButtonGroup->setGeometry(2, 13, 13, 4);
@ -103,7 +96,6 @@ int main (int argc, char* argv[])
// Create a OK button
FButton btn("&OK", &dgl);
btn.setGeometry (24, 18, 10, 1);
btn.setShadow();
// Connect checkbox signal "clicked" with a callback function
check1->addCallback

View File

@ -52,11 +52,9 @@ AttribDlg::AttribDlg (FWidget* parent)
next_button = new FButton("&Next >", this);
next_button->setGeometry(getWidth()-13, getHeight()-4, 10, 1);
next_button->setShadow();
next_button->addAccelerator(fc::Fkey_right);
back_button = new FButton("< &Back", this);
back_button->setGeometry(getWidth()-25, getHeight()-4, 10, 1);
back_button->setShadow();
back_button->addAccelerator(fc::Fkey_left);
// Add function callbacks

View File

@ -150,16 +150,19 @@ MainWindow::MainWindow (FWidget* parent)
Transparent* transpwin = new Transparent(this);
transpwin->setText("transparent");
transpwin->setGeometry (6, 3, 29, 12);
transpwin->unsetTransparentShadow();
transpwin->show();
Transparent* shadowwin = new Transparent(this, Transparent::shadow);
shadowwin->setText("shadow");
shadowwin->setGeometry (46, 11, 29, 12);
shadowwin->unsetTransparentShadow();
shadowwin->show();
Transparent* ibg = new Transparent(this, Transparent::inherit_background);
ibg->setText("inherit background");
ibg->setGeometry (42, 3, 29, 7);
ibg->unsetTransparentShadow();
ibg->show();
// Statusbar at the bottom
@ -167,6 +170,7 @@ MainWindow::MainWindow (FWidget* parent)
statusbar->setMessage("Press Q to quit");
addAccelerator('q');
unsetTransparentShadow();
activateDialog();
}

View File

@ -47,33 +47,28 @@ ProgressDialog::ProgressDialog (FWidget* parent)
{
setGeometry (int((this->getParentWidget()->getWidth()-40)/2), 7, 40, 10);
setText("Progress bar");
setTransparentShadow();
//setModal();
reset = new FButton(this);
reset->setText("&Reset");
reset->setStatusbarMessage ("Reset the progress bar");
reset->setGeometry(2, 6, 8, 1, false);
reset->setShadow();
reset->setDisable();
more = new FButton(this);
more->setText("&More");
more->setStatusbarMessage ("Increases the progress bar position");
more->setGeometry(15, 6, 8, 1, false);
more->setShadow();
more->setDisable();
quit = new FButton(this);
quit->setText("E&xit");
quit->setGeometry(28, 6, 8, 1, false);
quit->setShadow();
quit->setDisable();
progressBar = new FProgressbar(this);
progressBar->setGeometry(2, 3, 34, 1, false);
//progressBar->setPercentage(78);
progressBar->setShadow();
//progressBar->setPercentage(78);<
reset->addCallback
(
@ -391,28 +386,24 @@ MyDialog::MyDialog (FWidget* parent)
myLineEdit->setText (FString("EnTry").toLower());
myLineEdit->setLabelText (L"&Input:");
myLineEdit->setStatusbarMessage ("Press Enter to set the title");
myLineEdit->setShadow();
// Buttons
FButton* MyButton4 = new FButton (this);
MyButton4->setGeometry(20, 8, 12, 1);
MyButton4->setText (L"&Get input");
MyButton4->setStatusbarMessage ("Take text from input field");
MyButton4->setShadow();
MyButton4->setFocus();
FButton* MyButton5 = new FButton (this);
MyButton5->setGeometry(20, 11, 12, 1);
MyButton5->setText (L"&Test");
MyButton5->setStatusbarMessage ("Progressbar testing dialog");
MyButton5->setShadow();
MyButton5->setDisable();
FButton* MyButton6 = new FButton (this);
MyButton6->setGeometry(20, 14, 12, 1);
MyButton6->setText (L"&Quit");
MyButton6->setStatusbarMessage ("Exit the program");
MyButton6->setShadow();
MyButton6->addAccelerator('x');
// A multiple selection listbox
@ -761,7 +752,6 @@ void MyDialog::cb_view (FWidget*, void* data_ptr)
int(getRootWidget()->getHeight()/6),
60,
int(getRootWidget()->getHeight()*3/4));
view->setTransparentShadow();
FTextView* scrollText = new FTextView(view);
scrollText->ignorePadding();
@ -854,6 +844,7 @@ int main (int argc, char* argv[])
d.setText (title);
d.setGeometry (int((app.getWidth()-56)/2), 2, 56, app.getHeight()-4);
d.setShadow();
d.setResizeable();
app.setMainWidget(&d);
d.show();

View File

@ -55,7 +55,6 @@ watch::watch (FWidget* parent)
, seconds_sw(0)
{
setText ("Watch");
setShadow();
int pw = getParentWidget()->getWidth();
setGeometry (1+(pw-22)/2, 3, 22, 13);
@ -76,8 +75,6 @@ watch::watch (FWidget* parent)
// Create button
FButton* quit_btn = new FButton(L"&Quit", this);
quit_btn->setGeometry(6, 9, 9, 1);
quit_btn->setShadow();
// Connect switch signal "toggled" with a callback member function
clock_sw->addCallback

View File

@ -99,17 +99,14 @@ Window::Window (FWidget* parent)
FButton* CreateButton = new FButton (this);
CreateButton->setGeometry(2, 2, 9, 1);
CreateButton->setText (L"&Create");
CreateButton->setShadow();
FButton* CloseButton = new FButton (this);
CloseButton->setGeometry(15, 2, 9, 1);
CloseButton->setText (L"C&lose");
CloseButton->setShadow();
FButton* QuitButton = new FButton (this);
QuitButton->setGeometry(28, 2, 9, 1);
QuitButton->setText (L"&Quit");
QuitButton->setShadow();
// Add menu item callback
New->addCallback
@ -242,7 +239,6 @@ void Window::cb_createWindows (FWidget*, void*)
x = dx + 5 + (n%3)*25 + int(n/3)*3;
y = dy + 11 + int(n/3)*3;
win->setGeometry (x, y, 20, 8);
win->setTransparentShadow();
win->show();
win->addCallback
@ -427,7 +423,6 @@ int main (int argc, char* argv[])
Window main_dlg (&app);
main_dlg.setText ("Main window");
main_dlg.setGeometry (int(1+(app.getWidth()-40)/2), 2, 40, 6);
main_dlg.setTransparentShadow();
app.setMainWidget (&main_dlg);
main_dlg.show();