mIRC Home    About    Download    Register    News    Help

Print Thread
colouring lines in mdx ListView #137572 14/12/05 12:58 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
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?

Re: colouring lines in mdx ListView #137573 14/12/05 01:10 PM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
I don't think that is possible for only one line.

I think you can alter the text color for the whole control only.

Re: colouring lines in mdx ListView #137574 14/12/05 06:43 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.


$maybe
Re: colouring lines in mdx ListView #137575 15/12/05 02:58 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
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...

Re: colouring lines in mdx ListView #137576 15/12/05 03:25 PM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
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.

Re: colouring lines in mdx ListView #137577 15/12/05 08:53 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
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

Last edited by Aenei; 15/12/05 09:48 PM.
Re: colouring lines in mdx ListView #137578 16/12/05 03:41 PM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
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