Group Abstract Group Abstract

Message Boards Message Boards

7
|
12.2K Views
|
5 Replies
|
16 Total Likes
View groups...
Share
Share this post:

Create (Header + Main area + Settings pane) notebook layout?

Posted 8 years ago
POSTED BY: Kuba Podkalicki
5 Replies

I forgot to mention longstanding bugs that will make your life miserable if you start implementing this manually.

Avoiding sizes recalculations and re-rendering is crucial but those bugs make it tough/impossible:

I don't want to be picky I just want to show that there are fundamental problems which are ignored for a long time.

This plus lack of (visible/documented) updates for desktop's FrontEnd make me wonder, is WRI planning to replace it or is this a result of shifting humanpower towards Cloud's FrontEnd and iOS's?

POSTED BY: Kuba Podkalicki
Posted 8 years ago

To add to this, the lack of documented support for AttachedCells is a big pain. They could make this process much easier, but I don't really want to mess with them too much until they become documented because I don't know what bugs are hiding in them.

POSTED BY: b3m2a1 ​ 

Here is what could make gui developers lives easier:

  • CurrentValue[ NotebookContentSize ], WindowSize without notebook frame, I can manage CellMargins by myself.

  • Flexibility in specifying whether Scaled/Full ImageSize should respect FrameMargins/ImageMargins

  • like element that will gather functionality from Pane/Framed and friends, that is ResizeArea/Frame/Background. If introduced it should have all margins/styles/etc set to 0 / {} / None etc, bare rectangular area without any surprises.

  • Spacings and friends support for printers points (<cough>pixels on windows</cough>)

Any update will help, at this point I will take anything

POSTED BY: Kuba Podkalicki

One suggestion that might help: you can have any structure or element that takes sizing options that respond to the size of the notebook window the element is in, using dynamic formulas for options that reference WindowSize as a variable:

Pane[TextCell[
  "You can have any structure or element that takes sizing options that respond to the size of the notebook window the element is in, using dynamic formulas for options that reference WindowSize as a variable."], 
 ImageSize -> {Dynamic[First@CurrentValue[WindowSize] .2], 250} ]
POSTED BY: Andre Kuzniarek

Yes, I know, my example already contains AbsoluteCurrentValue[WindowSize].

The devil is in details though:

  • We want to have consistent margins around as well as between frames. To achieve that we need to know Notebook's frame widths (direction, OS and FrameElements dependent...). Otherwise the full content will exceed the window from the right side (unless every possible margin is set 0 or unless scaled sizes do not sum up to 100% and we are left with a scaled gap).

  • We also want to be able to resize inner panels, so we need to use Pane as only that gui element has ResizeArea. That is fine but it does not have Frame option (or background) so we need to wrap it with Panel or Framed and now hell begins... Since we want spacings between panels we need ImageMargins for those Panel/Framed-s. Pane's ImageSize will not account for that so it is another value we need to know and manage.

  • If this is not enough, notice that ImageSize arithmetic does not make sense (at least on Win):

    Grid[{#}, Spacings -> {0, 0}] & /@ Table[
       Framed["-", ImageSize -> {250/t, 50}, ImageMargins -> 0], 
       {t,  1, 10}, {n, 1, t}
    ] // Column // Framed
    

enter image description here

Which means we have another value to account for, this one is also number of elements in a row dependent.

POSTED BY: Kuba Podkalicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard