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 Previous  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: Wed Apr 04, 2007 5:32 am    Post subject: Reply with quote

Ok ...for those who want to know what subItem was clicked in a Table Element this worked

Code:
# 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;

  %X = @diff(@mousepos(X),@winpos(~TABLE1,L))
  %Y = @diff(@mousepos(Y),@winpos(~TABLE1,T))
  %%Point = @BINARY(DWORD,%X)@BINARY(DWORD,%Y)
  %%Flags = 0
  %%LVHITTESTINFO = %%Point@BINARY(DWORD,%%Flags)@BINARY(DWORD,0)@BINARY(DWORD,0)
  %L = %%LVHITTESTINFO
  %%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,@addr("%L"))
  %%Item = @val(@substr(%L,13,16))
  %%subItem = @val(@substr(%L,17,20))
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: Wed Apr 04, 2007 3:13 pm    Post subject: Reply with quote

Hmmm very strange Question The only issue with using a DWORD value is the fact that you can have negative numbers in a point structure and there are no negative numbers in a DWORD value. You would have to get the complement of the DWORD value and place it in an INT.

I could not remember if @Binary() would accept INT as a variable type?

An INT and a DWORD are both 4 bytes so they can be interchanged but their numeric range is different from each other.


  • INT = −2147483648 to +2147483647
  • DWORD = 0 to +4294967295

_________________
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 5:01 pm    Post subject: Reply with quote

It seems what I was doing wrong origonally was I needed to send the address of %%LVHITTESTINFO instead of the variable itself.

Actually, using (INT) works too:

Code:

:Table1CLICK
  %X = @diff(@mousepos(X),@winpos(~TABLE1,L))
  %Y = @diff(@mousepos(Y),@winpos(~TABLE1,T))
  %%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
  %%Flags = 0
  %%LVHITTESTINFO = %%Point@BINARY(DWORD,%%Flags)@BINARY(INT,0)@BINARY(INT,0)
  %L = %%LVHITTESTINFO
  %%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,@addr("%L"))
  %%Item = @val(@substr(%L,13,16))
  %%subItem = @val(@substr(%L,17,20))

#This should give you the bounding rectangle coordinates for SubItems
#but "Left" and "Right" are unreliable for some reason.

#Also if you are using LVS_EX_FULLROWSELECT the result will be for the whole row.

  %r = @BINARY(INT,%%subItem)@BINARY(INT,0)@BINARY(INT,0)@BINARY(INT,0)
  %%GetSubItemRec = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,56),%%Item,@addr("%r"))
  Info Left = @val(@substr(%r,1,4))@cr()Top = @val(@substr(%r,5,8))@cr()Right = @val(@substr(%r,9,12))@cr()Bottom = @val(@substr(%r,13,16))
 


BTW - for those who haven't figured it out yet the names "Item" and "SubItem" can also be referenced as "Row" and "Column" respectfully and "Item" is also the same as the List Index.


Last edited by Aslan on Wed Apr 04, 2007 6:53 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


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

PostPosted: Wed Apr 04, 2007 5:12 pm    Post subject: Reply with quote

So, is a DSU comming soon? Smile
_________________
Chris
Http://vdsfreak.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: Wed Apr 04, 2007 5:35 pm    Post subject: Reply with quote

Liquidcode,

I think I'm going to try to get one more feature done then stop and prepare a release.

Sorry, It's taking longer than I had planned Sad But I just keep finding more neet stuff to add to it...hehe Laughing
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: Wed Apr 04, 2007 6:02 pm    Post subject: Reply with quote

Aslan wrote:
Liquidcode,

I think I'm going to try to get one more feature done then stop and prepare a release.

Sorry, It's taking longer than I had planned But I just keep finding more neet stuff to add to it...hehe


Yeah that is the problem I had with GadgetX.dll Wink

Quote:
Golden rule of Win32 API programming if it is not specified always pass the Address of a structure or any variable type that is larger than 4 bytes
.
_________________
Home of

Give VDS a new purpose!


Last edited by vdsalchemist on Wed Apr 04, 2007 6:20 pm; edited 2 times in total
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: Wed Apr 04, 2007 6:05 pm    Post subject: Reply with quote

Aslan,
You forgot a comma in the first @Binary(INT) of the variable %r

Code:

:Table1CLICK
  %X = @diff(@mousepos(X),@winpos(~TABLE1,L))
  %Y = @diff(@mousepos(Y),@winpos(~TABLE1,T))
  %%Point = @BINARY(INT,%X)@BINARY(INT,%Y)
  %%Flags = 0
  %%LVHITTESTINFO = %%Point@BINARY(DWORD,%%Flags)@BINARY(INT,0)@BINARY(INT,0)
  %L = %%LVHITTESTINFO
  %%LVM_SUBITEMHITTEST = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,57),0,@addr("%L"))
  %%Item = @val(@substr(%L,13,16))
  %%subItem = @val(@substr(%L,17,20))

