[?] Trying to get into the advanced stuff |
Author: |
Message: |
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
O.P. [?] Trying to get into the advanced stuff
Okay, for a very long time I managed to do all my scripting stuff using just JScript code with some API calls. But that time seems to be ended...
I want to make my ListViewControl's columns sortable. This can be done usign the LVM_SORTITEMS message, but because Plus! doesn't support function pointers I'll need to program a DLL with a function to do this and call it from my script. The only problem is: I have no clue how. I never programmed a DLL before.
So, if anyone's interested in helping me with this, please PM me so I can give you my Messenger address.
Thanks in advance!
This post was edited on 06-09-2007 at 03:02 PM by Matti.
|
|
06-09-2007 03:02 PM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
Joined: Oct 2004
|
RE: [?] Trying to get into the advanced stuff
ListViewControl columns can be made sortable within the schema file can't they?
code: <ReportView>
<SortColHeader>true</SortColHeader>
</ReportView>
|
|
06-09-2007 03:40 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
O.P. RE: [?] Trying to get into the advanced stuff
quote: Originally posted by Volv
ListViewControl columns can be made sortable within the schema file can't they?
code: <ReportView>
<SortColHeader>true</SortColHeader>
</ReportView>
If it would've been that easy, I'd already have done that!
No, Plus!' scripting engine still has a lot of incomplete features, including this one. Developers have to code it in manually, which I'm trying to do now.
|
|
06-09-2007 03:49 PM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
Joined: Oct 2004
|
RE: [?] Trying to get into the advanced stuff
Hmm ok, you're right - it doesn't work
I only just realised that I had that tag in my script all along and didn't even know about it
|
|
06-09-2007 04:06 PM |
|
|
vikke
Senior Member
Posts: 900 Reputation: 28
31 / /
Joined: May 2006
|
RE: [?] Trying to get into the advanced stuff
I don't get what you would do with function pointers, but I have PMed you, hopefully I can help you.
|
|
06-09-2007 04:17 PM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
|
RE: [?] Trying to get into the advanced stuff
I was looking at this just last week and though that Patchou should have really put events on the column names being pressed and was suprised it wasn't there and that they weren't called through the CtrlClicked event. The only work around I could think of was to remove the top bar and sit buttons there instead, but then you can't use the <SortColHeader> which is unfortunate (but I have been too lazy to do this....). I'm sure your method is probably going to be better, but if you wanted to be lazy like me then this way is always a possibility (and will only require JScript).
|
|
06-10-2007 07:02 AM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
O.P. RE: [?] Trying to get into the advanced stuff
quote: Originally posted by markee
I was looking at this just last week and though that Patchou should have really put events on the column names being pressed and was suprised it wasn't there and that they weren't called through the CtrlClicked event. The only work around I could think of was to remove the top bar and sit buttons there instead, but then you can't use the <SortColHeader> which is unfortunate (but I have been too lazy to do this....). I'm sure your method is probably going to be better, but if you wanted to be lazy like me then this way is always a possibility (and will only require JScript).
But then, it'd be better to write it with a DLL, since then you can actually receive notifications from window controls and use function pointers... I just want to learn HOW.
|
|
06-10-2007 11:49 AM |
|
|
Eljay
Elite Member
:O
Posts: 2949 Reputation: 77
– / / –
Joined: May 2004
|
RE: [?] Trying to get into the advanced stuff
To detect when someone clicks the column header, you don't have to write a dll to subclass the ListView at all. ListView controls send a WM_NOTIFY message to the parent window for various events, including when the column headers are clicked, which means you can detect it in JScript using PlusWnd.RegisterMessageNotification().
I have attached a little example script to detect column header clicks, enjoy
Note: if you have multiple ListViews, you can distinguish between them by reading the hwndFrom of the NMLISTVIEW structure.
if(NMLISTVIEW.ReadDWORD(0) == Wnd.GetControlHandle("<ControlId>"))...
Attachment: _ListViewControl_ColumnClicked.plsc (1.8 KB)
This file has been downloaded 201 time(s).
This post was edited on 06-10-2007 at 01:35 PM by Eljay.
|
|
06-10-2007 01:28 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
O.P. RE: [?] Trying to get into the advanced stuff
Whoa, thanks! Now I only need to program a DLL to do the sorting.
EDIT: Just for the sake of correctness: it's LVN_COLUMNCLICK instead of LVN_COLUMNCLICK ED.
This post was edited on 06-10-2007 at 03:39 PM by Matti.
|
|
06-10-2007 03:36 PM |
|
|
Eljay
Elite Member
:O
Posts: 2949 Reputation: 77
– / / –
Joined: May 2004
|
RE: [?] Trying to get into the advanced stuff
|
|
06-10-2007 04:03 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|