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 


@CLICK(B) functionality for tables

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Mon Jul 21, 2003 7:04 pm    Post subject: @CLICK(B) functionality for tables Reply with quote

I have been using the EXTLIST element from the VDSLISTS DLL for several of my programs and was hoping to be able to convert my code to use the table element in VDS 5. However, come to find out that you can't tell what button was clicked when using the CLICK style for a table. Makes a right click context menu pretty tough to implement. Confused
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Jul 21, 2003 7:07 pm    Post subject: Reply with quote

In the TABLE element I'd also like to see a feature where you can find
what the current image for the current item is. This was possible with
the VDSLISTS and it would be nice to see in VDS 5 too. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Jul 22, 2003 9:15 am    Post subject: Reply with quote

Well, now we are 'cracking down' (just joking Wink ) the TABLE element, I wish to see a new '@item()' feature, which can get the value of just one column.

Code:
  DIALOG CREATE,Nieuw Dialoog,-1,0,240,160
  DIALOG ADD,TABLE,TABLE1,5,15,180,145,Column 1[80]|Column 2[80]|Column 3[80]
  DIALOG SHOW

list add,table1,hello@tab()hi@tab()hey
list add,table1,hi@tab()hey@tab()hello
list add,table1,hey@tab()hello@tab()hi

info @item(table1,2,Column 2)


In this case the function @item(table1,2,Column 2) should return hey. I could write my own function for it, but I think this should be included within VDS, if possible. Rolling Eyes

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Jul 23, 2003 9:14 am    Post subject: Reply with quote

i agree skit...i too would like to see the ability to obtain the contents of a cell by mentioning row and column

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 23, 2003 9:21 am    Post subject: Reply with quote

Like I said, I could make a script for that, but I also think it's something which must be included inside VDS itself...
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Døc
Newbie


Joined: 12 Sep 2003
Posts: 9
Location: Charleston, SC, USA

PostPosted: Sat Sep 13, 2003 1:49 am    Post subject: More TABLE Wishes Reply with quote

Tables rule, and there are so many additional possibilities...

It would be cool to be apply STYLES to certain rows in a table so you could highlight (change the background color) or bold the text.

A function to return the current column sort option would also be good. Then you could save and reapply sorting preferences.

How about adding those little up/down arrows to the column headings that show which on which column the data is sorted and in which direction.
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Sep 13, 2003 7:08 am    Post subject: Reply with quote

I think the VDS table dialog element is a Listview control with the SysHeader control sitting on top of it. I don't have much experience using Listview controls but I don't think that is behaves like a ordinary text grid (table) containing columns of lists. e.g You may not be able to select a subitem and manipulate it directly.

The control contains items arranged in the form of rows and not columns e.g:
Code:
1 a b c d e f
2 s d f e r y
where 1 is 0 th item and a b c d e f are it's subitems.
similarly:
2 is 1st item and s d f e r y are it's subitems.

So getting the contents of a "column" directly as skit said I fear may not be possible. You may have to loop through the subitems of each item and get it.

In a list view control you can use messages to control:
Code:
LVM_GETITEM/LVM_SETITEM
get/set a given item and subitem(text bitmap etc etc) using @sendmsg()
LVM_FINDITEM
find a given item in the Listview control.
LVM_DELETEITEM
Removes an item from a list view control.
LVM_GETBKCOLOR
Retrieves the background color of a list view control.
LVM_GETITEMCOUNT
Retrieves the number of items in a list view control.
LVM_GETNEXTITEM
Searches for a list view item that has the specified properties and bears the specified relationship to a specified item.
LVM_SETBKCOLOR
Sets the background color of a list view control.
LVM_SETBKIMAGE
Sets the background image in a list view control
LVM_GETCOLUMN
Retrieves the attributes of a list view control's column.
LVM_GETSELECTIONMARK
Retrieves the selection mark from a list view control.

and many more...

You can use imagelist and bitmaps to each item as I did in TAB element and also a background bitmap for logo etc.
Although all the above is possible using API you should note that it makes the script complex and this is again one of the relatively difficult API areas.

As such it looks like TABLE dialog element has just been implemented (beta) and most of the functions which need API now may be implemented in VDS itself. May be developers/CR have to say whether it is planned for VDS 5.x or preserved for VDS 6.x.

In nutshell I don't think TABLE dialog element is as easy to use though it gives your app a very proffesional look. Even many VB users say so - it seems documentation has errors/is improper etc..
My knowledge about list view control is limited. So if I am wrong correct me Smile

EDIT: Embarassed Many of the things I mentioned above are already documented in the popup help of VDS help file. I don't know why it is so obscure Confused Searching msdn is easier Wink I think the help file should really be updated Crying or Very sad

