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 


TABLE element problem
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Oct 23, 2003 6:06 pm    Post subject: TABLE element problem Reply with quote

I have a program that uses the table element from the VDSList.DLL. It works fine. It displays a list of customers and allows them to be sorted by different columns.

As the list has become larger (now it is at almost 900 names), it takes longer than I would like to resort the list (a few seconds).

I wanted to test the native TABLE element that is in VDS5, but I keep getting strange errors.

The problem occurs when I try to add a row to the table using the LIST ADD command. (LIST ADD, mytable, sometext|somemore)

I get an error in French:

Violation d'acces a l'adresse 0490B844. Lecture de l'addresse FFFFFFFF.

The first hex value varies each time.

I can display a table with no info just fine. Just a problem when I add rows.

My questions:

1.) Does anyone know if the VDS 5 table will be faster to do a Columnsort?

2.) Does anyone have any ideas what could be causing this strange error?

Thanks,

Joe

_________________
Joe Floyd
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Thu Oct 23, 2003 6:13 pm    Post subject: Re: TABLE element problem Reply with quote

jwfv wrote:
The problem occurs when I try to add a row to the table using the LIST ADD command. (LIST ADD, mytable, sometext|somemore)


I thought the table element used @tab() to seperate fields and the vertical bar to add a resource Wink

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Oct 23, 2003 7:09 pm    Post subject: Reply with quote

Yes, you are right - I don't know why I put that in my example.

But it was not in my program. In my program I just tried to add one column, no @tab() or |.

_________________
Joe Floyd
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Oct 24, 2003 12:37 pm    Post subject: Reply with quote

Yeah it is just like Vic said.
I haven't tried large number of items though it appears faster
than VDS list element as most of the things are managed by
the system itself.


Code:
#-----------------------------------------------------------------------------#
#                                                                             #
# Discalimer - Use at your own risk                                           #
#                                                                             #
# Author:  CodeScript                                                         #
#                                                                             #
# Copyright: © 2003 CodeScript Software                                       #
#                                                                             #
#-----------------------------------------------------------------------------#
  DIALOG CREATE,Table API Test,-1,0,328,213,CLASS TBLE
  DIALOG ADD,TABLE,TABLE1,20,37,253,155,Column 0[80]|Column 1[80]|Column 2[80],,,COLUMNSORT
  DIALOG ADD,BUTTON,BUTTON1,180,102,107,29,Add Items,,DEFAULT
  DIALOG SHOW
  REM API For full Row Select and grid
  %X = @SENDMSG(@WINEXISTS(~TABLE1),@SUM($1000,54),0,@SUM($20,$1))

 
:EVLOOP
WAIT EVENT
GOTO @EVENT()

:BUTTON1BUTTON
  list add,table1,hello@tab()hi@tab()hey! This is very long text
  list add,table1,hi@tab()hey@tab()hello! Another very long text
  list add,table1,hey@tab()hello@tab()hai! Third very long text
  GOTO EVLOOP
 
:CLOSE
EXIT

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Oct 24, 2003 3:43 pm    Post subject: Reply with quote

Thanks for the example - it runs well. I even changed it to put in 1800 items or so and it is very fast to resort them. I'll study it to see what I may have wrong in my code.

I wasn't aware of the API call that would allow you to highlight the entire row - is there a message in the forum that lists the API calls that can be used with TABLE elements?

I'll do a search ...

_________________
Joe Floyd
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Oct 24, 2003 3:55 pm    Post subject: Reply with quote

CodeScript I noticed you are using @sum, why not just use the values instead? Cuts down on VDS having to interpret and process the sum function>

%X = @SENDMSG(@WINEXISTS(~TABLE1),4150,0,33)
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Oct 24, 2003 4:23 pm    Post subject: Reply with quote

Btw heres a whole list of listview message id's that can be used with the api, I'll try to add them shortly into the API reference guide with examples.


