Re: [Ql-Users] Why does WM_SETUP - never return an error?
Norman, it probably was a „If we can’t get them all, we probably shouldn’t even start looking for them“-decision. Potential of lurking errors in window definitions is immense and a full check of the definition in WM_SETUP is maybe a bit ambitious. After all, the Tebby team used the QPTR macros that do quite a bit of sanity check during the compile of a definition (I don’t use them either). Maybe they considered the whole thing part of the program that doesn’t need checking by the application ;) Tobias Am 18.04.2015 um 20:44 schrieb Norman Dunbar nor...@dunbar-it.co.uk: Evening all, I've spent some free time today examining a problem I've been having for some time. LibGen (anyone remember that?) when executed displays the window on screen and works fine until I exit from the program. At that point, QPC no longer is able to receive the cursor - it passes behind the QPC window as opposed to over the top of it. I should point out that QPC 4.0 is running on Mint Linux 17.1, 64 bit, under Wine. I know what the problem is, I created the window for LibGen without an application sub-window menu, so I simply added one in manually, but I screwed up! I think the major fault was defining the pointer to the menu items status block to be zero when obviously, that means it's the same status area as the entire Window's status area. There may well have been other problems! I've rolled back my changes and the code works fine, and when I ESC, QPC stays usable. Hooray. So, WM_SETUP returns no errors, ever. It's says so in the documentation. Does anyone have any clues as to why this should be? It's (obviously) clear that errors should occur in WM_SETUP when someone like me does something stupid. Even after all these years, I still find bits appear to be missing from the docs. Pan/Scroll control block definitions, for example, where are they in the Window Definition docs? Nowhere (that I can find anyway) although there is mention of them in the Window Working Definition docs. I haven't looked at the code, nor am I requesting/demanding/hinting that someone should do something about it. I'm just wondering why this quite important feature of WMAN should care so little about the correct setup of the window definition data. End of eRant! ;-) Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
On 18 Apr 2015, at 19:49, Norman Dunbar nor...@dunbar-it.co.uk wrote: does anyone have any decent examples of setting up a Window, with one application sub-window that doesn't have a menu, and then dynamically building a menu into the afore mentioned sub-window. I thought that SET_AP in Easy_Peasy did just that. George ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
On 19 April 2015 08:38:29 BST, Tobias Fröschle tobias.froesc...@t-online.de wrote: Norman, it probably was a „If we can’t get them all, we probably shouldn’t even start looking for them“-decision. Potential of lurking errors in window definitions is immense and a full check of the definition in WM_SETUP is maybe a bit ambitious. After all, the Tebby team used the QPTR macros that do quite a bit of sanity check during the compile of a definition (I don’t use them either). Maybe they considered the whole thing part of the program that doesn’t need checking by the application ;) Tobias Am 18.04.2015 um 20:44 schrieb Norman Dunbar nor...@dunbar-it.co.uk: Evening all, I've spent some free time today examining a problem I've been having for some time. LibGen (anyone remember that?) when executed displays the window on screen and works fine until I exit from the program. At that point, QPC no longer is able to receive the cursor - it passes behind the QPC window as opposed to over the top of it. I should point out that QPC 4.0 is running on Mint Linux 17.1, 64 bit, under Wine. I know what the problem is, I created the window for LibGen without an application sub-window menu, so I simply added one in manually, but I screwed up! I think the major fault was defining the pointer to the menu items status block to be zero when obviously, that means it's the same status area as the entire Window's status area. There may well have been other problems! I've rolled back my changes and the code works fine, and when I ESC, QPC stays usable. Hooray. So, WM_SETUP returns no errors, ever. It's says so in the documentation. Does anyone have any clues as to why this should be? It's (obviously) clear that errors should occur in WM_SETUP when someone like me does something stupid. Even after all these years, I still find bits appear to be missing from the docs. Pan/Scroll control block definitions, for example, where are they in the Window Definition docs? Nowhere (that I can find anyway) although there is mention of them in the Window Working Definition docs. I haven't looked at the code, nor am I requesting/demanding/hinting that someone should do something about it. I'm just wondering why this quite important feature of WMAN should care so little about the correct setup of the window definition data. End of eRant! ;-) Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm Morning Tobias, I expect Tony Tebby must have assumed that everyone would use his macros. I bet he never even considered that WM_SETUP could crash an emulator when he wrote it either! Given that different bits of a PE program setup use different macros though, I doubt that there's really a whole lot of sanity checking that could be done. Personally I would have made each chunk of PE structures take a signature word at the start to identify them as a window definition, a loose item, etc. That would help. Maybe. Cheers, Norm. -- Sent from my Android device with K-9 Mail. Please excuse my brevity and any auto corrections that are just wrong! ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
Norman, this is the best I could possible come up with so far (can’t find my own code anymore…) These are routines Easysource includes as app win menu handling code when you generate an application without a fixed menu. They don’t, however, cover any of the actual list allocation tasks. Maybe they help a bit forward? Tobias ; ;Universal application sub-window routines ; asw_setr move.l a4,-(a7) jsr wm.smenu(a2) move.l (a7)+,a3 tst.l d0 bne.s end_setr movem.l d3-d7/a1,-(a7) tst.l $44(a3) bne.s cal_ctrl tst.l -$44(a3) beq.s end_cal tst.l $2c(a3) beq.s end_cal lea awb_draw,a1 move.l a1,-$50(a3) clr.l -$4c(a3) lea awb_ctrl,a1 move.l a1,-$48(a3) cal_ctrl move.w $04(a3),d3 add.w d3,d3 addq.w #4,d3 move.l -$1e(a3),d0 beq.s pan_ctrl move.l $38(a3),d7 addq.l #2,a3 bsr.s set_ctrl subq.l #2,a3 pan_ctrl move.l -$3c(a3),d0 beq.s end_cal add.w d3,d3 move.l $34(a3),d7 bsr.s set_ctrl end_cal movem.l (a7)+,d3-d7/a1 moveq #0,d0 end_setr rts set_ctrl move.l d0,a1 move.w #1,(a1)+ clr.l (a1)+ move.w -$64(a3),d0 sub.w $30(a3),d0 sub.w d3,d0 move.w $2c(a3),d4 ble.s end_setr subq.w #1,d4 moveq #-1,d5 tst.l d7 bgt.s spac_lst cnt_spc addq.w #1,d5 add.w d7,d0 dbltd4,cnt_spc bra.s set_siz spac_lst move.l d7,a2 cnt_spl addq.l #2,a2 addq.w #1,d5 sub.w (a2)+,d0 dbltd4,cnt_spl set_siz move.w d5,(a1) rts awm_hitr jmp $34(a2) awm_draw jsr $20(a2) awb_draw jmp $24(a2) awm_ctrl jmp $38(a2) awb_ctrl subi.w #$0a,d4 beq.s pan_bl move.l $46(a3),d0 bra.s ctrl_bl pan_bl move.l $28(a3),d0 ctrl_bl beq.s end_ctrl move.l d0,a1 add.w d4,d4 adda.w d4,a3 swapd3 mulu$90(a3),d3 divu(a3),d3 move.w d3,4(a1) suba.w d4,a3 jsr $24(a2) end_ctrl moveq #0,d4 rts Am 18.04.2015 um 20:49 schrieb Norman Dunbar nor...@dunbar-it.co.uk: And, sorry, I forgot, does anyone have any decent examples of setting up a Window, with one application sub-window that doesn't have a menu, and then dynamically building a menu into the afore mentioned sub-window. I'm sure it can be done, I'm thinking MAWDRAW from EasyMenu as an example. Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
Norman, …and another one. I just remembered when I started doing this stuff in assembler, I used the (C!)-routines that came with EasyC (available at Dillwyn’s) from the master himself as a starting point. The example there shows how a menu in an application sub window is dynamically set up in the working definition. The code goes in easy understandable steps, nicely commented and is nice to follow as it is C and comes with an explanatory document (in the EG sub-directory). Tobias Am 19.04.2015 um 11:06 schrieb Tobias Fröschle tobias.froesc...@t-online.de: Norman, this is the best I could possible come up with so far (can’t find my own code anymore…) These are routines Easysource includes as app win menu handling code when you generate an application without a fixed menu. They don’t, however, cover any of the actual list allocation tasks. Maybe they help a bit forward? Tobias ; ;Universal application sub-window routines ; asw_setr move.l a4,-(a7) jsr wm.smenu(a2) move.l (a7)+,a3 tst.l d0 bne.s end_setr movem.l d3-d7/a1,-(a7) tst.l $44(a3) bne.s cal_ctrl tst.l -$44(a3) beq.s end_cal tst.l $2c(a3) beq.s end_cal lea awb_draw,a1 move.l a1,-$50(a3) clr.l -$4c(a3) lea awb_ctrl,a1 move.l a1,-$48(a3) cal_ctrl move.w $04(a3),d3 add.w d3,d3 addq.w #4,d3 move.l -$1e(a3),d0 beq.s pan_ctrl move.l $38(a3),d7 addq.l #2,a3 bsr.s set_ctrl subq.l #2,a3 pan_ctrl move.l -$3c(a3),d0 beq.s end_cal add.w d3,d3 move.l $34(a3),d7 bsr.s set_ctrl end_cal movem.l (a7)+,d3-d7/a1 moveq #0,d0 end_setr rts set_ctrl move.l d0,a1 move.w #1,(a1)+ clr.l (a1)+ move.w -$64(a3),d0 sub.w $30(a3),d0 sub.w d3,d0 move.w $2c(a3),d4 ble.s end_setr subq.w #1,d4 moveq #-1,d5 tst.l d7 bgt.s spac_lst cnt_spc addq.w #1,d5 add.w d7,d0 dbltd4,cnt_spc bra.s set_siz spac_lst move.l d7,a2 cnt_spl addq.l #2,a2 addq.w #1,d5 sub.w (a2)+,d0 dbltd4,cnt_spl set_siz move.w d5,(a1) rts awm_hitr jmp $34(a2) awm_draw jsr $20(a2) awb_draw jmp $24(a2) awm_ctrl jmp $38(a2) awb_ctrl subi.w #$0a,d4 beq.s pan_bl move.l $46(a3),d0 bra.s ctrl_bl pan_bl move.l $28(a3),d0 ctrl_bl beq.s end_ctrl move.l d0,a1 add.w d4,d4 adda.w d4,a3 swapd3 mulu$90(a3),d3 divu(a3),d3 move.w d3,4(a1) suba.w d4,a3 jsr $24(a2) end_ctrl moveq #0,d4 rts Am 18.04.2015 um 20:49 schrieb Norman Dunbar nor...@dunbar-it.co.uk: And, sorry, I forgot, does anyone have any decent examples of setting up a Window, with one application sub-window that doesn't have a menu, and then dynamically building a menu into the afore mentioned sub-window. I'm sure it can be done, I'm thinking MAWDRAW from EasyMenu as an example. Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
On 19 April 2015 06:53:02 BST, Wolfgang Lenerz wlen...@free.fr wrote: Hi Norman I 'll have a look at your points, but won't be able to reply for a few days at least. WOlfgan ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm Thanks Wolfgang. -- Sent from my Android device with K-9 Mail. Please excuse my brevity and any auto corrections that are just wrong! ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
Hi George, On 19/04/15 14:04, gdgqler wrote: On 18 Apr 2015, at 19:49, Norman Dunbar nor...@dunbar-it.co.uk wrote: does anyone have any decent examples of setting up a Window, with one application sub-window that doesn't have a menu, and then dynamically building a menu into the afore mentioned sub-window. I thought that SET_AP in Easy_Peasy did just that. I thought SET_AP was used to set up the menu items statically? What I need for LibGen is a blank application window until such time as the user has selected the sym_lst file to load, then I count the offsets to code routines and then create the menu with the items etc. Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
The Easy PEasy example EX1_asm is an example of using SET_AP, this is good, but, when executed it calls WM_WRSET after calling SET_AP. This breaks LibGen as it clears all text from all the various information windows that have user input displayed in them - the Sym File, Lib File and Bin File for example. Info windows and loose items that have text objects are obvioulsy fine. The ones I use for user input get wiped out. However, I'll have another look at SET_AP - now that I've got a working version of LibGen that doesn't trash QPC when it is run! :-) Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
Re: [Ql-Users] Why does WM_SETUP - never return an error?
On 19/04/15 15:13, Norman Dunbar wrote: However, I'll have another look at SET_AP - now that I've got a working version of LibGen that doesn't trash QPC when it is run! :-) I have a working example now of a program that sets up a dynamic menu. It seems I need to design the window with a menu to start with, the SET_AP will work. As noted previously, I need to call WM_WRSET after calling SET_AP or the program just crashes. Looks like I need to amend LibGen so that I redraw all my own information windows, with dynamic content, whenever I create a dynamic application window menu. Progress at least! I seem to also be restricted to a single column with SET_AP, I can live with that. Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: 27a Lidget Hill Pudsey West Yorkshire United Kingdom LS28 7LG Company Number: 05132767 ___ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm