From 5a547e6b955ea5c655edb3b87b7ff7676ced36fe Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Tue, 6 Nov 2012 20:15:01 +0000 Subject: change code alignment using tabstop=4 shiftwidth=4 expandtab --- modules/test.cpp | 54 ++++++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 30 deletions(-) (limited to 'modules/test.cpp') diff --git a/modules/test.cpp b/modules/test.cpp index 6f3178ef..8c3aa647 100644 --- a/modules/test.cpp +++ b/modules/test.cpp @@ -1,3 +1,5 @@ +// vim: set et ts=4 sw=4: +// // Trivial libyui example. // // Compile with: @@ -46,7 +48,7 @@ int main( int argc, char **argv ) std::vectorbuttons; for (;;) - { + { YEvent* event = dialog->waitForEvent(); // Check for window close if (event->eventType() == YEvent::CancelEvent) @@ -56,7 +58,7 @@ int main( int argc, char **argv ) // Check for Exit button push if(event->widget() == (YWidget*)exitButton ) { - break; + break; }; if(event->widget() == (YWidget*)addButton ) { @@ -66,8 +68,7 @@ int main( int argc, char **argv ) vbox_rframe = YUI::widgetFactory()->createVBox( replacePoint ); bnum++; buttons.clear(); - for (int i=0; i < bnum; ++i) - { + for (int i=0; i < bnum; ++i) { YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); buttons.push_back(tmpB); } @@ -75,14 +76,12 @@ int main( int argc, char **argv ) dialog->recalcLayout(); dialog->doneMultipleChanges(); } - else if (bnum == 6) - { + else if (bnum == 6) { dialog->startMultipleChanges(); replacePoint->deleteChildren(); vbox_rframe = YUI::widgetFactory()->createVBox( replacePoint ); buttons.clear(); - for (int i=0; i < bnum; ++i) - { + for (int i=0; i < bnum; ++i) { YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); buttons.push_back(tmpB); } @@ -93,37 +92,32 @@ int main( int argc, char **argv ) } } if(event->widget() == (YWidget*)removeButton ) { - if (bnum > 0) - { - dialog->startMultipleChanges(); - replacePoint->deleteChildren(); - vbox_rframe = YUI::widgetFactory()->createVBox( replacePoint ); - bnum--; - buttons.clear(); - for (int i=0; i < bnum; ++i) - { - YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); - buttons.push_back(tmpB); - } - replacePoint->showChild(); - dialog->recalcLayout(); - dialog->doneMultipleChanges(); + if (bnum > 0) { + dialog->startMultipleChanges(); + replacePoint->deleteChildren(); + vbox_rframe = YUI::widgetFactory()->createVBox( replacePoint ); + bnum--; + buttons.clear(); + for (int i=0; i < bnum; ++i) { + YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); + buttons.push_back(tmpB); + } + replacePoint->showChild(); + dialog->recalcLayout(); + dialog->doneMultipleChanges(); } } - - for(int i = 0; i < bnum; ++i) - { + for(int i = 0; i < bnum; ++i) { if (event->widget() == (YWidget*)buttons[i]) { dialog->startMultipleChanges(); replacePoint->deleteChildren(); vbox_rframe = YUI::widgetFactory()->createVBox( replacePoint ); bnum--; buttons.clear(); - for (int i=0; i < bnum; ++i) - { - YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); - buttons.push_back(tmpB); + for (int i=0; i < bnum; ++i) { + YPushButton* tmpB = YUI::widgetFactory()->createPushButton( vbox_rframe, "Delete Me" ); + buttons.push_back(tmpB); } replacePoint->showChild(); dialog->recalcLayout(); -- cgit v1.2.1