LVM_ARRANGE = 4118
LVM_CREATEDRAGIMAGE = 4129
LVM_DELETEALLITEMS = 4105
LVM_DELETECOLUMN = 4124
LVM_DELETEITEM = 4104
LVM_EDITLABEL = 4119
LVM_ENSUREVISIBLE = 4115
LVM_FINDITEM = 4109
LVM_GETBKCOLOR = 4096
LVM_GETCALLBACKMASK = 4106
LVM_GETCOLUMN = 4121
LVM_GETCOLUMNWIDTH = 4125
LVM_GETCOUNTPERPAGE = 4136
LVM_GETEDITCONTROL = 4120
LVM_GETIMAGELIST = 4098
LVM_GETISEARCHSTRING = 4148
LVM_GETITEM = 4101
LVM_GETITEMCOUNT = 4100
LVM_GETITEMPOSITION = 4112
LVM_GETITEMRECT = 4110
LVM_GETITEMSPACING = 4147
LVM_GETITEMSTATE = 4140
LVM_GETITEMTEXT = 4141
LVM_GETNEXTITEM = 4108
LVM_GETORIGIN = 4137
LVM_GETSELECTEDCOUNT = 4146
LVM_GETSTRINGWIDTH = 4113
LVM_GETTEXTBKCOLOR = 4133
LVM_GETTEXTCOLOR = 4131
LVM_GETTOPINDEX = 4135
LVM_GETVIEWRECT = 4130
LVM_HITTEXT = 4114
LVM_INSERTCOLUMN = 4123
LVM_INSERTITEM = 4103
LVM_REDRAWITEMS = 4117
LVM_SCROLL = 4116
LVM_SETBKCOLOR = 4097
LVM_SETCALLBACKMASK = 4107
LVM_SETCOLUMN = 4122
LVM_SETCOLUMNWIDTH = 4126
LVM_SETIMAGELIST = 4099
LVM_SETITEM = 4102
LVM_SETITEMCOUNT = 4143
LVM_SETITEMPOSITION = 4111
LVM_SETITEMPOSITION32 = 4145
LVM_SETITEMSTATE = 4139
LVM_SETITEMTEXT = 4142
LVM_SETTEXTBKCOLOR = 4134
LVM_SETTEXTCOLOR = 4132
LVM_SORTITEMS = 4144
LVM_UPDATE = 4138
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Oct 24, 2003 5:13 pm    Post subject: Reply with quote

PGWARE wrote:
CodeScript I noticed you are using @sum, why not just use the values instead?

Yes Prakash it does cut down execution time a lttle bit - that may be negligible.
I used that way mainly becuse one can always referback what he had used by using that style (In C, VB etc also that is a standard practice I think). Ofcourse comments can be used to the same effect.
Hi jwfv
VDS table is a ListView element but becuse VDS handles it it in some ways may be all of them don't work as documented. I had put up an example - Scripts+DSU+colorful Helpfile documentation of all the API I could get to work on it. I know it needs some corrections and additions - Image list with Explorer style large Icons etc which I may plan later but most of the things workas far as I remember. It's more than a month on the main site I think Smile
http://www.vdsworld.com/index.php?page=download&fileid=341
Enjoy

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Oct 24, 2003 5:31 pm    Post subject: Reply with quote

I found my problem!

I was switching back and forth between using the EXTLIST commands in VDSLISTS.DLL and the VDS5 TABLE element I was trying to move to.

