CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 86 users online: 4 members, 58 guests and 24 bots.
Members: Ashbad, keoni29, Piguy-3.14.
Bots: MSN/Bing (1), Magpie Crawler (3), Googlebot (19), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Author Message
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 13 Feb 2012 10:02:19 pm    Post subject:

thydowulays wrote:
Okay, I figured out why the textbox wasn't showing. (super n00b reason) I forgot to add the stack on top -.- But I have a new thing now, what should I put for the 5th byte? I've tried everything, and every time I try to type in the box, my calculator crashes. I tried looking at Document DE 7's code for the GUIRTextMultiline thing, but it had .db 0 in it, and when used with my calculator it crashes it. Please help!
Would you care to share the code in question for us to examine? That might make it easier to debug.
_________________


Back to top
thydowulays


Newbie


Joined: 06 Feb 2012
Posts: 23

Posted: 13 Feb 2012 10:23:45 pm    Post subject:

Sure thing:
(starting at my start: label)

Code:

  call OpenGUIStack
  ld hl,myWin
  ld de,closeButton-myWin
  ld a,GUIRLargeWin
  call PushGUIStack
  ld hl,closeButton
  ld de,textInput-closeButton
  ld a,GUIRButtonText
  call PushGUIStack
  ld hl,textInput
  ld de,winButtons-textInput
  ld a,GUIRTextLineIn
  call PushGUIStack
  ld hl,winButtons
  ld de,dat_end-winButtons
  ld a,GUIRWinButtons
  call PushGUIStack
  ld hl,0
  call GUIMouse
  ret
exitMyProg:
  call ResetAppPage
  call CloseGUIStack
  ret
myWin:
  .db %00010000,%00111000,%01111100,%00111000,%00010000
  .db "DoorsCS GUI Example",0
closeButton:
  .db 1,1
  .dw exitMyProg
  .db "Close",0
textInput:
  .db 1,20,50,16,0
  .db "Test",0
winButtons:
  .db %00100000
  .dw 0
  .dw 0
  .dw exitMyProg
dat_end:

Okay, it's the 5th byte in the .dw 1,20,50,16,0 in my textInput label that's causing the problem. Thanks!
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 13 Feb 2012 11:52:27 pm    Post subject:

You missed that one of the fields for GUIRTextLineIn is a two-byte word (.dw) not a byte (.db):

Quote:
0: x-coordinate [1 byte]
1: y-coordinate [1 byte]
2: width in pixels [1 byte]
3: Maximum characters allows [2 bytes]
5: Current offset from start of data string [2 bytes]
7: Zero-terminated string [1+ bytes] (appears in the box)

_________________


Back to top
thydowulays


Newbie


Joined: 06 Feb 2012
Posts: 23

Posted: 14 Feb 2012 07:14:31 am    Post subject:

So doing .dw 0 would fix it?
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 14 Feb 2012 11:07:00 am    Post subject:

thydowulays wrote:
So doing .dw 0 would fix it?
I believe so. The best way to find out would be to just give it a try, though!
_________________


Back to top
thydowulays


Newbie


Joined: 06 Feb 2012
Posts: 23

Posted: 14 Feb 2012 03:59:32 pm    Post subject:

Okay, it works, sort of. I can type something in, but when I press 2nd to get out of it, then try to edit it again, my calc freezes. Could it be the next thing I need? The zero-terminated string?

EDIT: Actually, when I get out of the textbox and click on anything it freezes.

EDIT: I finally figured out the problem, by looking at Document DE 7's source! The problem is, I treated the offset as a 1 byte variable rather than a two byte! So all I had to do was change .dw 0 to .dw 0,0!
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 14 Feb 2012 05:21:19 pm    Post subject:

Huzzah, even better, glad you figured it out! So it's working smoothly for you now?
_________________


Back to top
thydowulays


Newbie


Joined: 06 Feb 2012
Posts: 23

Posted: 14 Feb 2012 05:42:10 pm    Post subject:

Indeed it is! Work's perfectly! Now I'm just trying to figure out how to make a small window pop up when you press a button. So far when you press the button, it crashes, not sure why, but it was my first try, so it's likely I'll figure it out on my own Smile
Back to top
ACagliano


Super-Expert


Joined: 08 Feb 2010
Posts: 922

Posted: 23 Feb 2012 11:13:28 am    Post subject:

Make sure you "call ResetAppPage" as the first command of a routine jumped to by the GUI Mouse.
_________________
-ACagliano

Current Projects

Legend of Zelda. "Ganon's Rage"
51%
Back to top
ACagliano


Super-Expert


Joined: 08 Feb 2010
Posts: 922

Posted: 20 Mar 2012 09:08:03 am    Post subject:

Ok..sorry. I lost the topic where I asked about this...

I was asking at one point about doing a "File Selection" window and you said I would have to draw the Window, then put the scrollbars and everything. Let's say I want to use Checkboxes to select the files to include. I just need a bit of conceptual help...how would I handle items offscreen. Could I just GUI Render the whole list and then the scrollbars would handle positioning on a virtual buffer?
_________________
-ACagliano

Current Projects

Legend of Zelda. "Ganon's Rage"
51%
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 20 Mar 2012 11:08:29 am    Post subject:

No, that's not how scrolling works. You would need to, for each offset in the program list, figure out which checkboxes and program names to display. You'd need (number of programs) bytes somewhere as an array of flags of which programs had been selected. You could also do it as a bitmask, so (number of programs)/8 bytes, but that's harder to mask and set.
_________________


Back to top
Display posts from previous:   
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
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are GMT - 5 Hours

 
Jump to:  
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

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.034045 seconds.