I wanted to use GUIRText, and went to the SDK and found this:


Code:
GUIRText: sum(7,4,X,Y,0,"STRING"). The specified string will be displayed in the GUI stack,
where X,Y is the top-left corner of the text. The 0 specifies what font to use; as of Doors CS
7.0, only one font is available, but future versions of Doors CS may add additional fonts.
The STRING should not overflow the right edge of the container or the screen.


Is this a TI-Basic function only?

I'd like to use it in Asm, can I do that?

I found this:

http://dcs.cemetech.net/index.php?title=PushGUIStack

However, it asks me to set a to a string, how can I do that?

Thanks, I'd like to display a string at (0,0) for experimenting.
I moved this to the z80 ASM topic.

The basic way the GUI works is you have to open the stack, push an item, and then close the stack when you're done. Also note that you need a container element. So, what you'll want to do is:
Open Stack
Push GUIRNull
Push GUIRText
Render GUI
Close Stack

I don't have any code offhand to demonstrate, here's the main page for looking up GUI stuff:
http://dcs.cemetech.net/index.php?title=GUI_Tools
and here's Kerm's Document DE, which helped me figure stuff out with the GUI:
http://www.ticalc.org/archives/files/fileinfo/398/39851.html
Hopefully that's a good start, if you're still stuck let us know.
ScoutDavid wrote:
I wanted to use GUIRText, and went to the SDK and found this:


Code:
GUIRText: sum(7,4,X,Y,0,"STRING"). The specified string will be displayed in the GUI stack,
where X,Y is the top-left corner of the text. The 0 specifies what font to use; as of Doors CS
7.0, only one font is available, but future versions of Doors CS may add additional fonts.
The STRING should not overflow the right edge of the container or the screen.


Is this a TI-Basic function only?

Yes, that's a TI-BASIC function. You can do, however, do the same thing in asm.
Quote:

I'd like to use it in Asm, can I do that?

I found this:

http://dcs.cemetech.net/index.php?title=PushGUIStack

However, it asks me to set a to a string, how can I do that?

Thanks, I'd like to display a string at (0,0) for experimenting.

That doesn't say "set a to a string", it says "Item type. Examples: GUIRSmallWin, GUIRRadio, GUIRPassIn". For example, if you wanted to push a GUIRText to the GUI Stack, you would set A to 4, as described here.
Please be sure to read the chapter on using the GUI API in the PDF of the Doors CS SDK. You can also read this page, GUI API, in the DCS wiki, which explains the GUI more concisely.
Questions: I remember a call that moves the gui6/7 appvar into higher memory, used if you create a program/appvar while the GUI stack is open. What is that exact call, and am I right about why to call it? What makes it necessary to use?
ACagliano wrote:
Questions: I remember a call that moves the gui6/7 appvar into higher memory, used if you create a program/appvar while the GUI stack is open. What is that exact call, and am I right about why to call it? What makes it necessary to use?
There are only very, very few reasons you should use that call; it's only exposed because of some awkward things that I do in Document DE. Basically, the GUI Stack should always be in highest memory, above all programs and appvars, because its size is changed often. The more stuff is above a piece of data being resized, the slower the resize is. However, Document DE of course creates documents, so if a new document is created, it needs to move the appvar back above the new document.
On the GUI function, TextLineIn, what exactly is meant by "offset from start of data string"?
ACagliano wrote:
On the GUI function, TextLineIn, what exactly is meant by "offset from start of data string"?
That should more or less always be .dw 0 unless you know what it's for. Wink
Ok. Then if I do .dw 0, then where does it put the Input string? At the byte after that?
ACagliano wrote:
Ok. Then if I do .dw 0, then where does it put the Input string? At the byte after that?
Correct. The offset isn't for the offset to the string. It's actually the offset into the string where the first displayed character currently is. If you type a string one character wider than the box, for example, then when you're at the end of the string one character will be "off-screen" to the left, and that value will be $0001.
That explains some of my crashes. lol. good to know.
ACagliano wrote:
That explains some of my crashes. 0x5. good to know.
Sounds good. Smile When in doubt, don't mess with the values if their use doesn't make sense, or please ask, because I'm sure that a lot of the documentation makes perfect sense to me, the creator of the API, but very little sense to others.
Does the GUI Stack interfere with CALCnet memory area?
iirc, it doesn't interfere with CALCnet.
What is CALCnet?
ACagliano wrote:
Does the GUI Stack interfere with CALCnet memory area?
It does not. Chat! is an example of both CALCnet and the DCS GUI stuff working together.
CALCnet is a networking protocol for multiple calculators on a network.
Calcman: Read about (and watch a video about) CALCnet and global CALCnet.

ACagliano: As Merthsoft said, they do not interfere. See also Interfacing CALCnet2 and GUI Memory Areas for the respective, non-overlapping areas.
Kerm, can you explain to me, and perhaps include a bit of sample code, of how to use the GUIMouse hook. Would that be possible to make an OK button appear only when a text field contains data, but disappear if it contains no data?
ACagliano wrote:
Kerm, can you explain to me, and perhaps include a bit of sample code, of how to use the GUIMouse hook. Would that be possible to make an OK button appear only when a text field contains data, but disappear if it contains no data?
It's just a routine that gets pointed to, but what you're describing wouldn't be a very good thing to use a MouseHook for, since it shouldn't modify a GUIStack in use. What you should do is, inside the click handler for the button, check the contents of the input box, and if it's empty, just loop write back to GUIMouse(0).
  
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