I REMmed out all the EXTLIST commands except EXTLIST WINDOW (I didn't think it would affect anything.) Well, it does affect things when you attempt to add lines to a table element.


Thanks - I just downloaded the Table Control API and will check it out. I knew I had seen it somewhere, but couldn't remember where. Thanks for the help.

_________________
Joe Floyd
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Oct 24, 2003 5:39 pm    Post subject: Reply with quote

Very nice example CodeScript, I didn't notice that example and api help file before ;(

Here are some great api constants -

http://docs.eiffel.com/libraries/wel/reference/consts/


There are tons of messages here with appropriate message id's. I'm taking a look at the http://docs.eiffel.com/libraries/wel/reference/consts/wel_tbm_constants.html - Trackbar messages and will include these as well into the api reference.
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Oct 24, 2003 6:04 pm    Post subject: Reply with quote

Hi Prakash
I will take a look at those.
BTW if anyone wants I had put up collection of more than 50,000 (I think around 54 thousand) API constants in VDS syntax in a searchable form.
There are some minor corrections/a few more additions needed but it is sufficent for most API work.
http://www.vdsworld.com/index.php?page=download&fileid=332
Needs VDS 5 Runtime if VDS 5 is not installed on the system:
http://codescript.vdsworld.com/VDS5src/vdsrun50.dll

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Oct 24, 2003 6:13 pm    Post subject: Reply with quote

It seems the message LVM_SETEXTENDEDLISTVIEWSTYLE you found is quite nice, it allows multiple styles to be attributed to the list view, for instance -

%X = @SENDMSG(@WINEXISTS(~TABLE1),@SUM($1000,54),0,61)

Causes the listview to have a checkbox infront of each item, causes hottracking, and the ability to move columns. I kept changing the last digit from (0 - 61) to get different styles, it seems that the last digit can keep going up with many different styles.


Last edited by PGWARE on Fri Oct 24, 2003 6:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Oct 24, 2003 6:21 pm    Post subject: Reply with quote

Is there a way to go to AND show a particular row in a table?

For instance, I have a search button on the dialog. It allows the user to type in a name to search for, and then I use @match() to find that value in the TABLE. (For large tables this is easier than scrolling through the names.)

It works fine in my program except that it doesn't move the table list to display the new selection. If I scroll down to it, it is highlighted, but the list doesn't move to show it.

_________________
Joe Floyd
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Oct 24, 2003 6:35 pm    Post subject: Reply with quote

PGWARE wrote:
.it seems that the last digit can keep going up with many different styles.

Yes prakash the last digit represents the view style - Report view; small icons; list etc. Some like grid style cannot go with non report style. Other than that most of permuatation combiantions are possible to suit one's choice.
As for jwfv's question yes I had seen a message that does this - Select a Item and scroll into view. I have to check.
EDIT:
===
LVM_ENSUREVISIBLE
wParam = (WPARAM) (int) iItem;
lParam = (LPARAM) (BOOL) fPartialOk;

Code:
%X = @SENDMSG(@WINEXISTS(~<Nmae of tbale element>),@SUM($1000,19),<Item Index -zero based>,0)


Example:
Code:
%X = @SENDMSG(@WINEXISTS(~TABLE1),@SUM($1000,19),1,0)

Will see to it that second item is visible to user. It will make sure that the item is visible to the user even adding scrollbars if needed and one has not been set - but need not be the topmost item.

If U want it to be topmost item then U need to do what PGWARE said below.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension


Last edited by CodeScript on Fri Oct 24, 2003 7:08 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Oct 24, 2003 6:52 pm    Post subject: Reply with quote

JWFV try this :

Code:

  rem create a rect structure
  %A = @binary(dword,0)@binary(dword,0)@binary(dword,0)@binary(dword,0)
  rem use LVM_GETITEMRECT to get the height of each item, we do this because
  rem the font on some machines is different and the height of each item thus
  rem can be different
  %X = @sendmsg(@win(~TABLE1),4110,@diff(@count(table1),1),@addr("%A"))
  %%height = @diff(@val(@substr(%A,13,16)), @val(@substr(%A,5,Cool))
  rem now we select the item with LVM_SCROLL, first lets set the pointer at the top
  rem so its easier to calculate position of where to scroll to, we do this by grabbing
  rem the count of all items in the table, mutliply that by the height of each cell and
  rem making it a negative so it scrolls the table up towards the top
  %X = @sendmsg(@win(~TABLE1),4116, 0, -@fmul(%%height,@count(TABLE1)))
  rem now we do the actual selection, here it is selecting item 11 in the table
  %X = @sendmsg(@win(~TABLE1),4116, 0, @fmul(%%height, 11))


Unfortuantely there is no LVM_SETTOPINDEX Sad but for some reason MS decided to create a LVM_GETTOPINDEX. I had to get a rect structure and set the view by using the LVM_SCROLL.

Notice the remarks in the code, the last line basically sets the scroll caret into view, you just need to change the 11 to the index value you need to set into view.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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