IMHO I think a text grid type control is the one which is much more required for an average/most VDS user and that SHOULD have been provided before a complex control like a list view control. Confused [/b]

_________________
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
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Sep 13, 2003 1:18 pm    Post subject: Reply with quote

I think the table element is a good element. That is a standard element
used in a lot of programs. A grid element is different. If you need a grid
element you can also use VDSOBJ02.DLL

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Sat Sep 13, 2003 2:29 pm    Post subject: Reply with quote

Yes the vdsobj extension uses a customized StringGrid, which allows multiple lines of text/wordwrapping and many other features. It definately allows you to seek to a certain cell and grab/modify data as well.
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Sep 13, 2003 3:18 pm    Post subject: Reply with quote

I never said TABLE is a bad element(gives highly proffesional look to your app) but more advanced one and grid was my feature request. I know that VDSOBJ02.DLL has grid element. I don't need it currently as I am not authoring any commercial app to get money. Smile

Hortalonus wrote:
Makes a right click context menu pretty tough to implement.


I don't know if U have already implemented it. But here is a workaround I found. I hope it works.
I think VDS has a bug that if an already selected item is right clicked it will not fire any event. I tried to hook the messages but even that does not work. So the below code is based on GetAsyncKeyState API and handing all the right click events by ourself as far as possible.
The code may seem complicate at first but if U go through it agin U can follow.

If Rt click bug ? is fixed then you can allow selction of the items to remainmaking the code simpler. Easiest would be to have @CLICK(B) as U said.
Hope this helps Smile

Code:
  DIALOG CREATE,Table Test,-1,0,312,241,CLASS TBLE,CLICK
  REM Add click style to the dialog to capture all Right clicks on the dialog
  DIALOG ADD,TABLE,TABLE1,19,22,251,171,Column 1[80]|Column 2[80]|Column 3[80],,COLUMNSORT,CLICK,SORTED
  list add,table1,hello@tab()hi@tab()hey
list add,table1,hi@tab()hey@tab()hello
list add,table1,hey@tab()hello@tab()hai
  DIALOG ADD,TEXT,TEXT1,209,122,,,
  DIALOG SHOW
  %A = @sendmsg(@winexists(~TABLE1),$0201,0,0)
LOADLIB USER32

:EVLOOP
WAIT EVENT,0.06
GOTO @EVENT()

:TIMER
 IF @EQUAL(@CLICK(B),RIGHT)
 %A = @LIB(USER32,GetAsyncKeyState,INT:,02)
 END
GOTO EVLOOP

:CLICK
REM Destroy effects of right click on the dialog
IF @EQUAL(@CLICK(B),RIGHT)
%A = @LIB(USER32,GetAsyncKeyState,INT:,02)
END
GOTO EVLOOP

:TABLE1CLICK
REM STORE THE SELECTED/CLICKED ITEM as we are going to erase the selection.
REM (You can use @INDEX() and store Item nuber also)
%%INDEX = @ITEM(TABLE1)
%A = @LIB(USER32,GetAsyncKeyState,INT:,02)
REM IF it is Right mouse button that was clicked then
IF @EQUAL(%A,1)
  REM IF %%INDEX is valid then a table Item was clicked
  REM ELSE An empty space in the table/subitem was clicked.
   IF %%INDEX
    REM Destroy selection to prevent problems for next selection
    REM A bug ?? in VDS prevents an event being fired if an already
    REM selected item is right clicked.
    %A = @sendmsg(@winexists(~TABLE1),$0201,0,0)
    REM SHOW the POPUP Menu
    DIALOG POPUP,Open|More INFO|-|About
    END
ELSE
REM It was not right mouse button that was clicked.
REM So it is left what else??
  REM IF %%INDEX is valid then a table Item was clicked
  REM ELSE An empty space in the table/subitem was clicked.
  IF %%INDEX
    REM Just to show U that I got the value of the %%INDEX
    DIALOG SET,TEXT1,%%INDEX
    %A = @sendmsg(@winexists(~TABLE1),$0201,0,0)
  END
END
REM IF %%INDEX is valid hand it over to %%INDEX1 for safe keeping
REM for the next cycle is going to empty %%INDEX before it reaches the
REM popupmenu event.
IF %%INDEX
%%INDEX1 = %%INDEX
END
REM RESET %%INDEX
%%INDEX = ""
GOTO EVLOOP

:OPENMENU
:More INFOMENU
:ABOUTMENU
INFO %%INDEX1!
GOTO EVLOOP

:CLOSE
FREELIB USER32
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
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List All times are GMT
Page 1 of 1

 
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