forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Yeh! Table Element Grouping...
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 29, 2007 3:33 pm    Post subject: Yeh! Table Element Grouping... Reply with quote

1) Anyone know how to handle a LPWSTR type variable? I don't think @BINARY(DWORD,%%var) is correct.

2) Also, what is the proper way to use multiple options for a struct member?

Example:

I need all of these options for the "MASK" member (or at least two of them)

%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8

I have tried %%MASK = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)

And

%%MASK = @sum(%%LVGF_HEADER,%%LVGF_GROUPID)

I'm not sure if it is working. However, I might have %%MASK right and it's just my first question that is giving me the problem.

If it helps I'm working with the LVGROUP structure.

StrucTypeDefs:
# UINT cbSize; // 4 bytes
# UINT mask; // 4 bytes
# LPWSTR pszHeader; // ? bytes
# int cchHeader; // 4 bytes
# LPWSTR pszFooter; // ? bytes
# int cchFooter; // 4 bytes
# int iGroupId; // 4 bytes
# UINT stateMask; // 4 bytes
# UINT state; // 4 bytes
# UINT uAlign; // 4 bytes

Code:

:LVGROUP

%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8

%%LVGA_FOOTER_CENTER = $10
%%LVGA_FOOTER_LEFT =  $8
%%LVGA_FOOTER_RIGHT = $20
%%LVGA_HEADER_CENTER = $2
%%LVGA_HEADER_LEFT = $1
%%LVGA_HEADER_RIGHT = $4

 
  %%cbSize = 40
  %%mask = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)
  %%pszHeader = "TEST GROUP"
  %%cchHeader = @len(%%pszHeader)
  %%pszFooter = 0
  %%cchFooter = @len(%%pszFooter)
  %%iGroupId  = %3
  %%stateMask = 0
  %%state = $0
  %%uAlign = %%LVGA_FOOTER_LEFT
  %%LVGROUP = @BINARY(DWORD,%%cbSize)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%mask)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszHeader)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchHeader)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszFooter)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchFooter)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%iGroupId)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%statemask)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%state)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%uAlign)


I actually have groups working for the VDS table element but can't get the group header text to show up.

Thanks in advance,

Aslan


Last edited by Aslan on Thu Mar 29, 2007 8:23 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 29, 2007 7:39 pm    Post subject: Reply with quote

Sorry Aslan that I have not answered you yet on this. You actually don't need the Wide character strings LPWSTR. Make sure you are sending the ASCII version of the API Messages. Your code is incorrect... See below for the correct way to handle the strings.

Code:

:LVGROUP

%%LVGF_HEADER = $1
%%LVGF_GROUPID = $10
%%LVGF_ALIGN = $8

%%LVGA_FOOTER_CENTER = $10
%%LVGA_FOOTER_LEFT =  $8
%%LVGA_FOOTER_RIGHT = $20
%%LVGA_HEADER_CENTER = $2
%%LVGA_HEADER_LEFT = $1
%%LVGA_HEADER_RIGHT = $4

 
  %%cbSize = 40
  %%mask = @sum(%%LVGF_HEADER,%%LVGF_GROUPID,%%LVGF_ALIGN)
  %%pszHeader = "TEST GROUP"
  %H = %%pszHeader
  %%cchHeader = @len(%%pszHeader)
  %%pszFooter = 0
  %%cchFooter = 0
  %%iGroupId  = %3
  %%stateMask = 0
  %%state = $0
  %%uAlign = %%LVGA_FOOTER_LEFT
  %%LVGROUP = @BINARY(DWORD,%%cbSize)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%mask)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,@Addr("%H"))
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchHeader)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%pszFooter)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%cchFooter)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%iGroupId)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%statemask)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%state)
  %%LVGROUP = %%LVGROUP@BINARY(DWORD,%%uAlign)

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 29, 2007 7:54 pm    Post subject: Re: Yeh! Table Element Grouping works !! Reply with quote

