On 11/17/21 11:42 PM Albrecht Schlosser wrote:
Meanwhile I made good progress but the new widget is not yet feature complete. Anyway, I wanted to let you know and share the code for testing. My branch Fl_Grid ( https://github.com/Albrecht-S/fltk/tree/Fl_Grid ) has all the new code and demo programs (test/grid_*.cxx).
Would like to suggest before the final commit the OP's
copyright/date be added
to the comment header for the Fl_Grid's .cxx/.H files vis a
vis Tree/Table/FNFC, etc.
To check my branch out and test it:
$ git clone https://github.com/Albrecht-S/fltk.git fltk_Fl_Grid
Cloning into 'fltk_Fl_Grid'...
remote: Enumerating objects: 76129, done.
remote: Counting objects: 100% (1970/1970), done.
remote: Compressing objects: 100% (1017/1017), done.
remote: Total 76129 (delta 1234), reused 1482 (delta 947), pack-reused 74159
Receiving objects: 100% (76129/76129), 28.43 MiB | 8.75 MiB/s, done.
Resolving deltas: 100% (62210/62210), done.
$ cd fltk_Fl_Grid
fltk_Fl_Grid$ git branch Fl_Grid
fltk_Fl_Grid$
Dear fellow developers,
I feel that the time has come to ask you for your votes to include the
new Fl_Grid widget in the FLTK core.
…
Besides votes all comments, suggestions, RFE's and even requests for API
changes would be appreciated.
On 11/29/21 10:03 PM Albrecht Schlosser wrote:
Dear fellow developers,
I feel that the time has come to ask you for your votes to include the
new Fl_Grid widget in the FLTK core.
…
Besides votes all comments, suggestions, RFE's and even requests for API
changes would be appreciated.
After reading the Doxygen doc of Fl_Grid, I would suggest not to use the word "pixels"
therein because it's wrong under macOS on a retina display and everywhere after the GUI was scaled.
Under macOS, the grid_xxx demo programs randomly crash at start.That's becauseCols_ = 0; Rows_ = 0;
must be added to the Fl_Grid constructor.
You can achieve something at least similar to the Fl_Group::resizable()
child widget if you set only one column's and one row's weight to a
non-zero value (or more than one adjacent rows/columns). But Fl_Grid can
do much more, for instance the "button row with two resizing gaps" in a
single Fl_Grid widget whereas you'd need complex Fl_Group nesting to
achieve the same. See my test/grid_buttons.cxx example vs. Ian's example
in fltk.general.
Dear fellow developers,
I feel that the time has come to ask you for your votes to include the
new Fl_Grid widget in the FLTK core.
Side note: I was tempted to "redesign" the test/device.cxx example program with Fl_Grid but this would have been too much work just for testing although I believe it's trivial. Maybe I'll try it later or once Fl_Grid is in the official FLTK repo.
It sounds great to me; I haven't had time to actully try it,
but
I will though, and fully expect to give it a +1.
I've seen your examples.. seems intuitive, and interesting use
of
(apparently) using the x,y position value of widgets as the
row/col hints.
That's pretty clever!
I take it the ascii art layout hints (in the OP's widget) was
redone
in favor of this.
Look forward to seeing it as a development branch on the
origin fltk repo
so I can try to integrate it into my commercial build/testing.
On 12/1/21 3:55 AM, Albrecht Schlosser wrote:
Side note: I was tempted to "redesign" the test/device.cxx example program with Fl_Grid but this would have been too much work just for testing although I believe it's trivial. Maybe I'll try it later or once Fl_Grid is in the official FLTK repo.
A possibly good candidate for redesign might be test/cube.cxx.
If you recall I had to do a bit of work to get that to behave properly
so that both windows and buttons resized nicely.
While I was happy with the end result in the code (it wasn't too lengthly),
it sounds like using Fl_Grid might result in clearer/shorter code, which
would be an indication of its success..! :-D
On 12/1/21 9:42 AM, Albrecht Schlosser wrote:
The grid layout portion starts here:
https://github.com/Albrecht-S/fltk/blob/467086d3268f2e4431437bce09d5ae483a57db1a/test/grid_cube.cxx#L197
Is this something Fl_Grid could do too (calculate the total rows/cols on the fly)?
Also: it seems from the above it's a two stage process; create the widgetsThe grid layout portion starts here:
https://github.com/Albrecht-S/fltk/blob/467086d3268f2e4431437bce09d5ae483a57db1a/test/grid_cube.cxx#L197
The grid layout portion starts here:
https://github.com/Albrecht-S/fltk/blob/467086d3268f2e4431437bce09d5ae483a57db1a/test/grid_cube.cxx#L197
Oh, that's weird, that test/grid_cube.cxx code looks quite different
from the grid_cube.cxx code I'm seeing when I cloned and checked out
the Fl_Grid branch and looking at test/grid_cube.cxx.
In the github link above, it appears all the widgets are put into the grid
arrangement this way:
(scratches head) Perhaps you determined the latter technique is shorter,
leveraging both the old school Fl_Group behavior where it works fine,
and the layout behavior for handling the things Fl_Group can't easily.
Hmm, using "gitk test/grid_cube.cxx" seems to show that was the
development evolution, which seems right to keep the cube demo
short and sweet for its own purpose, and the older code is probably
good to just demo Fl_Grid itself (in a separate demo).
I take it the API is evolving, so I should probably go back through
the docs (TBD I take it) and your posts to see if I can determine
the different techniques Fl_Grid can use, as I take it there's several
ways to use it.