Page 1 of 1

D4D getmode

PostPosted: Tue Aug 08, 2017 4:14 pm
by dhs
Decided to convert one of my existing DCAL macros to D4D and went looking for the D4D equivalent of getmode. But I can't find it.

Does anybody know if there is a D4D equivalent to getmode?
I could not find a single example of a selection menu in the D4D samples provided.

My assumption is that I will need to write the selection logic myself. Not an enormous task, but I don't want to go to that effort if something is already provided.

Thanks,
David H.

Re: D4D getmode

PostPosted: Thu Aug 10, 2017 2:56 pm
by Jsosnowski
I second Dave's question. I am translating some macros from DCAL to D4D and make use of the getmode function in many places. Before reinventing the wheel, does anyone have sample code for this ?

Re: D4D getmode

PostPosted: Thu Aug 10, 2017 3:14 pm
by dhs
Hopefully there is a provided equivalent to getmode that I haven't been told about yet!

I haven't spent that much time on it yet but am partway through coding my own version of getmode.
A bit more complicated than I originally envisioned as I hadn't thought about the Mask & Crossing options.
In terms of the Crossing option, there is a greedy_box field in the mode_type record { bit0 = box; bit1=greedy }. I'm assuming that 'greedy' is equivalent to Crossing ? Is setting this field the mode record the best way to implement crossing?

Re: D4D getmode

PostPosted: Thu Aug 10, 2017 3:50 pm
by dhs
Another question on the (hope not) assumption that I need to code my own version of getmode:

The standard interface has a 'Previous' button on the Mask menu. In order to replicate this in my own version of getmode I need to be able to access the previous selection (presumably a mode_type variable). Is this previous selection available to D4D (at a quick look I cannot find a likely candidate in the header files) ?