Updated: Dragonshere, you must have posted while I was creating my post.. Wink
I tried it with %%pszHeader = "TEST GROUP" and it didn't work however,
using %%pszHeader = T@chr(0)E@chr(0)S@chr(0)T@chr(0)@chr(32)@chr(0)G@chr(0)R@chr(0)O@chr(0)U@chr(0)P@chr(0) did work.

I'll probably make a DSU with it after I work out some of the other features.


Ok after some more testing using @sum() to combine the MASK obtions is correct.

The LPWSTR type variable is pointer to a memory address, plus every character inthe string saved at that address must be followed by a NULL character ie. @chr(0)

The string must be assigned to a 'LOCAL' variable to get the addess pointer in VDS.

ie. For the string "TEST" it would look like this:

%A = T@chr(0)E@chr(0)S@chr(0)T@chr(0)

Then it can be added as a member in the stucture using @BINARY(DWORD,@addr("%A"))

Now that I've gotten that figured out you can use Grouping with the Table element.

The attached pic is just one small sample of what you can do with the Table Element and Listview API implementing Groups.

More later



grpdemo.bmp
 Description:
 Filesize:  369.03 KB
 Viewed:  2128 Time(s)

grpdemo.bmp




Last edited by Aslan on Thu Mar 29, 2007 8:26 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 29, 2007 8:17 pm    Post subject: Reply with quote

BTW- I recently remembered something in a post about how to do Wide character strings. I'm not sure were the post is but I believe Dragonshere you were the one who posted it. Wink
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 29, 2007 8:49 pm    Post subject: Reply with quote

Aslan,
Your right... I just looked up the LVM_INSERTGROUP and there is no ASCII version of this message. Also there is no ASCII version of the LVGROUP structure so you are correct that you will need to use Wide character strings. Lucky for you that the control seems to handle Big endian Wide characters Wink

Also just so you know GadgetX has a @Ole(VDSTOBSTR) function that will take a VDS string and turn it into a BSTR ie Wide String and return it's memory address that you should be able to use in the structure. Might make it easier.

I have posted several times about Wide character strings and how to convert from a VDS string to a Wide character string. This question started poping up as soon as VDS 5 was released since many API messages and functions use UNICODE/Wide characters or multibyte characters...

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 29, 2007 8:54 pm    Post subject: Reply with quote

Aslan,
BTW you have my permission to include my utils.dsu into your DSU if you like. I don't care about credits or anything like that.
Maybe I will integrate this into my TLibBrowser GadgetX tool for looking up Type Info on OLE controls.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 29, 2007 9:00 pm    Post subject: Reply with quote

Oh just so you know you would do the same thing for the pszFooter as you did for the header.
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 29, 2007 9:48 pm    Post subject: Reply with quote

LOL hehehe... Aslan, here is your original post about all of this were a solution was already given... http://www.vdsworld.com/forum/viewtopic.php?t=3665&highlight=character
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 29, 2007 10:13 pm    Post subject: Reply with quote

dragonsphere wrote:
LOL hehehe... Aslan, here is your original post about all of this were a solution was already given... http://www.vdsworld.com/forum/viewtopic.php?t=3665&highlight=character


Yep that would be the one. Probably my bad choice for the title is what through me off. Stupid

I started on this DSU a long time ago and dropped it for a while.

Thanks for permit to incorporate your util.dsu into this one.

I had been planning on combining everything I have learned and others have shared into single DSU for quite some time now.

In fact Shinobi (Where is he anyway?) was helping me with some of it.

Anyway, I'll post a list of what I know I can include so far and if anyone wants to contribute more... please feel free
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Fri Mar 30, 2007 3:29 am    Post subject: Reply with quote

Oh yeah! I am VERY interested in the grouping!!! If a DSU could be made for this it would be great!! I am making an app that I could use this feature!! Please post when it is done. Thanks so much!!
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Fri Mar 30, 2007 5:01 am    Post subject: Reply with quote

Let's see what I can get done this weekend Wink

I might have to make two DSUs;
A pure VDS one and an advanced one that requires Dragonshere's GadgetX.

BTW - for anyone else that might be trying to use the LVGROUP structure, make sure that LVGF_GROUPID is last in the MASK member or the rest won't work.