#This should give you the bounding rectangle coordinates but "Left" and "Right" are unreliable for some reason.
#Also if you are using LVS_EX_FULLROWSELECT the result will be for the whole row.

 %r = @BINARY(INT,%%subItem)@BINARY(INT,0)@BINARY(INT,0)@BINARY(INT,0)
  %%GetSubItemRec = @SENDMSG(@WINEXISTS(~Table1),@SUM($1000,56),%%Item,@addr("%r"))
  Info Left = @val(@substr(%r,1,4))@cr()Top = @val(@substr(%r,5,8))@cr()Right = @val(@substr(%r,9,12))@cr()Bottom = @val(@substr(%r,13,16))
 

_________________
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
LiquidCode
Moderator Team


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

PostPosted: Thu Apr 05, 2007 3:44 pm    Post subject: Reply with quote

Ok. me waits patiently... Shocked Rolling Eyes Wink Laughing
_________________
Chris
Http://vdsfreak.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: Thu Apr 05, 2007 11:16 pm    Post subject: Reply with quote

I am trying to get Scroll Bar positions in a Table element.

The following does not seem to work.

I'm hoping, it's just that I did something wrong and not that it just won't work with a VDS Table (ListView) element.

Any suggestions please....


Code:

:GetScrollPos

# Get Scroll Position from a ListView control **

# int GetScrollPos(          HWND hWnd,
#     int nBar
# );

# nBar values (Can only use one)

# SB_HORZ = 0
# SB_VERT = 1

 %1 = H
 
   LOADLIB user32.dll
   If @equal(%1,H)
    %%Result = @lib(user32.dll,GetScrollPos,INT:,@winexists(~TABLE1),INT:0)
   end
   if @equal(%1,V)
    %%Result = @lib(user32.dll,GetScrollPos,INT:,@winexists(~TABLE1),INT:1)
   end
   FREELIB user32.dll
 INFO %%Result
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: Fri Apr 06, 2007 1:51 am    Post subject: Reply with quote

Aslan,
You have to take the '%' character off of the return of the @winexist() function.

Code:

:GetScrollPos

# Get Scroll Position from a ListView control **

# int GetScrollPos(          HWND hWnd,
#     int nBar
# );

# nBar values (Can only use one)

# SB_HORZ = 0
# SB_VERT = 1

 %1 = H
 
   LOADLIB user32.dll
   %%hwnd = @strdel(@winexists(~TABLE1),1)
   If @equal(%1,H)
    %%Result = @lib(user32.dll,GetScrollPos,INT:,DWORD:%%hwnd,INT:0)
   end
   if @equal(%1,V)
    %%Result = @lib(user32.dll,GetScrollPos,INT:,DWORD:%%hwnd,INT:1)
   end
   FREELIB user32.dll
 INFO %%Result

_________________
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: Fri Apr 06, 2007 6:25 am    Post subject: Reply with quote

Well that explains it Embarassed

It works now Very Happy

Thanks Dragonshere
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: Fri Apr 06, 2007 5:19 pm    Post subject: Reply with quote

Unfortunately, the above code only works after the scroll button has been released. Same thing using a Timer loop with "GetScrollInfo" with 'SIF_TRACKPOS' which according to M$ should give me the position even while being dragged.

Maybe there is a way to temporarily handle the following messages.

WM_HSCROLL = $114
WM_VSCROLL = $115

The problem is that I get no event responce whatsoever from the following.

OPTION MSGEVENT,$114,WM_HSCROLL
OPTION MSGEVENT,$115,WM_VSCROLL

-or-

OPTION MSGEVENT,$114,WM_HSCROLL,HANDLED
OPTION MSGEVENT,$115,WM_VSCROLL,HANDLED

Any ideas?
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: Fri Apr 06, 2007 5:31 pm    Post subject: Reply with quote

Ok, I appears that while depressing a scrollbar in VDS, the script will pause until the scrollbar is released. Evil or Very Mad

Interestingly though, VDS doesn't pause while depressing a column header or any button on the dialog for that matter.
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: Fri Apr 06, 2007 5:39 pm    Post subject: Reply with quote

What exactly are you wanting to do Aslan? I don't understand the need to mess with the scrollbars on the Table element?
_________________
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: Fri Apr 06, 2007 5:50 pm    Post subject: Reply with quote

If I can detect scroll movement, I can manage objects placed on top of the Table Element.

An example would be to ability to create edit boxes for subItems.

I can already create this functionallity but the problem is that I can't reposition it as the scroll bar is moved. Basically the Table data scrolls beneath the edit element.
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 Previous  1, 2, 3  Next
Page 2 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