So I've decided that there will be 4 major foci of Doors CS 6:

:: Making it an app (duh)
:: Maximal compatibility
:: gCn and CALCnet2 - interconnectivity
:: Easy-to-use GUI tools

I'll focus on the fourth of these, easy to use GUI tools, for now. OK, I've decided that in order to make ASM programming as painless as possible for programmers, I'm gonna make DCS6 contain bcalls for common GUI functions. Something like this:

openGUIstack()
pushGUIstack()
popGUIstack()
closeGUIstack()
refreshGUI()

So what exactly is a "GUI Stack" and how am I going to use it? Let's imagine a theoretical program that has a large (ie fullscreen) window in the background, with a dialog that's in the foreground asking the user to confirm something. Firstly, you need to know that the Gstack will be a LIFO type stack - Last In, First Out. If you push 2,3,4, the first thing that will pop off is a 4, and the second thing is a 3. Once you pop something, it is removed from the stack. The Gstack will be a variable-size entity stored in an appvar that is created and initialized when openGUIstack() is called and cleared and deleted when closeGUIstack() is called. refreshGUI() will parse the Gstack and completely update the screen based on the contents of the stack. In other words, it will erase the screen, render the bottommost item in the stack, then the next up, until it reaches the top, to provide the layered-windows effect that the GUI will allow programmers to achieve. Now, the GUI stack is simply a series of entries in this format:

size (1 byte)
type (1 byte)
data (size-1 bytes)

To add an entry to the stack, you write it to some temporary mem, point to that with hl, and then call pushGUIstack(). Things you might want to push onto the stack: window title, sprite, text, input elements, buttons, etc. Once everything you want is on the stack, just call refreshGUI() to draw it all up. Even better, you can then call Mouse() and Doors CS will automatically parse the top Gstack entry, figure out the requisite hotspots, and handle all mouse-related stuff including various cursors, like arrow or text-edit, entry of text into GUI elements and modifications to the GUI stack, and then returning the values on the stack back to the program for processing. If you want to remove the top GUI element, such as the dialog box, simply call popGUIstack(). If you pop off the last element or call closeGUIstack(), the stack will be disabled and deleted. The GUI stack format is as follows;

-Header:defines window type and number of entries in group
---Element
---Element
---Element
-Header
---Element
---Element
---Element
---Element

I will post more detailed information as I come up with it. Feel free to provide feedback.
ok, sounds cool, if only I could understand half of it
Essentially, it should make writing a word processor as easy as pushing some stuff onto the Gstack, drawing, setting up some routines to call openFile() and saveFile(), and that's it. Maybe 400 bytes max Smile
you should try or some USB compatibility Smile allow thumb-drives, keyboards, and mice Very Happy
Am I to understand that the GUI stack will act as the sprite routine for layered windows in a program? If so, that sounds pretty awesome and I bet it will incourage more windows-like programs. Good Idea
Chipmaster wrote:
I bet it will encourage more windows-like programs. Good Idea


