-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of expanding text widget (+ / - syntax) #96
Comments
I think you want to use a FListView widget in tree view mode. You can expand and collapse sub-lines by clicking the triangle, double-clicking a line, or using the +, -, →, or ← keyboard keys. Here is a small code example: #include <final/final.h>
using namespace finalcut;
int main (int argc, char* argv[])
{
FApplication app(argc, argv);
FDialog dialog ("Expand and collapse data", &app);
dialog.setGeometry (FPoint(30, 6), FSize(33, 10));
FListView list (&dialog);
list.ignorePadding();
list.setGeometry (FPoint(1, 2), FSize(33, 9));
// Add columns to the view
list.addColumn ("id", 5);
list.addColumn ("mode", 5);
list.addColumn ("A", 5);
list.addColumn ("B", 5);
list.addColumn ("C", 5);
// Activate tree view
list.setTreeView();
auto iter1 = list.insert ({"X", "*", "2", "2", "2"});
list.insert ({"X", "x1", "1", "1", "1"}, iter1);
list.insert ({"X", "x2", "1", "1", "1"}, iter1);
auto iter2 = list.insert ({"Y", "*", "3", "3", "3"});
list.insert ({"Y", "y1", "1", "1", "1"}, iter2);
list.insert ({"Y", "y2", "2", "2", "2"}, iter2);
app.setMainWidget(&dialog);
dialog.show();
return app.exec();
}
PS: Removing the ID in the sub-lines would emphasize the togetherness. |
I have not received any further feedback from you. Can I assume that this is a working solution for you? |
Is this a workable solution for you? |
Based on the absence of feedback, I will be closing this issue. |
I'm printing very simple pre-formatted text in a tabular format; I am tabulating myself using snprintf(..) etc. In below example I have a (X, *) that is the summation of (X, x1) and (X, x2). I am wondering if there's a way to support a expand section / contract section type syntax with some minor effort or reasonably achieve the same thing by placing buttons to the left of each expanding section and clicking on them.
My widget architecture is FDialog -> FScrollView -> FLabel and I just call FLabel::setText(..) to update the text.
Thanks in advance!
The text was updated successfully, but these errors were encountered: