Comments (2)
This is a good idea, in my view.
from glui.
I'm looking at Example #5. It has an awkward bottom subwindow that requires inserting new GLUI_Column()
after every element.
I'm planning on making the column functionality a bool
value so dynamic_cast
is less necessary.
To drag-drop elements around they need to remember if they have arbitrary columns or other formatting features attached. One simple serialization pattern is to use negative numbers to indicate a column is attached, and sort by absolute-value.
Below is a scheme that is maybe GLUI/GLUT centric. It uses temporary objects to format the UI. They remember their settings, so that there is less repetition involved. And they can pass values to a callback that lets them be inlined as constants instead of sourced from the control.
GLUI_Library::Stack st = glui1;
GLUI_Library::Shelf sh = glui2;
GLUI_Rotation *rot =
sh.add("Objects",rot)->set_spin(1);
sh.set_identity(1);
sh.set_grouping();
sh.set_variable(view_rotate);
sh^[=] //or sh.set_callback();
{
//callback implementation here
};
sh.sep(); //add visual separator
A Stack is vertical. A Shelf is used here because these are horizontal. The only difference is the shelf inserts the column setting. This avoids reading into subwindows orientation.
I've been meaning to review wxWidget's system, to see if it gives me ideas. I've looked at it before, enough to determine it would require a wrapper.
In this system set_grouping
and sep
can take values, but they have default behavior, like adding +1 to the current group number. (EDITED: It should automatically add +1 to the user-id so it doesn't have to be set for contiguous identifiers.)
The assignment/constructor becomes the container node. The rot
value doesn't have to be assigned to, but these days all compilers squeal if you don't initialize it. Compiler writers must be the most inconsiderate people on earth. It illustrates set_spin
is modified to return itself for chaining.
set_identity
is the ID. optional. set_variable
is a live-variable. You kind of have to know what it wants. I think the constructors are a little top-heavy, and not very extensible. Especially for "styles". The lambda callback uses an overloaded operator ^
because I don't like C++ lambda style. It's so alien to my C++ eyes.
Something like push
and pop
can be nice for nested containers. I think Stack and Shelf would be able to assign to one another, being nearly identical.
from glui.
Related Issues (20)
- Rollout look bugs me some HOT 2
- FIX: glutPositionWindow fails inside GLUI_Main::reshape (Nvidia GLUT) HOT 8
- Finding/fix: glutPostRedisplay inside mouse event workaround for Nvidia GLUT HOT 9
- Extension: User layout control feature (PX?)
- glui_spinner link error HOT 1
- Windows GLUT: scrollbars/rotation mouse up/down events (affecting Idling?) HOT 11
- Windows GLUT: post_update_main_gfx "post" happens before execute_callback HOT 12
- "makefile" What is it exactly? CMake clobbers it. Why is it here? HOT 1
- GLUI "3.00" code dump information (github.com/mick-p1982/glui) HOT 3
- Work: Emulating GLUT with wxWidgets (wxGLCanvas) HOT 7
- Windows Visual Studio Project needs updating HOT 1
- Remaining gcc warnings
- Mac GL_SILENCE_DEPRECATION
- MS Compiler Warnings (2019 x64)
- How do I listen to glui_treepanel or glui_tree click events?
- macOS example1 stepper number doesn't change
- So what's going on with GL_POLYGON in the translate tool's arrow base? HOT 5
- glui 2.3.7 cmake build error with microsoft visual studio 2019
- Launch parameters support?
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 glui.