View Single Post
Old 07-12-2004, 00:10   #4 (permalink)
rizapn
No Life Poster
 
Join Date: Mar 2002
Location: -[r0]-
Age: 53
Posts: 834
Member: 9891
Status: Offline
Thanks Meter: 2
Dynamic Text:
(Yes, dynamic text means not only 'text' but also number (as a text)). Then, we can use : id2str, strcpy, word2str, etc-etc, and then string2id ... before using the MsgBox.

Menu Structure:
This is only one example of creating menu, using CreateMenu02 function (0xE6EC90) which is used by "New Application menu" and "Format" SMS menu ... (why did I choose that function, just because its need less bytecode than the others). The code example is based on sfe format (o,p,q,r built-in function)

Code:
func_createMenu:
mov r14, #0
mov [-r0], r14  ; dunno, most samples is set to zero
mov [-r0], r14

mov [-r0], r13  ; r13:r12 is input parameter from the caller
mov [-r0], r12  ; something like the caller's handle

mov [-r0], r14
mov [-r0], r14
mov [-r0], r14
mov [-r0], r14

mov r13, #q(MENUHEADER)  ; offset of MENUHEADER data
mov r14, #p(MENUHEADER)  ; page of MENUHEADER data
mov [-r0], r14
mov [-r0], r13
mov r13, #q(MENUSTRUCT)  ; offset of MENUSTRUCT data
mov r14, #p(MENUSTRUCT)  ; page of MENUSTRUCT data
mov [-r0], r14
mov [-r0], r13
mov r12, #0  ; menu_style, 0=full_screen, 1=options-like
mov r13, #0
mov r14, #0
calls createMenu02  ; 0xE6EC90
add r0, #18h
rets

MENUHEADER:
dw 5,9,5fh,15h ; dunno ...
dw 0,0 ; pointer to MenuIcon ID
dw 885h ; menu header string ID
dw 7fffh ; end_of_data

MENUSTRUCT:
dw 0,0,0,0,0,0,0,0 ; handler_info
dw 3c02h,2ebh,3bfch,2ebh,48h,0 ; pointer to some data, dunno...
dw o(itemHandler), s(itemHandler) ; itemHandler func address
dw q(MENUBUFF), p(MENUBUFF)  ; pointer to menu items data
dw q(MENUHANDLER), p(MENUHANDLER)  ; pointer to menuHandler (if selected)
dw MENUITEMNO  ; number of menu item

itemHandler is the OnChange() function for menu item (executed each time, the menu cursor is change). Set to 0 if there is no such function needed.

MENUBUFF is the detail data for menu item (18 bytes each) :
MENUBUFF:
dw 0,0  ; dunno, pointer to some data?
dw stringID1,stringID2  ; stringID used as a menu item
dw 0,3c06h,2ebh ; dunno
dw 3  ; menu item type
dw 0d0h  ; menu item condition code
...

MENUHANDLER:
dw o(onSelectHandler), s(onSelectHandler) ...

onSelectHandler is the function which is executed when the menu item is selected.
Function parameters:
I have write a document called 'functions.txt', where you can find some functions and their parameters. I think I already zipped into my sl45 document, but if it is not there I will put it here also ...

Modify string location in the screen:
For that date and time string, I also have no information. I am searching, but still no lucky. I found something new yesterday (when I found text style master data), but still not include that ones ... Hope somebody will found it soon ...

Executing our function after some times:
- If we are in the loop, then we can put our own counter somewhere in the RAM, and increase/decrease it based on that loop, and if the counter reach some number, it will call our function.
- If we are not in the loop, I'm not sure about that, but there is a function called 'setTimer' or 'setDelay' or I don't know, but it has a timer and function address as the parameter. The function address is 0xD6026C, and the parameter is : r13:r12 miliseconds (double_word), r15:r14 (function address). You can check the example in BLR or from address 0xDAFC46.

rizapn

Last edited by rizapn; 07-12-2004 at 00:24.
  Reply With Quote
 
Page generated in 0.09739 seconds with 7 queries