Mike,
I have not tried the drag list box. I'm no expert, but since no one else
seems to have answered, I can make a few comments. Basically it looks like
the stack is unbalanced in the CASE structure in DRAGGER in at least three
places. Perhaps a few more stack comments could help you keep things
straight, I know I need more than what's there.
First it looks like you may be ignoring the void returned by DrawInsert.
Remember, there will be an item on the stack even if it's a void type, so :
Function: DrawInsert ( handParent hLB nItem -- )
should be
Function: DrawInsert ( handParent hLB nItem -- void)
Then down in DRAGGER change
OF HWND DLI hLB @ DL_MOVECURSOR DrawInsert
to
OF HWND DLI hLB @ DL_MOVECURSOR DrawInsert DROP
This should then leave the stack at the level it was before the OF, instead
of leaving the void on the stack for the next OF or ENDCASE to see. You
will have to decide how to fix the res DRAGGER returns from this thread.
Second, the DUP OF words ENDOF structure is interesting. Is this not
always executed, just as if the words followed ENDCASE? A <default action>
should be at the end of the OF .. ENDOF list but before ENDCASE without any
bracketing compiler action. The way it is, there will be a TRUE that is
always consumed by ENDCASE instead of the selector, which I assume is not
what you intend to pass back as the res of DRAGGER.
Third, the IF ELSE THEN in the DL_BEGINDRAG action is not stack balanced,
the IF clause is balanced, but the ELSE clause adds an item. So, your CASE
is doomed to stack over or underflow ( I suspect over).
Now, why it happens to fail at LBItemFromPt? I can not say, but if you
clean up these other things you may have better luck. I hope this helps.
Matt
Has anyone been successful implementing "Drag List Boxes" inside
of a dialog? It appears to be fairly straight forward but after
a full day of trying, I can't get past a page fault in Kernel.dll
when I attempt to execute LBItemFromPt in the definition
DRAGGER (about half way down). File attached is about 100 lines.
Thanks, Mike
Received on Mon Nov 06 2000 - 07:29:30 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.