ie. %%mask = @sum(%%LVGF_HEADER,%%LVGF_ALIGN,%%LVGF_GROUPID)
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Fri Mar 30, 2007 5:18 am    Post subject: Reply with quote

Very cool. Thanks. I could use both. Smile
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Apr 03, 2007 6:42 pm    Post subject: Reply with quote

Ok I've gotten a long way but I'm having trouble with a key issue.

I'm trying to see if I can make use of a subitem being clicked.

My problem is how to put a C struct in a C struct.

Code:

##################Notes##################

# LVM_SUBITEMHITTEST
# lResult = SendMessage(      // returns LRESULT in lResult
#     (HWND) hWndControl,      // handle to destination control
#     (UINT) LVM_SUBITEMHITTEST,      // message ID
#     (WPARAM) wParam,      // = 0; not used, must be zero
#     (LPARAM) lParam      // = (LPARAM) (LVHITTESTINFO) pInfo; );
#wParam //Must be zero.
#pInfo //Pointer to an LVHITTESTINFO structure.

# typedef struct _LVHITTESTINFO {
#    POINT pt;
#    UINT flags;
#    int iItem;
#    int iSubItem;
#} LVHITTESTINFO, *LPLVHITTESTINFO;

#typedef struct tagPOINT {
#  LONG x;
#  LONG y;
#} POINT, *PPOINT;
#########################################

:Table1CLICK
  %X = @MOUSEPOS(X)
  %Y = @MOUSEPOS(Y)
  %%Point = @BINARY(LARGEINT,%X)@BINARY(LARGEINT,%Y)
#The problem is here;  I need to put %%point in %%LVHITTESTINFO
  %%LVHITTESTINFO = @BINARY(DWORD,%%Point)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,0)
  %%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,%%LVHITTESTINFO)
  info %%LVM_SUBITEMHITTEST
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Apr 03, 2007 8:50 pm    Post subject: Reply with quote

Aslan,
Below is your code corrected.

Code:

##################Notes##################

# LVM_SUBITEMHITTEST
# lResult = SendMessage(      // returns LRESULT in lResult
#     (HWND) hWndControl,      // handle to destination control
#     (UINT) LVM_SUBITEMHITTEST,      // message ID
#     (WPARAM) wParam,      // = 0; not used, must be zero
#     (LPARAM) lParam      // = (LPARAM) (LVHITTESTINFO) pInfo; );
#wParam //Must be zero.
#pInfo //Pointer to an LVHITTESTINFO structure.

# typedef struct _LVHITTESTINFO {
#    POINT pt;
#    UINT flags;
#    int iItem;
#    int iSubItem;
#} LVHITTESTINFO, *LPLVHITTESTINFO;

#typedef struct tagPOINT {
#  LONG x;
#  LONG y;
#} POINT, *PPOINT;
#########################################

:Table1CLICK
  %X = @MOUSEPOS(X)
  %Y = @MOUSEPOS(Y)
  %%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
#The problem is here;  I need to put %%point in %%LVHITTESTINFO
  %%LVHITTESTINFO = %%Point@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0)
  %%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,%%LVHITTESTINFO)
  info %%LVM_SUBITEMHITTEST

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Apr 04, 2007 1:16 am    Post subject: Reply with quote

Thanks Draogonshere,

Unfortunately that didn't work either Sad

Interestingly, (INT) isn't in the VDS helpfile for @BINARY() but, it didn't error either so I guess it must be valid.

I think somehow that %%POINT needs to identified as a single variable because isn't this:

Code:

%%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
  %%LVHITTESTINFO = %%Point@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0)


The same as this:

Code:

  %%LVHITTESTINFO = @BINARY(INT,%X)@BINARY(INT,%Y)@BINARY(DWORD,0)@BINARY(INT,0)@BINARY(INT,0)


Wouldn't the LVHITTESTINFO stuct be treating "@BINARY(INT,%Y)" as one of the flags instead of being part of the Point struct?

Or is (INT) 2 bytes and LVHITTESTINFO treats the first 4 bytes as the Point structure?

Have I confused myself enough Confused
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group