mIRC Homepage
Posted By: Aenei colouring lines in mdx ListView - 14/12/05 12:58 PM
I am trying to colour a line in a ListView box (created using mdx.dll) red if a value is negative.
Code:
if ( $left(%remain,1) == $chr(45) ) did -o $dname 101 %i settxt color $rgb(255,0,0)

does not work, it merely overwrites the line with "settxt color 255" in the first column. Playing around manually if %i is any value it will rewrite the line, except for if %i is 1, in which case it colours the WHOLE thing red. So, is it possible to do just one line, or even a particular column/cell?
Posted By: ClickHeRe Re: colouring lines in mdx ListView - 14/12/05 01:10 PM
I don't think that is possible for only one line.

I think you can alter the text color for the whole control only.
Posted By: Mpdreamz Re: colouring lines in mdx ListView - 14/12/05 06:43 PM
in MDX only line 1 is reserved to pass commands to
instead of using 1 to insert a first item on the listview you use 2.

If you want to use individual line colours check out DCX as this is not possible with MDX.
Posted By: Aenei Re: colouring lines in mdx ListView - 15/12/05 02:58 PM
I'd decided it probably wasn't possible, thanks for confirming.

Mpdreamz - DCX it looks to have more potential for some of the things I'll be wanting to do, now just to find some nice documentation/even a "MDX Studio" equivalent...
Posted By: ClickHeRe Re: colouring lines in mdx ListView - 15/12/05 03:25 PM
There is no DCX Studio available. It's open to anyone that wants to build the application.

There is also a lack of tutorials or other material simply because the DLL is still in development (we're almost at an official release).

Most features are implemented, I'm mainly in the phase of correcting bugs found and implementing useful feature suggestions submitted by users.

There is one important thing to note, DCX does not work like MDX so there will be a learning curve for people used to the MDX way, but they will finally find that DCX is more natural in the way of processing information in the controls. There is no reserved line 1 like in MDX and the controls are not hosted into mIRC native controls. Also, DCX offers infinit container recursion of controls with it's rebar, panel, box, divider and tab controls. So you can build complexe UIs using all these tools.

Input and Output from controls and dialogs are done via the supplied /xdid, $xdid, /xdialog, $xdialog commands and identifiers. These are used exactly like mIRC's /did, $did, /dialog, $dialog.

Events are handled with a "callback" scheme which mens that the user can interact proactively to certain events to prevent the default action to be done. (A quick example is prevent the headers of a listview from being resized for example.)

There is a file called dcx.mrc in the DLL package which is used to test the DLL but also illustrate how each control is created and used which can act as a first tutorial contact with the help file to start using the DLL.

Once the userbase grows, we will probably see some specific tutorials emerge and hopefully a DCX Studio.
Posted By: Aenei Re: colouring lines in mdx ListView - 15/12/05 08:53 PM
Probably luckily for me I have not been writing using mdx for all that long and I am certainly finding that I am getting on better with dcx; in fact I just rewrote my dialog to use dcx controls rather than the mdx ones I had previously.

The 'callbacks' you mention, does this mean I have to put all the responses to events into the dcx_call alias rahter than the mirc style *:DIALOG: events?

Edit: don't worry, have found that you specify the callback alias in the mark statement and that events are handled in there. Quite a tidy way to do it I think. Good work all round smile
Posted By: ClickHeRe Re: colouring lines in mdx ListView - 16/12/05 03:41 PM
If you use regular mIRC controls, the events will be issued to the regular ON *:DIALOG for example if you use menus.

Only DCX control events will be issued to the supplied command and some can be interacted with by supplying a return value.

Feel free to report any problems (bugs) or questions to the DLL forum/bug tracker (suggestions are posted there too for an easy tracking)

Thanks
© mIRC Discussion Forums