Comments (2)
Hi gansm,
Thanks for this example. Just what I needed.
from finalcut.
Hi Wim, it's generally intended that the child adding order determines the tab order. But you can change the order afterward (for example, by sorting the children's list).
#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{20, 5}, FSize{40, 12});
// The child objects from dialog
FButton child4("&4", &dialog); // 1st child
FButton child1("&1", &dialog); // 2nd child
FButton child3("&3", &dialog); // 3rd child
FButton child2("&2", &dialog); // 4th child
child1.setGeometry(FPoint{6, 2}, FSize{28, 1});
child2.setGeometry(FPoint{6, 4}, FSize{28, 1});
child3.setGeometry(FPoint{6, 6}, FSize{28, 1});
child4.setGeometry(FPoint{6, 8}, FSize{28, 1});
// Sort by button name to change the initial tab order of the widgets
std::sort ( dialog.begin()
, dialog.end()
, [] (const auto lhs, const auto rhs)
{
// Skip non-button widgets
if ( ! lhs->isInstanceOf("FButton")
|| ! rhs->isInstanceOf("FButton") )
return false;
const auto& lhs_btn = static_cast<FButton*>(lhs);
const auto& rhs_btn = static_cast<FButton*>(rhs);
return lhs_btn->getText() < rhs_btn->getText();
} );
FWidget::setMainWidget(&dialog);
dialog.show();
return app.exec();
}
from finalcut.
Related Issues (20)
- Align Right for FLineedit HOT 2
- How to acces FLineEdit text after event FFocusEvent HOT 2
- Problem with FLabel drawing double HOT 2
- Dynamic Layout issue HOT 1
- FListView crashing HOT 7
- Catching the terminal focus and unfocus signal in finalcut HOT 2
- ColorPalette not resetting after close HOT 2
- pretty last moment to get a newer version into debian HOT 1
- Does it support MSYS2 MinGW64? HOT 2
- Failed to build on MSYS2 MinGW64 HOT 2
- Compile error with clang++ -std=c++20 HOT 2
- FListview hide columns HOT 2
- Make it work on touchscreens HOT 4
- Build failed on ubuntu 22.04.2 LTS HOT 1
- can i recomend you guys an acscii 3d game HOT 2
- show windows on frame buffer HOT 4
- Enabling text selection HOT 3
- does it need ncurses?? HOT 1
- [FIX] Unable to build latest "main" without this HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finalcut.