Hi guys !

I finally aborted AxiomGui to work on another project : add DCS GUI funcs to Axe. I know that several people tried to do this, but it never ended, so I try myself too.

For now, I only have one command, and it's not working properly -_-' So I also need help for this one (it's mostly due to Axe replacements, I think).

Here is the actual code (I'm using Mimas) :
Code:
dw $C0DE

; Alert(
; Displays a modal msg box with custom text

dw AlertEnd+2                       ; I use REP_NEXT twice
db %00001000                      ; only for DoorsCS
db $BB,$1B                            ; normalpdf(
db 0                                       ; inline
db 1                                       ; 1 arg

rorg 0
 push hl
 inc hl
 inc hl
 inc hl
 call sub_Length
 ex de,hl
 push de
 call OpenGUIStack

 REP_NEXT                            ; db $7F \ rorg $-1

 ld hl,SmallWin
 ld de,WinButtons-SmallWin
 ld a,GUIRSmallWin
 call PushGUIStack
 
 REP_NEXT

 ld hl,WinButtons
 ld de,AlertEnd-WinButtons
 ld a,GUIRWinButtons
 call PushGUIStack
 
 pop de
 pop hl
 inc de
 inc de
 inc de
 ld a,GUIRText
 call PushGUIStack

 ld hl,0
 call GUIMouse
 ret

exitAx1:
 call ResetAppPage
 ret

SmallWin:
db 7,7
db $E0,$B0,$90,$90,$F0
db " ",0

WinButtons:
db %00100000
dw 0
dw 0
dw exitAx1

AlertEnd:

dw 0                                     ; AXM_END

; token hook
dw $03E0                             ; hnormalpdf
db 6
db "Alert("


The only arg of this func is a data containing a GUIRText datas :

Code:
:.AXEDCS
:#Axiom(AXIOMDCS)
:Data(0,0,0)"Bonjour"→GDB1
:Alert(GDB1



Here is a screen of it running :



Once the mouse freezed, I resetted manually Wabbitemu ; on my real calc it freezes, and that's all.

If someone can help me ..?
So, the way the GUIMouse works (if you take a look at the DCS wiki documentation on it): "You need to call GUIMouse, but when control is returned to your program, the stack will be in a condition as if you jped to GUIMouse. Keep that in mind!!" In other words, the window buttons must contain a pointer to the address to jump to when the button is clicked, at which point you need to (1) call ResetAppPage and (2) do whatever response to that click and cleanup you want.
So it's a matter of what is after GUIMouse or what is after exitAx1 ? I'm not sure to understand well (sorry, I'm french) :/

EDIT : the problem is the text vector, the one which lead to exitAx1, Axe can't replace it correctly :/ but what can I do now >_<
Update !

All of the past problems are now resolved, and you already can use several DCS GUI widgets Very Happy



I'll post the axiom when I'll add WinButtons, to prevent bugs ^^' and I'll also explain how to use the axiom Smile
Superb, this is great progress! When you're done, I should make sure I make you a DCSWiki account so you can document this there. Smile I will eagerly await more of the GUI functions getting added.
I need to know how can you flush the GUIStack ? I want to include a command to delete all widgets in GUIStack, and CloseGUIStack doesn't work for it. Is there a mean of flushing the GUIStack ?

EDIT : in fact it's resolved, I just forgot to ClrDraw ^^' and I also added WinButtons and changed the menu where the tokens are Smile I'll add widgets until this evening (in 10h) and I'll post my progress.
matrefeytontias wrote:
I need to know how can you flush the GUIStack ? I want to include a command to delete all widgets in GUIStack, and CloseGUIStack doesn't work for it. Is there a mean of flushing the GUIStack ?

EDIT : in fact it's resolved, I just forgot to ClrDraw ^^' and I also added WinButtons and changed the menu where the tokens are Smile I'll add widgets until this evening (in 10h) and I'll post my progress.
CloseGUIStack should indeed do the trick for that, so I'm glad that it is. Just don't forget to re-open the GUIStack again. Smile Great progress!
ooh, this looks like it will be pretty useful =D
/me, for one, is looking forward to using it.
shmibs wrote:
ooh, this looks like it will be pretty useful =D
/me, for one, is looking forward to using it.
That makes me very happy to hear. I feel the DCS GUI has been a bit underutilized, so hopefully this will open it up to a lot more programmers and make it more accessible.
Here is the promised screenshot, plus the add of the Hotspots !

Great! And you're finding the GUI API reasonably easy-to-use so far? Given the items you have implemented already, I'm hoping that you won't encounter any significant problems with the rest of the GUI items, but as always, I'm here to answer any questions.
I had several problems, but I resolved them quickly, since they weren't really significant Smile and I found the GUI API pretty useful and easy-to-use, but I especially had a hard time with the data format returned in HL by GUIFindxxxx, I had to find it myself 'cos I couldn't find any doc about this.

Well, let's return to AxeDCS, I added GUIRText, GUIRTextLineIn aaand ... GUIFindFirst and GUIFindNext, called FindFirst and FindNext ! I didn't think thatt GUIFindThis was really important to implement since you can just do :
Code:
:For(x)
:FindNext
:End


Here is the habitual screenshot :

The nice thing about GUIFindThis is that I did a few tricks to make it slightly faster than repeatedly GUIFindNext'ing, but it's not enough of a different to make it worthwhile for you to pull it out. Smile Keep up the good progress, and I'm sorry you were confused about the data that FindFind{First,Next,This} points to. Don't hesitate to post any questions if you're near an internet-connected computer.
  
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 1
» 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