not necessarily good Smile
it almost sounds like it is an ASM thing though. Windows Programs are always in BASIC with ASM libs it seems][
Chipmaster wrote:
Am I to understand that the GUI stack will act as the sprite routine for layered windows in a program? If so, that sounds pretty awesome and I bet it will encourage more windows-like programs. Good Idea


That's exactly it. And rivereye, we mean windows-style applications, not shells. Smile
Edit:

Code:
GUI System Types
Doors CS 6
Doc Ver #1
Jan 2, 2006
(c) 2006 Cemetech
________________

Notes:
[1] All x.y valyes are relative to top left of the
    window.  x increases left to right; y increases
    top to bottom.
[2] x,y values refer to the top left pixel of an
    element unless otherwise specified
[3] [H] indicates this value is only valid as a
    group header type
[4] Most values are bytes; 2-byte word
[5] For sprites with 'b' value, the top 2 bits
    of b determine logic type:
    00nnnnnn = XOR
    01nnnnnn = AND
    10nnnnnn = OR
[6] fill:
    0=transparent/none
    1=white
    2=black

Byte->|<-Type------------->  |<-Following Data--->
------+----------------------+---------------------
 00   | Transparent       [H]| [number of elements]
 01   | Fullscreen Window [H]| [number of elements]
 02   | Large Window      [H]| [number of elements]
 03   | Small Window      [H]| [number of elements]
 04   | Text                 | x,y,font,ptr_to_text
 05   | Window Buttons       | %00000[-][][X]
 06   | Wrapped Text         | x,y,width,font,ptr
 07   | Text Button          | x,y,target[w],ptr2txt
 08   | Graphical Button     | x,y,target[w],ptr2_8b
 09   | Single-line text in. | x,y,width,maxchar,ptr
 0A   | Radio Button         | x,y,groupnum,ptrtoval
 0B   | Checkbox             | x,y,ptrtoval,initval
 0C   | Integer Input [byte] | x,y,min,max,ptrtoval
 0D   | Integer Input [word] | x,y,min,max,ptrtoval
 0E   | Invisible Hotspot    | x,y,width,height,trgt
 0F   | Textarea Input       | x,y,width,rows,ptr,maxlines[W]
 10   | Sprite [8xb]         | x,y,b,ptr
 11   | Sprite [8*a x b]     | x,y,a,b,ptr
 12   | Password input       | x,y,width,maxchar,ptr
 13   | Scrollbar            | x,y,height,ID,max,cur
 14   | Border               | x,y,height,width,textptr
 15   | Rectangle            | x,y,height,width,border,fill
 16   | Fullscreen image     | ptr_to_768b

Routines:
-----------------------------+----------------------------------
openGUIstack()               | inits GUI stack
-----------------------------+----------------------------------
pushGUIstack(ptr[w],size)    | pushes the entry at ptr of size
                             | size onto the GUI stack
-----------------------------+----------------------------------
popGUIstack()                | pops the top group off the Gstack
-----------------------------+----------------------------------
closeGUIstack()              | closes and deletes the stack
                             | should ideally be called with an
                             | empty stack
-----------------------------+----------------------------------
refreshGUI()                 | redraws GUI
-----------------------------+----------------------------------
updateScrollbar(depth,ID,max,cur)
                             | depth: 0=top,1=next to top, etc
                             | ID must be valid; max and cur
                             | update those two fields
-----------------------------+----------------------------------
mouse(x,y)                   | sets up hotspots based on top
                             | GUI entry, sets mouse xy to x,y,
                             | and then runs mouse until a
                             | hotspot is selected.  Returns x,y
                             | and clicktype
-----------------------------+----------------------------------
Here's a partial design:
That's pretty cool. I hope people will utilize this helpful tool. Jeez, this could completely change the look of many programs. (dialog boxes for exits instead of other screens, options menus that don't take up an entire screen) Good Idea
Aye, that's my hope! Smile
sounds like you are trying to make a widget-toolkit for the calculator, lol

Just don't forget about BASIC!!! - see if you can't make some basic-extra's too Very Happy
add a Open/ExecLib interface to the app Smile Smile Very Happy
Hmm, but that's 84 only. Razz
Got a new entry for that big post, byte ID 16.
Kllrnohj wrote:
sounds like you are trying to make a widget-toolkit for the calculator, lol

Just don't forget about BASIC!!! - see if you can't make some basic-extra's too Very Happy
I was trying to convince Kerm to do this - he seems opposed to it at the moment, but like all ideas I suggest to him, he will eventually implement it. Laughing
Jonathan_Pezzino wrote:
Kllrnohj wrote:
sounds like you are trying to make a widget-toolkit for the calculator, lol

Just don't forget about BASIC!!! - see if you can't make some basic-extra's too Very Happy
I was trying to convince Kerm to do this - he seems opposed to it at the moment, but like all ideas I suggest to him, he will eventually implement it. Laughing


It's a remote possibility, but I tend to avoid such things with BASIC 'cause then calcs without DCS won't be able to use them.
KermMartian wrote:
It's a remote possibility, but I tend to avoid such things with BASIC 'cause then calcs without DCS won't be able to use them.


Then those calcs will just have to use DCS...Very Happy

I think you should just do it with hooks, ala Omnicalc
OKOK, maybe I will...we shall see.
the z80 stack! yay, stack-ific!
But it's better than the regular word stack!! Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement