Giter Club home page Giter Club logo

Comments (2)

nigels-com avatar nigels-com commented on September 17, 2024

This is a good idea, in my view.

from glui.

m-7761 avatar m-7761 commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.