"wolfgang kern" <
now...@never.at> wrote in message
news:l0k82h$mir$1...@newsreader2.utanet.at...
...
>> I am thinking that the app would specify the GUI/TUI in such a way that
>> it could be rendered appropriately. For example, it would not dictate the
>> layout in most cases (though it could provide hints as to desirable
>> layout) but would focus on the elements it needs. It would separate the
>> layout from the semantics of the window elements and how they needed to
>> be grouped together. The renderer would convert that to a specific layout
>> depending on the mode (text/graphical), resolution of the underlying
>> canvas and hints provided by the application.
>
> I see no problem with displaying text-based apps in graphic-mode.
> But I can't imagine how to convert clickable Icons and bitmaps (like
> mouse-moveable scales/bars) into text-fields without loosing precision.
Rather than converting pre-existing GUI elements into text I was thinking
more of defining the essential elements of a user interface and specifying
them in a way that could be rendered as text or graphics. Icons and bitmaps
could not be rendered but scroll bars could.
As mentioned, I'm not proposing a complete solution. These were just some
ideas and are not something I am working on. However, to try to illustrate
what I had in mind perhaps a UI could be defined in the following terms.
Title: usually a bar at the top
Menu: bar and/or pop-up
Status: usually a bar
Clickables: buttons and links
Text entry: boxes, areas
Drop-downs: list selection and combo boxes
Check boxes and radio buttons
Grid
Sliders including scroll bars
Spinners
All of these could appear in either text or graphics mode.
...
>> Am posting here because ISTM it would also be helpful for OS development.
>> A windowing system could be developed in text mode and later used as a
>> GUI without having to rewrite the code.
>
> Yes, in this direction it would work.
Cool.
>> Maybe someone has already defined a common GUI/TUI API but I haven't
>> found one.
>
> As mentioned above, my only G/T-'API' is the formatted text output incl.
> vertical lists, where all additional graphic-elements (borders, circels,
> bitmaps,...) were just ignored in text mode.
I have thought that if windows were allowed to overlap in text mode there
would need to be some way to distinguish one window from another. For that
case a border might be useful and there are characters that can be rendered
as lines. Alternatively, or if space were really tight, each window could
have a different background colour.
>> Such a system would have to be defined in layers. There would be widgets
>> and layout controls at the top and, essentially, rectangles at the
>> bottom.
>> Some elements would be recursively placeable so that, for example, a
>> given rectangle could have other rectangles within it and thus effect
>> layouts that the programmer wants. Further, the programmer should be
>> able to hint at how essential a given layout is so that the elements
>> could be best shown on a screen which is not big enough for the ideal
>> layout. Perhaps a user could even be allowed to move elements within a
>> window rather than just moving windows.
>
> Methink that an APP which can run in both modes should contain layouts
> for all supported modes anyway. Apps usually set their desired mode.
> I daubt that an API can be made that smart to cover all opportunities.
> Your suggestion for predefined layouts and elements reminds on windoze :)
I was really suggesting that the layouts not be predefined but to allow for
hints along the lines of: if there is enough space then lay elements out in
this way.
You'll see I omitted text output aka label boxes from the list above. That's
because they often need to relate to some other control and would need to be
specified along with the control to which they relate. That would allow two
things. First, even though the screen layout can be altered by the rendering
process (to fit the screen) defining them together would allow the renderer
to keep them together. The label might have to be moved from beside the
control to above the control but it could still be kept with the element to
which it relates.
Second, some elements can be selected by Alt+key where the key is underlined
in the label. Defining the label with the control would allow the TUI or GUI
to know which control to select when that alt key combination is pressed.
>> Bottom line: if there was a GUI/TUI "language" then elements of a user
>> interface could be defined and used whether the program or OS was running
>> in a graphical or a textual environment.
>
> Sure, but when I think about an APP written for 1920*1080,32-bit,
> then I can't see how a full-screen input-field matrix could be displayed
> on a 80*25 mode_3 screen.
The idea would not be to convert a big GUI to work in small text mode but to
allow UI elements to be specified in a way that could be rendered on both.
In other words, one would start from the definition of the essential
elements and work from there to the display mechanism. On a large screen all
the elements might be visible at once. On a small text screen the user might
have to scroll up and down to get to all of the elements. For the TUI the
elements themselves would be more chunky and not so good to look at but they
would operate as normal.
The user could even be allowed to rearrange the UI elements within the TUI
or to change some of them from visible to ones which would pop up on
request. For example, a combo box could be just a single dot on the screen.
Clicking that dot would pop-up the full control. Anything to save space!
> And the opposite, ie: a msg-box in text-mode 40*25 APP would show up
> as a post-stamp at the top left corner of a 3200*2400 screen without
> converting all size and position information (the OS cant do this on
> its own, because it dont know about the original resolution).
>
> Ok if you mean only message-boxes, pulldown-menus and a few simple
> button-styles to adapt here,
> ...but there are many other graphic elements used in my OS which I
> could never transform into text-based equivalents without creating
> totally new functions to achieve the same results.
Agreed. It would not work at all for graphical elements but I wasn't
thinking of replacing a GUI, merely of 1) supporting certain apps and 2)
providing a UI while an OS is still in text mode.
James