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.
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!
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)
So doing .dw 0 would fix it?
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!
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!
Huzzah, even better, glad you figured it out! So it's working smoothly for you now?
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
Make sure you "call ResetAppPage" as the first command of a routine jumped to by the GUI Mouse.
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?
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.
  
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 2 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