![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Refresh dialog box elements Topic Summary: Update label and list Created On: 12-Dec-2006 17:35 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Figured it out for what I'm doing: | |
![]() |
|
I'm trying to create a dialog box that tells a user how many columns are in the current view and how many they can add (to the max of 32 columns in a view). The script also adds columns so if theres 31 columns and they want to add 2, they need to remove one which it lets them do.
The part I'm not sure on is if they select a column and I delete it, how do I refresh the dialog box to reflect the new number of columns in the view and refresh the list of columns so that the column they removed is no longer there. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Figured it out for what I'm doing:
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com Edited: 21-Dec-2006 at 14:09 by David Pechacek |
|
![]() |
|
![]() |
|
Hi David,
I am working on a similar code, but the list DBE consists an array of strings, not integers. The 'delete' function is not working with a string arg - the selected string is not getting deleted from the list. How do I go about it? Is there any way to 'refresh' the contents of the listDBE which displays the values of a string array? Any suggestions will be appreciated. |
|
![]() |
|
![]() |
|
My list was also a list of strings. The column headings for every column in the current view to be exact. What (part of) my program did was let a user select a column from the current view and delete it. The code I posted took that selection, deleted the column, removed it from the list, and updated the window the module was in.
The "int selectedColumn" variable is the selection of what column the user chose. So if you have 5 columns in the list and the user selects the 3rd one in the list (index 2 in the array since arrays start at 0), selectedColumn will be 2. Remember that the get() function regardless of the data in the array can return an integer OR a string(plus many other types). If you assign the result of get() to a string variable, the returned result will be the string of the selected item in the list. If you use it on an int variable, you get the position in the list(and also the array) of the selected item in the list. So, once you get which item in the list you want to delete, you use that for(selectedIndex; selectedIndex < maxIndex; selectedIndex++) loop to go through the list starting at the selected item and move each item below it in the list up one index(using the insert() command). The "else" condition moves each element in the array/list up one index. The main "if" condition is for the last item in the array/list that has already been copied to the previous index. You set it equal to "" in the array and then delete that item from the list. So basically you just need to change your variable that you're using to get the selected item in your list that you want to delete from a string to an integer. For a list of all the different types the get() function can return from a DBE look in the DXL Reference manual under Dialog boxes -> Common element operations -> get(element or option). Finally, I'm not sure but you might just be able to call delete() on the selected item in the list without reordering the list like I did in my loop using insert(). But I chose to keep my array and list indexes the same. If you don't care about the indexes being the same, just try deleting it from the list. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Thanks for the detailed explanations. The identification of the selected item in the list is a great help in the deletion of the item from the list. I worked on my code on the same lines and it works very well.
Thanks again |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Refresh dialog box elements
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.