Rows in an ArrayField

Hi Everybody,
How do one highlight a row or a particular cell in an
ArrayField, the row / cell which is being currently
pointed to?
Thanks in Advance
Muthu
Get Your Private, Free Email at http://www.hotmail.com

Hi Everybody,
How do one highlight a row or a particular cell in an
ArrayField, the row / cell which is being currently
pointed to?
Thanks in Advance
Muthu
Get Your Private, Free Email at http://www.hotmail.com

Similar Messages

  • Selecting Widgets in ArrayF

    TransCanada PipeLines P.O. Box 1000, Station
    M
    Calgary, Alberta, T2P
    4K5
    Telephone: (403)
    267-6100
    FAX: (403) 267-6444/5/6
    Corporate Head Office
    Reply: Selecting Widgets in ArrayField
    Hi,
    Is it possible to select (ie. have hilited) a row in an Array Field even though the column you click on has a state of Drag?
    Also, if I have an ArrayField consisting of DataFields and ToggleFields, is it possible to hide the toggle field widgets for those rows in the ArrayField that don't have corresponding rows in the array variable? I have an Array field that has 5 visible rows, but only two rows are actually in the array. The problem is that Forte displays the toggle fields for the last 3 rows even though there aren't any rows in the corresponding array variable.
    Thanks in advance for your help,
    Brendan Duddridge

    These widgets work best when you have a strong internet connection. You could try reloading the widgets by pressing Command-r.

  • Scrolling arrays

    I need to write a piece of code that loops through an array, selects the
    current row in an ArrayField and puts up a dialog box. Something like the
    following:
    for x in 1 to set.Items do
    arrayWidget.CurrentRow=x;
    // put up question dialog, if yes do some stuff
    end for;
    The problem I'm having is with the scrolling of the ArrayField. Lets say my
    ArrayField has 5 rows and my data set has 20 rows. When it gets to row 6 the
    ArrayWidget generates some (focus) events to scroll the array and bring the 6th
    row into view. The problem is these events are not processed until my code is
    done and control returns back to the event loop. The user sees the first 5
    dialog boxes along with their associated rows, but the remaining 15 dialog
    boxes are all displayed while row 5 is highlighted. As soon as my code finishes
    the system goes wild doing all the scrolling.
    Is there some way of forcing the window to process the pending events (the
    opposite of PurgeEvents)? I tried posting my own event to trigger the dialog
    but it seemed to get processed before the scroll events. Are there multiple
    queues for the window? Do the events have different priorites?
    For Express users, you can do the same thing with the
    ExpressClassWindow.ScrollToIndex() method. I also tried using
    arrayWidget.RequestFocus as the documentation notes that CurrentRow is read
    only but they appear to have work the same.
    Any help would be appreciated.

    The trick is to drive the process from the parent window's event loop
    instead of from a FOR loop. That way all of the window events will be
    handled promptly. You would need to define one or more custom events to
    control this process. I envision the parent window event loop would look
    something like this:
    when <updateButton>.click do
    <arrayWidget>.currentRow = 1;
    post self.updateCurrentRow;
    when self.updateCurrentRow do
    // display dialog to update current row here
    post self.updateNext;
    when self.updateNext do
    if <arrayWidget>.currentRow < set.items then
    <arrayWidget>.currentRow = <arrayWidget>.currentRow + 1;
    post self.updateCurrentRow;
    end if;
    Of course there are many variations of this scheme that will achieve the
    same result.
    Kevin Klein
    Millennium Partners, Inc.
    Milwaukee, Wisconsin, USA
    -----Original Message-----
    From: [email protected] <[email protected]>
    To: [email protected] <[email protected]>
    Date: Thursday, February 12, 1998 3:06 AM
    Subject: Scrolling arrays
    I need to write a piece of code that loops through an array, selects the
    current row in an ArrayField and puts up a dialog box. Something like the
    following:
    for x in 1 to set.Items do
    arrayWidget.CurrentRow=x;
    // put up question dialog, if yes do some stuff
    end for;
    The problem I'm having is with the scrolling of the ArrayField. Lets say my
    ArrayField has 5 rows and my data set has 20 rows. When it gets to row 6the
    ArrayWidget generates some (focus) events to scroll the array and bring the6th
    row into view. The problem is these events are not processed until my codeis
    done and control returns back to the event loop. The user sees the first 5
    dialog boxes along with their associated rows, but the remaining 15 dialog
    boxes are all displayed while row 5 is highlighted. As soon as my codefinishes
    the system goes wild doing all the scrolling.
    Is there some way of forcing the window to process the pending events (the
    opposite of PurgeEvents)? I tried posting my own event to trigger thedialog
    but it seemed to get processed before the scroll events. Are there multiple
    queues for the window? Do the events have different priorites?
    For Express users, you can do the same thing with the
    ExpressClassWindow.ScrollToIndex() method. I also tried using
    arrayWidget.RequestFocus as the documentation notes that CurrentRow is read
    only but they appear to have work the same.
    Any help would be appreciated.

  • RE: DropLists in ArrayFields - is it possible to have adifferent sele

    Richard;
    Here you go....
    newList : Array of ListElement = new;
    { add elements }
    row : Integer = { get your row };
    column : Integer = { get by name or just know the number }
    // poof! Watch that down cast!
    (DropList)(<arrayField>.BodyGrid.GetChildInCell(row,column)).SetElementList(
    newList);
    You can also change FieldWidget settings....
    <arrayField>.BodyGrid.GetChildInCell(row,column).FillColor =
    C_BLUE;
    My array field doesn't scroll (lucky me!). See if the AfterFieldScrolled
    event fires at the right time to recalculate the widget state. I haven't
    played with it and I'm far from a Forte GUI guru, but I suspect that you are
    altering the column template and the visible widget is separate from the
    data. So as you scroll, the data would scroll but the new settings stay
    put. That's not what I would want/need. The widget reflects something
    about the data. When the data scrolls, so should the presentation
    properties!
    What may be needed is to somehow derive the presentation state settings
    dynamically from the mapped data. So when the data scrolled, the dynamic
    settings change on the new presentation row.
    Let me know.....
    Scott Irwin
    -----Original Message-----
    From: Richard Finegan [SMTP:[email protected]]
    Sent: Monday, August 24, 1998 1:38 PM
    To: 'Forte Users Mailing List'
    Subject: DropLists in ArrayFields - is it possible to have a
    different selection list per row?
    I have a DropList in an ArrayField column. Is it possible to have a
    different list of selections for each DropList in a different row?
    (ex.
    DropList #1 in row #1 can choose from a/b/c, whereas a DropList #2
    in row
    #2 can choose only from d/e/f, etc.) Technote 4996 seems to imply
    that it
    isn't possible, and everything I've tried so far has failed as well.
    Any insight appreciated.
    Richard Finegan
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    One way to do this is to get at the specific dropList widget in the
    arrayField by calling the getChildInCell(Row,Column) method on
    <..theArrayField..>.BodyGrid. This widget can then be assigned any
    dropList you want. Depending on the uniqueness of the individual
    dropLists, each data row specific dropList can be coded as an attribute
    (array of ListElement) on the mapped class, which can then be assigned
    to the dropList widget.
    A code snippet to do this would be -
    method refreshArray
    begin
    for displayRow in 1 to <myArrayField>.VisibleRows do
    dataRow : integer = displayRow + <myArrayField>.TopRow - 1;
    myDropListWidget : dropList =
    dropList(<myArrayField>.BodyGrid.getChildInCell(displayRow,
    <..columnNumOfDropList..>));
    myDropListWidget.setElementList(myArrayField[dataRow].myElementList);
    end for;
    end method;
    This method has be called only when the user scrolls the arrayField, as
    in -
    when <myArrayField>.AfterFieldScrolled do
    refreshArray();
    Hope this helps.
    Prashant.
    From: Richard Finegan[SMTP:[email protected]]
    Reply To: Richard Finegan
    Sent: Monday, August 24, 1998 11:38 AM
    To: 'Forte Users Mailing List'
    Subject: DropLists in ArrayFields - is it possible to have a
    different selection list per row?
    I have a DropList in an ArrayField column. Is it possible to have a
    different list of selections for each DropList in a different row?
    (ex.
    DropList #1 in row #1 can choose from a/b/c, whereas a DropList #2 in
    row
    #2 can choose only from d/e/f, etc.) Technote 4996 seems to imply
    that it
    isn't possible, and everything I've tried so far has failed as well.
    Any insight appreciated.
    Richard Finegan
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Re: Sorting in ArrayField widget.

    Hi,
    If you need a little sample about sorting Arrays or Listviews you can find
    one on http://perso.club-internet.fr/dnguyen/
    It shows how to use a QuickSort generic class (the source code of that class
    is not delivered, but you can find a quicksort sample class at forte.com) :
    - Sub-class the class
    - Overwrite DoSortExpLow and DoSortExpSup
    - In your user class, call QuickSort(Self.SortArray, 1,
    Self.SortArray.Items, pcol, Self.SortListMode) where SortArray is the Array
    to sort, pCol is a parameter that defines the column and SortListMode
    defines if you want an ascending or descending sort.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Url : http://perso.club-internet.fr/dnguyen/
    David Foote a &eacute;crit:
    There is a more flexible solution with less code duplication that has
    worked well for us.
    Create a class SortService with a method with the following signature:
    Sort(list:Array of Object, stategy:ComparisonStrategy):Array of Object
    create a class called ComparisonStrategy with a method with the
    following signature:
    Compare(a:Object,b:Object):integer
    For each class that needs to be sorted, define a new
    ComparisonStrategy sub-class that overrides the Compare()
    method. Inside the overridden Compare() method, cast a and b to the
    correct class and compare them by whatever criteria is appropriate.
    If a>b return 1, if a=b return zero, if a<b return -1. Inside the
    SortService.Sort() method, call strategy.Compare(a=object1,b=object2)
    each time you need to compare two objects.
    This is quite similar to the C-library's implementation of the qsort
    function:
    void qsort( void *base, size_t num, size_t width, int (__cdecl
    compare )(const void elem1, const void *elem2 ) );
    compare( (void *) elem1, (void *) elem2 );
    It is also a good use of the Strategy design pattern. The one method,
    Sort(), will now sort any list of objects for which you pass in an
    appropriate ComparisonStrategy sub-class. The objects to be sorted do
    not have to implement any extra interface or inherit from any
    particular class. If you are interested and need more help I can
    probably lay my hands on some source.
    P.S. This sort should be applied to the data array not the
    arrayfield.
    David N. Foote
    ----Original Message Follows----
    What you need is a set of sort methods, one for each basic data type
    and a wrapper method which discovers the data type of the column to be
    sorted and calls the appropriate Sort method.
    Create a group of sort methods depending on the data type
    e.g..
    sortInt( p_Arr : Array of Object, Col : integer ),
    SortString( p_Arr : Array of Object, Col : integer ) ,
    SortYour4GLObject( p_Arr : Array of Object, Col : integer ) etc.
    Then create a wrapper method called Sort( p_Arr : Array of Object,
    Col :
    integer ).
    In this method, look at p_Arr[Col].ClassName to find out the datatype
    and appropriately call the method which sorts that data type
    i.e..,
    SortInt() if ClassName is qqsp_integer,
    SortString() if ClassName is qqsp_string
    SortYour4GLObject() if ClassName is Your4GLClass etc.
    In each of the sort method, implement the sort algorithm on the
    p_Arr[ Col ] values.
    Good luck,
    Ajith Kallambella. M
    Fort&eacute; Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Savory, Mark [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 9:54 AM
    To: 'Kapil Tyagi'; '[email protected]'
    Subject: RE: Sorting in ArrayField widget.
    Kapil,
    Since you can't inherit from Array, you can create a helper for
    sorting
    arrays in general. Some helper class would have a method called:
    SomeHelperClass.Sort(list: Array of SomeInterface, column : int):Array
    of
    SomeInterface. The SomeInterface interface would have a virtual
    method
    called:
    SomeInterface.GetColumn(col:int):DataValue. All your classes that
    would be
    in an array to sort would have to implement the SomeInterface
    interface.
    Implementing the GetColumn method would require that your class
    attributes
    inherit from DataValue(TextData, DoubleData, IntegerData, etc.) or the
    GetColumn method could do a conversion. The SomeHelperClass.Sort
    method
    could then sort the appropriate column of the array.
    Mark Savory
    GTE Gov. Sys.
    -----Original Message-----
    From: Kapil Tyagi [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 4:02 AM
    To: '[email protected]'
    Subject: Sorting in ArrayField widget.
    Hi,
    We are using ArrayField widget. Forte does not provide any in-built
    sorting
    facility
    in ArrayField as it does in ListView.
    Is there an easy way to do that?
    If we implement our own sorting algorithm then how do we make it
    generic
    method
    for different arrays.
    We can use GetChildInCell to fetch the values generically, but it
    works only
    for
    visible rows.
    Any pointers in this direction are appreciated.
    Kapil Tyagi
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    Get Free Email and Do More On The Web. Visit http://www.msn.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi,
    If you need a little sample about sorting Arrays or Listviews you can find
    one on http://perso.club-internet.fr/dnguyen/
    It shows how to use a QuickSort generic class (the source code of that class
    is not delivered, but you can find a quicksort sample class at forte.com) :
    - Sub-class the class
    - Overwrite DoSortExpLow and DoSortExpSup
    - In your user class, call QuickSort(Self.SortArray, 1,
    Self.SortArray.Items, pcol, Self.SortListMode) where SortArray is the Array
    to sort, pCol is a parameter that defines the column and SortListMode
    defines if you want an ascending or descending sort.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Url : http://perso.club-internet.fr/dnguyen/
    David Foote a &eacute;crit:
    There is a more flexible solution with less code duplication that has
    worked well for us.
    Create a class SortService with a method with the following signature:
    Sort(list:Array of Object, stategy:ComparisonStrategy):Array of Object
    create a class called ComparisonStrategy with a method with the
    following signature:
    Compare(a:Object,b:Object):integer
    For each class that needs to be sorted, define a new
    ComparisonStrategy sub-class that overrides the Compare()
    method. Inside the overridden Compare() method, cast a and b to the
    correct class and compare them by whatever criteria is appropriate.
    If a>b return 1, if a=b return zero, if a<b return -1. Inside the
    SortService.Sort() method, call strategy.Compare(a=object1,b=object2)
    each time you need to compare two objects.
    This is quite similar to the C-library's implementation of the qsort
    function:
    void qsort( void *base, size_t num, size_t width, int (__cdecl
    compare )(const void elem1, const void *elem2 ) );
    compare( (void *) elem1, (void *) elem2 );
    It is also a good use of the Strategy design pattern. The one method,
    Sort(), will now sort any list of objects for which you pass in an
    appropriate ComparisonStrategy sub-class. The objects to be sorted do
    not have to implement any extra interface or inherit from any
    particular class. If you are interested and need more help I can
    probably lay my hands on some source.
    P.S. This sort should be applied to the data array not the
    arrayfield.
    David N. Foote
    ----Original Message Follows----
    What you need is a set of sort methods, one for each basic data type
    and a wrapper method which discovers the data type of the column to be
    sorted and calls the appropriate Sort method.
    Create a group of sort methods depending on the data type
    e.g..
    sortInt( p_Arr : Array of Object, Col : integer ),
    SortString( p_Arr : Array of Object, Col : integer ) ,
    SortYour4GLObject( p_Arr : Array of Object, Col : integer ) etc.
    Then create a wrapper method called Sort( p_Arr : Array of Object,
    Col :
    integer ).
    In this method, look at p_Arr[Col].ClassName to find out the datatype
    and appropriately call the method which sorts that data type
    i.e..,
    SortInt() if ClassName is qqsp_integer,
    SortString() if ClassName is qqsp_string
    SortYour4GLObject() if ClassName is Your4GLClass etc.
    In each of the sort method, implement the sort algorithm on the
    p_Arr[ Col ] values.
    Good luck,
    Ajith Kallambella. M
    Fort&eacute; Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Savory, Mark [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 9:54 AM
    To: 'Kapil Tyagi'; '[email protected]'
    Subject: RE: Sorting in ArrayField widget.
    Kapil,
    Since you can't inherit from Array, you can create a helper for
    sorting
    arrays in general. Some helper class would have a method called:
    SomeHelperClass.Sort(list: Array of SomeInterface, column : int):Array
    of
    SomeInterface. The SomeInterface interface would have a virtual
    method
    called:
    SomeInterface.GetColumn(col:int):DataValue. All your classes that
    would be
    in an array to sort would have to implement the SomeInterface
    interface.
    Implementing the GetColumn method would require that your class
    attributes
    inherit from DataValue(TextData, DoubleData, IntegerData, etc.) or the
    GetColumn method could do a conversion. The SomeHelperClass.Sort
    method
    could then sort the appropriate column of the array.
    Mark Savory
    GTE Gov. Sys.
    -----Original Message-----
    From: Kapil Tyagi [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 4:02 AM
    To: '[email protected]'
    Subject: Sorting in ArrayField widget.
    Hi,
    We are using ArrayField widget. Forte does not provide any in-built
    sorting
    facility
    in ArrayField as it does in ListView.
    Is there an easy way to do that?
    If we implement our own sorting algorithm then how do we make it
    generic
    method
    for different arrays.
    We can use GetChildInCell to fetch the values generically, but it
    works only
    for
    visible rows.
    Any pointers in this direction are appreciated.
    Kapil Tyagi
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    Get Free Email and Do More On The Web. Visit http://www.msn.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • DropLists in ArrayFields - is it possible to have adifferent selection

    I have a DropList in an ArrayField column. Is it possible to have a
    different list of selections for each DropList in a different row? (ex.
    DropList #1 in row #1 can choose from a/b/c, whereas a DropList #2 in row
    #2 can choose only from d/e/f, etc.) Technote 4996 seems to imply that it
    isn't possible, and everything I've tried so far has failed as well.
    Any insight appreciated.
    Richard Finegan
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    One way to do this is to get at the specific dropList widget in the
    arrayField by calling the getChildInCell(Row,Column) method on
    <..theArrayField..>.BodyGrid. This widget can then be assigned any
    dropList you want. Depending on the uniqueness of the individual
    dropLists, each data row specific dropList can be coded as an attribute
    (array of ListElement) on the mapped class, which can then be assigned
    to the dropList widget.
    A code snippet to do this would be -
    method refreshArray
    begin
    for displayRow in 1 to <myArrayField>.VisibleRows do
    dataRow : integer = displayRow + <myArrayField>.TopRow - 1;
    myDropListWidget : dropList =
    dropList(<myArrayField>.BodyGrid.getChildInCell(displayRow,
    <..columnNumOfDropList..>));
    myDropListWidget.setElementList(myArrayField[dataRow].myElementList);
    end for;
    end method;
    This method has be called only when the user scrolls the arrayField, as
    in -
    when <myArrayField>.AfterFieldScrolled do
    refreshArray();
    Hope this helps.
    Prashant.
    From: Richard Finegan[SMTP:[email protected]]
    Reply To: Richard Finegan
    Sent: Monday, August 24, 1998 11:38 AM
    To: 'Forte Users Mailing List'
    Subject: DropLists in ArrayFields - is it possible to have a
    different selection list per row?
    I have a DropList in an ArrayField column. Is it possible to have a
    different list of selections for each DropList in a different row?
    (ex.
    DropList #1 in row #1 can choose from a/b/c, whereas a DropList #2 in
    row
    #2 can choose only from d/e/f, etc.) Technote 4996 seems to imply
    that it
    isn't possible, and everything I've tried so far has failed as well.
    Any insight appreciated.
    Richard Finegan
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Sorting in ArrayField widget.

    Hi,
    We are using ArrayField widget. Forte does not provide any in-built sorting facility
    in ArrayField as it does in ListView.
    Is there an easy way to do that?
    If we implement our own sorting algorithm then how do we make it generic method
    for different arrays.
    We can use GetChildInCell to fetch the values generically, but it works only for
    visible rows.
    Any pointers in this direction are appreciated.
    Kapil Tyagi
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi,
    I would be interested in how the objects are sorted i.e. on which attribute the objects will get sorted.
    On runtime only it will be known that on which attribute the objects is to be sorted. The problem is compounded further because the data type of attributes is also different.
    Thanks for all your replies. I have designed/written a generic reusable code for sorting in an ArrayField widget. On double clicking the column title the array gets sorted on the corresponding column.
    Thanks and regards
    Kapil Tyagi
    From: David Foote[SMTP:[email protected]]
    Reply To: David Foote
    Sent: Tuesday, April 13, 1999 12:55 PM
    To: [email protected]
    Subject: RE: Sorting in ArrayField widget.
    There is a more flexible solution with less code duplication that has
    worked well for us.
    Create a class SortService with a method with the following signature:
    Sort(list:Array of Object, stategy:ComparisonStrategy):Array of Object
    create a class called ComparisonStrategy with a method with the
    following signature:
    Compare(a:Object,b:Object):integer
    For each class that needs to be sorted, define a new
    ComparisonStrategy sub-class that overrides the Compare()
    method. Inside the overridden Compare() method, cast a and b to the
    correct class and compare them by whatever criteria is appropriate.
    If a>b return 1, if a=b return zero, if a<b return -1. Inside the
    SortService.Sort() method, call strategy.Compare(a=object1,b=object2)
    each time you need to compare two objects.
    This is quite similar to the C-library's implementation of the qsort
    function:
    void qsort( void *base, size_t num, size_t width, int (__cdecl
    compare )(const void elem1, const void *elem2 ) );
    compare( (void *) elem1, (void *) elem2 );
    It is also a good use of the Strategy design pattern. The one method,
    Sort(), will now sort any list of objects for which you pass in an
    appropriate ComparisonStrategy sub-class. The objects to be sorted do
    not have to implement any extra interface or inherit from any
    particular class. If you are interested and need more help I can
    probably lay my hands on some source.
    P.S. This sort should be applied to the data array not the
    arrayfield.
    David N. Foote
    ----Original Message Follows----
    What you need is a set of sort methods, one for each basic data type
    and a wrapper method which discovers the data type of the column to be
    sorted and calls the appropriate Sort method.
    Create a group of sort methods depending on the data type
    e.g..
    sortInt( p_Arr : Array of Object, Col : integer ),
    SortString( p_Arr : Array of Object, Col : integer ) ,
    SortYour4GLObject( p_Arr : Array of Object, Col : integer ) etc.
    Then create a wrapper method called Sort( p_Arr : Array of Object,
    Col :
    integer ).
    In this method, look at p_Arr[Col].ClassName to find out the datatype
    and appropriately call the method which sorts that data type
    i.e..,
    SortInt() if ClassName is qqsp_integer,
    SortString() if ClassName is qqsp_string
    SortYour4GLObject() if ClassName is Your4GLClass etc.
    In each of the sort method, implement the sort algorithm on the
    p_Arr[ Col ] values.
    Good luck,
    Ajith Kallambella. M
    Fort&eacute; Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Savory, Mark [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 9:54 AM
    To: 'Kapil Tyagi'; '[email protected]'
    Subject: RE: Sorting in ArrayField widget.
    Kapil,
    Since you can't inherit from Array, you can create a helper for
    sorting
    arrays in general. Some helper class would have a method called:
    SomeHelperClass.Sort(list: Array of SomeInterface, column : int):Array
    of
    SomeInterface. The SomeInterface interface would have a virtual
    method
    called:
    SomeInterface.GetColumn(col:int):DataValue. All your classes that
    would be
    in an array to sort would have to implement the SomeInterface
    interface.
    Implementing the GetColumn method would require that your class
    attributes
    inherit from DataValue(TextData, DoubleData, IntegerData, etc.) or the
    GetColumn method could do a conversion. The SomeHelperClass.Sort
    method
    could then sort the appropriate column of the array.
    Mark Savory
    GTE Gov. Sys.
    -----Original Message-----
    From: Kapil Tyagi [mailto:[email protected]]
    Sent: Thursday, March 11, 1999 4:02 AM
    To: '[email protected]'
    Subject: Sorting in ArrayField widget.
    Hi,
    We are using ArrayField widget. Forte does not provide any in-built
    sorting
    facility
    in ArrayField as it does in ListView.
    Is there an easy way to do that?
    If we implement our own sorting algorithm then how do we make it
    generic
    method
    for different arrays.
    We can use GetChildInCell to fetch the values generically, but it
    works only
    for
    visible rows.
    Any pointers in this direction are appreciated.
    Kapil Tyagi
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    Get Free Email and Do More On The Web. Visit http://www.msn.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • RE: A difficult problem using arrayfields.

    >
    The arrayfield widget has an attribute called bodygrid which is a
    compoundfield object containing the actual widgets, like the
    togglefield,
    in the visible rows of the array field.
    If you iterate through the children of the bodygrid and determine
    which child is in the right row and column for the cell you want,
    you can then change its state or other widget attributes.
    This technique is commonly used to highlight the selected row or cell
    in an array field.
    I'm aware of this technique. Our application uses highlightbars and this
    is exactly how we implemented them. However, when you code the following
    call:
    <arrayfield>.bodygrid.children[5].fillcolor = C_RED;
    you'll see the widget change color, but when you code
    <arrayfield>.bodygrid.children[5].state = FS_DISABLE;
    nothing happens. Somehow, forte won't allow you to change the state of a
    widget in this context. Is there a way around this?
    Pascal Rottier
    Origin Rotterdam
    Nederland

    >
    I ran in to the same problem a long time ago (Version 1-H)..
    My solution then was to trap for click events or other row-change events
    in the array field and set the state of the entire column (using the
    strange syntax they have for columns in array fields) to whatever state
    I wanted for the particular cell the user just went in to..
    To the user, it acted as if some cells were modifiable and some were
    not. Note that DISABLED doesn't allow click events at all, making it
    impossible to click on a different row which you could edit. I think I
    used "VIEW" state..
    Hope this helps.The user can click the togglefield without first entering the row. It's
    even possible that the arrayfield doesn't have the focus, when the user
    clicks the togglefield. In other words, with this technique you can
    disable the field AFTER it has been altered. Not before. The way I
    solved it now, is to trap the clickevent, check if it is legal for this
    row and if not, turn the field back to false. Now the user has a field
    that doesn't look disabled (since it isn't), but behaves like it. The
    only drawback is, that often you'll see the x apear for a microsecond
    before it disappears again.
    Pascal Rottier
    Origin Netherlands/Rotterdam

  • RE: Selective State change of ArrayField

    >
    [Pascal Rottier]
    Thanks for sending me the technote, but look at the part I cut
    out of
    this technote and placed at the bottom of this message. It kind
    of
    proves my point. You can change a single cell's color, but not
    it's
    state. Hence, you can't make a cell invisible while leaving the
    other ones visible, which was the problem presented in the first
    message of this thread.
    it does work and there is a forte technote with sample codeavailable
    on the
    forte web site
    At 04:35 PM 5/19/98 +0200, you wrote:
    This won't work, because Forte ignores it if you try to set the
    state
    of
    a widget that is
    part of the bodygrid of an arrayfield. You can change color this
    way,
    but you can't change widget state.
    [Pascal Rottier]
    You can use this example to manipulate the visual behavior of
    a cell in an
    arrayfield, ie. its appearance (color, bold, highlighting,
    etc.), but
    not its functional behavior such as cell state. If you want
    to change
    the cell's functional behavior, you must set it for the entire
    column
    via the template field.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Okay, lets put an end to all this confusion. There are two ways to get
    to a single cell in an arrayfield.
    1) <ArrayField>.BodyGrid.GetChildInCell(row,column)
    2) for aWgt in <ArrayField>.BodyGrid.Children do
    if aWgt.Row = row
    and aWgt.Column = column then
    -- This is the one.
    end if;
    end for;
    The first one is only available in Forte 3 (and higher). The second
    one will work in all versions of Forte (I've never used Forte 1, so
    maybe it won't work there).
    Once you have the right widget, you can treat it like any other
    widget. Change it's color, inputmask, sizepolicy, size, state, what-
    ever.
    However, if the widget you found came from the bodygrid of an
    arrayfield and you change the state of the widget, nothing happens.
    The widget will always have the same state as it's template field.
    If you want to change the state of a widget, you have to change
    the state of it's templatefield, which will cause all widgets in that
    column to change to a new state.
    That is my experience with Forte 2. Maybe in Forte 3 it does
    work. The sample code supplied by Forte clearly states it is
    not possible to change the state, but this code also states it
    is intended for Forte 2. The sampe code supplied by some-
    one who had no problem changing the state of a cell in an
    arrayfield also included the method GetChildInCell, which would
    suggest he uses Forte 3.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Selective State change of ArrayField Cell

    Hi guys,
    I have an ArrayField which has a cloumn as a ToggleField. My
    requirement is depending on some condition (Business Rule) make the
    ToggleField invisible for some rows while visible for others, so that
    they do not try to Toggle unwanted rows. The version we are using is
    20H2. Does any other version allow this. I know this doesn't. Also, is
    there any good workaround that anybody who faced with such a situation
    has tried. We have already implemented one workaround but was
    wondering if there is any other way?
    Any help would be Greatly appreaciated.
    Thank You All.
    Shrikant P. Iyengar
    Forte Systems Engineer
    International Business Corporation
    DO YOU YAHOO!?
    Get your free @yahoo.com address at http://mail.yahoo.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi guys,
    I have an ArrayField which has a cloumn as a ToggleField. My
    requirement is depending on some condition (Business Rule) make the
    ToggleField invisible for some rows while visible for others, so that
    they do not try to Toggle unwanted rows. The version we are using is
    20H2. Does any other version allow this. I know this doesn't. Also, is
    there any good workaround that anybody who faced with such a situation
    has tried. We have already implemented one workaround but was
    wondering if there is any other way?
    Any help would be Greatly appreaciated.
    Thank You All.
    Shrikant P. Iyengar
    Forte Systems Engineer
    International Business Corporation
    DO YOU YAHOO!?
    Get your free @yahoo.com address at http://mail.yahoo.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • A difficult problem using arrayfields.

    I wanted to build some functionality into a window that I've been unable
    to do. The window has een arrayfield that shows an array of objects. The
    array has a few collums, one of which is a togglefield that shows the
    value of a booleandata attribute on the object. However, for some
    objects, depending on the value of another attribute, this booleandata
    attribute is not allowed to be set to true. We wanted to have these
    toggelfields disabled.
    So, we have an array, with, on each row a few textdatas, integerdatas
    and a togglefield, which is sometimes UPDATE and sometimes DISABLE.
    Well, I wasn't able to pull this off.
    It doesn't seem to be possible to set the widgetstate for widgets in an
    array seperately for each row.
    Does anyone have any suggestions.
    Thanks,
    Pascal Rottier
    Origin Netherlands
    Rotterdam

    >
    I ran in to the same problem a long time ago (Version 1-H)..
    My solution then was to trap for click events or other row-change events
    in the array field and set the state of the entire column (using the
    strange syntax they have for columns in array fields) to whatever state
    I wanted for the particular cell the user just went in to..
    To the user, it acted as if some cells were modifiable and some were
    not. Note that DISABLED doesn't allow click events at all, making it
    impossible to click on a different row which you could edit. I think I
    used "VIEW" state..
    Hope this helps.The user can click the togglefield without first entering the row. It's
    even possible that the arrayfield doesn't have the focus, when the user
    clicks the togglefield. In other words, with this technique you can
    disable the field AFTER it has been altered. Not before. The way I
    solved it now, is to trap the clickevent, check if it is legal for this
    row and if not, turn the field back to false. Now the user has a field
    that doesn't look disabled (since it isn't), but behaves like it. The
    only drawback is, that often you'll see the x apear for a microsecond
    before it disappears again.
    Pascal Rottier
    Origin Netherlands/Rotterdam

  • Re: ArrayField FieldWidget.State

    Hello Joseph,
    you get old. You don't see additional lines of code which makes
    the whole ArrayField FS_UPDATE and FS_INACTIVE. After this lines the
    original state of every widget is overridden :-) .
    Sorry for this unnecessary questions and answers :-))))
    Joseph Mirwald
    At 12:31 31.07.98 +0200, you wrote:
    Hello forte-users,
    i have a problem using ArrayField and set the state of
    direct mapped FieldWidget's.
    Dependent on a flag in the array i would set the (e.g.) 6th field-state to
    FS_INACTIVE or FS_UPDATE. To do this with an normal DataType like
    DecimalNullable worked well. I use:
    specialField : FieldWidget;
    for row in 1 to ....
    specialField=af.BodyGrid.GetChildInCell(row=row,column=6); // Get the widget
    end for;
    and dependent on the flag I set the state:
    if flag[row] then
    specialField.State=FS_UPDATE;
    else
    specialField.State=FS_INACTIVE;
    end if;
    But now i need a virtual attribute of type integer instead of the
    DecimalNullable and i implement it well. But now the mechanism to set the
    usage-state does not work anymore.
    1.How do you implement ArrayField's with field-dependent state's ?
    I use also the same mechanism to set the NextTabField and PrevTabField
    property but if a widget is outside the visible grid there is no chance to do
    this.
    2. Have someone implement a special Prev-/NextTabField attribute
    written which is able to set the Prev-/NextTabField also outside the visible
    part of the ArrayField? (To slide within tool-code down and up does not
    help. The last setting on a slided AF is the general setting for the others.
    Maybe the MatrixField is the problem).

    Xavier,
    Create a method called GetWidgetState on your window which contains
    the following:
    GetWidgetState(w:fieldwidget):
    if w.state = FS_USAGESTATE then
    return w.GetStateForUsage(self.window.usage);
    else
    return w.state;
    end if;
    By default, a widget state equals FS_USAGESTATE(0) which is the
    state set in the window workshop for the particular window usage.
    Unless you specifically change the state, it will always be 0 and you
    have to fetch the actual state using GetStateForUsage on the widget.
    Hope this helps.
    Peter
    Hi every one
    I'm looking for something to check the current state of the fieldWidget.
    The State attribute (integer) determines how a widget reacts to user
    actions and how it is displayed. It's a virtual attribute. No problem to
    setting it with variable, but I don't find the way to test it like :
    myFieldWidget.State <> FS_INACTIVE
    (myFieldWidget.State & FS_INVISIBLE) <> 0
    but this doesn't work
    could you help me...?
    Thank
    Xavier Michel
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Free Email and Do More On The Web. Visit http://www.msn.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • RE: Dynamic ArrayField

    Hello Corinne,
    Did you try the AddColumn method on ArrayField. I think this work even if
    your ArrayField is brand new.
    And I do not think you have to create all these widgets that are
    'attributes' of the ArrayField. If you want a ScrollBar, there is a boolean
    called HasScrollBar...
    I hope this will help,
    Franck SAGE
    Datasign AG fur Informatik
    -----Message d'origine-----
    De: Corinne Barbat-F085785 [SMTP:[email protected]]
    Date: mardi 27 octobre 1998 15:08
    A: [email protected]
    Objet: Dynamic ArrayField
    Hi,
    I wanna create dynamic widgets.
    I can create simple widget, but I have problems to create dynamic
    ArrayField. (I don't wanna clone existing arrayfield, I wanna create
    a brand new one)
    Does someone have already created a dynamic ArrayField ?
    Should I create a ScrollBar, a BodyGrid and a TitleGridField to create
    Dynamic ArrayField (because when I create a dynamic ArrayField, this
    ArrayField doesn't have any ScrollBar, BodyGrid or TitleGridField) ?
    Can I do a "GroupInto ArrayField" for a DataField in ToolCode ?
    thank you for your help.
    Corinne Barbat
    Michelin/France
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Corinne ,
    You can add/delete vertical scroll bar to the array
    field at runtime
    by resetting <ArrayField>.HasScrollBar attribute.
    Similarly you can turn on and turn off the column
    titles by resetting
    <ArrayField>.HasColumnTitles attribute. Remember
    Setting an array
    field's HasColumnTitles attribute to FALSE sets its
    TitleGrid attribute to NIL.
    When you create an array field, it already has
    TitleGrid and BodyGrid.
    You do not explicitly create them. You can dynamically
    add fieldwidgets
    to the array field in a similar way you add widgets to
    a Grid field.
    First set the row and col attributes of the field
    widget and
    then assign FieldWidget.Parent = <ArrayField>.BodyGrid.
    Take a look at "Anatomy of an Array Field" and
    "Adding Cells to a Grid Field" online help topics for
    more info.
    Ajith Kallambella M.
    Fort&eacute; Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Corinne Barbat-F085785
    [SMTP:[email protected]]
    Sent: Tuesday, October 27, 1998 9:08 AM
    To: [email protected]
    Subject: Dynamic ArrayField
    Hi,
    I wanna create dynamic widgets.
    I can create simple widget, but I have problems to
    create dynamic
    ArrayField. (I don't wanna clone existing
    arrayfield, I wanna create
    a brand new one)
    Does someone have already created a dynamic
    ArrayField ?
    Should I create a ScrollBar, a BodyGrid and a
    TitleGridField to create
    Dynamic ArrayField (because when I create a
    dynamic ArrayField, this
    ArrayField doesn't have any ScrollBar, BodyGrid or
    TitleGridField) ?
    Can I do a "GroupInto ArrayField" for a DataField
    in ToolCode ?
    thank you for your help.
    Corinne Barbat
    Michelin/France
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • RE: Tabbing into ArrayField

    Hello Steve
    The way I use to tab into an ArrayField, is to define an arrayfield
    with at least one element (one row with or without data). Then in the
    Init method I assign the NextTabField and the PrevTabField attributes of
    the around widgets to the first ArrayField element, as this :
    <TextBox1>.NextTabField = <MyArray>.Children[1];
    <QuitBtn>.PrevTabField = <MyArray>.Children[1];
    And in the Display Method I register the BeforeFocusLoss on this widgets
    (<TextBox1> and <QuitBtn>) and ask for the reason value returned by the
    event, Example:
    When <TextBox1>.BeforeFocusLoss(evento = eventInfo, razon = reason) do
    if ( razon = FC_KEYNEXT ) then
    <MyArray>.CurrentRow = 1;
    <MyArray>.RequestFocus;
    end if;
    When <QuitBtn>.BeforeFocusLoss(evento = eventInfo, razon = reason) do
    if ( razon = FC_KEYPREV ) then
    <MyArray>.CurrentRow = 1;
    <MyArray>.RequestFocus;
    end if;
    I Hope this help you!!
    Regards
    Victor Navarro
    [email protected]
    GMD
    Lima, PERU
    Does anyone out there know how to tab into an ArrayField under Windows 3.1?
    Currently our screens skip over the ArrayField when tabbing through the
    fields, but once you click on the ArrayField you can tab through the
    fields in
    the ArrayField.
    Any help would be appreciated.
    Thanks,
    Steve Isaac

    This is a message that I got when asking the same question.

  • ArrayField and state of child

    I got this problem:
    I want the array fieild to show the elementa of some columns depending on a
    boolean attribute of the mapped class:
    if true col 6 and 7 (datafield) will be invisible an col 5 visible and vice
    versa.
    Col 5 is a scrolllist so I need to populate each time the widget with
    different data.
    Everything functions well (htanks to the help found on the list) but I see
    a strange quirk:
    When I set to true two consecutive rows and then I scroll the arrayfield
    the widget of col 6 and 7 that were invisible
    pop up (only on one of the row), they are just a dirty paint as they cannot
    be selected (but show the hidden data)
    Any suggestion on this.
    I use R3.f
    Here is a code fragment of the method
    The array field has 5 rows
    Method popProv just populate the scrolllist with the array of listelement
    passed as parameter.
    mw1 : fieldWidget;
    mw2 : fieldWidget;
    mw3 : fieldWidget;
    myRow : integer = 1;
    for i in <arfProc>.TopRow to <arfProc>.TopRow + 4 do
    mw1 = <arfProc>.BodyGrid.GetChildInCell(myRow ,5);
    mw2 = <arfProc>.BodyGrid.GetChildInCell(myRow ,6);
    mw3 = <arfProc>.BodyGrid.GetChildInCell(myRow ,7);
    if arfProc.codFilter then
    mw1.State = FS_UPDATE;
    popProv(PI_sclProv = ScrollList(mw1),
    PI_arrPr = arfProc[i].arrProv);
    mw2.State = FS_INVISIBLE;
    mw3.State = FS_INVISIBLE;
    else
    mw1.State = FS_INVISIBLE;
    mw2.State = FS_UPDATE;
    mw3.State = FS_UPDATE;
    end if;
    myRow = myRow + 1;
    end for;
    Thanks
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Apple does not sell Macs for any other purpose than for their own software, especially Mac OS X. It is not available without Leopard, soon to be Snow Leopard.
    Nothing has changed regarding installing or hosting other OSs.
    Apple posts no information for expanding the RAM capacity. You would need to check with the Hackintosh community for that information.
    Dah•veed
    Why do you reward points? 
The reward system helps to increase community participation. When a community member gives a reward to another member for providing helpful advice or a solution to his or her question, the recipient's points will help increase his or her status level within the community.

Maybe you are looking for

  • MBP - Mini Display Port VGA?

    Hi, So I'm trying to connect my Mid-2012 13" MBP to my TV via a Mini Display Port to VGA adaptor.  The problem is it won't work ^_^ My TV simply says 'No PC input', but my Mac detects the display.  I have tried booting in Safe Mode, as I found suggst

  • OS X Mavericks not showing up in boot menu?

    Hi, I recently applied to the OS X Yosemite Beta program and downloaded and installed the Beta. I have a 1TB Hard drive in my MacBook Pro which is was partitioned in two partitions, one for OS X Mavericks and one for Bootcamp. I decided I wanted to k

  • OBIEE : Newly created rpd file not showing in the online mode in Admin tool

    Hi, I have recently installed OBIEE 10.1.3.4.2 and Oracle XE databse in a Windows XP (Professional version 2002 Service Pack 3) virtual machine on my Windows 7 machine. 1) I have create an rpd file in Admin tool (all three layers). But I can only loa

  • IPad   iTunes rental   TV = Full screen?

    When previewing the rental movies from TV using iPad and digital av adapter (hdmi), tv shows a windowboxed image. When watching a movie from the library, tv shows full screen. Does rental movies work in full screen, or does the preview show the exact

  • Virtual Machines disappear from Hyper-V Manager on reboot

    I have a Windows 2012 RC server that has fail-over clustering installed (single server at the moment), and it has an iSCSI disk that is configured as a CSV volume.  When I create a new VM in Hyper-V Manager, I am storing the .vhdx and machine definit