Closed wimstockman closed 1 year ago
Very nice idea! I implemented it directly.
#include <final/final.h>
using namespace finalcut;
int main (int argc, char* argv[])
{
FApplication app(argc, argv);
// The dialog window
FDialog dialog("The window title", &app);
dialog.setGeometry (FPoint{23, 5}, FSize{34, 13});
// The child objects from dialog
FLineEdit text_field1("Left", &dialog);
FLineEdit text_field2("Center", &dialog);
FLineEdit text_field3("Right", &dialog);
FButton exit_btn("E&xit", &dialog);
// Set the geometry of widgets
text_field1.setGeometry(FPoint{2, 2}, FSize{30, 1});
text_field2.setGeometry(FPoint{2, 4}, FSize{30, 1});
text_field3.setGeometry(FPoint{2, 6}, FSize{30, 1});
exit_btn.setGeometry(FPoint{22, 9}, FSize{10, 1});
// Set the alignment of text fields
text_field1.setAlignment(Align::Left); // default alignment
text_field2.setAlignment(Align::Center);
text_field3.setAlignment(Align::Right);
exit_btn.addCallback
(
"clicked",
finalcut::getFApplication(),
&finalcut::FApplication::cb_exitApp,
&dialog
);
FWidget::setMainWidget(&dialog);
dialog.show();
return app.exec();
}
Great thanks for the quick implementation. Already using it my application. Great Work ! Kind regards, Wim Stockman
Feature Request
Is there a possibility to align right in FLineEdit or align center ? Kind regards, Wim